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

UPDATE FIELDS USING BADI INVOICE_UPDATE

Former Member
0 Likes
3,984

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

9 REPLIES 9
Read only

Former Member
0 Likes
2,628

HI,

Check this badi..MRM_MRIS_IDAT_MODIFY

Read only

0 Likes
2,628

But this BADI allows to change certain fields only. I want to change field RSEG-EREKZ

Read only

0 Likes
2,628

Arn't you able to change the value in TI_MRMRSEG-EREKZ

Read only

0 Likes
2,628

Jay,

I am not able to do it in INVOICE_UPDATE badi.

Read only

0 Likes
2,628

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]

Read only

0 Likes
2,628

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.

Read only

2,628

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.

Read only

0 Likes
2,628

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

Read only

0 Likes
2,628

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