‎2010 Aug 28 2:09 PM
Hi Friend,
In my SAP SCRIPT using the Subroutine for Main Window..
My internal table structure ( out_tab) have 4 recoreds, but it is papuating last record of the internal table.
I want to display the all the record in the internal table Structure (out_tab).
If you have any idea pls help me.
EG:
-
: PERFORM calscript IN PROGRAM QCJPERFO
/: USING &matnr&
/: USING &VAL_MAT&
..........
..............
/: ENDPERFORM
FORM calscript TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
................
(out_put structure contain the 4 records,)
but it displaying form only last records.
ENDFORM.
-
Subash
‎2010 Aug 28 4:21 PM
Hi,
Are you modifying the out_tab with proper values? Show the code that you have written. May be it is easy to look into the issue.
Thanks & Regards,
Swarna Munukoti
‎2010 Aug 29 7:41 PM
hello,
you need to understand the flow of calling subroutine in sap script...
'out_tab' (in your example) has a structure which contains field (which is passed throuhg using parameter) and value which can be changed and accessed...
so if you have four records in out_tab, it will display the last one becasue you are calling the subroutine through 'using' parameter....so it can not contain 4 records!
Hope it will help you to understand...
Thanks...
‎2010 Aug 29 7:53 PM
Hi,
Those fields you want to be populated inside the subroutine, pass them as a changing parameter. You can check the below code.
/: PERFORM SUB_GET_EMAIL_ADDR IN PROGRAM Z_SPRN_POOL_FORM0094_SCR2074
/: USING &V_EMAIL&
/: USING &V_WR_LINE&
/: CHANGING &V_MAIL_1&
/: CHANGING &V_MAIL_2&
/: ENDPERFORM
Z1 ,,&V_HTNM-MFRPN&,,&SY-VLINE& &V_MAIL_1& &V_MAIL_2& ,, ,, ,, ,,
Thanks
Subhankar