cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_INVOICEEC_CREATE

Former Member
0 Kudos

Hello All,

My team is trying to use BAPI_INVOICEEC_CREATE to electronically post invoices from our external supplies to SRM 5.0 using an XI interface.

However, at present we are testing the BAPI using SE37 test tool. We have set up a test sequence in which the BAPI_INVOICEEC_CREATE is called with test data and the the BAPI_TRANSACTION_COMMIT is called to post the data to the database.

Two things are happening... the first: the process_type is being changed from INV to CREME (INvoice to Credit Memo) This is validated using trx BBP_PD

The second issue is that our line item data is not being written to the database. This is also validated using trx BBP_PD

We noticed that there does not seem to be a field to link the line item details with the invoice header detail structure.

Does anyone have expereience in posting invoices into SRM using the BAPI?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

<b>Refer to the SRM function module - BBP_BC_INVOICE_CREATE, which a RFC enabled FM.

This Module is for XML Communication.

This inturn calls the BAPI - BAPI_INVOICEEC_CREATE.</b>

<u>Additionally, as told by Nishant, Refer to the BAPI Function module documentation in SE37 transaction.</u>

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

BAPI_INVOICEEC_CREATE does not have a link to connect the item data with the header data. The FM documentation is wrong. So, I can't see how the XML FM's will do anything different since there is no way to tie the item data to the header. Check the item table. It i has a ITEM_GUID field, but no PARENT field to tie it to the header table.

former_member195032
Active Contributor
0 Kudos

Hi Wally,

Have you looked at BAPI Documentation.

See FM Documentation in SE37 transaction.

It should create data if thse field are populated as described.

Regards,Nishant

FU BAPI_INVOICEEC_CREATE

Functionality

You can create invoices with this method.

Note that this method is only for local purchase order handling. You cannnot create invoices with reference to purchase orders in the backend system.

Transfer

You transfer the header and item data for the invoice, the business partner, taxes, shipment costs, and texts.

If the data is incomplete (for example, account assignment missing) data from the PO or the confirmation document for goods receipt/service is used.

Returned data

Header and item data of the created invoice and account assignments are returned.

Messages

Messages are returned in parameter Return

Documents can be saved with errors. Note the following message categories:

E

These messages are output as a result of erroneous or missing data (for example, missing vendor) and usually mean that the purchase order requires postprocessing.

A

These messages refer to serious errors that prevent the document from being saved.

Pointing of header data, item data, and set tables

All the BAPI tables have to be supplied with pointers identifying them as either header or item data.

The following fields are used for pointing (these are of type character with a length of 32 and entry area 0-9 and A-F. SAP recommends that you use only numerical values.):

BUSINESSPROCESS

Technical key of the transaction on header level.

ITEM_GUID

Technical key of the item.

PARENT / PARENT_GUID (in each case one of these fields identifies the item).

Field of the item that is used as pointer and that refers to the hierarchy level above.

With structures consisting of header and item data, the field refers to the header level. See the explanations for the header/item data structure below.

In the case of multi-level hierarchies, the field refers to the next highest hierarchy level.

PARENT_GUID

Field of set table that points to the header or item according to whether header or item data exists. Set tables are available for:

Partners

Organizational data

Taxes

Account assignments

Limits

Status

Long texts

Attachments

Note:

The fields PARENT and PARENT_GUID have the same meaning at item level. PARENT_GUID can be either in a set table or in an item table. If part of an item table, the field points to the higher-level hierarchy level. If part of a set table, the field points to the header or item data.

Make sure that the applications of SAP Enterprise Buyer do not always use all set tables.

Header/item data structure

The following display illustrates the connectivity. We have used the example of a purchase order to demonstrate pointing. Note that the other purchasing documents use the same logic even when other data (such as account assignment data) also has pointers.

(PO) Header

123456

|__________ G_L_ACCT 400000

|

|__________ITEM 10

|

|__________ G_L_ACCT 400001

-


Header data

BUSINESSPROCESS OBJECT_ID OBJECT_TYPE ...

1 123456 BUS2201 ...----


Item data

ITEM_GUID PARENT OBJECT_TYPE NUMBER_INT ...

2 1 BUS2201001 10 ...

Explanation:

Value 1 in field PARENT of item data table refers to

value 1 in field BUSINESSPROCESS in the header data.

-


Account assignment data

GUID PARENT_GUID G_L_ACCT ...

5 1 400000 ...

8 2 400001 ...

Explanation:

Value 1 in field PARENT_GUID of the set table for account assignment refers to

value 1 in field BUSINESSPROCESS in the header data.

Value 2 in field PARENT_GUID of set table for account assignment refers to

value 2 in field ITEM_GUID in the item data.

Parameters

I_INV_HEADER

I_INV_HEADER_CUST

I_INP_TYPE

I_TESTRUN

E_INV_HEADER

E_INV_HEADER_CUST

I_INV_ITEMS

I_INV_ITEMS_CUST

I_INV_ACCASS

I_INV_ACCASS_CUST

I_INV_PARTNER

I_INV_TAXES

I_INV_SHIPCOST

I_INV_TEXT

I_INV_ATTACH

E_INV_ITEMS

E_INV_ITEMS_CUST

E_INV_ACCASS

E_INV_ACCASS_CUST

E_INV_PARTNER

E_INV_TAXES

E_INV_SHIPCOST

E_INV_ORGDATA

E_INV_TEXT

E_INV_STATUS

E_INV_ATTACH

RETURN

Exceptions

Function Group

BBP_BUS2205

Former Member
0 Kudos

BAPI_INVOICEEC_CREATE does not have a link to connect the item data with the header data. The FM documentation is wrong. So, I can't see how the XML FM's will do anything different since there is no way to tie the item data to the header. Check the item table. It has a ITEM_GUID field, but no PARENT field to tie it to the header table.

Thus this FM documentation is wrong.

Header data

BUSINESSPROCESS OBJECT_ID OBJECT_TYPE ...

1 123456 BUS2201 ...----


Item data

ITEM_GUID <b>PARENT</b> OBJECT_TYPE NUMBER_INT ...

2 1 BUS2201001 10 ...

Explanation:

Value 1 in field PARENT of item data table refers to

value 1 in field BUSINESSPROCESS in the header data.