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

Issue with BAPI_SALESORDER_CHANGE

hI ,

I am trying to add line items to the exising sales orders based on some conditions using

BAPI_SALESORDER_CHANGE

but it is populating

"ENter the Sales Document Number " as error message into RETURN table .

Please let me know the reason for this message

Urgent !!!!!

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2008 at 03:39 AM

    Can you show your code? You may not be passing sales order number correctly.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2008 at 06:28 AM

    Hi

    Put a break point before calling the BAPi and check whether the value of the document is avaialable during the period

    Regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2008 at 06:54 AM

    Hi ,

    Before Calling the BAPI_SALESORDER_CHANGE bapi please check whether there are lagging zeros for your sales order number if not appned the lagging zeros.

    Thanks ,

    J.Prasanna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 04:52 AM

    Hi,

    field check_fld-updateflag should have the value 'I' if you are inserting the new item to the sales order. But u r using 'X' in ur code so please change it to 'I' and check it once.

    NOTE:

    Controls processing functions with the value in the UPDATEFLAG field (change indicator).

    The following entries are available:

    ' ': Create a new sales document item

    I: Create a new sales document item

    U: Change an existing sales document item

    D: Delete an existing sales document item

    check_fld-UPDATEFLAG = 'X'. (Instead use check_fld-UPDATEFLAG = 'I')

    CHECK_FLD-HG_LV_ITEM = 'X'.

    check_fld-MATERIAL = 'X'.

    CHECK_FLd-PLANT = 'X'.

    CHECK_FLD-STORE_LOC = 'X'.

    CHECK_FLD-SHIP_POINt = 'X'.

    append check_fld.

    Reward points if the sol;ution is helpfull

    Thanks,

    J.Prasanna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 06:19 AM

    Hi,

    Please find some points below:

    You can use this method to change or delete sales orders.

    You can change header, item, schedule line and configuration data.

    In general, note that you should:

    Only specify fields that should be changed

    Select these fields by entering an X in the checkboxes

    Enter a U in the UPDATEFLAG field

    Always specify key fields when changing the data, including in the checkboxes

    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.

    Maintain quantities and dates in the schedule line data

    Possible UPDATEFLAGS:

    U = change

    D = delete

    I = add

    Example

    Delete the whole order

    Delete order items

    Change the order

    Change the configuration

    Notes

    Minimum entry:

    You must enter the order number in the SALESDOCUMENT structure.

    You must always enter key fields for changes.

    You must always specify the update indicator in the ORDER_HEADER_INX.

    Commit control:

    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

    Since you are adding the line items, your update flag must be set to 'I' in both the places.

    Change the update flag to 'I' and try again. Plz let me know if u still have issues.

    Regards,

    Asif Ali Khan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 06:55 AM

    Hi,

    keep the header level update flag as 'U' and item level header flag as 'I'. and also enter all the key fields at the header level and also at item level.

    Let me know if there are any new errors.

    Thanks,

    Prasanna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 07:11 AM

    Hi Reddy,

    Actually you are not passing the fields for Updation in ORDER_HEADER_INX structure.

    Please find the code below:

    FLAG- UPDATEFLAG = 'U'.

    FLAG - SALES_ORG = 'X'.

    FLAG - DISTR_CHAN = 'X'.

    FLAG - DIVISION = 'X'.

    APPEND FLAG.

    In Item details also follow the same logic.

    Since you are adding the line items you should keep the flag as 'I'.

    CHECK_FLD-UPDATEFLAG = 'I'.

    CHECK_FLD-HG_LV_ITEM = 'X'.

    check_fld-MATERIAL = 'X'.

    CHECK_FLd-PLANT = 'X'.

    CHECK_FLD-STORE_LOC = 'X'.

    CHECK_FLD-SHIP_POINt = 'X'.

    append check_fld.

    Hope this answers your question.

    Regards,

    Asif

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi ,

      Thanks for the quick replies ...

      I am passing as u said . but it is triggering *Enter Sales Order Number * once BAPI gets into

      call function 'SD_SALES_DOCUMENT_READ' function module .

      Thanks and greatfull to the solutions

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 07:19 AM

    Hi reddy,

    You may also use this FM.

    CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'

    EXPORTING

    SALESDOCUMENT = SALESDOCUMENT

    ORDER_HEADER_IN = DA_ORDER_HEADER_IN

    ORDER_HEADER_INX =

    TABLES

    RETURN = RETURN

    ITEM_IN = DA_ORDER_ITEM_IN

    ITEM_INX = DA_ORDER_ITEM_INX

    SCHEDULE_IN = SCHEDULE_LINES

    SCHEDULE_INX = SCHEDULE_LINESX

    partners = partners

    partnerchanges = partnerchanges

    partneraddresses = partneraddresses

    CONDITIONS_IN = CONDITIONS_IN

    CONDITIONS_INX = CONDITIONS_INX

    SALES_CFGS_REF = ORDER_CFGS_REF

    SALES_CFGS_INST = ORDER_CFGS_INST

    SALES_CFGS_PART_OF = ORDER_CFGS_PART_OF

    SALES_CFGS_VALUE = ORDER_CFGS_VALUE

    SALES_CFGS_BLOB = ORDER_CFGS_BLOB

    sales_cfgs_vk = order_cfgs_vk

    sales_cfgs_refinst = order_cfgs_refinst

    SALES_TEXT = ORDER_TEXT

    SALES_KEYS = ORDER_KEYS

    EXTENSIONIN = EXTENSIONIN.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I am passing the order number which is existing one and anyhow i am also checking that order is initial or not .

      I am using BAPI_SALESORDER_CHANGE fm to add additional line to the existing sales order based on some conditions with in user exit , but it is always giving

      ENTER THE DOCUMENT NUMBER error populatin into RETURN table .

      *Once SD_SLESDOCUMENT_CHANGE executed within the BAPI , it is populating the error message

      ENTER THE document number .*

      Can anybody throw some light on this Thread and provide me the solution .

      Helpfull answeres will be given Reward Points without fail .

      Edited by: shishupalreddy ramreddy on Feb 20, 2008 6:16 PM

      Edited by: shishupalreddy ramreddy on Feb 20, 2008 6:34 PM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.