on 07-30-2008 11:57 AM
Hi,
Pls let me know the difference between subroutines used in scripts and the subroutines used in reports
regards
Saravan
Hi saravana
Refer to these links
http://www.allinterview.com/viewpost/63045.html
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db978335c111d1829f0000e829fbfe/content.htm
Regards,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not much of a difference except as folows:
You can call an ABAP subroutine from SapScript using the PERFORM statment. You can use this to get data without havning to cnahge the print program. In the examole below NAME is retreived from table SCUSTOM.
SapScript
/:DEFINE &CUST& = '00000021'.
/:PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_HF
/: USING &CUST&
/: CHANGING &NAME&
/:ENDPERFORM.
Dear &NAME&
The ABAP routine
The ABAP routine could be defined as follows:
IMPORTANT: The structure itcsy must be used for the parameters.
REPORT Z_HENRIKF_SCRIPT_FORM .
TABLES scustom.
FORM get_name tables in_tab structure itcsy out_tab structure itcsy.
read table in_tab index 1.
select single * from scustom
where id = in_tab-value.
if sy-subrc = 0.
read table out_tab index 1.
move scustom-name to out_tab-value.
modify out_tab index sy-tabix.
else.
read table out_tab index 1.
move 'No name' to out_tab-value.
modify out_tab index sy-tabix.
endif.
ENDFORM.
Note that if you use more than one parameter you must use Using or Changing before every parameter !
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The subroutines in scripts are called dynamic subroutines because you don't have a perform statement in the program
where as in reports you need to use perform statement to call the subroutine.
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.