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

Purchase order History

Former Member
0 Likes
4,805

Hi..

Iam trying to display the Purchase order History using BAPI_PO_GETDETAIL function module... and my code is

data : i_ekko type table of ekko,
       i_ekko_wa like line of i_ekko.
parameters : p_vendor like ekko-lifnr,
             p_po     like ekko-ebeln.

select * from ekko into corresponding fields of table i_ekko where lifnr = p_vendor and ebeln = p_po.

loop at i_ekko into i_ekko_wa.


CALL FUNCTION 'BAPI_PO_GETDETAIL'
  EXPORTING
    PURCHASEORDER                    =  '4500017124'
   ITEMS                            = 'X'
*   ACCOUNT_ASSIGNMENT               = ' '
*   SCHEDULES                        = ' '
   HISTORY                          = 'X'
*   ITEM_TEXTS                       = ' '
*   HEADER_TEXTS                     = ' '
*   SERVICES                         = ' '
*   CONFIRMATIONS                    = ' '
*   SERVICE_TEXTS                    = ' '
*   EXTENSIONS                       = ' '
* IMPORTING
*   PO_HEADER                        =
*   PO_ADDRESS                       =
* TABLES
*   PO_HEADER_TEXTS                  =
*   PO_ITEMS                         =
*   PO_ITEM_ACCOUNT_ASSIGNMENT       =
*   PO_ITEM_SCHEDULES                =
*   PO_ITEM_CONFIRMATIONS            =
*   PO_ITEM_TEXTS                    =
*   PO_ITEM_HISTORY                  =
*   PO_ITEM_HISTORY_TOTALS           =
*   PO_ITEM_LIMITS                   =
*   PO_ITEM_CONTRACT_LIMITS          =
*   PO_ITEM_SERVICES                 =
*   PO_ITEM_SRV_ACCASS_VALUES        =
*   RETURN                           =
*   PO_SERVICES_TEXTS                =
*   EXTENSIONOUT                     =
          .
endloop.

Iam not getting the output ... It doesnt show errors..

Regards,

Abaper.

1 ACCEPTED SOLUTION
Read only

former_member203501
Active Contributor
0 Likes
2,639

where is the displaying PO code???

check your code once again...

look at this example...

report zbapi_1.

data: begin of i_poitem occurs 0.

include structure bapiekpo.

data: end of i_poitem.

parameters p_ebeln like ekko-ebeln default '4500012164'.

call function 'BAPI_PO_GETDETAIL'

exporting

purchaseorder = p_ebeln

  • ITEMS = 'X'

  • ACCOUNT_ASSIGNMENT = ' '

  • SCHEDULES = ' '

  • HISTORY = ' '

  • ITEM_TEXTS = ' '

  • HEADER_TEXTS = ' '

  • SERVICES = ' '

  • CONFIRMATIONS = ' '

  • SERVICE_TEXTS = ' '

  • EXTENSIONS = ' '

  • IMPORTING

  • PO_HEADER = PO_HEADER

  • PO_ADDRESS = PO_ADDRESS

tables

  • PO_HEADER_TEXTS = PO_HEADER_TEXTS

po_items = i_poitem.

  • PO_ITEM_ACCOUNT_ASSIGNMENT = PO_ITEM_ACCOUNT_ASSIGNMENT

  • PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES

  • PO_ITEM_CONFIRMATIONS = PO_ITEM_CONFIRMATIONS

  • PO_ITEM_TEXTS = PO_ITEM_TEXTS

  • PO_ITEM_HISTORY = PO_ITEM_HISTORY

  • PO_ITEM_HISTORY_TOTALS = PO_ITEM_HISTORY_TOTALS

  • PO_ITEM_LIMITS =

  • PO_ITEM_CONTRACT_LIMITS =

  • PO_ITEM_SERVICES =

  • PO_ITEM_SRV_ACCASS_VALUES =

  • RETURN =

  • PO_SERVICES_TEXTS = .

  • EXTENSIONOUT = EXTENSIONOUT

loop at i_poitem.

write 😕 'PONUMBER = ' , i_poitem-po_number color col_heading,

/ 'ITEM = ' , i_poitem-po_item,

/ 'MATERIAL NAME = ' , i_poitem-material,

/ 'MATERIAL = ' , i_poitem-pur_mat,

/ 'CHANGED ON = ', i_poitem-changed_on,

/ 'SHORT TEXT = ' , i_poitem-short_text,

/ 'COMPANY CODE = ' , i_poitem-co_code,

/ 'PLANT = ' , i_poitem-plant,

/ 'MATERIAL GROUP = ' , i_poitem-mat_grp,

/ 'QUANTITY = ' , i_poitem-quantity left-justified,

/ 'UNIT = ' , i_poitem-unit,

/ 'NET PRICE = ' , i_poitem-net_price left-justified.

uline.

endloop.

Edited by: Venkat Appikonda on Mar 7, 2009 11:57 AM

Hi..

Iam trying to display the Purchase order History using BAPI_PO_GETDETAIL function module... and my code is

data : i_ekko type table of ekko,
       i_ekko_wa like line of i_ekko.
parameters : p_vendor like ekko-lifnr,
             p_po     like ekko-ebeln.

