on 03-22-2007 10:44 AM
Hi All,
Please give me a sample and easy code
for calling subroutine in script
subroutine defination zprogram which is having a select statement.
every helpful answere is rewarded surely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi priyanka,
sample code for routines in script.
/: PERFORM FORM_TEST IN PROGRAM ZTEST
/: USING &VAR1&
/: USING &VAR2&
/: USING &VAR3&
/: .............
/: USING &VARN&
/: CHANGING &VAR_OUT1&
/: ................
/: CHANGING &VAR_OUTN&
in the program ZTEST...
FORM FORM_TEST tables in_tab structure itcsy
out_tab structure itcsy.
Get value of VARN
data: varn like ....
read table in_tab with key name = 'VARN'.
if sy-subrc = 0.
move in_tab-value to varn.
endif.
Update the value of VAR_OUTN
read table out_tab with key name = 'VAR_OUTN'.
if sy-subrc = 0.
move <value> to out_tab-value.
modify out_tab index sy-tabix.
endif.
ENDFORM.
check this link too...
http://help.sap.com/saphelp_erp2005/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm
Regards...
Arun.
Reward points if useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Syntax in a form window:
/: PERFORM
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY PAGE.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY NEXTPAGE.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY BARCODE.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
ELSE.
OUT_PAR-VALUE = ||. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Regards
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PERFORM <subroutinename> IN PROGRAM <DRIVER_PGM-NAME>.
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 | |
10 | |
7 | |
6 | |
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.