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_SIMULATE error

chris_mowl
Active Participant
0 Likes
1,726

When trying to run BAPI_SALESORDER_SIMULATE, I get an error, V1 044, that says "Enter a document number between  XXXXXX and YYYYYY" that is the SAP default number range for Sales Order numbers.

We use a custom range of numbers for Sales Orders.  Is there a setting or something that allows you to bypass this check of the number range?

The check occurs in Form  VBAK-VBELN_PRUEFEN of Include FV45KF0V_VBAK-VBELN_PRUEFEN.

Thanks for any help.

Kind regards,

Chris Mowl

4 REPLIES 4
Read only

Former Member
0 Likes
1,212

Are you passing a document number in the header to the BAPI or is it initial? In case you are passing a document number, make sure to also pass a document type for which the document number is valid, meaning there is a valid number range assigned to the document type.

Read only

0 Likes
1,212

Hi Samuli,

     Thanks for your response.  I am passing a document number and a type as well.  You actually get an error if you don't pass a type and that error occurs before this one.

     This message gets issued after a call to function module NUMBER_GET_INFO that checks if the number passed is within the configured range.  It only checks the SAP standard range and I can't figure out how to get it to use the custom range. 

     What I'm really trying to do is simulate a Sales Order for an item so I can get the tax data for that item.  These are items that were originally created as no cost items on the original sales order. 

Read only

0 Likes
1,212

Reading the ABAP code I think the problem is not with NUMBER_GET_INFO which is just used to format the error message, the error itself occurs earlier with NUMBER_CHECK returning DA_RETURNCODE <> ' '. What if you run NUMBER_CHECK in test mode with the document number and external number range? It should return the same error. My guess is that the wrong number range is determined for the document type, as indicated by the error message you are getting.

Read only

chris_mowl
Active Participant
0 Likes
1,212

I tried running it without a document number and it returned the condition values and other data.  As I had seen in another post of someone trying to get condition data for an item, I think BAPISDORDER_GETDETAILEDLIST will provide the data I need.