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

How to update VBFA while sales order creation using BAPI

nmsmk
Explorer
0 Likes
3,732

Hi,

I am trying to create sales orders for each schedule line items while inquiry creation.

This I have done in the user exit in the VA11 program MV45AFF using BAPI "BAPI_SALESORDER_CREATEFROMDAT2".

along with the Inquiry, Sales orders are also getting created. But I am facing 2 problems.

1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order

number.

2) It is not updating the VBFA (SD flow) table.

Regards,

Krishna.

8 REPLIES 8
Read only

former_member195421
Participant
0 Likes
2,302

Hi Krishna,

Are you getting any errors in the return table ? , if not possibly there is no commit happening .

Regards,

Ratheesh BS

Read only

0 Likes
2,302

Hi Ratheesh,

It is not returning any errors. In the return table, finally it gives 'Successfully created.' I am also using CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' after calling the SO creation BAPI.

Regards,

Krishna.

Read only

Former Member
0 Likes
2,302

Hello,

1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order

number.

- are you passing simulation parameter (TESTRUN) as 'X'

2) It is not updating the VBFA (SD flow) table.

- Please use BAPI_SALESDOCUMENT_COPY for copying and updating VBFA table

Thanks

Krish

Read only

0 Likes
2,302

Hi Krish,

I am also facing the same problem..can you please let me know how the problem is solved, if solved.

Regards,

Sri.

Read only

dev_parbutteea
Active Contributor
0 Likes
2,302

Are you importing the correct import parameters which return the document number ?

IMPORTING
         SALESDOCUMENT                 = SALESDOCUMENT

Regards,

Dev.

Read only

0 Likes
2,302

Hi Dev,

I have declared a variable lv_number TYPE bapivbeln-vbeln and using this variable to hold the generated sales order document number.

Regards,

Krishna.

Read only

0 Likes
2,302

Hi,

please paste the part of your code where you are doing the bapi call . i't enable us to better analyse the issue.

Dev.

Read only

Former Member
0 Likes
2,302

Hi,

You can use the FM : RV_XVBFA_MAINTAIN to update the document flow explicitly incase if you want.

Regards

Rajesh V