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 Sales Order Change !!!!

Former Member
0 Likes
2,152

Dear all,

I am trying to update a sale order with some characteristic values.

I have filled the some of the fields in "bapicuval" and " bapicucfg " but I am not able to update the sale order.

I am not sure about the values that I have passes for the below parameters.

1. External Configuration ID (Temporary)

2. Instance Number in Configuration

Could some tell me the right way to update the characteristics values and the how to find out the values for the above two parameters.

Thanks in advance.

Regards,

Arul.

10 REPLIES 10
Read only

Former Member
0 Likes
1,387

Hi,

check this out, this might help:

Data: salesd like BAPIVBELN-VBELN.

data: it_BAPISDH1 type BAPISDH1.

data: it_BAPISDH1X type BAPISDH1X.

data: it_BAPIPARNR type BAPIPARNR occurs 0 with header line.

data: it_BAPIRET2 type BAPIRET2 occurs 0 with header line.

data: it_BAPIPARNRC type BAPIPARNRC occurs 0 with header line.

data: it_BAPISDITMX type BAPISDITMX occurs 0 with header line.

data: it_BAPISDITM type standard table of BAPISDITM with header line.

constants: c_bp(2) type c value 'BP'.

it_BAPISDH1X-UPDATEFLAG = 'U'.

it_BAPISDH1X-SALES_ORG = 'X'.

it_BAPISDH1X-DISTR_CHAN = 'X'.

it_BAPISDH1X-DIVISION = 'X'.

it_BAPISDH1X-PURCH_NO_C = 'X'.

it_BAPISDH1X-CUST_GROUP = 'X'.

it_BAPISDH1-SALES_ORG = '1000'.

it_BAPISDH1-DISTR_CHAN = '01'.

it_BAPISDH1-DIVISION = '00'.

it_BAPISDH1-PURCH_NO_C = 'Test1'.

***it_BAPIPARNR-PARTN_ROLE = 'RE'.

***it_BAPIPARNR-PARTN_NUMB = '0000000171'.

***it_BAPIPARNR-ITM_NUMBER = '00000'.

***append it_BAPIPARNR.

***it_BAPIPARNR-PARTN_ROLE = 'RE'.

***it_BAPIPARNR-PARTN_NUMB = '0000000179'.

***it_BAPIPARNR-ITM_NUMBER = '000000'.

***append it_BAPIPARNR.

it_BAPIPARNRC-DOCUMENT = '000000375'.

it_BAPIPARNRC-ITM_NUMBER = '000000'.

it_BAPIPARNRC-UPDATEFLAG = 'U'.

it_BAPIPARNRC-PARTN_ROLE = 'WE'.

it_BAPIPARNRC-P_NUMB_OLD = '0000000171'.

it_BAPIPARNRC-P_NUMB_NEW = '0000000179'.

***it_BAPIPARNRC-ADDRESS = '26324'.

it_BAPIPARNRC-ADDR_LINK = '0000000003'.

***it_BAPIPARNRC-REFOBJTYPE = 'BUS2032'.

***it_BAPIPARNRC-REFOBJKEY = '000000375'.

append it_BAPIPARNRC.

data PARTNERADDRESSES like BAPIADDR1 occurs 0 with header line.

PARTNERADDRESSES-ADDR_NO = '0000000003'.

PARTNERADDRESSES-NAME = 'Test Cust'.

PARTNERADDRESSES-STREET = '222nd AVE'.

PARTNERADDRESSES-NAME_2 = 'NEW Bldg A2'.

PARTNERADDRESSES-CITY = 'MILPITAS'.

***PARTNERADDRESSES-REGION = 'CA'.

PARTNERADDRESSES-POSTL_COD1 = '950351'.

PARTNERADDRESSES-COUNTRY = 'IN'.

PARTNERADDRESSES-LANGU = 'E'.

APPEND PARTNERADDRESSES. CLEAR PARTNERADDRESSES.

*it_BAPISDITMX-ITM_NUMBER = '00010'.

*it_BAPISDITMX-UPDATEFLAG = 'U'.

