cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a Sales Order with external number using BAPI

Former Member
0 Kudos

Hi People,

I am wonderning how to create Sales order using external number range by BAPI (SALESORDER_CREATEFROMDAT202).

I tried search but could not succeed in finding the solution.

Please share if anyone has some info.

Thanks in advance.

Regards,

Praveen

Accepted Solutions (0)

Answers (3)

Answers (3)

falgunim
Explorer
0 Kudos

Hi Praveen,

I am able to find the solution, by passing the External number to BAPI_SALESORDER_CREATEFROMDAT2.

You have to pass external sales order number in the field - salesdocumentin

call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
salesdocumentin = iv_vbeln

and in the extensionin table you have to pass

wa_bape_vbak-vbeln = iv_vbeln.

wa_bape_vbakx-vbeln = iv_vbeln.

tables

extensionin = lt_extentionin

By Passing those parameter i am able to generate sales order using external number.

if you need any more help please let me know.

jitendraks
Newcomer
0 Kudos

Hi Praveen,

I am able to find the solution, by passing the External number to BAPI_SALESORDER_CREATEFROMDAT2.

You have to pass external sales order number in the field - salesdocumentin

call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
salesdocumentin = iv_vbeln

and in the extensionin table you have to pass

wa_bape_vbak-vbeln = iv_vbeln.

wa_bape_vbakx-vbeln = iv_vbeln.

tables

extensionin = lt_extentionin


By Passing those parameter i am able to generate sales order using external number.

jpfriends079
Active Contributor
0 Kudos

Can you briefly tell us? What all steps you are following to achieve your result?

Thanks, JP

Former Member
0 Kudos

Hi Prakash,

The requirement is simple.
BAPI has to create a sales order using external number. Inwhich scenario external number should be passed through BAPI for processing. However, I am not aware of the place holder for the Sales order number during the creation.

If you take the scenario of using internal number range, BAPI will process the data and creates a sales order which assigns the next available number from the internal number range. In this case, we don't require to mention the sales order number.

However, using external number, sales order number should be explicitly provided

Hope this helps to understand.

Regards,

Praveen

jpfriends079
Active Contributor
0 Kudos

As per my understanding, the BAPI


SALESORDER_CREATEFROMDAT202

mentioned by you, is not BAPI. In fact, that is basic IDoc Type.  For processing an Inbound IDoc, we use FM IDOC_INPUT_ORDERS.

If you want to create sales order other than IDoc, refer FM BAPI_SALESORDER_CREATEFROMDAT2. There you can provide external sales order no in SALESDOCUMENTIN. In addition to that check whether your sales doc type is relevant for external number range or not. If yes. then make sure you are providing external number according to the number range maintained.

If you still have any concerns, please revert back.

Thanks, JP

Former Member
0 Kudos

Hi JP,

Sorry for confusing you with BAPI and basic type. Yes we are using BAPI_SALESORDER_CREATEFROMDAT2.


Sales order number was provided in SALESDOCUMENTIN.

The sales order type is customized to use the external number range.

When the data is processed through BAPI, below error was populated

Field header_inx-updateflag is not an input field

As using to BAPI in creation mode, not sure why it is checking for 'Updateflag' whic is generally used to flag for changes.

Please suggest.

Regards,

Praveen

jpfriends079
Active Contributor
0 Kudos

I'm not a technical consultant, therefore, I may not be able to guide,


why/what is the use of header_inx-updateflag in "Create" BAPI.

You can also try with FM BAPI_SALESDOCU_CREATEWITHDIA.

Alternatively, close this discussion and open a new discussion in ABAP Development space and you can provided reference of this thread there.

Thanks, JP

Lakshmipathi
Active Contributor
0 Kudos
Field header_inx-updateflag is not an input field

Check the below thread where the same topic was discussed

G. Lakshmipathi

Former Member
0 Kudos


HI JP,

I shared the error message just for your information to convey the message if I give the sales order number in 'SALESDOCUMENTIN' filed probably system is treating it as change. I would like to understand the field mapping in this case. Apart from gving the sales order number (External number range) do I need to pass any flag or indicator to indicate it as external.

Please help with the field mappings while using external number range.

Regards,

Praveen