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
*                http://www.erpgreat.com
*
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.

*-- End of Program


SAP Books
SAP Certification, Functional, System Administration and ABAP Programming Reference Books

SAP Scripts Tips
SAP Sapscripts Tips and Tricks

ABAP Tips
ABAP and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.