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

Problem in using a BAPI

Former Member
0 Likes
621

Hi all,

Working on some BAPI, using *BAPISALESDOCUMENT_COPY_ i am creating the sub-engagement(VBELN) with reference to some standard engagement(VGBEL), after this have to creat the header and item details for the sub-engagement using BAPI *BAPISALESORDER_CHANGE,_ upto this no issues.

After creating this some data will be maintained in an Excel sheet for Additional data for the sub-engagement. To create this also i have to use the same BAPI *BAPISALESORDER_CHANGE*,_ When using this getting some problem like the data that has been created earlier been overwritten with the new data.

Please help me out in this regard. I have to create the sub-engagement with all core details and Additional details.

Regards,

C.Bharath Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
586

Hi Bharat,

Nice to hear from u back again...

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

ORDER_HEADER_INX fulfills the following two tasks:

Controls processing functions with the value in the UPDATEFLAG field (change indicator).

The following entries are available:

' ' : Create a new sales document

I: Create a new sales document

U: Change an existing sales document

😧 Delete an existing sales document

Controls the field entry with checkboxes

If the UPDATEFLAG field has been activated, the system only copies those fields from the SALES_HEADER_IN parameter that have been activated with 'X'.

For more information, please refer to the documenation of this FM (BAPI)

Regards,

Aditya(LNT)

4 REPLIES 4
Read only

Former Member
0 Likes
586

dear

Please check whether BAPISDH1X-UPDATEFLAG field in export parameter of BAPI is set to 'I' for insert.

same for other X structures in table parameters.

cheers

Read only

Former Member
0 Likes
587

Hi Bharat,

Nice to hear from u back again...

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

ORDER_HEADER_INX fulfills the following two tasks:

Controls processing functions with the value in the UPDATEFLAG field (change indicator).

The following entries are available:

' ' : Create a new sales document

I: Create a new sales document

U: Change an existing sales document

😧 Delete an existing sales document

Controls the field entry with checkboxes

If the UPDATEFLAG field has been activated, the system only copies those fields from the SALES_HEADER_IN parameter that have been activated with 'X'.

For more information, please refer to the documenation of this FM (BAPI)

Regards,

Aditya(LNT)

Read only

0 Likes
586

Hi Aditya,

Thanks for your solution, still facing some problem in updating the salesorder created in using BAPI *BAPISALESORDER_CREATEFROMDAT2*_, probelm is given below.

I am creating an salesorder using the above given BAPI, and have a requirement to change the salesorder which is created with some additional data using the BAPI *BAPISALESDOCUMENT_CHANGE*_,

When i am trying to change the sales order its not updating the same record instead creating a new record in VBAP table with some new POSNR value. I am passing the value for update flag as 'U', then also its creating a new record.

If this issue is solved then my whole object is done please help me out in this regard.

Regards,

C.Bharath Kumar

Read only

Former Member
0 Likes
586

Solved the problem,

Thanks

C.Bharath Kumar