Skip to Content

How to change IDOC segment value?

Hi Experts

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

For this I have used BADI IDOC_DATA_INSERT~FILL

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.
ENDIF.
ENDLOOP.
HAVE_TO_CHANGE = 'X'.

ENDIF.

Thanks

Gopal

idoc.jpg (83.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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!)