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 should not allow users to post in back dated or future date

priyank_dev2
Participant
0 Kudos

Dear All,

I need to add a condition in the MIGO under badi(IF_EX_MB_MIGO_BADI~STATUS_AND_HEADER)based on the movement type the user should not be able to post data on back dated or future date respectively.I have implemented the logic but unable to get the movement type to add the condition.There was one solution provided in google but could not help us as we are in to S4 HANA.

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

The movement codes are available in the items (GOITEM) so you should use one of the method with GOITEM parameter to check this code.

NB: you can also use some methods (e.g. LINE_MODIFY) to save some data in an instance attribute of you implementing class so to be able to check their value in another method. (Actually look at the SAP sample class provided, it saves the item data in an internal table of a function group)

0 Kudos

Hello Raymond,

Thanks for your valuable inputs.I tried with the below code in the existing method(status_and_header):

data: obj1 type REF TO ZCL_IM__CHECK_MIGO_POST_DT.
create OBJECT obj1.

call method obj1->if_ex_mb_migo_badi~line_modify
exporting
i_line_id = '000001' -> Hardcoded just to test the results
changing
cs_goitem = ls_item.

But could not get any values in the ls_item.

BR,

Priyank Patil

0 Kudos

In my sample you could (just suggestions)

  • implement BAdI method line_modify to save some goitem value in an internal table defined as attribute of the implementing class. In the status_and_header (or another method where gohead is available) perform a loop on this internal table to check your rules.
  • implement BAdI method pai_header to save gohead data, and use those data in line_modify or check_item
  • etc.