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

Call BAPI

Former Member
0 Likes
1,221

guys;

I am using Bapi BAPI_SALESORDER_CREATEFROMDAT2 this my call:

BAPI_SALESORDER_CREATEFROMDAT2

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

SALESDOCUMENTIN = new_so

ORDER_HEADER_IN = order_header_in1

TABLES

RETURN = RETURN1

ORDER_ITEMS_IN = ORDER_ITEMS_IN

  • ORDER_ITEMS_INX =

ORDER_PARTNERS = order_partners1

ORDER_SCHEDULES_IN = SCHED

    • ORDER_SCHEDULES_INX = SCHEDX

EXTENSIONIN = BAPI_EXT.

I am having an error when I try to add to the sales creation my custom fields . the error is as follow:

Enter a document number between 0005000000 and 0005999999

5 REPLIES 5
Read only

Former Member
0 Likes
981

Hi,

For the document type for which you are creating, number range has been set as between 0005000000 and 0005999999 and external numbering.

call function module number_get_next for the same and pass to the BAPI.

Hope it helps.

Sujay

@OP: Don't give generic subject.

Edited by: Sujay Venkateswaran Krishnakumar on Sep 21, 2010 6:34 PM

Read only

0 Likes
981

thank you but It is not changing

Read only

Former Member
0 Likes
981

Hi,

see this sample wiki

http://wiki.sdn.sap.com/wiki/display/ABAP/MasterBapiProgramMMand+SD

Prabhudas

Read only

Former Member
0 Likes
981

You pass parameter as follow


  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
             ORDER_HEADER_IN               = ORDER_HEADER_IN
            ORDER_HEADER_INX              = headerx

       IMPORTING
         SALESDOCUMENT                 = SALESDOCUMENT
        TABLES
         RETURN                        = RETURN
             ORDER_ITEMS_IN                = ORDER_ITEMS_IN
             ORDER_PARTNERS                = ORDER_PARTNERS
             ORDER_SCHEDULES_IN            = ORDER_SCHEDULES_IN
            ORDER_SCHEDULES_INX           = ORDER_SCHEDULES_INX
         ORDER_KEYS                    = ORDER_KEYS

IMPORTING

SALESDOCUMENT = SALESDOCUMENT

Read only

Former Member
0 Likes
981

answer by myself