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

BAPI_PO_GETDETAIL sample code

Former Member
0 Likes
3,964

Hi experts ,

Can anyone , gimme a samlpe code for using "BAPI_PO_GETDETAIL " .

Thanx in advance .

Regards

Rajesh .

1 REPLY 1
Read only

Former Member
0 Likes
1,664

HI,

FORM get_position_details USING

pi_bukrs TYPE ekko-bukrs

pi_lifnr TYPE ekko-lifnr

pi_ebeln TYPE ekko-ebeln

pi_zterm TYPE ekko-zterm

pi_bsart TYPE ekko-bsart

pi_date TYPE d

pi_file TYPE string.

  • Read informations of all order positions for one purchase order

DATA:

ls_poitem TYPE bapiekpo,

ls_item_hist TYPE bapiekbe,

lt_poitem TYPE STANDARD TABLE OF bapiekpo,

lt_item_hist TYPE STANDARD TABLE OF bapiekbe,

lt_item_total TYPE STANDARD TABLE OF bapiekbes,

l_ebeln TYPE ekpo-ebeln,

l_ebelp TYPE ekpo-ebelp.

CALL FUNCTION 'BAPI_PO_GETDETAIL'

EXPORTING

purchaseorder = pi_ebeln

items = c_yes

history = c_yes

TABLES

po_items = lt_poitem

po_item_history = lt_item_hist

po_item_history_totals = lt_item_total.

  • Check posting date, because the bapi list the complete

  • history of a delivery plan

DELETE lt_item_hist WHERE pstng_date LT pi_date.

Regards

Nicole