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: 
Read only

Problem in badi 'ME_PROCESS_REQ_CUST'

Former Member
0 Likes
1,505

Hi experts,

               I am trying to implement the badi 'ME_PROCESS_REQ_CUST' with the method 'IF_EX_ME_PROCESS_REQ_CUST~CHECK' .I want to check the data ( Like : ITEM NO , PRICE, QUANTITY , ACCOUNT ASSIGNMENT CATEGORY ,GL CODE , COST CENTER etc ) of the purchase requisition which is going to be created at the time of creation . I am able to get the ITEM NO , PRICE, QUANTITY , but not able to get data of  ACCOUNT ASSIGNMENT CATAGORY ,GL CODE , COST CENTER . Please tell me how can I do this .

Thanks & regards,

Deb

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
772

I suppose you were able to get the item list in CHECK method using interface IF_PURCHASE_REQUISITION method GET_ITEMS on header received, so now looping at those items you get new methods available thru interface IF_ACCT_CONTAINER_MM, using again method GET_ITEMS and looping to call method method GET_EXKN of interface IF_ACCOUNTING_MODEL_MM.

Regards,

Raymond

Read only

0 Likes
772

Hi Raymond,

                   The code I have written is as the following :

DATA: li_items  TYPE mmpur_requisition_items,
       lw_items  TYPE mmpur_requisition_item,
       i_items  TYPE mmpur_requisition_items,
       w_items  TYPE mmpur_requisition_item,
       li_req_item TYPE TABLE OF mereq_item,
       lw_req_item TYPE   mereq_item,
       I_ITEM TYPE TABLE OF MMPUR_ACCOUNTING_LIST,
       W_ITEM TYPE   MMPUR_ACCOUNTING_LIST,
       I_ACC TYPE TABLE OF mereq_item,
       W_ACC TYPE   mereq_item.

  DATA:lif_item TYPE REF TO if_purchase_requisition_item.

     REFRESH:li_items.
     CLEAR: lw_items,lw_req_item.

     IF im_header IS NOT INITIAL.
       CALL METHOD im_header->get_items
         RECEIVING
           re_items = li_items.
       IF li_items IS NOT INITIAL.
         CLEAR: lw_items,lw_req_item.

         LOOP AT li_items INTO lw_items.
           lif_item = lw_items-item.
           IF lif_item IS NOT INITIAL.
             CALL METHOD lif_item->get_data
               RECEIVING
                 re_data = lw_req_item.
             APPEND lw_req_item TO li_req_item.

           ENDIF.
           CLEAR lw_req_item.
         ENDLOOP.
       ENDIF.
      ENDIF.


After execution of this code I am getting the line item wise data in table li_req_item .

So, please tell me where and how I have to attach the code for fetching 'Account assignment Category' , 'GL code', and 'Cost center' .