Enter the document number error in BAPI_SALESORDER_CHANGE

Hi,
please help me on the below error:
Call of BAPI_SALESORDER_CHANGE gives us an error V1 045 "Enter the document number". We are sure the call is proper (document number is send). The errors occurs in function module SD_SALES_DOCUMENT_READ in lines 60 and 61:
60 VBAK-VBELN = DOCUMENT_NUMBER.
61 PERFORM BELEG_LESEN(SAPMV45A).
In line 60 field VBAK-VBELN is set but in form BELEG_LESEN(SAPMV45) is initial. The value of field is checked in MV45AF0B_BELEG_LESEN line 53.
53 if vbak-vbeln is initial.
54 message e045.
55 endif.
kindly help me on this error,
Thanks in advance friends,
Naidu

LOOP AT IT_ZVCONTRACT_SUSP_SAVE INTO WA_ZVCONTRACT_SUSP_SAVE.
*Assign values to required fields for for updation
    SALESDOCUMENT = WA_ZVCONTRACT_SUSP_SAVE-VBELN.
    ORDER_HEADER_IN-SALES_ORG = WA_ZVCONTRACT_SUSP_SAVE-VKORG.
    ORDER_HEADER_IN-PURCH_DATE = '00000000'.
    ORDER_HEADER_INX-SALES_ORG = 'X'.
    ORDER_HEADER_INX-PURCH_DATE = 'X'.
    ORDER_HEADER_INX-UPDATEFLAG = 'U'.
    WA_ORDER_ITEM_IN-ITM_NUMBER = WA_ZVCONTRACT_SUSP_SAVE-POSNR.
    IF WA_ZVCONTRACT_SUSP_SAVE-CFLAG EQ 'P'.      "flag for permanent suspension
      WA_ORDER_ITEM_IN-REASON_REJ = WA_ZVCONTRACT_SUSP_SAVE-ABGRU.
    ELSEIF WA_ZVCONTRACT_SUSP_SAVE-CFLAG EQ 'T'.  "flag for temporary suspension
      WA_ORDER_ITEM_IN-REASON_REJ = ''.
    ENDIF.
    APPEND WA_ORDER_ITEM_IN TO ORDER_ITEM_IN.
    WA_ORDER_ITEM_INX-ITM_NUMBER = WA_ZVCONTRACT_SUSP_SAVE-POSNR.
    WA_ORDER_ITEM_INX-UPDATEFLAG = 'U'.
    WA_ORDER_ITEM_INX-REASON_REJ = 'X'.
    APPEND WA_ORDER_ITEM_INX TO ORDER_ITEM_INX.
*update contract for reason code
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        SALESDOCUMENT    = SALESDOCUMENT
        ORDER_HEADER_IN  = ORDER_HEADER_IN
        ORDER_HEADER_INX = ORDER_HEADER_INX
      TABLES
        RETURN           = RETURN
        ORDER_ITEM_IN    = ORDER_ITEM_IN
        ORDER_ITEM_INX   = ORDER_ITEM_INX.
ENDLOOP.
We are using it the above given way and it is working fine.
Regards,
Abhijit G. Borkar

