Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BADI IF_EX_ME_PROCESS_PO_CUST, field MEPO1331-ABLAD

Hi BADI friends,

I'd lke to change field ABLAD via BADI in purchase order view "shipping".

1) i like to "read" the field ( -> get_shipping_data( ) )

2) i like to "change" if necessary ( -> set_shipping_data ( ) )

The problem is that i'm not keen enough in using methods and i don't know how to add structure MEPO1331 in my existing source code ... So if someone could help me in correct declaring / using ls_mepo1331 ...?

Existing code (+ not working attempts - ??? -):

METHOD if_ex_me_process_po_cust~process_item .
* Business-Add-Inn ME_PROCESS_PO_CUST
* Jörg Sauterleute - 23.12.2005
*
* ----------------------------------------------

  DATA: ls_mepoitem TYPE mepoitem,		   "OK
        ls_mepoheader TYPE mepoheader,             "OK
        ls_mepoaccounting TYPE mepoaccounting.     "OK

* ??? DATA: ls_mepo1331 TYPE mepo1331.             " need help --- Shipping data
  ---

* Interfacereferenz auf <if_purchase_order_mm>
  DATA: header_obj TYPE REF TO if_purchase_order_mm.
* Interfacereferenz auf <if_purchase_order_account_mm> über Tabelle
  DATA: it_accountings TYPE purchase_order_accountings, "Tabelle
        accounting_obj TYPE purchase_order_accounting.


* ???  DATA: it_mepo1331 TYPE REF TO (?)if_purchase_order_item_mm.   "need help 
  ---

  INCLUDE mm_messages_mac.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 1. Datenbeschaffung
* ######################################################################

* Kopfdaten
  header_obj = im_item->get_header( ).
  ls_mepoheader = header_obj->get_data( ).

* Positionsdaten
  ls_mepoitem = im_item->get_data( ).

* Versanddaten (Position)                                                 "need help 
* ???  call method it_mepo1331->get_shipping_data( ).
* ??? OR
* ??? ls_mepo1331 = im_item->get_shipping_data( ).
  ---


* Kontierungsdaten (Accounting) über Tabelle it_accountings
  it_accountings = im_item->get_accountings( ).
* ...IF eingebaut, weil sonst später Abbruch, wenn sy-subrc <> 0
  IF NOT ls_mepoitem-knttp IS INITIAL.
    LOOP AT it_accountings INTO accounting_obj.
      ls_mepoaccounting = accounting_obj-accounting->get_data( ).
    ENDLOOP.
  ENDIF.

Please check lines with "need help

Here i need hints/correct code, to get the shipping data.

kind regards

Jörg

replied

Hi,

the method get_shipping_data returns structure with type EKPV. How did you get the structure mepo1331. The code to get shipping data is pretty simple

DATA ls_sdata TYPE ekpv.

ls_sdate = im_item->get_shipping_data( ).

Cheers

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question