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: 

BAPI_INCOMINGINVOICE_CREATE Error

Former Member
0 Kudos
2,066

Dear Guru's,

I have a problem when using BAPI_INCOMINGINVOICE_CREATE, I have a requirement that I can create IR and adding tax, freight etc. through GL Account.

Because this is standard PO, I left blank field serial number in ACCOUNTINGDATA it comes with and error return message

"Account assignment 00 for purchasing document does not exist"

So I try to fill the GLACCOUNTDATA table but always have a short dump

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught in

procedure "CO_FILL" "(FORM)", nor was it propagated by a RAISING clause.

The call to the function module "FUNC_AREA_CONVERSION_INBOUND" is incorrect:

The function module interface allows you to specify only

fields of a particular type under "I_FUNC_AREA".

The field "S_GLACCOUNTDATA-FUNC_AREA" specified here is a different

field type

.

Is there any notes that I can apply to solve this problem, or are there other solutions for the requirement.

Thanks in advance

AT

9 REPLIES 9

madhu_vadlamani
Active Contributor
0 Kudos
377

Hi Allan,

Wecome to scn.Are you able to create it manually.

Regards,

Madhu.

0 Kudos
377

Hi,

Yes we can create manually through MIRO transaction

Regards,

AT

former_member222709
Contributor
0 Kudos
377

Hi Allan,

You've rightly considered that Accounting Data being standard PO data, it should automatically flow. Once Account Assignment is done in PR, it gets automatically reflected in the PO as well as the Invoice. You need not pass it.

About the Account Assignment error, I suppose you need to verify your Line Item data in correspondence to your Schedule Line Item Data. If that is in sync., your BAPI will work successfully.

If still there is an element of doubt, then, please post your code for reference.

Regards,

Pranav.

former_member404244
Active Contributor
0 Kudos
377

Hi,

Please check the source and target strcure having same type or not?

Regards,

Nagaraj

Former Member
0 Kudos
377

Hi,

If i understand correctly, you need to pass item no and serial no also.

like,

AccountingData table

1st line: Change account assignment data

INVOICE_DOC_ITEM (Document item in invoice document): 0001

SERIAL_NO (Serial number for the accont assignment): 01

TAX_CODE (Tax code): V1

ITEM_AMOUNT (Amount in document currency): 30

GL_ACCOUNT (G/L account number): 890000

COSTCENTER (Cost center): 1200

check documentation of FM BAPI_INCOMINGINVOICE_CREATE for further understanding..

Regards,

Ravi.

0 Kudos
377

Thanks for all the prompt input

It appears that the short dump is caused because of modification of the bapi structure.

It's solved now many thanks

Regards,

AT

0 Kudos
377

Hi Allan,

It is good.

Regards,

Madhu.

0 Kudos
377

Hi Allan,

I am getting an error when calling this BAPI. The error is CX_SY_DYN_CALL_ILLEGAL_TYPE.

In the function module interface, you can specify only

fields of a specific type and length under "HEADERDATA".

Although the currently specified field

"IT_HEADERDATA" is the correct type, its length is incorrect.

I know I have populated the IT_HEADERDATA correctly, as far as I know. May I know how you resolved your error? I am hoping your solution could help me with my issue.

Thank you in advance.

Hoops

Edited by: Hoops on Jan 14, 2012 3:27 AM

Former Member
0 Kudos
377

Please

attach code for example