Application Development and Automation 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: 
Read only

Data display problem in SAP SCPRIPT

Former Member
0 Likes
475

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

3 REPLIES 3
Read only

former_member217544
Active Contributor
0 Likes
444

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

Read only

Former Member
0 Likes
444

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...

Read only

Subhankar
Active Contributor
0 Likes
444

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