Similar Messages

  • "Enter the document number" in BAPI_SALESORDER_CHANGE.

    Hi,
    I've got the following error:
    Call of BAPI_SALESORDER_CHANGE gives us an error V1 045 "Enter the document number". We are sure the call is proper (document number is send). The errors occurs in function module SD_SALES_DOCUMENT_READ in lines 60 and 61:
    60    VBAK-VBELN = DOCUMENT_NUMBER.
    61   PERFORM BELEG_LESEN(SAPMV45A).
    In line 60 field VBAK-VBELN is set  but in form BELEG_LESEN(SAPMV45) is initial. The value of field is checked in MV45AF0B_BELEG_LESEN line 53.
    53    if vbak-vbeln is initial.
    54    message e045.
    55   endif.
    The error occurs only when we have mass changing of sales order and posting deliveries in reference to sales order. Single operation doesn't make any problem.
    Our system:
       SAP_APPL 470 with  SAPKH47026
       SAP_BASIS 620 with SAPKB62059
    Anyone met it before? I'm quite confused.
    Best regards:
    Lukasz Tylutki

    Hi Lukasz,
    If I understand correctly the problem occurs with multiple calls of the BAPI within the same program call. As a general rule of thumb, this could be due to parts of the program not properly initialized. Don't try to correct the BAPI - it's hopeless.
    I suggest you make use of the suggestion in note 760068 to start a new task.
    This can be achieved as follows:
    Call function 'XXXXXX' starting new task 'BLABLA'
    performing yyyyy on end of task
    ...rest of function interface (only export and tables)...
    wait until semaphore = 'X'.
    form yyyyy
    receive results from function 'XXXXXX'
    importing...
    tables...
    exceptions....
    semaphore = 'X'.
    endform.
    This way all data are initalized in a different LUW, thus not influencing the next function executions. An alternative would be to submit programs for each function call, passing the interface through export-import parameters, but it doesn't look as nice.
    Best regards,
    Stratis

  • IDOC error status 'Enter the Document Number'

    Hi PI or SD masters,
    I have a status 51 in my IDOC. The reason was 'Enter the Document Number'. Has anyone encountered this before?

    Sold To Party Account number was changed

  • "Enter document number error" in BAPI_SALESORDER_CHANGE

    Hi,
    I am trying to change the sales order thorugh BAPI_SALEORDER_CHANGE as follows,
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = <fs_order_alv_aux>-vbeln
    order_header_in = e_bapisdh1
    order_header_inx = e_bapisdh1x
    simulation = p_consol
    TABLES
    return = t_bapi_return
    extensionin = t_bapiparex.
    I am changing only KVGR5 through this BAPI, and I am passing sales documetn number through <fs_order_alv_aux>-vbeln.
    When I check inside BAPI I am able to see SALESDOCUMENT : 0021033932, while debugging further I came to know about following.
    Inside the Function SD_SALES_DOCUMENT_READ. following 2 lines gets executed.
    VBAK-VBELN = DOCUMENT_NUMBER.
    PERFORM BELEG_LESEN(SAPMV45A).
    Here, VBAK-VBELN has a value, but as soon as it goes inside PERFORM BELEG_LESEN(SAPMV45A). VBAK-VBELN value gets cleared and following error has been set inside the perform.
    if vbak-vbeln is initial.
    message e045.
    endif.
    If I manually fill VBAK-VBELN inside this perform then everything works fine.
    I even tried same thing through SE37 by executing this BAPI but in this case it doesnot clear the VBAK-VBELN inside this PERFROM.
    Can anyone help?
    Thank you.

    Hi Pramod,
    it does not look like a conversion error.
    You may try again with SE37, enter debugger at start and set a watchpoint at VBAK-VBELN in function SD_SALES_DOCUMENT_READ, i.e. program SAPLV45A.
    When VBAK-VBELN is set, it will stop at the watchpoint. Check the call stack at this point to find out how the value gets here. Then start your misbehaving program and (I hope so) find out ehere it is going wrong.
    The SD process is heavily penetrated with enhancements for a couple of industry solutions. I do not know your environment so it is hard to say how the document number is passed to function group V45A.
    Regards,
    Clemens

  • I am trying to download Illustrator to my windows laptop.  I tried with CC but got an error when entering the license number.  So someone told me that CC is different from CS6 Illustrator, and I have a license only for CS6 Illustrator.  What is the correc

    I am trying to download Illustrator to my windows laptop.  I tried with CC but got an error when entering the license number.  So someone told me that CC is different from CS6 Illustrator, and I have a license only for CS6 Illustrator.  What is the correct link for CS6 Illustrator then?

    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.window using the Lightroom 3 link to see those 'Important Instructions'.

  • Why does iCal insist on formatting a phone number as a hyperlink? How can I prevent this, and prevent iCal from launching FaceTime in response to entering the phone number in the event box?

    I just want to enter a phone number into an event in iCal. I do not want to launch FaceTime. How can I just put a phone number in an iCal event, without OSX 10.10 insisting on launching FaceTime in response to entering the phone number? I use a Macbook Pro.

    Megantic wrote:
    Ever since I upgraded my iPhone 4S to iOS7, it has basically become a brick.  It constantly freezes, and the home button becomes completely inoperable.  People have suggested a number of fixes for the home button problem ("calibrating", tightening screws, etc.) but none of the fixes solved the problem.  Through trial and error, I've come to realize that the problem is that the phone doesn't have enough computing power and that too much of its RAM gets used up by background processes, causing the phone to freeze.
    I have found an app that stops unnecessary background processes currently running, frees up RAM, and lets the phone function properly (Free RAM 1.3). Once I've run this app, the phone functions perfectly.
    However, this clean up only happens each time the app is launched (ie: it does not continuously free up RAM).  So, I constantly have to run it (and sometimes am not able to because the phone is frozen and the home button won't work).
    When it is running, the app  displays the background processes that are running.  Looking at the list, there are many processes for which I have no need, such as processes related to automatic checking for app updates, processes related to iCloud (which I do not use), etc.  Preventing these processes from running in the first place would go a long way in making my phone more useable (being able to return to a previous iOS would be a better option, but Apple won't allow this).
    Here is my question:  is there a way to prevent unnecessary background processes from running at all?
    Which app is this?

  • Where can I download photoshop cs 8.0  I have the serial number from the case but I can't find the Cd that came with it.  I can't find where to download the software for it so I can just enter the serial number and download the program.

    I am trying to find at least the trial version so that I can enter the serial number that I have on the back of the case and activate the full version so I can get some work I need to get done finished.  My laptop was thrown away after a flood in my basement and I believe the cd was still in it.  I don't recall ever taking it out.

    Forget your existing disc and serial number. They won't work.
    Download the new non-activation version of CS2 (applies to CS owners as well) from
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Install then enter the new serial number provided at that link.

  • I reinstalled operating system software on my MacBook Air (Yosemite 10.10.3) and tried reinstalling Adobe Acrobat 9 Pro.  I was able to install the software into my Applications folder but I was unable to enter the serial number or go any further with the

    I reinstalled operating system software on my MacBook Air (Yosemite 10.10.3) and tried reinstalling Adobe Acrobat 9 Pro.  I was able to install the software into my Applications folder but I was unable to enter the serial number or go any further with the installation.  When I click on the Adobe Acrobat icon in the Applications folder, nothing happens.

    Hi Tom,
    kindly check the System requirements | Acrobat family of products—older versions (XI, X, 9)
    For serial number message try: 
    Error "Invalid serial number" | Acrobat 9 | CS4
    Thanks,
    Atul Saini

  • Attaching a flat file to the Document Number

    Hi,
       I want to attach a flat file to the Document Number generated .
    Please follow the steps :
    1) Goto transaction FB03.
    2) Enter into it by giving a document number.
    3) At the Document overview screen you will find the 'Services for Object' button(Left side upper part of the screen)
    4) When you click it you will find Create-> Create attachment will be there where you can browse and upload a flat file that tags tagged to the Document number.
         Is there any FM to do this activity.
    Thanks in Advance

    Hi Raja,
           I have used the function module
    'BDS_BUSINESSDOCUMENT_CREATEF' with the following parameters .
         Export:      
              LOGICAL_SYSTEM =  'LS_TSX100'
              CLASSNAME      = 'BUS6035'
              CLASSTYPE      = 'BO'
              CLIENT         = '100'
              OBJECT_KEY     = 'SE1201000000012006'
         Tables:
              Files-directory = 'C:\'
              files-filename  = 'POSTING.TXT'.
    After that I have committed it .
    The file doesn't get attached . I went into the FB02 and entered the accounting number(100000001) and checked but it has not got attached .
    Please help me .

  • I am installing CS6, for the first time, on a Mac, from a CD.  I have a valid serial number that I just obtained.  When I enter the serial number, it is not validated and I cannot continue.

    I am installing CS6, for the first time, on a Mac, from a CD.  I have a valid serial number that I just obtained.  When I enter the serial number, it is not validated and I cannot continue.

    Error "The serial number is not valid for this product" | Creative Suite

  • When I enter the serial number for photoshop CS6 on my second machine, I get the message - Your comp

    When I enter the serial number for Photoshop CS6 on my second machine, I get the message,  -Your computer seems to be off line -....    But it is on line.  Can you help?

    Please check your system date.
    Any mismatch can lead to the error.
    -Pragya

  • I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    Error "The serial number is not valid for this product" | Creative Suite

  • I just purchased LR5 online and installed it on my PC. I entered the serial number I was given and it said "this is an upgrade serial number. The serial number from your previous version of LR is also required." Since I just bought it I don't have a previ

    I just purchased LR5 online and installed it on my PC. I entered the serial number I was given and it said "this is an upgrade serial number. The serial number from your previous version of LR is also required." Since I just bought it I don't have a previous serial number. What do I enter?

    You return the upgrade version since it was purchased in error
    Return, cancel, or exchange an Adobe order
    Purchase a full version.

  • Hello. i have used up the free trial of premier pro cc. now i want to buy the rral package. it is prompting me to enter the serial number, but i dont know where i can get one. kindly trll me how i can get one of these. thanks.

    Hello. I have exhausted my free trial of premier pro cc. Now I want to buy the real one. It is promoting me to enter the serial number. But I don't have one. Can anyone please tell me how to get one and from where.

    Sushant,
    The Country of the Adobe ID, payment details & store has to be same.
    Please see the link below that explains both of these cases:
    If you do have a credit card and billing address in the country associated with your Adobe ID...
    If you do not have a credit card and billing address in the country associated with your Adobe ID...
    How do I complete a purchase when I get an incorrect "country" error?
    IF you need to contact our support staff, please check that you are logged in to adobe with your adobeid and use this link to access support :  Contact Customer Care . Scroll down and click on the blue bar that says, "Still need help?” Contact us."
    Pattie

  • Document number error in billing

    HI all,
    When I am doing billing for a sales order, I am getting the following error. The full message is :
    "The document number you specified is not in the appropriate number range. The number range is dependent on the  document type.
    The exception to this rule is formed by recurring entry documents, which must use number range 'x1' and sample documents, which must use number range 'x2'.
    Possible reasons for this error are given as
    You have given an incorrect document number
    An incorrect document number is transferred to this application during an  update from another application (eg CO)"
    Can anybody give a solution for this errror.
    Thanks in advance,
    Sreedhar

    Normally billing docs are internally number ranged which is the sap standard. If you have not canged this then the only problem which occurs is w.r.t Costing. Generally at the time invoicing some CO docs get generated as well if you have automatic posting enabled.
    In this case number range formats need to be maintianed. Please maintian them and proceed.
    If you are ofcourse on an IDES system for training purposes Check your assignments to Controlling area/ Profit centre ... Deactivate them. It will allow you to invoice. However in this no costing docs will get generated.
    regards
    Jude

