Dear All,
I have the following code snippet. In this I cook up the table t_vbrk2. then i print it out and I use 2 hide statements to choose the row of this table to pass to the next screen. But the problem is that is ALWAYS passes the last line of the table to the next screen. Any advice ?
LOOP AT T_VBRK2.
WRITE: /2 sy-vline , T_VBRK2-VBELN under 'Billing Doc' ,
15 sy-vline , T_VBRK2-FKDAT under 'Billing Date' ,
30 sy-vline , T_VBRK2-KUNAG under 'Sold-To-Party' ,
45 sy-vline , T_VBRK2-FKART under 'Billing Type' ,
60 sy-vline , T_VBRK2-VGPOS under 'Inv. LI No' ,
75 sy-vline , T_VBRK2-FKTYP under 'Item Cat' ,
90 sy-vline , T_VBRK2-ZTERM under 'Pay Term' ,
105 sy-vline, T_VBRK2-LAND1 under 'Cust Ctry' ,
120 sy-vline , T_VBRK2-NETWR under 'Inv Net Val' ,
135 sy-vline , T_VBRK2-MWSBK under 'Tax Amt' ,
150 sy-vline , T_VBRK2-VTEXT under 'Doc Type Text' ,
170 sy-vline , T_vbrk2-NAME1 under 'Cust Name' ,
200 SY-VLINE.
hide t_vbrk2-kunag.
hide t_vbrk2-name1.
WRITE : / SY-ULINE(200).
ENDLOOP.
data : n type i .
describe table t_vbrk2 lines n.
at line-selection.
get cursor field c.
WRITE C.
IF C = 'T_VBRK2-NAME1'.
write :/10 'Customer No.',
30 'Name',
50 'Country Code',
70 'Address',
90 'Authorization Group'.
select * from kna1 where kunnr = t_vbrk2-kunag.
write :/ kna1-kunnr under 'Customer No.',
kna1-name1 under 'Name',
kna1-counc under 'Country Code',
kna1-stras under 'Address'.
endselect.
select * from knb1 where kunnr = t_vbrk2-kunag.
write : knb1-begru under 'Authorization Group'.
endselect.
ENDIF.
IF C = 'T_VBRK2-VBELN'.
write : / 'Customer No','Billing Date','Doc Curr','Terms of Payment','Sales Org','Division','Location','Created On','Created By','No of line items'.
SELECT * FROM VBRK WHERE VBELN = T_VBRK2-VBELN.
WRITE : / VBRK-KUNAG under 'Customer No',
VBRK-FKDAT under 'Billing Date',
VBRK-WAERK under 'Doc Curr',
VBRK-ZTERM under 'Terms of Payment',
VBRK-VKORG under 'Sales Org',
VBRK-SPART under 'Division',
VBRK-BZIRK under 'Location',
vbrk-erdat under 'Created On',
vbrk-ernam under 'Created By'.
endselect.
write : n under 'No of line items'.
ENDIF.