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: 

Calling subroutine from SAPscript - please help

Former Member
0 Kudos

Hi,

Please help in regards to the following:

From the SAPscript form, I need to obtain 2 things using the PERFORM command:

1) Address of the company code, passing BKPF-BUKRS

2) 2 fields from table EINE, passing EINA-INFNR

How do I get these?

I have looked at several online tutorials on calling a subroutine from a SAPscript.

However, I do not understand them.

Please help.

Thanks,

John

5 REPLIES 5

nkr1shna
Contributor
0 Kudos

Hi John,

Inside your SAPScript you can use PERFORM command like given below

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

.....

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

.....

/: ENDPERFORM

<prog> mentioned in the above PERFORM command refers to the print program and subroutine exits in the print program.

Make sure you enter subroutine name, print program name and parameters correctly. Parameters can be USING or CHANGING parameters based on your requirement.

Please create sub-routine in your print program which perform data fetching company address and fields from EINE.

Best Regards,

Krishna

Former Member
0 Kudos

How do you pass address information to a table of structure ITCSY?

From http://help.sap.com/saphelp_46c/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm

Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

/: USING &PAGE&

/: USING &NEXTPAGE&

/: CHANGING &BARCODE&

/: ENDPERFORM

/

/ &BARCODE&

Coding of the calling ABAP program:

REPORT QCJPERFO.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

0 Kudos

Hi John,

Can you please tell me in your PERFORM command in sap-script what you wish to pass and what you are expecting back from sub-routine.

Regards

Krishna

Former Member
0 Kudos

Well, from the perform I will pass the company code.

In the form, I will need to go to V001, get the address number and then get the address details from ADRC.

While I can pass each field one by one to the SAPscript, can't I just pass the full ADRC record?

Former Member
0 Kudos