Maybe you are looking for

  • How can reach someone that can help me

    I am leaving feedback here because countless attempts to reach verizon by phone, chat, & email have  proven to be frustrating and impossible. If I had a few thousands extra dollars I would buy out my contracts today. On Friday 9/12/2014 I went to add

  • I have an Ipad 2 and have about 20 apps that will not update, How can I delete these?

    I have some apps that will not update on my IPad 2.  They say they are installing, but Installing is grey..not black, and they have been like this for several weeks.  I cannot find out how to finish the updates or delete them.  Can someone suggest a

  • Imported Photos Don't Show

    Let me start from the beginning. I was playing around with my iPhoto library to try to get rid of duplicate photos that were just rotated. I went back and realized I deleted some photos. Yeah, dumb. I know. I have a backup of my library. I took the w

  • Highest quality export

    whats the highest quality export for dvd. I have a client who wants to watch it on computer, tv and projection with best quality. Also, is a video_TS file better quality than a fcp quicktime mov file?

  • Sol 10 X86 with Qlogic 1280 controller

    Sol 10 X86 installation problem: System has two internal disks, 1 quantum SCSI 6 gb, which was UNconnected. One Seagate 18 GB SCSI from Qlogic 1280 controller with Sol 9 installed. Disconnected Seagate to play with the old Quantum drive. Problem was