Block for sales document by using SALES_ORDER_CREATE

My program creates customer orders from a sequential file, which is output by another system. For the booking the function modul SD_ORDER_CREATE_WWW is used (which is also called by the function modul BAPI_SALESORDER_CREATEFROMDAT1 ). The sales order documents are assigned to contracts.
Occasionally the function modul does not do the booking, but exports the return-message V1 042 (Sales document &1 is currently being processed (by user &2) ) with &1 = the number of contract..
I think it a bad solution to add for this case the command WAIT 1 and start the function modul a second time. Could anybody help me with a better way to solve this problem ?

Wolfrad,
SET UPDATE TASK LOCAL is not a dangerous command!  You just have to use it appropriately.
What I believe is happening in your situation is that when you call the function module SD_ORDER_CREATE_WWW to create the sales order it does the initial processing before calling the function module RV_SALES_DOCUMENT_ADD in UPDATE TASK.  When it issues the COMMIT WORK, an update task session is initiated in parrallel to your SD_ORDER_CREATE_WWW call.  The sales order number can be passed back to you as it is actually generated prior to the call of RV_SALES_DOCUMENT_ADD.
Now, when you next call SD_ORDER_CREATE_WWW, the update task can still be running, meaning that the contract could be locked by the update task.
By prefixing the call of SD_ORDER_CREATE_WWW with SET UPDATE_TASK_LOCAL, all the update task activity should be performed in the same task, so by the time you have received control back from SD_ORDER_CREATE_WWW, the order will have been created and the contract will no longer be locked. You can then safely execute the next call to create an order.
BTW- to answer your question about locking, call the function module ENQUEUE_EVVBAKE passing it the contract number in the VBELN parameter.  If you get an exception then the contract is being processed.  BUT remember, in doing this, you have actually locked the contract yourself and so will need to do a DEQUEUE_EVVBAKE prior to calling SD_ORDER_CREATE_WWW.
That was lengthy, hope it makes sense.
Cheers,
Brad

