Application Development and Automation 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: 
Read only

Passing two paramaters from sapscript to calling program

Former Member
0 Likes
656

Hi all,

Apparently, I wish to pass 2 parameters from sapscript to called program, and trigger the subroutine from the program to manipulate some data. Below is my coding in my sapscript:

PERFORM GET_PO_MAT_TEXT IN PROGRAM ZMMSCC_PO_OUTPUT

USING &EKPO-EBELN& &EKPO-EBELP&

CHANGING &PO_MAT_TXT&

ENDPERFORM

<u>Called Program:</u>

READ TABLE in_param WITH KEY 'EKPO-EBELN'.

IF sy-subrc = 0.

lebeln = in_param-value.

endif.

READ TABLE in_param WITH KEY 'EKPO-EBELP'.

IF sy-subrc = 0.

lebelp = in_param-value.

endif.

Based on the coding above, the program reads incoming parameters with key EKKO-EBELN and EKKO-EBELP, however, I just can grab the value from parameter EKKO-EBELN only, not both of value from EKKO-EBELN and EKKO-EBELP.

Can somebody guide me on how to pass two parameters from a sapscript to a subroutine program?

Any advise will be much appreciated.

Thanks.

Patrick

1 REPLY 1
Read only

Former Member
0 Likes
447

Hi Patrick

You have to add the USING statement before each parameter:

PERFORM .....

USING &EKKO-EBELN&

USING &EKKO-EBELP&

CHANIGN ...

Regards,

John.