‎2009 Mar 19 5:24 PM
I have a requirement to change item level fields based on some condition during transaction MIRO, but the BADI INVOICE_UPDATE does not have any exporting parameters and thus not allow changing the fields. So is there any other way to do it? Appreciate your help.
Thank you,
Rohit
Edited by: Julius Bussche on Mar 19, 2009 9:24 PM
Please dont use CAPS-LOCK. It is generally interpreted as SHOUTING
‎2009 Mar 19 5:42 PM
‎2009 Mar 19 5:59 PM
But this BADI allows to change certain fields only. I want to change field RSEG-EREKZ
‎2009 Mar 19 6:11 PM
‎2009 Mar 19 6:25 PM
‎2009 Mar 19 6:32 PM
its a table you should be able to change...
One question Did you [Implementing Business Add-Ins (BADI)|http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm]
‎2009 Mar 19 6:39 PM
Yes I am doing implientation of it. If you look at the BADI INVOICE_UPDATE it does not have any exporting parameters and thus not allow changing the fields.
‎2009 Mar 19 6:47 PM
Method: IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE
DATA: wa_reseg_new LIKE LINE OF ti_rseg_new.
LOOP AT ti_rseg_new INTO wa_reseg_new.
.......
....
ENDLOOP.
‎2009 Mar 19 7:56 PM
Hey Jay, Have you even looked at the BADI. it does not allow to change any field. Look at the OSS note 392342. Let me know if it can be done in any other way.
Thanks
‎2009 Mar 20 7:25 AM
Hi,
you could try to do something via field-symbols (but be careful):
e.g.
CONSTANTS: c_ydrseg(18) TYPE c VALUE '(SAPLMR1M)YDRSEG[]'.
DATA: wa_drseg TYPE mmcr_drseg.
CLEAR wa_drseg.
FIELD-SYMBOLS: <fs_ydrseg> TYPE table.
ASSIGN (c_ydrseg) TO <fs_ydrseg>.
CLEAR lt_drseg.
REFRESH lt_drseg.
lt_drseg[] = <fs_ydrseg>.
IF NOT <fs_ydrseg>[] IS INITIAL.
LOOP AT lt_drseg INTO wa_drseg.
* do something with EREKZ
ENDIF.
ENDIF.
Best regards