Hi experts,
i am new to sapscripts,
i want to do Retrieving data without modifying the original called program .
i got one exmplae program from sap img site.
i copied form into my z_medruck1 then i am calling the subroutine in my header window(PERFORM GET_BARCODE IN PROGRAM ZSCRIPTPERFORM).
i wrote the ZSCRIPTPERFORM as shown below.
now i want to know how to debugg this program.
or else you can give some other example programs then i can understand easily.
help...
Retrieving data without modifying the original called program
*
Retrieving data without modifying the original called program
*
Put this script code in your sapscripts
/: PERFORM GET_BARCODE IN PROGRAM ZSCRIPTPERFORM
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
*
Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
REPORT ZSCRIPTPERFORM.
FORM GET_BARCODE TABLES IN_PAR STRUCTURE 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.