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_SALESORDER_CHANGE

Former Member
0 Likes
1,612

Hello All,

I am using BAPI_SALESORDER_CHANGE to change the Billing relevance (VBAP-FKREL) field of Sales Order from "B" to "F".

All the parameters are rightly sent to this BAPI. Now BILL_REL is the field in ORDER_ITEM_IN I am using to change the billing relevance status to "F".

Also the BILL_REL in ORDER_ITEM_INX is marked for change with "X".

I get an error "Field BILL_REL is not in VBAK or VBKD".

Any help is highly appreciated.

FYI: System is ECC 6

Thanks in advance.

Regards,

Smita

Hello All,

I am using BAPI_SALESORDER_CHANGE to change the Billing relevance (VBAP-FKREL) field of Sales Order from "B" to "F".

All the parameters are rightly sent to this BAPI. Now BILL_REL is the field in ORDER_ITEM_IN I am using to change the billing relevance status to "F".

Also the BILL_REL in ORDER_ITEM_INX is marked for change with "X".

I get an error "Field BILL_REL is not in VBAK or VBKD".

Any help is highly appreciated.

FYI: System is ECC 6

Thanks in advance.

Regards,

Smita

6 REPLIES 6
Read only

Former Member
0 Likes
1,253

Hi,

You can use this method to change or delete sales orders.

You can change header, item, schedule line and configuration data.

In general, note that you should:

Only specify fields that should be changed

Select these fields by entering an X in the checkboxes

Enter a U in the UPDATEFLAG field

Always specify key fields when changing the data, including in the checkboxes

The configuration is an exception here. If this needs to be changed, you need to complete it again fully.

Maintain quantities and dates in the schedule line data

Possible UPDATEFLAGS:

U = change

D = delete

I = add

Example

1. Delete the whole order

2. Delete order items

3. Change the order

4. Change the configuration

Notes

1. Minimum entry:

You must enter the order number in the SALESDOCUMENT structure.

You must always enter key fields for changes.

You must always specify the update indicator in the ORDER_HEADER_INX.

2. Commit control:

The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

Parameters

SALESDOCUMENT

ORDER_HEADER_IN

ORDER_HEADER_INX

SIMULATION

BEHAVE_WHEN_ERROR

INT_NUMBER_ASSIGNMENT

LOGIC_SWITCH

NO_STATUS_BUF_INIT

RETURN

ORDER_ITEM_IN

ORDER_ITEM_INX

PARTNERS

PARTNERCHANGES

PARTNERADDRESSES

ORDER_CFGS_REF

ORDER_CFGS_INST

ORDER_CFGS_PART_OF

ORDER_CFGS_VALUE

ORDER_CFGS_BLOB

ORDER_CFGS_VK

ORDER_CFGS_REFINST

SCHEDULE_LINES

SCHEDULE_LINESX

ORDER_TEXT

ORDER_KEYS

CONDITIONS_IN

CONDITIONS_INX

EXTENSIONIN

Read only

0 Likes
1,253

Yes I have read this documentation. This is followed in my program. But still the error..!!

Read only

Former Member
0 Likes
1,253

hi,

the filed which ur trying to update is for CRM related , and u might be doing for normal sales order

so check wehter u need it or not , or some other field

regards

afzal

Read only

0 Likes
1,253

Thanks Afzal..!

But I dont find any other field relevant for Billing Relevance.

Read only

0 Likes
1,253

hi ,

may be u have to see soem other bapi for billing relevance , as u ur updating the sales order u can chekc for any billing related where u cna use the sales order number

regards

afzal

Read only

0 Likes
1,253

Hi,

I guess you will have to do coding in L_SD_SALES_ITEM_EXIT->ITEM_MAINTAIN_COM

badi. I checked the bapi and funciton modules called inside. I can't find if the field FKREL is populated from ORDER_ITEM_IN-BILL_REL.

Try doing coding in the FV45PFAP_VBAP_FUELLEN_VBAPKOM include and check if it works.

KR Jaideep,