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: 

MIGO - Batch number to show an error message

divsmart
Participant
0 Kudos
1,594

Hi Experts,

I have an requirment as below:-

1. When user enter MIGO ( Transfer Posting - 311 , 312 ) from one storage to other storage .

I need to compare with PLANT (SAME) from batch number and dest batch (SAME) .

Here user makes an correction in Dest batch needs to raise an error message.

I checked the MB_MIGO_BADI in line_modify method but i didn't the idea regarding .

Please help me..

.

10 REPLIES 10

DominikTylczyn
SAP Champion
SAP Champion
0 Kudos
1,399

Hello divsmart

You can implement such a validation with the MB_MIGO_BADI enhancement, method CHECK_ITEM.

Alternatively you can try do set the receiving batch field to display only or suppressed, so its value can't be changed. I'm not sure if it's going to work, but it's worth trying.

Best regards

Dominik Tylczynski

1,399

Thanks Dominik,

I checked in SPRO with display only or suppressed . But not working . (OM** series t-code)

Need to check in MB_MIGO_BADI.

divsmart
Participant
0 Kudos
1,399

Thanks Dominik,

Can i have some piece of code

0 Kudos
1,399

Read the "Before answering" section. You should only use "answer" to propose a solution, otherwise "comment" on the original question or on an answer already published.

raymond_giuseppi
Active Contributor
0 Kudos
1,399

Ask your abaper to implement Enhancement/BAdI MB_MIGO_BADI

  • save GOITEM data in method LINE_MODIFY (into an internal table defined as instance attribute, key is LINE_ID)
  • read the internal table in CHECK_ITEM and raise error when required (UMCHA <> CHARG, etc.)

0 Kudos
1,399

Thanks Raymond,

I done like below.

I need to move the value of CS_goitem-charg (ENTER by user) to UMCHA field

and if User changes the batch number in UMCHA (if CHARG NE UMCHA ).

Need to raise an error message. Please guidance.

EXPORT cs_goitem = cs_goitem TO MEMORY ID 'CS_GOITEM' .

IF cs_goitem-bwart = '311' AND cs_goitem-bwart = '312'.

IF cs_goitem-charg IS NOT INITIAL.

MOVE cs_goitem-charg TO cs_goitem-umcha.
ENDIF.

ENDIF.

0 Kudos
1,399

You can force the batch number in the LINE_MODIFY method.

  • if target batch number is initial copy source batch number
  • always insert/update GOITEM data and LINE_ID to an instance attribute itab

In CHECK_ITEM method

  • read GOITEM record with key LINE_ID
  • raise an error when 2 different batch numbers (and other criteria from your specifications)

Can you post the code you tried in your implementing class?

0 Kudos
1,399

Thanks Raymond,

Thanks for your response.

I raised an error message when batch number NE 'CS_goitem-charg<> cs_goitem-umcha.

But issue here ""After giving error message how to make field ready for input again MIGO for User again ""...

Please guidance.

TYPES: BEGIN OF ty_zmigo_mov,
zuser_name TYPE zmigo_mov-zuser_name,
END OF ty_zmigo_mov.

DATA: ls_zmigo_mov TYPE ty_zmigo_mov,
lt_zmigo_mov TYPE TABLE OF ty_zmigo_mov.
DATA: ls_msg(150) TYPE c.

EXPORT cs_goitem = cs_goitem TO MEMORY ID 'CS_GOITEM' .

IF cs_goitem-bwart = '311' OR cs_goitem-bwart = '312'.

IF cs_goitem-charg IS NOT INITIAL AND cs_goitem-umcha IS INITIAL.
MOVE cs_goitem-charg TO cs_goitem-umcha.
ENDIF.

SELECT SINGLE zuser_name FROM zmigo_mov INTO ls_zmigo_mov WHERE zuser_name EQ sy-uname.
IF ls_zmigo_mov IS INITIAL.
IF cs_goitem-charg <> cs_goitem-umcha.
CONCATENATE 'Please enter the correct batch number as from receiving batch number line item' cs_goitem-zeile INTO ls_msg SEPARATED BY space.
MESSAGE ls_msg TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.

'

0 Kudos
1,399

Don't use this syntax, add the error in the ET_BAPIRET2 parameter.

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,399

As neither RFC nor HTTP communication seems to be used here, I'm removing the "ABAP Connectivity" tag.