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: 

restricting user exit ZXEDFU02 to one customer in WE20

Former Member
0 Kudos

I'm new to SAP. I've just written a code in user exit 002 (include zxedfu02) for the bill-to party invoice IDOC generation (FUNCTION IDOC_OUTPUT_INVOIC). My code is working perfectly. The only problem is I would like to restrict the use of this user exit to only one of my customers. From my understanding once I've programmed the user exit, every IDOC that is generated using IDOC_OUTPUT_INVOIC will perform my user exit, however I would like to be only executed for one partner. How do I do this?

If possible, please post a step by step solution to my problem, I would really appreciate your help.

Thanks in advance.

Edited by: mrisad on Jul 29, 2010 4:21 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Mrisad,

As per your input, your exit function module EXIT_SAPLVEDF_002 contains CONTROL_RECORD_OUT as the import parameter.

Within your include please check the value of the following(which are the reciver related values) in the debugging mode.On top of your current code you can add this check, and include ur current code within this check.

RCVPOR

RCVPRT

RCVPRN

RCVSAD

RCVSMN

RCVSNA

RCVSCA

RCVSDF

RCVSLF

RCVLAD

Hope this will help you..

Regards,

Antony Thomas

4 REPLIES 4

Former Member
0 Kudos

Hello Mrisad,

As per your input, your exit function module EXIT_SAPLVEDF_002 contains CONTROL_RECORD_OUT as the import parameter.

Within your include please check the value of the following(which are the reciver related values) in the debugging mode.On top of your current code you can add this check, and include ur current code within this check.

RCVPOR

RCVPRT

RCVPRN

RCVSAD

RCVSMN

RCVSNA

RCVSCA

RCVSDF

RCVSLF

RCVLAD

Hope this will help you..

Regards,

Antony Thomas

0 Kudos

Thanks Antony I've solved the problem with the following modification to my user exit:

DATA: rcvprn type rcvprn:

select rcvprn

from edidc

into rcvprn.

endselect.

if rcvprn = '0001005924'. ---> 0001005924 is my partner

<<MY CODE>

endif.

0 Kudos

Hello mrisad,

just a side note: It's no good style to carve such an exception into your coding. Depending on your SAP release you should elaborate the use of either the BRFplus or a custom customizing database table.

Regards,

Alej

SuhaSaha
Advisor
Advisor
0 Kudos

As mentioned in the previous post, you have to utilize the CONTROL_RECORD_OUT parameter. You need to restrict the User Exit execution based on a particular Partner you have to target the field "RCVPRN" which is the "Partner Number of Receiver".

CHECK CONTROL_RECORD_OUT-RCVPRN = <your desired partner >.

"Your user-exit code

BR,

Suhas