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: 

MB_MIGO_BADI line item refresh

Former Member
0 Kudos

Hello All,

I have created a Z* report in which I'm generating a number against material document & line item.

If the Number is generated against the document & line item, it should not allow user to cancel it.

for this i implemented ZMB_MIGO_BADI~LINE_MODIFY & ZMB_MIGO_BADI~CHECK_ITEM

Below is the code which i've written....

for some line item it is working fine & for some it is not working

I'm not getting where i'm going wrong......

ZMB_MIGO_BADI~LINE_MODIFY


DATA: gs_goitem TYPE goitem.

READ TABLE gt_goitem INTO gs_goitem WITH KEY zeile = i_line_id.

IF sy-subrc = 0.

   MODIFY gt_goitem FROM cs_goitem INDEX i_line_id.

ELSE.

   APPEND cs_goitem TO gt_goitem.

ENDIF.




ZMB_MIGO_BADI~CHECK_ITEM


zeile = i_line_id.

READ TABLE gt_goitem INTO gs_goitem WITH key zeile = zeile.


select SINGLE * from zdebit_note INTO wa_zdebtab WHERE refbn = gs_goitem-mblnr

                                                                       AND     refbz = gs_goitem-zeile.

   if sy-subrc = 0.

     wa_return-type   = 'E'.

     wa_return-id     = 'ZREV'.

     wa_return-number = '002'.

     append wa_return to et_bapiret2.

     clear: wa_return.

   endif.




Regards,

Hardik B

4 REPLIES 4

Former Member
0 Kudos

Anybody ?????

0 Kudos

Hi Hardik

Where is i_line_id being calculated?

Regards

Arden

0 Kudos

will get in both the methods mentioned above.Its parameter for both.

Former Member
0 Kudos

If I use it like this

import zmblnr to zmblnr from memory id 'MBLNR'.


select single * from zdebit_note into wa_zdebtab where refbn = zmblnr

                                                                        and    refbz = zeile.

   if sy-subrc = 0.

     wa_return-type   = 'E'.

     wa_return-id     = 'ZREV'.

     wa_return-number = '002'.

     append wa_return to et_bapiret2.

     clear: wa_return.

   endif.



still it it not working



Please reply....