*it_BAPISDITMX-MATERIAL = 'X'.

*it_BAPISDITMX-CUST_GROUP = 'X'.

*append it_BAPISDITMX.

*it_BAPISDITM-ITM_NUMBER = '00010'.

*it_BAPISDITM-MATERIAL = '946'.

*append it_BAPISDITM.

break-point.

salesd = '0000000375'.

call function 'BAPI_SALESORDER_CHANGE'

exporting

salesdocument = salesd

ORDER_HEADER_IN = it_BAPISDH1

order_header_inx = it_BAPISDH1X

  • SIMULATION =

  • BEHAVE_WHEN_ERROR = ' '

  • INT_NUMBER_ASSIGNMENT = ' '

  • LOGIC_SWITCH =

tables

  • ORDER_ITEM_IN = it_BAPISDITM

  • ORDER_ITEM_INX = it_BAPISDITMX

  • PARTNERS = it_BAPIPARNR

return = it_BAPIRET2

PARTNERCHANGES = it_BAPIPARNRC

PARTNERADDRESSES = 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 =

.

If sy-subrc = 0.

break-point.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

Read only

0 Likes
1,387

Hi Pradeep,

Thanks for your reply.

You have not answered my question at all. All I want is how to update the CONFIGURATION data for the following parameters

ORDER_CFGS_REF

ORDER_CFGS_INST

ORDER_CFGS_PART_OF

ORDER_CFGS_VALUE

Read only

Former Member
0 Likes
1,387

Hi,

Check if there are any return parameters and if SO is changed. Also use BAPI_TRANSACTION_COMMIT after BAPI_SALES ORDER CHANGE. Then it will work.

Hope this might have helped you.

Thanks,

Prashanth

Read only

0 Likes
1,387

Hi Prashanth,

I have used the FM for commit work. My question is how to change the characteristic values of a sale order Item.

-Arul.

Read only

Former Member
0 Likes
1,387

Dear all,

I am trying to update a sale order with some characteristic values.

I have filled the some of the fields in "bapicuval" and " bapicucfg " but I am not able to update the sale order.

I am not sure about the values that I have passes for the below parameters.

1. External Configuration ID (Temporary)

2. Instance Number in Configuration

Could some tell me the right way to update the characteristics values and the how to find out the values for the above two parameters.

Thanks in advance.

Regards,

Arul.

Read only

Former Member
0 Likes
1,387

Dear all,

I am trying to update a sale order with some characteristic values.

I have filled the some of the fields in "bapicuval" and " bapicucfg " but I am not able to update the sale order.

I am not sure about the values that I have passes for the below parameters.

1. External Configuration ID (Temporary)

2. Instance Number in Configuration

Could some tell me the right way to update the characteristics values and the how to find out the values for the above two parameters.

Thanks in advance.

Regards,

Arul.

Read only

0 Likes
1,387

Hi,

First get the details of the sales order using FM

"BAPI_SALESORDER_GETDETAILBOS".

Then loop into Orderitems or any internal table where you would like to change the data. Pass your data modify the table. then move the values to Function Module "BAPI_SALESORDER_CHANGEBOS".

This should work.

Thanks,

Prashanth

Read only

0 Likes
1,387

Hi Prashanth,

Thats a lovely FM, thank you very much.

I am trying to solve my problem.

Regards,

Arul.

Read only

0 Likes
1,387

Hi Arul,

Were you able to solve your problem using the FM (BAPI_SALESORDER_GETDETAILBOS) proposed by Prashanth?

It's an unreleased version and contains syntax errors.

If you found other way to solve your problem, would you please mind sharing?

Thanks a lot,

Franck

Read only

0 Likes
1,387

Hi Arul,

I am trying to generate a suimulated sales order using BAPI_SALESORDER_SIMULATE.

I have filled the some of the fields in "bapicuval" but i'm having problems with the characteristics. I read that you had problems with the characteristics using the same structures that i use. So, could you solve your issue? Can you tell me how you did it.

Thanks in advance

Regards

Diego