cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript Passing parameter value not shown.

Former Member
0 Kudos

Hi all,

I am writing a sapscript form to call a subrountine by passing the hardcode parameter 'ZXX_TSI_SHIPMENTS_FROM' shown as below: -


PERFORM GET_STANDARD_TEXT IN PROGRAM ZPXX_SHIP_INST
USING 'ZXX_TSI_SHIPMENTS_FROM'
CHANGING &ZXX_TSI_SHIPMENTS_FROM&
ENDPERFORM

My problem now is when I debugged in program ZPXX_SHIP_INST, the passing parameter is empty.

Could someone help me?

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Refer the below link for passing parameters with simple example program :

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

BR,

Rajani

Former Member
0 Kudos

Hi,

Put a debugg point in program ZPXX_SHIP_INST and check it.

Insted of this u can directly fetch the standard text by using 'INCLUDE TEXT'.

/: INCLUDE &OBJNAM& OBJECT 'EKPO' ID 'F03' LANGUAGE 'E' PARAGRAPH M3

Former Member
0 Kudos

Hi Usha,

There is a reason why I did that. If I use INCLUDE, then I wont be able to get the data in more than one column.

Former Member
0 Kudos

Hi,

Put a break point in progrm and check

Madhurivs23
Participant
0 Kudos

/: DEFINE &INVAR_1& = 'ZXX_TSI_SHIPMENTS_FROM' PERFORM GET_STANDARD_TEXT IN PROGRAM ZPXX_SHIP_INST USING &INVAR_1& CHANGING &ZXX_TSI_SHIPMENTS_FROM& ENDPERFORM

hope this helps

rgds,

Madhuri

Former Member
0 Kudos

Hi Usha,

I have already mentioned in the first post, I have debugged into the program. The passing parameter is empty.

My question is why it is empty? Is there any way to pass a hardcode parameter into the subroutine?

Former Member
0 Kudos

Hi.

In program ZPXX_SHIP_INST write like this.

FORM GET_STANDARD_TEXT TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

READ TABLE in_tab WITH KEY name = 'INVAR_1'

IF sy-subrc = c_zero. "check for subrc

lv_ebeln = in_tab-value.

ENDIF.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = p_lc_f01

language = sy-langu

name = p_lv_ebeln

object = text-t28 "EKKO

TABLES

lines = it_tline

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

IF sy-subrc <> c_zero. "checking for subrc

"to avoid epc error

ENDIF. "IF sy-subrc <> c_zero

in it_tline[] u can get the text.

cocatenate this text into one variable and pass this to script.

Former Member
0 Kudos

Hi Wong,

Syntax in a form window:

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM

INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

So those parameters should be only the symbols, hard coded text should not be considered by perform statement in scripts.

Regards,

Vineel.

Former Member
0 Kudos

Hi all,

What if my data is


Shipment 
from

Can I assign this into one variable?

Former Member
0 Kudos

hi,

Loop u r internal table.

in the loop concatenate u r lines into one variable.

pass that variable into script

Former Member
0 Kudos

Hi Usha,

How can I assign 2 lines value into one variable?

Can I?

Former Member
0 Kudos

Hi

the table it_lines[] contains

Shipment

from

data : v_pack(250).

loop at it_lines into wa_lines.

concatenate v_pack wa_lines-tdline into v_pack separated by ' '.

endloop.

Pass this v_pack to the outtab.

Madhurivs23
Participant
0 Kudos

you need to declare one variable and assign it the value and then pass this as parameter.

Former Member
0 Kudos

Hi Madhuri,

Can you show some code how should I declare variable in sapscript?

Former Member
0 Kudos

Hi,

Declare a variable in Script window using DEFINE

Ex : DEFINE &VAR1& = ' '

Before passing variables to Subroutine in Script those are declared in Script window code using Define statement.

But in your case you are sending direct variable from print program. so it is not necessary to declare variable in that case. To get the value debug the print program before assign to script otherwise debug the Script by active debugger in Utilities of SE71.