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

Problem with importing parameter

Former Member
0 Likes
536

Hi all.

I have an FM exit, where it is an importing parameter say e_tq32.

after the exit call, first it calls FM X. where in the beginning of the FM the value to e_tq32 is filled. so, now e_tq32 has some value.

in the furthur code there is an exception raised due to some code, then once the call come out FM to the main the exit call,

the value e_tq32 is getting clear. but it should not. is'not it??

can you please advise what could be the reason.

Regards,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
494

If the above question is not clear, below is the short explanation about prob.

call function 'XYZ'

EXPORTING
        i_matnr                  = i_matnr
        i_werks                  = i_werks
        i_tq32                   = i_tq32

IMPORTING
        e_tq32                   = l_tq32

EXCEPTIONS
       no_insptype              = 1
       OTHERS                   = 2.

Function XYZ.

MOVE-CORRESPONDING i_tq32 TO e_tq32.

IF 1 = 1.

RAISE no_insptype.

ENDIF:

ENDFUNCTION.

Now my question is l_tq32 is getting clear, even it is assigned value.

3 REPLIES 3
Read only

Former Member
0 Likes
495

If the above question is not clear, below is the short explanation about prob.

call function 'XYZ'

EXPORTING
        i_matnr                  = i_matnr
        i_werks                  = i_werks
        i_tq32                   = i_tq32

IMPORTING
        e_tq32                   = l_tq32

EXCEPTIONS
       no_insptype              = 1
       OTHERS                   = 2.

Function XYZ.

MOVE-CORRESPONDING i_tq32 TO e_tq32.

IF 1 = 1.

RAISE no_insptype.

ENDIF:

ENDFUNCTION.

Now my question is l_tq32 is getting clear, even it is assigned value.

Read only

0 Likes
494

When the raise statement is executed, control returns immediately to the call function statement and a value is assigned to sy-subrc based on the exceptions you have listed there. Values assigned to export parameters are not copied back to the calling program.

Read only

0 Likes
494

Hi all,

I got the answer. i forgot to uncheck the 'Pass Value' .

Regards,

Venkat