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: 

Issue while using MB_MIGO_BADI

venkata_reddy6
Participant
0 Kudos
1,256

Hi All,

I am facing an issue while using MB_MIGO_BADI for MIGO validations when click on post button(for cancellation of doc).

I set a break point and checked the structure for docno and fyear it's blank for both check_header and check_item.

why BADI is not giving any input values? any clue?

while creating implementation have chosen option copy sample code.

Thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
563

Hi Venkat,

You can write your validation code in this method,IF_EX_MB_MIGO_BADI~PAI_DETAIL.

Here the table G_GOITEM will give you all the details include Materials document No. and Year.

Declare structure like,

DATA WA_GOITEM LIKE LINE OF G_GOITEM.

If you want to loop the table G_GOITEM. as we have to declare 'work area' explicitly in methods (OOPS Concept).

Hope this will help you. 

6 REPLIES 6

reachdebopriya
Active Participant
0 Kudos
563

Hi Venkata,

Have you put a break point in METHOD if_ex_mb_migo_badi~post_document ?

Check structure - IT_MSEG and IS_MKPF .

With Regards,

Debopriya Ghosh

Former Member
0 Kudos
563

Hi Venkat,

You will get Material Document No and Year in IS_MKPF structure in IF_EX_MB_MIGO_BADI~POST_DOCUMENT Method.

Fields:is_mkpf-mblnr,

           is_mkpf-mjahr.

0 Kudos
563

Hi All,

Thank you for you early response,

POST_DOCUMENT is last step in posting, by the time reaching method POST_DOCUMENT cancellation document is generated, it should not be the case. any message in POST_DOCUMENT should be type A or X.

In my requirement it's just validations at header level when cancellation document is posted.

Regards.

alex_campbell
Contributor
0 Kudos
563

Venkata Reddy wrote:

...

why BADI is not giving any input values?

...

To answer your question, I suspect that the document and item numbers have not yet been determined, since the material document has not yet been posted. The purpose of the "CHECK" methods is to give you a chance to prevent the posting of the Material Document before it happens, and you shouldn't need to make that determination based on the document and item numbers.

Former Member
0 Kudos
564

Hi Venkat,

You can write your validation code in this method,IF_EX_MB_MIGO_BADI~PAI_DETAIL.

Here the table G_GOITEM will give you all the details include Materials document No. and Year.

Declare structure like,

DATA WA_GOITEM LIKE LINE OF G_GOITEM.

If you want to loop the table G_GOITEM. as we have to declare 'work area' explicitly in methods (OOPS Concept).

Hope this will help you. 

0 Kudos
563

Hi All,

Thanks for every one, it is resolved by using badi MB_CHECK_LINE_BADI.

Regards,