Skip to Content
0

Error creating PO with BAPI_PO_CREATE1

Aug 21, 2017 at 11:29 AM

72

avatar image

Hi Expert,

I've followed few of the forum suggestion mentioned in SCN and SAP Note but still get error "In case of account assignment, please enter acc. assignment data for item" while creating PO via BAPI_PO_CREATE1. My scenario are PO with limit data + single account assignment.

Using BAPI_PO_CREATE1 : Linking service, and account assignment

PO Upload through BAPI_PO_CREATE1 - Problem in Service Item

2114353 - How to create service PO with BAPI_PO_CREATE1

Appreciate anyone that could guide me through this as I've faced this issues few days.

Thanks.

Regards,

-Ben-

10 |10000 characters needed characters left characters exceeded

Are you filling in the account assignment information? Can you share the relevant code?

0

Hi Jelena,

Yes, I've filled in account assignment info in POACCOUNT and POACCOUNX structure. Kindly refer my code as below:

PO HEADER & PO HEADERX

ls_poheader-doc_type = ls_file-bsart.
ls_poheader-vendor = ls_file-lifnr.
ls_poheader-comp_code = ls_file-bukrs.
ls_poheader-purch_org = ls_file-ekorg.
ls_poheader-pur_group = ls_file-ekgrp.
ls_poheader-currency = ls_file-waers.

PO ITEM & PO ITEMX

ls_poitem-po_item = ls_file-ebelp.
ls_poitem-acctasscat = ls_file-knttp.
ls_poitem-item_cat = ls_file-pstyp.
ls_poitem-short_text = ls_file-txz01.
ls_poitem-matl_group = ls_file-matkl.
ls_poitem-plant = ls_file-werks.
ls_poitem-pckg_no = '0000000001'.

APPEND ls_poitem to lt_poitem.

PO ACCOUNT & PO ACCOUNTX

ls_poaccount-po_item = ls_file-ebelp.
ls_poaccount-serial_no = ls_file-zekkn.
ls_poaccount-gl_account = ls_file-sakto.
ls_poaccount-co_area = ls_file-kokrs.
ls_poaccount-costcenter = ls_file-kostl.
ls_poaccount-fund = ls_file-geber.
ls_poaccount-funds_ctr = ls_file-fistl.
ls_poaccount-cmmt_item = ls_file-fipos.
ls_poaccount-bus_area = ls_file-gsber.
ls_poaccount-func_area = ls_file-fkber.
ls_poaccount-grant_nbr = ls_file-grant_nbr.

APPEND ls_poaccount to lt_poaccount.

PO LIMITS

ls_polimits-pckg_no = '0000000001'.
ls_polimits-limit = ls_file-sumlimit.
ls_polimits-exp_value = ls_file-commitment.

APPEND ls_polimits to lt_polimits.

POSRVACCESSVALUES

ls_POSRVACCESSVALUES-PCKG_NO = '0000000001'.
ls_POSRVACCESSVALUES-LINE_NO = '0000000000'.
ls_POSRVACCESSVALUES-SERNO_LINE = '01'.
ls_POSRVACCESSVALUES-SERIAL_NO = '01'.
ls_POSRVACCESSVALUES-PERCENTAGE = '100'.

APPEND ls_posrvaccessvalues to lt_posrvaccessvalues.

CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = ls_poheader
poheaderx = ls_poheaderx
IMPORTING
exppurchaseorder = lv_exppurchaseorder
TABLES
return = lt_return
poitem = lt_poitem
poitemx = lt_poitemx
poaccount = lt_poaccount
poaccountx = lt_poaccountx
polimits = lt_polimits
posrvaccessvalues = lt_posrvaccessvalues.

Hope my relevant code posted here could give you some hints on which part of the information that I still missed out.

Thanks.

Regards,

-Ben-

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jürgen L
Aug 22, 2017 at 05:06 AM
0

These lines do not look like in the example given in the OSS note 2114353

ls_POSRVACCESSVALUES-PCKG_NO = '0000000001'.

ls_POSRVACCESSVALUES-LINE_NO = '0000000000'.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Jürgen L,

I've followed as per mentioned in the OSS note 2114353. I'm in the scenario 3 where PO with limit data + single account assignment. Can you explain in details which part that I've missed out?

Thanks.

Regards,

-Ben-

1.png (21.7 kB)
0