Application Development 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: 

Using BAPI_PO_CREATE1 : Linking service, and account assignment

Former Member
0 Kudos

Hello,

I have trouble when using BAPI_PO_CREATE1. When creating PO using BAPI_PO_CREATE1, I need to input service for each po item and the service itself need to have account assignment. I simplify the code below.


**PO item
t_poitem-po_item        = '10'. "for item 10
t_poitem-PCKG_NO        = '20'. "link with service
...

t_poitemx-po_item        = 'X'.
t_poitemx-PCKG_NO       = 'X'.
...

**Account Assignment
t_poaccount-po_item    = '10'. "link with PO Item
t_poaccount-SERIAL_NO  = '01'. 
t_poaccount-DISTR_PERC = 1.
...
t_poaccountx-po_item    = '10'.
t_poaccountx-SERIAL_NO  =  '01'.
t_poaccountx-po_itemx    = 'X'.
t_poaccountx-SERIAL_NOx  = 'X'.
t_poaccountx-DISTR_PERC = 'X'.
...

**PO Services
**1st row
t_poservices-PCKG_NO = '20'.
t_poservices-LINE_NO = '0000000001'.
t_poservices-SUBPCKG_NO  = '21'.
APPEND t_poservices.
clear t_poservices.

**2nd row
t_poservices-PCKG_NO = '21'.
t_poservices-LINE_NO = '0000000002'.
t_poservices-EXT_LINE = '0000000010'.
...

**fill account assignment for services
t_POSRVACCESSVALUES-pckg_no = '21'.
t_POSRVACCESSVALUES-LINE_NO = '0000000002'.
T_POSRVACCESSVALUES-SERNO_LINE = '01'.
t_POSRVACCESSVALUES-SERIAL_NO = '01'. "acct. assign. link
t_POSRVACCESSVALUES-PERCENTAGE = '100'.
...

Every time i execute BAPI_PO_CREATE1 using entry similar like above, i always found error message in t_return like this:

No account assignment exists for service line 0000000010

I feel sure that i have fill every field needed to link services and account assignment which is using serial_no, but somehow it does not link correctly. Can anyone advise me if there is some thing missing or incorrect with my ABAP code above? Thank you in advance for your help. For sure, first helpful answer will receive my rewards point.

Regards,

Abraham

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I am facing the same problems as yours.

After looking around on SAP Service, I found that is a program error (at least as SAP says so). The solution they provide is to implement correction instructions).

Please take a look at the following SAP Notes for your reference:

767284 - SE518 occurs although account assignment is supplied to BAPI (this requires Note 552114 must be applied as a prerequisite)


Symptom
When BAPI_PO_CREATE1 is used to create a purchase order 
with only limits or unplanned services although the account 
assignment is supplied to the BAPI Interface the error message 
SE 518 No account assignment exists for service line occurs.

552114 - Repeat Account Assignment data for a service release order


*Symptom*
You have a service contract without accounting data. 
When you create a new release order referenced to this contract 
you select services from this contract and that enter accounting information 
and work with the function repeat accounting information. For this first item
in the release order if you maintain a contract limit the accounting data will
be correct suggested from the system. But if you add a new item at this 
document referenced also to the same contract and repeat the above scenario,
the system will no be able to suggest the accounting data saved with the
function repeat accounting information when you maintain for this new item
the contract limit.

376424 - BAPI_PO_CREATE1: Error messages for parked POs


*Symptom*
If purchase orders are held via BAPI_PO_CREATE1, error messages
 are not stored with the application object.As a result, in some cases these 
documents cannot be processed correctly.
or
When you create a service item using BAPI_PO_CREATE1, the system
 displays error message SE518.
SE 518: 'No account assignment exists for service line 0000000000'

I will ask the Basis team to see if they can help to implement this or not. I will be back right after the correction is done. .

10 REPLIES 10

Former Member
0 Kudos

i think you are doing wrong with assigning package numbers.

now i am in home, no R/3 system . i will give reply tomorrow.

0 Kudos

Narasimh,

Thank you for your reply. Package numbers was assigned to link between PO Item and services. I assume this link was success since the error message show that service line 0000000010 has been created but without account assignment. Thus, i assume missing link are between service and account assignment. If you can provide me correct sample to link service item and account assignment while using BAPI_PO_CREATE1, it will be very helpfull.

Regards,

Abraham

0 Kudos

Hi ,

You are missing so many mandatary fields.

here i am providing the fields which are mendatary.

through this values you can create the po.

POHEADER:

PO_NUMBER :4100000001

COMP_CODE :3000

DOC_TYPE :NB

VENDOR :146

PURCH_ORG :3000

PUR_GROUP:300

POHEADERX: you have to mantain 'X' values for enetred POHEADER values.

POITEM:::Structure

PO_ITEM :10

SHORT_TEXT:SERVICE

PLANT :3000

ITEM_CAT :9

ACCTASSCAT :F

PCKG_NO :0000000001

POITEMX: you have to mantain 'X' values

POSCHEDULE : structure name

PO_ITEM : 10