select * from ekko into corresponding fields of table i_ekko where lifnr = p_vendor and ebeln = p_po.

loop at i_ekko into i_ekko_wa.


CALL FUNCTION 'BAPI_PO_GETDETAIL'
  EXPORTING
    PURCHASEORDER                    =  '4500017124'
   ITEMS                            = 'X'
*   ACCOUNT_ASSIGNMENT               = ' '
*   SCHEDULES                        = ' '
   HISTORY                          = 'X'
*   ITEM_TEXTS                       = ' '
*   HEADER_TEXTS                     = ' '
*   SERVICES                         = ' '
*   CONFIRMATIONS                    = ' '
*   SERVICE_TEXTS                    = ' '
*   EXTENSIONS                       = ' '
* IMPORTING
*   PO_HEADER                        =
*   PO_ADDRESS                       =
* TABLES
*   PO_HEADER_TEXTS                  =
*   PO_ITEMS                         =
*   PO_ITEM_ACCOUNT_ASSIGNMENT       =
*   PO_ITEM_SCHEDULES                =
*   PO_ITEM_CONFIRMATIONS            =
*   PO_ITEM_TEXTS                    =
*   PO_ITEM_HISTORY                  =
*   PO_ITEM_HISTORY_TOTALS           =
*   PO_ITEM_LIMITS                   =
*   PO_ITEM_CONTRACT_LIMITS          =
*   PO_ITEM_SERVICES                 =
*   PO_ITEM_SRV_ACCASS_VALUES        =
*   RETURN                           =
*   PO_SERVICES_TEXTS                =
*   EXTENSIONOUT                     =
          .
endloop.

Iam not getting the output ... It doesnt show errors..

Regards,

Abaper.

5 REPLIES 5
Read only

former_member203501
Active Contributor
0 Likes
2,640

where is the displaying PO code???

check your code once again...

look at this example...

report zbapi_1.

data: begin of i_poitem occurs 0.

include structure bapiekpo.

data: end of i_poitem.

parameters p_ebeln like ekko-ebeln default '4500012164'.

call function 'BAPI_PO_GETDETAIL'

exporting

purchaseorder = p_ebeln

  • ITEMS = 'X'

  • ACCOUNT_ASSIGNMENT = ' '

  • SCHEDULES = ' '

  • HISTORY = ' '

  • ITEM_TEXTS = ' '

  • HEADER_TEXTS = ' '

  • SERVICES = ' '

  • CONFIRMATIONS = ' '

  • SERVICE_TEXTS = ' '

  • EXTENSIONS = ' '

  • IMPORTING

  • PO_HEADER = PO_HEADER

  • PO_ADDRESS = PO_ADDRESS

tables

  • PO_HEADER_TEXTS = PO_HEADER_TEXTS

po_items = i_poitem.

  • PO_ITEM_ACCOUNT_ASSIGNMENT = PO_ITEM_ACCOUNT_ASSIGNMENT

  • PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES

  • PO_ITEM_CONFIRMATIONS = PO_ITEM_CONFIRMATIONS

  • PO_ITEM_TEXTS = PO_ITEM_TEXTS

  • PO_ITEM_HISTORY = PO_ITEM_HISTORY

  • PO_ITEM_HISTORY_TOTALS = PO_ITEM_HISTORY_TOTALS

  • PO_ITEM_LIMITS =

  • PO_ITEM_CONTRACT_LIMITS =

  • PO_ITEM_SERVICES =

  • PO_ITEM_SRV_ACCASS_VALUES =

  • RETURN =

  • PO_SERVICES_TEXTS = .

  • EXTENSIONOUT = EXTENSIONOUT

loop at i_poitem.

write 😕 'PONUMBER = ' , i_poitem-po_number color col_heading,

/ 'ITEM = ' , i_poitem-po_item,

/ 'MATERIAL NAME = ' , i_poitem-material,

/ 'MATERIAL = ' , i_poitem-pur_mat,

/ 'CHANGED ON = ', i_poitem-changed_on,

/ 'SHORT TEXT = ' , i_poitem-short_text,

/ 'COMPANY CODE = ' , i_poitem-co_code,

/ 'PLANT = ' , i_poitem-plant,

/ 'MATERIAL GROUP = ' , i_poitem-mat_grp,

/ 'QUANTITY = ' , i_poitem-quantity left-justified,

/ 'UNIT = ' , i_poitem-unit,

/ 'NET PRICE = ' , i_poitem-net_price left-justified.

uline.

endloop.

Edited by: Venkat Appikonda on Mar 7, 2009 11:57 AM

Read only

0 Likes
2,639

Hi..,

Thanks for ur help ..Can I have the field name of pending purchase order quantity ... I want to display that

field mainly...

Regards,

Abaper.

Read only

0 Likes
2,639

u can also refer EKBE, EKET tables in conjuction with EKKO, EKPO.

thanq

Read only

former_member203501
Active Contributor
0 Likes
2,639

hi this can be calculated in the output table like this ..

pending PO quantity = Open Qty - Delivered Qty .

Read only

Former Member
0 Likes
2,639

It doesn't show errors because you have commented out the RETURN table!

Rob