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.
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)
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
i_line_id = '000001' -> Hardcoded just to test the results
cs_goitem = ls_item.
But could not get any values in the ls_item.
In my sample you could (just suggestions)