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: 

Regarding the sapscript SD_PACKING_LIST

Former Member
0 Kudos
132

Hi,

I am new to sapscripts, I have to add some fields from ADRC table, VBDKR, LIPS tables into the standard sapscript SD_PACKING_LIST. can anybody tell me how to proceed.

it is more helpfull if you can tell me perform statement on what basis we call perform, using which variable from the standard form and what values chaning.

if possible give an example of ADRC table to diplay the name, city, country from the ADRC table using form and perform functions.

Thanks in advance.

Ravi.

3 REPLIES 3

Former Member
0 Kudos
32

Hi Ravi,

If you need to add any code to standard SAPCRIPT, you will have to copy the sapscript to make it a 'z' object and then you can add your code where required.

You can just debug the SAPSCRIPT to understand the code execution

Regards

Vijaya

0 Kudos
32

hi kumari,

I am not changing the standard print program, without changing the print program i want to call a subroutines for the populating the values.

Please provide me how to call a subroutine and on what basis.

Thanks,

Ravi

Former Member
0 Kudos
32

Ravi,

2 ways to your problem.

1) Copying the Print program and SAP Script and change those.

2) Instead of Copying print program, make changes to the Custom sap script(you may need to copy SAP script to cusomer) and using PERFORM from custom SAP Script.

In you custom script you can wirte as

/: PERFORM my_form IN PROGRAM zmyinclude 
/: USING &pass1& 
/: USING &pass2& 
/: CHANGING &get2& 
/: ENDPERFORM

and inside include zmyinclude you can create a

FORM my_form

as

FORM my_form TABLES IN_PAR STUCTURE ITCSY 
OUT_PAR STRUCTURE ITCSY.

endform.

Just see one example below.


Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM ZMYINCLUDE 
/: USING &PAGE& 
/: USING &NEXTPAGE& 
/: CHANGING &BARCODE& 
/: ENDPERFORM 
/

/ &BARCODE&

Coding of the calling ABAP program:

REPORT ZMYINCLUDE.

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 IN_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.

Cheers,

Thomas.

Please mark point if your got solution.