Skip to Content
0
Jun 12, 2013 at 06:54 AM

Net Price and Currency is updating incorrect in BAPI_PO_CREATE

319 Views

Hi have developed below bapi,but thereis problem with Net price and Currecny. I using flat file for po data.

Below is the my code:

Please advice on this issue.

loop at tab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = tab-material
IMPORTING
OUTPUT = tab-material.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = tab-PUR_MAT
IMPORTING
OUTPUT = tab-PUR_MAT.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = tab-vendor
IMPORTING
OUTPUT = tab-vendor.



PO_HEADER-DOC_DATE = tab-DOC_DATE.
PO_HEADER-DOC_TYPE = tab-DOC_TYPE.
PO_HEADER-CO_CODE = tab-CO_CODE.
PO_HEADER-PURCH_ORG = tab-PURCH_ORG.
PO_HEADER-PUR_GROUP = tab-PUR_GROUP.
PO_HEADER-VENDOR = tab-VENDOR.

PO_HEADER_ADD_DATA-PMNTTRMS = tab-PMNTTRMS.
PO_HEADER_ADD_DATA-CURRENCY = tab-CURRENCY.

PO_ITEMS-PO_ITEM = tab-PO_ITEM.
PO_ITEMS-MATERIAL = tab-MATERIAL.
PO_ITEMS-PUR_MAT = tab-PUR_MAT.
PO_ITEMS-PLANT = tab-PLANT.
PO_ITEMS-NET_PRICE = tab-NET_PRICE.
PO_ITEMS-TAX_CODE = tab-TAX_CODE.
append po_items.

PO_ITEM_SCHEDULES-PO_ITEM = tab-PO_ITEM.
PO_ITEM_SCHEDULES-DELIV_DATE = tab-DELIV_DAT.
PO_ITEM_SCHEDULES-QUANTITY = tab-QUANTITY.
append PO_ITEM_SCHEDULES.


CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
PO_HEADER = PO_HEADER
PO_HEADER_ADD_DATA = PO_HEADER_ADD_DATA
* HEADER_ADD_DATA_RELEVANT =
* PO_ADDRESS =
* SKIP_ITEMS_WITH_ERROR = 'X'
* ITEM_ADD_DATA_RELEVANT =
* HEADER_TECH_FIELDS =
IMPORTING
PURCHASEORDER = PURCHASEORDER
TABLES
PO_ITEMS = PO_ITEMS
* PO_ITEM_ADD_DATA =
PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES
* PO_ITEM_ACCOUNT_ASSIGNMENT =
* PO_ITEM_TEXT =
RETURN = RETURN
* PO_LIMITS =
* PO_CONTRACT_LIMITS =
* PO_SERVICES =
* PO_SRV_ACCASS_VALUES =
* PO_SERVICES_TEXT =
* PO_BUSINESS_PARTNER =
* EXTENSIONIN =
* POADDRDELIVERY =
.

call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.

endloop.

Thanks,

Arsul