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: 

Change ekko-aedat in PO using BAPI

Former Member
0 Kudos

Hi gurus,

I have gone through the SDN and didn't find a suitable answer. I want to make myself clear. Using BAPI is it possible to change the (AEDAT) for a particular PO

Thanks in advance

Regards,

Kasuladevi

3 REPLIES 3

valter_oliveira
Active Contributor
0 Kudos

I supose you cannot change the creation date. However you can try BAPI_PO_CHANGE, with:

POHEADER-CREAT_DATE = <new_date>.

POHEADERX-CREAT_DATE = 'X'.

Post here the result.

Regards,

Valter Oliveira.

0 Kudos

Thanx for your reply.

Can u just provide me a step by step procedure. Like what should be passed in the Export Parameter and Import Parameter.

Thanx in Advance

Regards,

Kasuladevi

0 Kudos

Check this simple sample code:


DATA: po_number TYPE bapimepoheader-po_number.
DATA: poheader TYPE bapimepoheader.
DATA: poheaderx TYPE bapimepoheaderx.
DATA: expheader TYPE bapimepoheader.
DATA: return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.

CLEAR: poheader, poheaderx, expheader.
REFRESH: return.

po_number = <your_po_number>.
poheader-CREAT_DATE = <your_new_date>.
poheaderx-creat_date = 'X'. "Tells BAPI the field you want to modify

CALL FUNCTION 'BAPI_PO_CHANGE'
  EXPORTING
    purchaseorder = po_number
    poheader      = poheader
    poheaderx     = poheaderx
  IMPORTING
    expheader     = expheader
  TABLES
    return        = return.

READ TABLE return TRANSPORTING NO FIELDS WITH KEY type = 'E'.
IF sy-subrc NE 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'.
ENDIF.

Regards.

Valter Oliveira.