Application Development 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: 

BAPI_SALESORDER_CREATEFROMDAT2 jump Sales Order

Former Member
0 Kudos

Hi !!!

I'm working with the bapi,

BAPI_SALESORDER_CREATEFROMDAT2, when i execute the bapi, this return the number the sales order, in some cases the number the sales order that the bapi return not are consecutive, when i view the number the sales order that not generate by the bapi, this sales order have data with corresponding information the sales order generate by the BAPI.

I review the program, and debug, and i don't found

in what time this generate other sales order, this sales order never appear in the values that the bapi return.

Someone have any idea, what are happening !!!

Thanks !!

8 REPLIES 8

gregorw
Active Contributor
0 Kudos

Hi,

I have rearly problems to understand your description. Can you review your question with a native english speaker?

Regards

Gregor

Former Member
0 Kudos

Hi Gregor !!!

have a problem with the bapi, BAPI_SALESORDER_CREATEFROMDAT2, with an example i show what are happening.

The bapi generate the next sales orders:

sales order

1 Material A,B

2 Material C,D

3 MAterial E,F

4 Material G,A

-


> MATERISL A,B ( Sales order 1 )

6 MATERIAL H,E

-


> MATERIAL C,D ( Sales order 2 )

8 MATERIAL G,I

jump the sales order: 5,7.

i Rewiew the sales order 5, 7 (sales order that not appear or don't generate in the bapis' result) in the va03, curiosly the sales order 5 there is in the sistem

with information the sales order 1, the sales order 7 appear with information de the sales order 2 and so forth with the others sales order that don't appear in

bapis' result.

Message was edited by: Noemi Huerta

gregorw
Active Contributor
0 Kudos

Hello Noemi,

have you used BAPI_TRANSACTION_COMMIT after the BAPI_SALESORDER_CREATEFROMDAT2 ?

Regards

Gregor

Former Member
0 Kudos

Hi Noemi,

I am sorry but I could not get your problem exactly but still:

Are you sure that some other user is not using VA01 or the same BAPI program to create the orders ?

As per your mail, I think you said that BAPI is jumping sales order numbers but those missed orders are there in the system and can be seen through VA03.

I am not sure if I got it correctly.

To get an idea, you should check the created date and created by in VA03 for the order numbers that BAPI has jumped.

Also, it might happen ( not an error ) due to buffering of number range for Sales Orders. You can check the number range definition of Sales Orders.

Thanks,

Ram

Former Member
0 Kudos

Hi RAM !!!

Noemi.

About your question, i'm sure that nobody are using de va01, the sales orders that jump the bapi, are there in the sistem with the same user that i run my program.

Ram.

As per your mail, I think you said that BAPI is jumping sales order numbers but those missed orders are there in the system and can be seen through VA03.

I am not sure if I got it correctly.

Yes is correct !!!!

I checked the configuration and its ok.

i don't know what are happening, the problem is not only that jump the number of sales order, in the sistem are

the orders that don't return the bapi so, the information are duplicated !!!!

do you have any idea, what are happening ?

Former Member
0 Kudos

Hi Gregor !!!

Yes after the call BAPI_SALESORDER_CREATEFROMDAT2

i use BAPI_TRANSACTION_COMMIT.

The sales order that return the bapi are correct,

the problem is with the sales order that the sistem jump, because these are in te sistem, so the information are duplicated, couldn't identify when this are created.

Former Member
0 Kudos

Hi Noemi,

I don't think SAP meant this when they added 2 in the BAPI name

I'll suggest you first ensure that all the orders, even the missing ones, are getting created from BAPI only and by the run that you are executing and not by VA01 ..

check table VBAK ( Created by , Created Date, Time ...)

In order to ensure , you can hardcode the reference number or some other similar field with something like 'FROM_BAPI'.

And then check if there is any order created where ref number is not 'FROM_BAPI'.

If it is getting created by the BAPI only then you need to make sure your BAPI is not getting called twice for the same set of data ...or someone else is not running the same program.

In the meantime try to search any OSS note with text like

1. BAPI_SALESORDER_CREATEFROMDAT2 Twice

2. BAPI_SALESORDER_CREATEFROMDAT2 duplicate

I am sure there won't be any config in SD for SAP creating another free sales order with any new sales order.

Cheers,

Ram

Former Member
0 Kudos

I recently used this BAPI to create sales orders one at a time with numerous line items. I uploaded the input from an EXCEL spreadsheet with GUI_UPLOAD, and then converted the xls data into text format with function module 'TEXT_CONVERT_XLS_TO_SAP'. In some cases, the internal table of items match that of the spreadsheet. In other cases, the line items are duplicated. This error is caused by TEXT_CONVERT_XLS_TO_SAP when it calls method to 'cut and paste' the cells from the spreadsheet, although I don't see any differences between the spreadsheets other than the data they contain. So I switched to ALSM_EXCEL_TO_INTERNAL_TABLE and the spreadsheets that previously didn't convert correctly work fine. In my case, had I not caught the duplicate lines that I feed to the BAPI, I would have created duplicate line items instead of duplicate sales orders like you do.

If the source of your data is from GUI_UPLOAD, please take a look at the input you feed to the BAPI to check if there are duplicates, for example in the Debugger or using a write statement.

Good luck.