Skip to Content
author's profile photo Former Member
Former Member

Call BAPI

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

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2010 at 01:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2010 at 01:30 PM

    Hi,

    see this sample wiki

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

    Prabhudas

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2010 at 07:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2010 at 10:46 AM

    answer by myself

    Add comment
    10|10000 characters needed characters exceeded