‎2006 Jun 09 6:45 AM
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.
‎2006 Jun 09 6:51 AM
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
‎2006 Jun 09 7:15 AM
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
‎2006 Jun 09 9:35 AM
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_formas
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.