Application Development and Automation 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: 
Read only

BAPI_ACC_MANUAL_ALLOC_POST CUSTOMER_FIELDS - Customer Fields

Former Member
0 Likes
1,811

Hello Friends

Can some one please explain me how to fill Customer fields parameter while calling BAPI.BAPI_ACC_MANUAL_ALLOC_POST CUSTOMER_FIELDS

I have 2 custom fields in COBL structure .

Thanks

Lavanya

3 REPLIES 3
Read only

Former Member
0 Likes
941

I looked at the BAPI CODE where Function Module MAP2I_BAPIEXTC_TO_BAPICOBL_CI (Include:LK40CF2R Line 137).

Below are the key points,looking at the code:

1.The custom fields on COBL structure should have been added in the include structureCI_COBL

2. The record which want to update on DOC_ITEMS table should have the same ITEMNO_ACC

     Accounting Document Line Item Number on the custom field structure

3. If the first custom field on structure CI_COBL is of 10 character entry of the first line in CUSTOMER_FIELDS should be something like this:

  0000000001CUSTOMERNUMBER

  0000000001->ITEMNO_ACC ->Same as DOC_ITEMS

Customernumber->custome field

I think this is how its going to update it. May be you can try now.

I don't have all the data to test it with.

Thanks

Bhanu

Read only

0 Likes
941

Hi Bhanu

Am not clear still .......can you consider that we have Custom fields

Z1 & Z2 in COBL . How would you populate CUSTOMER_FIELDS records table with fields FIELD1, FIELD2, FIELD3?

Thanks

Read only

Former Member
0 Likes
941

Hi,

This is the same problem i had. Assuming you already have your custom fields in the CI_COBL, you have to concatenate the ITEMNO_ACC and your custom fields into a string. This will be field 1 of the   EXTENSION_CODINGBLOCK. then the FM MAP2I_BAPIEXTC_TO_BAPICOBL_CI will loop thru the Field 1 string while reading your CI_COBL field lengths and separate your values accordingly. See my example...

My CI_COBL fields from BAPICOBL_CI structure:

ITEM_NO_ACC N(10) "SAP already includes this field. not custom

ZZOT_QTY Quan(15)Dec(3) "custom field and length of 19 characters

ZZOT_RATE Curr(11)Dec(2) "custom field and length of 14 characters

So I would need to concatenate the ITEM_NO_ACC (which you get from the DOC_ITEMS in BAPI), ZZOT_QTY, & ZZOT_RATE.

When it loops thru the MAP2I_BAPIEXTC_TO_BAPICOBL_CI, the code will separate the following.....

000000000110.000             1.5           .

The first 10 chars = ITEM_NO_ACC passed from DOC_ITEMS

The next 19 chars = ZZOT_QTY passed from input field or inbound data etc.

The next 14 chars = ZZOT_RATE passed from input field or inbound data etc.

Good luck,

Jessica