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

Function Module query

Former Member
0 Likes
372

hi all ,

In my FM i am using another FM which updates kna1 and knvp

sometimes it doesnt

then it returns a sy-subrc 3 or 4

but i am passing that return code in MY FM as shown

CALL FUNCTION 'Y_ALB_PARTNER_KOPIEREN'

EXPORTING

i_kunnr_src = p_wa_vbap_kunnr

i_ktokd = '0003'

i_agkunnr = p_wa_vbap_kkunnr

IMPORTING

e_kunnr_dest = p_g_kunnr_dest

e_rc = .

do i need to give the value of e_rc that is of type sy-subrc in my subroutine parmeters also becoz i m taking this value from inside the FM i m using

PLease let me know

thnkx

2 REPLIES 2
Read only

0 Likes
352

Hello,

Your question is not clear.You are telling function module then sub-routine. Could you please be some more explanative.

Thanks

Farzan

Read only

Former Member
0 Likes
352

Hi,

The proper procedure is whatever inside your fm you need to raise the exceptions using RAISE <exception name>.

This <exception name> must be declared in exceptions tab of SE37.

Let us suppose you have declared 3 exceptions READ_ERROR, WRITE_ERROR, UNKNOWN_ERROR and raised them in your fm code.

Then the code that calls this fm will have:

Call function Z_ABC

Exporting:

<exp parameters>

Importing:

<imp parameters>

Exceptions:

Read_error = 1

write_error = 2

unknown_error = 3.

if you check the sy-subrc here if there is an exception inside the fm, then the value would be either 1, 2 or 3.

The number assignment will be done automatically in the cronological order in which the exceptions are defined.

The above is the recommended procedure.

Hope this helps..

Harikrishna.

Edited by: harikrishna indugu on Feb 22, 2008 10:26 AM