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: 

SUBROUTINE IN SAP SCRIPT

Former Member
0 Kudos

HI,

HOW WE CALL SUBROUTINE IN SAP SCRIPT?

IF OUR REQUIREMENT IS THT TO ADD NEW FIELD IN FORM AND U HAVE PASS VALUE THROUGH DRIVER PROGRAM FOR THT

PLEASE PROVIDE ME CODE FOR THT SCENERIO

PROVIDE IN EASY WAY STEP BY STEP.

THANKS

RAHUL

4 REPLIES 4

Former Member
0 Kudos

Hi,

You can define a form in your driver program of the form or in any other program.

form v_form tables in_par structure <b>itcsy</b> out_par structure <b>itcsy</b>.

*your code here....

*...

endform.

Here the type should be ITCSY for input and output parameters.

You can call this form in your script ...

/:PERFORM v_form IN PROGRAM z_prog

/:USING &EKKO-EBELN&

/:CHANGING &A1&

/:CHANGING &A2&

/:CHANGING &A3&

/:CHANGING &A4&

/:CHANGING &A5&

/:CHANGING &A6&

/:ENDPERFORM

Hope this helps

Former Member
0 Kudos

HiRahul,

In sapscript editor: use following syntax:

perfrom '<b>Perform</b> name' <b>in prog</b>ram '(se38 program name)'

<b>using</b> &variable name&

<b>changing</b> &variable name&.

<b>Endperform.</b>

Create a Se38 program with the name used in the perform statement and write the code in it..

For more info: refer the link...good one.

http://help.sap.com/saphelp_47x200/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm

Thank you.

Former Member
0 Kudos

hi rahul

u want add field na go to se71 and change mode where u want add filed in main r header r footer add the filed .

in program u retrive the data from itab thats all .

regards

kk.

harimanjesh_an
Active Participant
0 Kudos

hi rahul,

u can call ABAP sub routines from script.

In ur script:

/ : PERFORM <form> IN PROGRAM <prog>

/ : USING &invar1&

/ : USING &invar2&

/ : .......................

/ : CHANGING &outvar1&

/ : .......................

/ : ENDPERFORM

And in ur report program :

REPORT <prog>

FORM <form> TABLES in_tab STRUCTURE itcsy

in_tab STRUCTURE itcsy

ENDFORM.

check this link.....

http://help.sap.com/saphelp_47x200/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm

Reward me if useful....

Harimanjesh AN