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

Exit for MIGO tcode

shishupalreddy
Active Contributor
0 Likes
2,000

hi,

can you provide me the feasible exit for the following requirement in MIGO tcode.

the requirement is to enhance goods receipting process through an alteration to transaction MIGO. The business requires that the field GOHEAD-FRBNR is a mandatory entry only under certain circumstances and optional the rest of the time. The basic details for the requirement are as follows:

When posting a goods receipt through transaction MIGO, the user exit should identify the account group of the Purchase Order Vendor by reading GOHEAD-LIFNR for the Vendor number and then finding the account group in LFA1-KTOKK. If LFA1-KTOKK = "KINF" then GOHEAD-FRBNR is mandatory, else, GOHEAD-FRBNR is optional.

exits are as follows.

Exit Name Description

MBCF0002 Customer function exit: Segment text in material doc. item

MBCF0005 Material document item for goods receipt/issue slip

MBCF0006 Customer function for WBS element

MBCF0007 Customer function exit: Updating a reservation

MBCF0009 Filling the storage location field

MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1

MBCF0011 Read from RESB and RKPF for print list in MB26

MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.

thanks&regards,

13 REPLIES 13
Read only

Former Member
0 Likes
1,669

Use BADI instead.

BADI: MB_DOCUMENT_BADI.

Method: MB_DOCUMENT_BEFORE_UPDATE.

Here loop at XMSEG for LIFNR field.

Using LIFNR select on LFA1 get KTOKK.

loop at XMKPF.

if LFA1-KTOKK eq 'KINF' and XMKPF-FBRNR is initial

message e398(00) with 'FBRNR is mandatory'.

endif.

endloop.

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

hI Sharath,

Thanks for the reply ,...

But I would like to know the badi

MB_DOCUMENT_BADI will be triggered with MIGO tcode execution or not.

i.e I want to know at which instance of the MIGO tcode execution this badi wuld be triggered .

Is there any otherway to achieve this ....

I found the following BADI s in MIGO program .

BADI_MB_MIGO BADI_MB_MIGO_ITEM .

bUT When i tried to see the definitions of the same They are not exist in the system .

could you please help me in this regard.

thanks for the early answers .

regards,.

Message was edited by:

shishupalreddy ramreddy

Read only

Former Member
0 Likes
1,669

Hi,

The badi that i mentioned gets triggerred when a SAVE is pressed on MIGO screen.

There is another badi: MB_CHECK_LINE_BADI which gets triggerred whenever changes are made to the item of the document. Try this one.

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

Hi Sharath,

There no such BADI called in MIGO program but the badi called in this is

MB_MIGO_BADI inthis we have a method post_document .

Can you please tell me whthere that can be applied if so How ?

Thanks Regards

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

hai ,

Can you please provide the feasible solution to solve this issue asap .

Thanks Regards,

Read only

Former Member
0 Likes
1,669

MB_MIGO_BADI is used for adding custom screens so you cannot use that for your requirement, I am very suprised that badi's that i mentioned are not getting triggerred at any point.

1. have you first of all created a dummy implementation and then put a break point there to check whether the badi's are getting triggerred, if not then you should do that first.

2. if MB_MIGO_BADI is getting triggerred then the other badi's will/should get triggerred.

Note: Pls award points for helpful answers.

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

Hi Sharath,

I tried the BADI u mentioned with breakpoint and it was not triggering at all ...

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

Hi Sharath,

I tried by implemeting the BADI MB_DOCUMENT_SAVE but the same is not available in MIGO program (SAPLMIGO) .But i find the other BADI in that wht i told you .''

It is urgent can you please provide me the correct solution to accomplsih the requirement .

thanks

Read only

Former Member
0 Likes
1,669

All I did was:

1. Enter MIGO transaction.

2. Choose Goods Reciept and then enter a purchase order.

3. fill all the mandatory fields.

4. Click on Button 'CHECK'.

5. At this point i had swithced on debugger, but a break point on method GET_INSTANCE of BADI: CL_EXITHANDLER.

6. I could clearly see MB_CHECK_LINE_BADI getting triggerred.

Please do the same and let me know.

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

Hi Sharath,

Thanks lot for the reply ...and I would be gr8 if U could send me the clear screen shots with debugging to my mail id reddy_abap79@rediffmail.com.

Because I could not find whether that was triggered or not .

Please do this help.

thanks

Read only

Former Member
0 Likes
1,669

Done.

Read only

0 Likes
1,669

Hi Sharath,

Thanks a lot for the reply , but still iam havng a doubt .

the following method which u said was triggering but here the BADI name is hardcoded in our sap server so i could not foind the BADI s u mentioned .

call method cl_exithandler=>get_instance

EXPORTING exit_name = 'MB_MIGO_BADI' "552774

null_instance_accepted = x "552774

changing

instance = if_badi.

Even this BADI contains around 10 methods init which one i supposed to use .....

IOnemore point when i placed a breakpoint in the above mentioned Method it is triggering In PBO of MIGO tcode.

thanks again

Message was edited by:

shishupalreddy ramreddy

Read only

shishupalreddy
Active Contributor
0 Likes
1,669

hi sharath ,

thanks a lot for the answers ..

but i used the BADI

MB_MIGO_BADI and POST_DOCUMENT method and the requirement is done ..

awarding the points ...

thanks