BaDI ME_PROCESS_REQ_CUST — Accessing Local Class from Global Class

I’ve gotten new functional spec from my functional teams, in this requirements, I have to fill value into EBAN-FISTL ( Fund Center ) in Account Assignment tab — ME51N tcode , I believe you have known number of enhancement for these tcode ( ME51N/ME52N) , I choose BaDI ME_PROCESS_REQ_CUST ( Enhancements for Processing Enjoy PReqs: Customer) and  PROCESS_ITEM method for handling it.

I hope you are already familiar how to implement BaDI enhancement, as you know in this PROCESS_ITEM method have MEREQ_ITEM structure and i need to input value to FISTL field ( fund center ) in order this value will be saved to EBAN table.

After write ABAP code and test my enhancement code. so far nothing any error display, but EBAN-FISTL still empty, after debug this enhancement  in OOP ABAP and exploring clue to solve this problem, suddenly i remember one article about how to accessing local class within global class..


Note: im_item (TYPE REF TO if_purchase_requisition_item) is instantiated as local class of function group MEREQ. However, after casting to the ROOT object (lo_obj) the public attribute MY_STATE (TYPE REF TO lcl_req_item_state) is accessible, at least in the debugger but not in the coding. and if you go to SE80 and open MEREQ Function Group and then you can’t missed all of local class on it, as you can see picture below.


Look at a picture, these local class could be used to solve my requirement, at this time go to LCL_ACCT_CONTAINER because FISTL field is own by COBL ( Coding Block ).

Note : You can experiment with other class as your own requirement.

Expanding LCL_ACCT_CONTAINER node and check in Method Definitions, and there are two method that get my attention i.e : GET_COBL and SET_COBL.

LTY_T_COBL refer to COBL, if you check into COBL you’ll found FISTL ( Fund Center ), ok these methed is exactly i need.

Below my full source code to populate Account Assignment in ME51N/ME52N.

Ok this is my short article today about ABAP, i hope this article could be a solution if you meet same problem.


Incoming search terms:

https://www saptutorial org/populate-account-assignment-data-using-me_process_req_cust-badi/,ME_PROCESS_REQ_CUST post code,how to change data in pr item overview enhancment,ABAP ME51N CHECK BADI,Fill all local and global fields in sap,how to find pr number in badi me_process_req_cust process_account method sap,get cobl from me_procces_req_cust,ME_PROCESS_REQ_CUST~PROCESS_ACCOUNT,how to change gl account runtime in pr creation using BADI,sap badi to fill he pr account assignment value