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: 

PURCHASE ORDER

michael_teran
Participant
0 Kudos
115

Hi.

When I create a new item in TX ME21N . I have to validate Each line with the others positions. My problem is : I'm using IF_PURCHASE_ORDER_ITEM_MM but I can´t find a method which Get all the positions

In my case I can get current positions with get_data method but I want to get all Positions

Somebody Knows the method which it gets all items recorded before .

4 REPLIES 4

Former Member
0 Kudos
57

Hi,

User Exit MM06E005 ==>

Use this EXIT_SAPMM06E_012 Exit FM for validate all PO

item.

Thanks,

Durai.V

Edited by: Durai V on Jul 22, 2008 6:22 AM

uwe_schieferstein
Active Contributor
0 Kudos
57

Hello Michael

I assume you have implemented BAdI ME_PROCESS_PO_CUST.

If this is correct then you could use method IF_EX_ME_PROCESS_PO_CUST~CHECK ( Closing Check ) to make your final checks before saving:


METHOD if_ex_me_process_po_cust~check.
* define local data
   DATA: lt_items    TYPE PURCHASE_ORDER_ITEMS,
             ls_item      LIKE LINE OF lt_items.

  lt_items = im_header->get_items( ).

  LOOP AT lt_items INTO ls_item.
    IF ( ls_item-item ... ).
     ...
    ENDIF.
  ENDLOOP.

  
ENDMETHOD.

If you are using interface method PROCESS_ITEM you may try the following approach:


  DATA: lo_header    TYPE REF TO IF_PURCHASE_ORDER_MM,
             lt_items      TYPE purchase_orders_items.

  lo_header = im_item->get_header( ).

  lt_items = lo_header->get_items( ).

OR: you save the items into an additional instance attribute of your BAdI implementing class every time a new item is created.

Regards

Uwe

michael_teran
Participant
0 Kudos
57

Well I can solve my problem .

I have created a class and one of parameters is type IF_PURCHASE_ORDER_ITEM_MM

my class recieves a parameter and I call one method GET_DATA and i can get the current position

but I wanted to get all positions and then I call a function like that

CALL FUNCTION 'MEPO_DOC_ITEMS_GET'

TABLES

EXT_ITEM = AT_XEKPO

EXCEPTIONS

ERROR = 1.

And then get all EKPO position

michael_teran
Participant
0 Kudos
57

Thanks