Skip to Content
avatar image
Former Member

BADI : ME_PROCESS_PO_CUST

Hi Experts,

I want to use the BADI : ME_PROCESS_PO_CUST and the method POST in tht BADI. But here I don't know how to get the Item data. I was able to get the header data by using the below code

DATA : ls_hdr TYPE REF TO if_purchase_order_mm.

DATA : po_header TYPE mepoheader.

CALL METHOD im_header->get_data

RECEIVING

re_data = po_header.

Now please guide me how to get the item data that we enter in the ME21N screen to here.

  • Points will be assigned for the helpful answers

Regards,

Ravi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Aug 21, 2007 at 09:34 AM

    Hello Ravi

    Have a look at my posting in thread:

    ME21N, BADI ME_PROCESS_PO_CUST, compare delivery address in each line item

    ...
    METHOD if_ex_me_process_po_cust~check.
    * define local data
      DATA:
        lt_items      TYPE purchase_order_items,
        ls_item       TYPE purchase_order_item,
    *
        ls_header     TYPE mepoheader,
        ls_detail     TYPE mepoitem,
        lt_details    TYPE tab_mepoitem.
     
     
     
    * Get the order items
      lt_items = im_header->get_items( ).
    ...

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Ravi

      The following coding shows how to retrieve item details of a new purchase order. Class CL_PO_ITEM_HANDLE_MM implements the interface IF_PURCHASE_ORDER_ITEM_MM which represents the items returned by method im_header->get_items( ).

      METHOD if_ex_me_process_po_cust~post.
      * define local data
        DATA:
          lt_items      TYPE purchase_order_items,
      *    ls_item       LIKE LINE OF lt_items,  " alternatively
          ls_item       TYPE purchase_order_item,
      *
          ls_header     TYPE mepoheader,
          ls_detail     TYPE mepoitem,
          lt_details    TYPE tab_mepoitem.
      
      
      * Get the order items
        lt_items = im_header->get_items( ).
      
        LOOP AT lt_items INTO ls_item.
          ls_detail = ls_item-item->get_data( ).
          APPEND ls_detail TO lt_details.
      "   Call additional methods (of IF_PURCHASE_ORDER_ITEM_MM) for
      "   additional data about the purchase order item, e.g.
      *    GET_SCHEDULES	Delivery Schedule
      *    GET_ACCOUNTINGS	Account Assignments
      *    GET_CONDITIONS	Get Item Conditions
        ENDLOOP.
      
      
      ENDMETHOD.

      Regards

      Uwe