POSCHEDULEX : you have to mantain 'X' values

POACCOUNT: structure name

PO_ITEM :10

POACCOUNTX: you have to mantain 'X' values

POSERVICES:structure

PCKG_NO : 0000000001

LINE_NO :0000000001

SUBPCKG_NO : 0000000002

SERVICE :3000000000017

QUANTITY :5

BASE_UOM :AU

GR_PRICE :20000

POSRVACCESSVALUES: structure name

PCKG_NO :0000000002

LINE_NO :0000000002

with the above values i have created po for sertvice in my R/3 4.7c system.

if you are not able to cretae let me know.

0 Kudos

Thank you for the code. Actually i have fill the required field as you told but i did not put it in my code here to focus the problem on service and account assignment. After checking out your code, i found that the different between your code and mine is in services table.

<u><b>your code :</b></u>

<b>POSERVICES:structure</b>

PCKG_NO : 0000000001
LINE_NO :0000000001
SUBPCKG_NO : 0000000002
SERVICE :3000000000017
QUANTITY :5
BASE_UOM :AU
GR_PRICE :20000

<b>POSRVACCESSVALUES: structure name</b>

PCKG_NO :0000000002
LINE_NO :0000000002

<u><b>my code are:</b></u>

<b>POSERVICES:structure</b>

PCKG_NO : 0000000001

LINE_NO :0000000001

SUBPCKG_NO : 0000000002

PCKG_NO : 0000000002

LINE_NO :0000000002

SERVICE :3000000000017

QUANTITY :5

BASE_UOM :AU

GR_PRICE :20000

<b>POSRVACCESSVALUES: structure name</b>

PCKG_NO :0000000002
LINE_NO :0000000002
SERIAL_NO :0000000001

The other difference are in account assignment table, you didn't fill SERIAL_NO field.

my code will be like below:

<b>POACCOUNT: structure name</b>

PO_ITEM :10
SERIAL_NO : 0000000001

If using your version, the error message will be:

<i>In case of account assignment, please enter acc. assignment data for item</i>

If using my version, the error message will be:

<i>No account assignment exists for service line 0000000010</i>

Please advise what was wrong with my code. Thank you.

Regards,

Abraham

0 Kudos

Hi.

I'm having the same problem.

I try with the 2 versions and get the same 2 errors.

Did you solve the problem?

Regards.

Gregory.

Former Member
0 Kudos

Hi all,

Any update on this issue raised by Mr. Bukit ?

Thanks

Former Member
0 Kudos

This question should be unanswered because until know I can not use the Bapi for that requirement. In the end I mixed BAPI and BDC in that project with unexpected result which is inconsistent data in SAP database. Finally we have to fix hundreds of unusable PO manually.

Former Member
0 Kudos

Hi,

I am facing the same problems as yours.

After looking around on SAP Service, I found that is a program error (at least as SAP says so). The solution they provide is to implement correction instructions).

Please take a look at the following SAP Notes for your reference:

767284 - SE518 occurs although account assignment is supplied to BAPI (this requires Note 552114 must be applied as a prerequisite)


Symptom
When BAPI_PO_CREATE1 is used to create a purchase order 
with only limits or unplanned services although the account 
assignment is supplied to the BAPI Interface the error message 
SE 518 No account assignment exists for service line occurs.

552114 - Repeat Account Assignment data for a service release order


*Symptom*
You have a service contract without accounting data. 
When you create a new release order referenced to this contract 
you select services from this contract and that enter accounting information 
and work with the function repeat accounting information. For this first item
in the release order if you maintain a contract limit the accounting data will
be correct suggested from the system. But if you add a new item at this 
document referenced also to the same contract and repeat the above scenario,
the system will no be able to suggest the accounting data saved with the
function repeat accounting information when you maintain for this new item
the contract limit.

376424 - BAPI_PO_CREATE1: Error messages for parked POs


*Symptom*
If purchase orders are held via BAPI_PO_CREATE1, error messages
 are not stored with the application object.As a result, in some cases these 
documents cannot be processed correctly.
or
When you create a service item using BAPI_PO_CREATE1, the system
 displays error message SE518.
SE 518: 'No account assignment exists for service line 0000000000'

I will ask the Basis team to see if they can help to implement this or not. I will be back right after the correction is done. .

0 Kudos

I had the same issue and tried tons of different variants of data. In the end SAP connected to system and said that LINE_NO in POSRVACCESSVALUES should be 0, it does not make much sense, but it works just fine! After all the contracts are being created, hope this helps someone in future

POSERVICES:structure

PCKG_NO : 0000000001

LINE_NO :0000000001

SUBPCKG_NO : 0000000002

PCKG_NO : 0000000002

LINE_NO :0000000002

SERVICE :3000000000017

QUANTITY :5

BASE_UOM :AU

GR_PRICE :20000

POSRVACCESSVALUES: structure name

PCKG_NO :0000000002

LINE_NO :0000000002 -> LINE_NO:000000000

SERIAL_NO :0000000001

0 Kudos

Hi Stefanovic,

I have faced d same pblm, that worked for me also.

Thank U...