Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

MB_MIGO_BADI line item refresh

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

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question