Skip to Content

How to change IDOC segment value?

Jul 13, 2017 at 01:17 PM


avatar image

Hi Experts

I want to change value of field WKURS which is in segment E1EDK01.


But I don't see the field getting updated. Is there something wrong i am doing here in this BADI. Please help !!!!!

In the FILL method I have written the logic as below:

FF control-idoctp = 'INVOIC02'. "My Idoc type
DATA: x_idoc_data TYPE EDID4,
x_e1edk01 TYPE e1edk01.

LOOP AT DATA INTO x_idoc_data.
IF x_idoc_data-segnam = 'E1EDK01'.
MOVE x_idoc_data-sdata TO x_e1edk01.
x_e1edk01-wkurs = '5.00000'.
x_idoc_data-sdata = x_e1edk01.
MODIFY DATA FROM x_idoc_data.




idoc.jpg (83.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jelena Perfiljeva
Jul 13, 2017 at 05:07 PM

You really should not be manipulating this segment. This data is supposed to be filled in from the invoice. What are you doing here exactly and why?

That aside - I don't know about this BADI and documentation says it's for internal SAP use. There are good old SMOD/CMOD user exits that can be used to modify the segments. We use EXIT_SAPLVEDF_002. Look it up.

Show 6 Share
10 |10000 characters needed characters left characters exceeded

Thanks Jelena for your answer.

I did try EXIT_SAPLVEDF_002 and put my code in the include ZXEDFU02.

I have put an external breakpoint in the include. But when I try to trigger the IDOC via transaction WE15, it does not stop in my include. Any idea why?

So I am wondering if this is the correct user exit.




Did you activate the user exit?

I'm not sure what WE15 is but debugging the outbound IDocs is a bit tricky because if it's based on output it runs in a separate update process. I described some options in my book but then people are saying it's all available online, so perhaps google "outbound IDoc debugging"? :)

However, you should just see the results (fields added/changed) in the IDoc and only need to debug if it does not work as expected.

Jelena Perfiljeva

Jelena,can you please share the title of the book.

Got it but no e-Book :-(.



It's available on Amazon. It's not free, sorry, but you could try Google to find similar information from other sources. One of the reviewers stated that "nothing in this book that cannot be found online". They did not share any links though. :)


"nothing in this book that cannot be found online"

That's pretty much true of most technical books these days, but misses the point that books present a compilation of knowledge all in one place. Usually also far more reliable than the sometimes complete nonsense found online. You takes your chances and you get what you pay for on the world wild web.


I agree with you completely. By that logic there should be no more non-fiction books published these days. Was rather confused what sacred knowledge did that person expect but, of course, they didn't bother to elaborate. (Sorry for offtopic!)