‎2007 Oct 18 3:40 PM
Hi All,
I am working on an interface where I need to change the price of the PO's, and for this I will be getting an input file which will have the material no's and the price associated to those. I need to select PO's based on the following conditions:
document type = 'NB' and purchasing group = '111' and DCI = ' '.
and then once the PO is selected I need to update the price of the PO's for a specific material from the input file.
I know that I need to use BAPI_PO_CHANGE, but can you please tell me how to select the PO's based on the above criterion, I mean how will deal this situation in this BAPI.
Thanks
Rajeev....
‎2007 Oct 18 3:45 PM
You need to firs textract POS from EKKO table for the entered conditions.
SELECT EBELN
INTO TABLE IT_EKKO
FROM EKKO
WHERE BSART = 'NB' AND
EKGRP = 111' AND
LOEKZ = SPACE.
I believe DCI in you question is Deletion indicator.
Once you have all PO Nos, select entries from EKPO table.
SELECT EBELN
EBELP
MATNR
NETPR
INTO TABLE IT_EKPO
FROM EKPO
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN = IT_EKKO-EBELN.
Hope this helps.
ashish
‎2007 Oct 18 3:45 PM
Go to EKKO to get the POs satisfying the criteria you have. Then loop at the POs table and call BAPI_PO_GETDETAIL1. Once you have the PO details, identify the fields that you want to update, do the updates and call BAPI_PO_CHANGE.
‎2007 Oct 18 3:45 PM
You need to firs textract POS from EKKO table for the entered conditions.
SELECT EBELN
INTO TABLE IT_EKKO
FROM EKKO
WHERE BSART = 'NB' AND
EKGRP = 111' AND
LOEKZ = SPACE.
I believe DCI in you question is Deletion indicator.
Once you have all PO Nos, select entries from EKPO table.
SELECT EBELN
EBELP
MATNR
NETPR
INTO TABLE IT_EKPO
FROM EKPO
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN = IT_EKKO-EBELN.
Hope this helps.
ashish
‎2007 Oct 18 3:45 PM
Hi,
You can join table EKKO and EKPO to find the corresponding PO based on your above criteria.
EKKO-BSART (Document Type)
EKKO-EKGRP (Purchasing Group)
EKKO-AUTLF (Complete Delivery Indicator)
EKPO-MATNR (Material)
Regards,
Ferry Lianto