Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive reports using pfn

Former Member
0 Kudos
85

Hi all.

I have written code for interactive report using pfn.when i am clicking on check box for individual entries i am getting the correct result but when i am selecting multiple checkbox i am not getting required result.

Eg.suppose basic list has 10 and 20 values.on clicking checkbox for 10 and 20 separately i m getting the result but when i selecting 10 and 20 at same time 20 valuse are repeated.

please help me.

REPORT ZINTERACT.

tables:mara,mvke.

data:itab like mara occurs 0 with header line.

data:jtab like mvke occurs 0 with header line.

select-options: matnr for mara-matnr.

data:chk.

initialization.

matnr-low = '1'.

matnr-high = '500'.

matnr-sign = 'I'.

matnr-option = 'BT'.

append matnr.

start-of-selection.

select matnr mtart matkl from mara into corresponding fields of table

itab where matnr in matnr.

loop at itab.

write: / chk as checkbox , itab-matnr , itab-mtart , itab-matkl.

hide:itab-matnr.

endloop.

AT PF05.

CHECK SY-LSIND = 1.

select matnr vkorg vtweg from mvke into corresponding fields of table

jtab where matnr = itab-matnr.

WINDOW STARTING AT 10 5 ENDING AT 80 15.

DO.

CLEAR CHK.

READ LINE SY-INDEX FIELD VALUE CHK.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

CHECK CHK = 'X'.

loop at jtab.

write: / jtab-vkorg , jtab-vtweg.

endloop.

ENDDO.

clear itab-matnr.

1 REPLY 1

Former Member
0 Kudos
59

Hi,

Try the logic like,you can read multiple values from list

DO.

READ LINE SY-INDEX FIELD VALUE CHK itab-matnr.

IF sy-subrc = 0 and chk = 'X'.

select matnr vkorg vtweg from mvke into corresponding fields of table

jtab where matnr = itab-matnr.

ELSEIF SY-SUBRC NE 0.

EXIT.

ENDIF.

enddo.