Hi Nabheet,
I have got data in first Table control. Lets say 10 records...Now i select 4th record in first table control and at the same time i selected 7th row in 2nd table control.. My req is to get 4th record in 7th row position in 2nd table control.when i press the pushbutton
i tried to write the same in PAI..but when i press the pushbutton ...it is not working as it is not holding the selected record.
TYPES : BEGIN OF TYTAB1 ,
CH1 TYPE C ,
CARRID TYPE SFLIGHT-CARRID ,
CONNID TYPE SFLIGHT-CONNID ,
FLDATE TYPE SFLIGHT-FLDATE ,
PRICE TYPE SFLIGHT-PRICE ,
END OF TYTAB1.
TYPES : BEGIN OF TYTAB2 ,
CH2 TYPE C ,
CARRID TYPE SPFLI-CARRID ,
CONNID TYPE SPFLI-CONNID ,
CITYFROM TYPE SPFLI-CITYFROM ,
CITYTO TYPE SPFLI-CITYTO ,
END OF TYTAB2 .
DATA : ITAB1 TYPE STANDARD TABLE OF TYTAB1.
DATA : ITAB2 TYPE STANDARD TABLE OF TYTAB2.
DATA : WATAB1 TYPE TYTAB1.
DATA : WATAB2 TYPE TYTAB2.
DATA : OKCODE TYPE SY-UCOMM .
CONTROLS : TB1 TYPE TABLEVIEW USING SCREEN 9000.
CONTROLS : TB2 TYPE TABLEVIEW USING SCREEN 9000.
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9000 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
SELECT CARRID CONNID FLDATE PRICE FROM SFLIGHT INTO CORRESPONDING FIELDS OF TABLE ITAB1 UP TO 30 ROWS.
ENDMODULE. " STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9000 INPUT.
CASE OKCODE.
WHEN 'LEFT'.
data : l_index type sy-index.
data : l2_index type sy-index.
clear watab1.
loop at itab1 into watab1 where ch1 = 'X'.
modify itab1 from watab1 index sy-tabix transporting ch1.
read table itab2 into watab2 with key ch2 = 'X'.
clear l_index.
l_index = sy-tabix.
check sy-subrc eq 0.
watab2-ch2 = space.
modify itab2 from watab2 index l_index.
endloop.
Thanks