Similar Messages

  • Material to be block for sales document

    Hi Experts,
    A requirement has come up from client side in which he wants me to stop users from creating exchange sales orders for 4 materials. Users should be able to create normal sales order with these materials. Is there any way in SAP to make this setting? 4 Materials banned for exchange order. But not for normal order. Please guide.
    Chetan Barokar.

    hello, friend.
    ravi has given you the direction.  just to add... you also have the option of defining your own Exclusion condition type and access sequence (which contains the field for sales document type).
    another way is to activate exclusion in the relevant sales order type using OV04 (configuration) and for sales order types where exclusion should not take place, you can just leave the activation blank. 
    of course, in standard you maintain exclusions per customer using t-code VB01.  if you wish to maintain records using other combination keys, you must define your own access sequence.
    the configuration path is IMG > SD > Basic Functions.  look for Listing/Exclusion.  everything for configuration you will find there.

  • Deliveries blocked for sales document..

    Hi SDN's...
    Which reason makes the sales document deliveries are blocked...
    Can we see who blocked the deliveries or how the document get blocked..What r the possible reasons???
    Because of this our job did not creat invoices..
    Thanks in advance..
    Rahul...

    check VKM4 report .
    Regards
    Prabhu

  • What is the use of Release Strategy for Sales Document

    Hi,
    Can i know what is the use of Release Strategy for Sales Document? Difference between lowest level and Highest level.

    Hi,
    Can i know what is the use of Release Strategy for Sales Document? Difference between lowest level and Highest level.
    Lowest Status No: Sale Document can have several statuses at the same time. However, only one of the statuses may have a status number. If another status with a status number is activated; the old status with status number is deactivated. This is only valid under certain conditions. The system makes a note of the status with the highest status number that has been reached up to the present. The "lowest number" of this status number determines which status number a new status must have.
    Highest Status No: Sales Document can have several statuses at the same time. However, only one of the statuses may have a status number. If another status with a status number is activated, the old status with a status number is deactivated, provided the new status number does not exceed the 'highest number' defined for the old status number
    If you want more clarity try to check below link
    http://www.sapfunctional.com/SD/ReleaseStrategy/Index.htm
    Regards,
    Prasanna

  • Function Module to Generate Outbound IDOC for Sales Documents

    Hello Experts,
    Can someone please help me, I need to know which function module to use in order to generate the outbound IDOC for sales documents.  Some of the fm's I have come across are the following:
    IDOC_OUTPUT_ORDERS, but actually for Purchase Orders
    IDOC_OUTPUT_ORDRSP, but did not generate any IDocs for my sample Sales Order.
    Points will be given for any help provided.
    Thanks in advance.

    Hi Nagaraj,
    I tried using the IDOC_OUTPUT_ORDERS but I keep getting an error that the Purchase Order <xxx> does not exist, even though the document I tried is a sales order.  For everyone's reference here is the code:
    form process_data.
      DATA v_idoc       TYPE edidc-docnum.
      DATA i_edidd      TYPE TABLE OF edidd.
      DATA wa_idoc_ctrl TYPE edidc.
      LOOP AT i_nast INTO wa_nast.
        CLEAR i_msgs[].
        CALL FUNCTION 'WFMC_PROTOCOL_GET'
          EXPORTING
            cps_nast        = wa_nast
          tables
            messages        = i_msgs
         EXCEPTIONS
           NOT_FOUND       = 1
           OTHERS          = 2.
        LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'E0'.
    *--- Check first if there is an IDOC
          IF wa_msgs-msgv1 IS INITIAL.
            CONTINUE.
          ENDIF.
          v_idoc = wa_msgs-msgv1.
          CLEAR i_edidd[].
          CLEAR wa_idoc_ctrl.
          CALL FUNCTION 'IDOC_READ_COMPLETELY'
            EXPORTING
              document_number                = v_idoc
            IMPORTING
              IDOC_CONTROL                   = wa_idoc_ctrl
    *         NUMBER_OF_DATA_RECORDS         =
    *         NUMBER_OF_STATUS_RECORDS       =
            TABLES
    *         INT_EDIDS                      =
              INT_EDIDD                      = i_edidd
            EXCEPTIONS
    *         DOCUMENT_NOT_EXIST             = 1
    *         DOCUMENT_NUMBER_INVALID        = 2
              OTHERS                         = 3.
          CALL FUNCTION 'IDOC_OUTPUT_ORDERS'
            EXPORTING
              object                              = wa_nast
              control_record_in                   = wa_idoc_ctrl
    *       IMPORTING
    *         OBJECT_TYPE                         =
    *         CONTROL_RECORD_OUT                  =
            tables
              int_edidd                           = i_edidd
    *       EXCEPTIONS
    *         ERROR_MESSAGE_RECEIVED              = 1
    *         DATA_NOT_RELEVANT_FOR_SENDING       = 2
    *         OTHERS                              = 3
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          COMMIT WORK.
        ENDLOOP.
      ENDLOOP.

  • Post order processing for sales document is not yet complete

    hi,
    sap gurus,
    i am facing the error while saving the sales order and this ticket is unique and it is saying that
    "post order processing for sales document is not yet complete".
    please help me in this regard.
    and it is blocking the order for further processing.
    regards,
    balajit

    I dont think this is a standard error message.  Some exit is applied for sale order to meet some requirements.  You need to check with your ABAPer.
    In fact, you can conclude yourself based on the error message number.  If it starts with Z, then the above holds good.
    thanks
    G. Lakshmipathi

  • Insufficient authorization for sales document

    Insufficient authorization for sales document
    We are getting an error message as insufficient authorization in spite Sales Order fully approved. We are using Credit Card Processing without clearing house as payment process on sales order processing. Sales Order is process correctly with credit card pre-authorization.
    Creating delivery and billing document is giving an error as Insufficient authorization.
    We have completed configuration related to payment card. Also Maintain Clearing House...
    Chart of Accounts              ***
    Payment card receivables       ####        CASH CLR-CREDIT CARD
    Clearing account               ####        CASH - PNC
    Authorization                            CCARD_AUTH_SIMULATION
    Initialization Authorization SET
    Result Authorization (SET)               SD_CCARD_AUTH_CALL_RFC
    RFC destinations of functions
    Settlement                               CCARD_SETTLEMENT_SIMULATION
    RFC destination of functions
    Settlement answer                        CCARD_SETTLEMENT_RSP_EXECUTE
    Thanks
    PP

    Yadav,
    The new documents are working fine. The documents already created when try to release billing to accounting getting
    message..Insufficient authorization for sales document 90000055
    Message no. V/032
    Procedure
    Check the authorization amounts in the payment card plan and repeat authorization. Or reauthorize at a later time.
    Thanks
    PP

  • Error during material determination for sales document item - RRB

    Hi
    Iam getting following error when trying to create a billing request using DP91.
    Error during material determination for sales document item 40001560/000010
    Message no. AD01155
    Diagnosis
    An error occured during material determination for a dynamic item.
    System Response
    The system cannot perform the function.
    Procedure
    Check in the profile being used whether its characteristic allows the assignment of a material to each dynamic item.
    I have checked my DIP profile using ODP02 there are no errors in it, I have created a Setid and assigned it to costing element in selection criteria and material determination criteria.
    Material origin is checked in costing tab in material master.
    Appreciate help in resolving this.
    thanks,
    Vaishnavi

    Hi Vaishnavi
    The error which you are getting is related to costing.So kindly reach your FI Consultant
    please check the following links which may help you.Also check the link that has been provided my Lakshmipathi
    ERROR AT DP90  TRANSACTION
    Regards
    Srinath

  • Add fields in Locator result  for Sales Document in GUI (anyone?)

    Dear all,
    I try to find information on how we can customize the locator's result column (especially for Sales document)
    in GUI mode. I know we can Change Layout to choose other available field column to be displayed in the
    locator result. How to add more fields so we can have more fields to choose when we change the layout?
    I searched the SDN CRM forum but no exact answer for this (missed it?)
    In fact, there is a bug on the locator search result when I set field Employee Responsible to be displayed
    on the search result, the system is showing other Partner number instead.
    If you have experienced in add fields on the Change Layout, please kindly share it.
    Appreciate your help (with points)
    Cheers,
    Gun.

    It is GENIL BOL concept and now using WebUI Search.

  • Archiving for Sales Documents

    Hi All,
    I have setup archiving for sales document printout. Did uat in test system no issue but when move to live system, the output type could not be issued. I have set Print and Archive for the output type. The error as below when i view the sales document output. I have setup a ARCH device type in SPAD. But it is still not working. Any idea what config is missing?
    Unknown archiving device
    Message no. PT 040
    Diagnosis
    In archive customizing, you can assign an archive device to an archive. Otherwise, the value from the profile parameter 'rspo/default_archiver' is used, or the default value 'ARCH'. However, none of these devices exist.
    Procedure
    Maintain an appropriate device in Transaction SPAD.
    Thanks
    Dyl

    Hi,
    See whether this link helps in tackiling the issue.
    ftp://ftp.software.ibm.com/software/dw/dm/db2/0308kammerer/CommonstoreSAPArchive.pdf
    Regards,
    Saju.S

  • Number range for sales document type

    Hi,
    I am having 1 client under that 5 company codes, ade according to that 5 plants & 5 sales organization.
    so for one comapany code including all there are 15 sales document types same for other also
    my question is
    How can I assign number range for all that?
    If i am going to maintain seperate document type it goes to 75
    which userexit will help me out for this?
    without userexit what is the otherway?
    regards,
    Rahul

    Not only at order level, you will have to use exits at delivery and billing document level also.
    For sales documents:
    Exit USEREXIT_NUMBER_RANGE in MV45AFZZ
    For delivery documents:
    Exit USEREXIT_NUMBER_RANGE in MV50AFZ1
    For billing documents:
    Exit USEREXIT_NUMBER_RANGE in RV60AFZZ
    You need to give tables for maintaining numbers for sales, delivery and billing documents. In the exit a select query can be written to fetch the data based on the parameters like sale orgainzation, company code etc.
    Regards,
    GSL.

  • Partner determination for sales document item

    Hi people
    We have a partner function in sales order (carrier) that must be determinate by item, this is necessary because we sell different materias in the same order that can't be transported by the same carrier.
    In customizing Partner Determination for Sales Document Header is possible to use an user exit assign the origin X, Y or Z, in this case I would use the exit EXIT_SAPLV09A_003, but for partner determination for sales document item i didn't find a way to assign the origin X, Y and Z
    Does anyone have an idea for solving this?
    Thanks
    Emerson

    Whatever Partner functions are assigned to the Procedure  assigned to the Sales document Type, only those partner functions will feature in the Sales document header.
    In the procedure assigned to the Item category you will find like that 3 only only as in the Sales order you can not have different Sold-to-party for different Item.
    Whichever Sold-to-party is there in the header that is applicable to all item. So at item  level Procedure
    sold-to-party partner function is not required to assign.
    Sold-to-party is unique for a Sales order and can not be changed.
    But at Item level, you can have different Ship-to-party for different items so the partner function has to be there and to deliver the item one SH is mandatory, that is why it has been marked mandatory in the Procedure.
    All the partner function assigned to the Procedure at header level will be copied to all item. In your procedure for the header you must be having 5 partner functions.
    You can change the SH at item level for few items.

  • External number range for Sales Document

    hi,
        I have a requirement to generate external number range for sales document. I tried this user exit (MV45AFZZ) to generate external number.
    FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
    Endform.
    between these form and enform i written my logic and passing to US_RANGE_INTERN. But can one suggest where to write to generate external number range.
    Can any one help me out.
    Thanks and regards,
    Vijay.

    Hi
    Here you can assign a different number range for your sales order.
    The number range is linked to the order type (field VBAK-AUART), this link is done in customizing.
    It usually uses this routine if it can't assign the range in customzing because (for example) for different sales area it need have different number ranges for the same order type.
    So you should create an external range by trx SNRO and then assign the number before entering in the main screen of va01 or saving the document.
    When you need to assign the number depends on how you want to manage your range.
    If you assign the number in entering you has to make sure to not assign the same number document to severals order to be created in the same time by several useers.
    Max

  • Settlement rule for sales document item

    Hi,
    while creating settlement rule for sales document item, it shows message
    Sales document item is not defined for the transaction,
    Message no. V1198
    Regards
    Gajendra

    Do not give links are your reply. This will be considered as link farming. A user has been removed from forum, because he used to this several times and he was one of the top contributor.
    Just suggest the user to search the forum, hope nobody needs a guide on how to search in a forum or google.

  • Document flow for sales document

    It is possible NOT update the document flow when i create sales document with reference  to onther sales document?
    Thanks.

    When you don't want to have a relationship between to doc and want use only for reference then you can use - Dynamic Product Proposal or simply, user can refer the items from existing doc (to do this in sales order overview screen, press CRTL+F11, explore the option-easy without config )
    A product proposal is a list of products for a specific customer that is automatically proposed during sales document processing. You can decide for yourself which materials should be displayed as product proposals in the sales document. You can also determine the sequence in which the materials appear in the product proposal.
    During sales document processing, the system displays a product proposal in the item overview according to the customer and the business transaction. It displays the material number, material description, and historical order quantites in the sales unit last used. To use a material again, you just have to copy it. The system does not run the standard checks (pricing, availability, incompletion, material determination, free goods determination and so on) until you have entered the order quantities.
    The product proposal is both an entry help and an aid to sales support and promotions. It is particularly useful in Telesales, where the employee automatically receives a display of all the materials that are of interest to a particular customer. This helps them to provide appropriate advice to the customer quickly and easily. The sales document history enables you to analyse the purchasing behaviour of a customer and recognize early on if it changes, for instance, when the customer suddenly stops ordering a product.
    The product proposal differs to cross-selling in that it is dependent on the customer and sales area, and is displayed in the sales document as soon as you have entered a customer. Cross-selling, on the other hand, is triggered by a material. In other words, the system proposes cross-selling materials according to the material or a characteristic of the material you have entered.
    You can determine the product proposal from different data sources:
    -Order history
    -Listed materials
    -Excluded materials
    -Item proposal
    -Customer-material info records
    -Customer-specific data sources
    You can combine materials from these data sources to create a product proposal. The system then accesses the data sources either online or in the background.
    To define a product proposal for sales document processing, you must carry out the following activities in Customizing:
    -Define customer procedure for product proposal
    -Define document procedure for product proposal
    -Assign document procedure for product proposal to order types
    -Maintain table of origin for product proposal
    -Define product proposal procedure and determine access sequences
    -Maintain procedure determination (in background) for product proposal
    -Maintain procedure determination (online) for product proposal
    The product proposal procedure determines how the system displays the product proposal in the sales document. For instance, if the system has accessed the order history, it determines how many columns should be displayed in the sales document, in which period intervals thehistoric order quantities should be displayed (for instance, day, week, or month), and most importantly, the sequence in which the system should access the data sources (for example, order history, listing, exclusion).
    The product proposal procedure depends on the:
    - Customer determination procedure
    The customer procedure determines which product proposal procedure the system automatically uses when you create a sales document for a particular customer. It is specified in the customer master record per sales area.
    - Document determination procedure
    The document procedure determines which product proposal procedure the system automatically uses for a certain document type. The document procedure is stored as a key in the header for the sales document type.
    If you use online processing, the product proposal procedure is determined according to the customer and document determination procedures.
    If you use background processing, the product proposal procedure is determined according to the sales area in the customer master and the customer determination procedure. It does not use the document determination procedure because the document type is not recognized in background processing
    Hope this can assist.
    Thanks & Regards
    JP

Maybe you are looking for