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: 

MIGO Enhancement for line item validation

satheshkumar44
Explorer
0 Kudos

Hi Experts,

We need to do a validation during goods movement for transfer posting against manual reservation, after fetching all the line items entered in MIGO, we tried using the method IF_EX_MB_MIGO_BADI~POST_DOCUMENT. The reason to do the validation is to restrict processing of the same reservation line item twice in the same MIGO document. We are able to view the line items in the table IT_MSEG but not all the fields are populated such as IT_MSEG-WEMPF. Is the any other method or table we can use to access the RSNUM and RSPOS values of all the line items at the same time before document is posted.

Thanks and Regards,

Satheshkumar.P

1 ACCEPTED SOLUTION

JL23
Active Contributor

Let us assume you could do this validation.

The user would then probably try to post this as an individual movement by starting MIGO again after the initial movement was posted.

Is that then okay that he references the same reservation?

Or does the user then get a standard error message?

Assuming there is a standard error message, had you already searched for OSS notes, maybe it is just a bug that SAP does not check it within the same document.

8 REPLIES 8

raymond_giuseppi
Active Contributor
0 Kudos

Allowed error message types in this method are 'A' termination or 'X' short dump message, use will be very very happy. IMHO you should try another method IMHO. Look for a method where GOITEM-RSNUM/RSPOS are available?

0 Kudos

Hi Raymond,

Using MB_MIGO_BADI we are able to access the each item during each call of the method. Here we need to access all the items during one call of a method so that we can check the duplicate with RSPOS & RSNUM fields.

Regards,

Sathesh.

0 Kudos

You could store the reference for each item in an internal table defined as an instance attribute of your implementing class, so you could trigger error message on duplicates as soon as user create it?

0 Kudos

Hi Raymond,

Thank you for your reply,

I already tried by saving the line item in separate internal table, but the problem is the BAPI is executing for each line item & that one line item gets passed to internal table,

when the next line item comes the previous line item which got store in our internal is replaced by the current line item details.

0 Kudos

The ZEILE or I_LINE_OD value should enable to distinguish each item/itab record, this could be some key of the itab?

former_member192897
Active Contributor
0 Kudos

Did you try these Badi's MB_CHECK_LINE_BADI or MB_DOCUMENT_BADI?

0 Kudos

Hi Ashok,

I tried checking MB_CHECK_LINE_BADI or MB_DOCUMENT_BADI by setting break point but i am unable to find values in XMSEG tables while posting the document in MIGO.

JL23
Active Contributor

Let us assume you could do this validation.

The user would then probably try to post this as an individual movement by starting MIGO again after the initial movement was posted.

Is that then okay that he references the same reservation?

Or does the user then get a standard error message?

Assuming there is a standard error message, had you already searched for OSS notes, maybe it is just a bug that SAP does not check it within the same document.