Update delivery block on inbound Orders IDoc

Hi Folks,
I am using the following to code to place delivery block.
      zvbak-lifsk = zblock. "ZZ
      MOVE: 'X' TO z_d_flag_k-kde2.
      dxvbak = zvbak.
But some how my code is not placing delivery block on the sales order.
Can you guys tell me what am i doing wrong here??
Thanks,
Matt
Edited by: Creasy Matthew on Jul 29, 2009 4:19 PM

Hi,
Could you please tell me the IDoc type and Inbound Function Module u are using.
is it ORDERS05 and  IDOC_INPUT_ORDERS

Similar Messages

  • User exit for updating delivery block of Sales order before Delivery

    Hi  Folks,
    Need to have an user exit for updating Delivery Block indicator for a Sales order Before creating its delivery
    I have got an exit in Program SAPMV45A
    MV50AFZ1
    FORM USEREXIT_REFRESH_DOCUMENT.
    that hits before processing the delivery block fro delivery (Correct me if i m wrong with this )
    Now i want now how to change the Delivery Block indicator of Sales order in that exit
    any FM available ?
    Thanks n regards
    Sonal...

    Hi  ,
    How did you solved this issue?
    I am having similar scenario in which while pressing the save button  delivery block should update if multiple schedule line exist.
    Tried by two different approaches in various user exit without any success.
    AFAIK we have two ways to achieve this functionality.
    1) Count the no of rows in vbep. If greater than 1 then multiple schedule line exist and we can assign the value to VBAK-LIFSK(delivery block) as per our requirement.
    This is not correct. If there are two line items both with single schedule line . This case total no lines in vbep will 2 and above condition will true which is incorrect.
    2) There is a indicator for multiple schedule line (VBAPD-EPMEH , xvbap-epmeh ) if it is check then multiple schedule line exist and we can assign the value to VBAK-LIFSK(delivery block) as per our requirement.
    If I write code in USEREXIT_SAVE_DOCUMENT_PREPARE.
    Multiple schedule line indicator is not populate so can not use 2nd approach.
    If I write code in  USEREXIT_SAVE_DOCUMENT it of no use as vbak is updated before reaching this user exit.
    If I write code in USEREXIT_MOVE_FIELD_TO_VBAK as this user exit is also called while pressing the enter key for this I have use
    the condition of fcode but it also fails in some condition.
    If fcode eq 'SICH'.
    Read table xvbap with key epmeh = 'X'.
    IF SY-SUBRC = 0.
    VBAK-LIFSK = '03'.
    Else.
    VBAK-LIFSK = ' '.
    Endif.
    Endif.
    Please help me to get the desired functionality working for all cases.
    1) One line item with multiple schedule line                                              
    2) Two line item with multiple schedule line                                             
    3) One line item having one schedule line and second one having multiple
    4)Two line item both with single schedule line.

  • How to place a delivery block at line item level from Inbound ORDERS IDoc?

    Hi EDI/ABAP Experts,
    Can anyone please tell me how to place a delivery block at line item level from Inbound ORDERS IDoc?
    I tried using exit "EXIT_SAPLVEDA_001'. But there is no LIFSP field in either of XVBEP and YVBEP structures.
    Can you guys throw some light. How to place a delivery block @ line item level on sales order from Inbound ORDERS IDoc.
    Thanks,
    Matt .

    Look into the Include: LVEDAF5A that is the only place where this exit is hit... double click on the Structures and look which structure has billling block field.. and use that..
    FORM CUSTOMER_FUNCTION_IDOC USING IDOC_DATA.
      CALL CUSTOMER-FUNCTION '001'
        EXPORTING SEGMENT = IDOC_DATA
                  DVTCOMAG = VTCOMAG
                  DXMESCOD = IDOC_CONTRL-MESCOD
                  CONTRL   = IDOC_CONTRL
        TABLES    DXBDCDATA = BDCDATA
                  DXVBAP    = XVBAP
                  DXVBEP    = XVBEP
                  DYVBEP    = YVBEP
                  DXVBADR   = XVBADR
                  DYVBADR   = YVBADR
                  DXVBPA    = XVBPA
                  DXVBUV    = XVBUV
                  DD_FLAG_P = D_FLAG_P
                  DXKOMV    = XKOMV
                  DXVEKP    = XVEKP
                  DYVEKP    = YVEKP
        CHANGING  DXVBAK   = XVBAK
                  DD_FLAG_K = D_FLAG_K
        EXCEPTIONS
                  USER_ERROR = 01.
    If you are in ECC6.0  you can also use Enhancement point : INTERPRET_IDOC_ORDERS_01 SPOTS ES_SAPLVEDA. in include: LVEDAF2U

  • Remove Delivery Block - ORDCHG - INBOUND

    Hi,
    I'm trying to remove the delivery block set in sales order ( vbak-lifsk ) using the inbound ORDCHG message idoc.
    i'm populating E1EDK01-LIFSK = ''. This doesnt remove delivery block from the order. ( if we try to set delivery block E1EDK01-LIFSK = '01', it's coming through fine in the order ). when i debugged the FM IDOC_INPUT_ORDCHG, sap is populating the screen only if E1EDK01-LIFSK is NE space.
    Does this have to be handled in different way or in user-exit? Your inputs are highly appreciated.
    Thanks,
    Arun

    Naren,
    EXIT_SAPLVEDA_002 is triggered during ORDERS message. I'm changing the already created order using ORDCHG message type. In this case, i have to use EXIT_SAPLVEDB_002 to populate the BDC screens.
    I'm wondering why SAP standard segment field E1EDK01-LIFSK is not used for removing the delivery block as its for setting the block.
    If the standard segments are not working out, then i have to use  EXIT_SAPLVEDB_002 to populate the dynpros for delivery block field.
    Thanks for your input.
    Arun.

  • Automating delivery blocks in sales orders

    Hi,
    We have a delivery made with ref to a sales order. The goods are third party warehouse managed.When the goods are no longer needed, a third party warehouse sends an idoc in our system. This idoc deletes the delivery in our sap system and as soon as the delivery is deleted, the system also puts a delivery block(VBAK-LIFSK) in sales order at header level so that no further deliveries are made with ref to sales order.
    There is an issue at present that this delivery block is not set in sales order when the delivery is deleted.
    could anybody pls help where the code might have been written to automatically put the delivery block in sales order when the delivery is deleted.
    regards

    Hi,
    Just code the delivery block logic in DO user exit MV50AFZ1 routine "userexit_delete_document".
    Thus, when DO deleted then system will auto set delivery block to SO.
    Hope this help.
    Cheers,

  • Segment/Field name for Unplanned delivery costs in Inbound Invoic Idoc?

    Hi Folks,
    Will you please let me know the name of the segment/field (IDoc type INVOIC) for unplanned delivery costs on Inbound Invoic Idoc??
    Thanks,
    Matt

    Hi,
    Am facing the same issue and did tried the E1EDS01 segment. SUMID = 20 and passing the value to field BEZNK, but its not updating the value.
    Could you please give me some more info. how to achieve it.
    Thanks,
    Aniket Korde

  • How to update delivery block in delivery(vl02n) using BAPI

    hi all,
    i have to update delivery block of a delivery using a BAPI. can any one suggest which bapi i have to use. and if possible let me know what are the mandatory fields that i have to fill in that bapi.
    thank you all in advance

    HI,
    Use the BAPI BAPI_OUTB_DELIVERY_CHANGE..
    Pass the delivery number DELIV_NUMB in both HEADER_DATA and HEADER_CONTROL..
    In HEADER_DATA-DLV_BLOCK pass the delivery block.
    In HEADER_CONTROL-DLV_BLOCK_FLG pass 'X'
    Thanks
    Naren

  • Schedule Background Job :  Remove delivery Block in Sales order

    Hi Gurus,
    I have a requirement to select all sales orders as per a condition and remove delivery block at
    VA02-> Go to -> Header -> Status
    For that I have to write a program which will be run only in background and i have to schedule background job for the same.
    I have a parameter at selection - No of records
    If no of records = 500 , I have to submit 500 jobs ie one job each for each sales order for removing delivery block.
    I need to know
    1) Which function module/bapi I can use to remove delivery block at sales order header level.
        For blocked delivery the status is 'BSTK" . to remove block i need to change status to "RSTK".
    2) How to schedule a background job for my program and how to submit one job each for each sales   order.
    Regards
    Avi.

    Hi Avi,
    Would like to seek for your advice. I am facing the same scenario too which is to delete the delivery block but is deletion of the delivery block is done in the user exit MV45AFZZ. The subroutine which needs to have the extra logic of deleting the delivery block is USEREXIT_SAVE_DOCUMENT_PREPARE.
    Need your advice on how do you solve this scenario? Thanks in advance.

  • Removing of Delivery block in Sales Order using Authorization

    Hello,
    I have a urgent requirement on removing a Delivery block using authorization.
    The object V_VBAK_AAT is assigned to me and the ACTVT : 43 is permitted so I can release the block.
    As this was  not working I have created my own object with values ACTVT as 01, 02 , 43 and LIFSK : 1-10,11,12-99 .
    I am trying to remove the block from VA14L from VA14L I select my order with respect to delivery block and it navigates to VA02.
    From VA02 I am trying to remove the block.
    As this requirement may be simple but it is blocking my development.
    Thanks.

    Please correct whether I understood your issue correctly or not.
    You have developed the program only to put delivery block to Sales Order. This block should be approved by Authorized people for allowing the users to create delivery else Sales order delivery should not be possible. Is that program has any other additional functionality other than setting Delivery block??
    To keep delivery impossible till the Authorized person approves Sales order, you have the option of User Status. Process for creation of User Status for your requirement
    Create User Status Profile in OIBS
    Keep BLCK (Blocked for Delivery) & APPR (Approved for Delivery) as 2 statuses (No. of status can be as per your requirement. Here, simply I have 2 statuses)
    Assign Object types as "Sales Order Header" (if you want the Authorized people to approve at header level) or "Sales Order Item" (if you want the Authorized people to approve at Item level, may be for partial delivery)
    Keep BLCK as Initial status & Double click on BLCK status & click New entries on "Business transactions"
    There are many Business transactions such as "Create Delivery" / "Create Goods Issue for delivery". As per your requirement, select Forbidden option in one of the above mentioned business transaction
    Create Authorization Key in BS52 for Authorized People, say, as MNGR (Manager)
    Assign that Authorization Key to APPR user status in User status profile
    Using PFCG, you can create separate role by assigning this Authorization key
    This can be different kind of solution from your way. For reference, you can refer below document. Document content points some other space & transaction. But you can relate to above steps mentioned.
    User Status in SAP

  • Regarding Inbound Order Idocs

    Hi All,
    I want the tables in which Inbound Order Idocs were stored,
    Use WE02 transaction,
    i am trying to find the tables , but i cant, plz any body help me in this problem,
    Balu.

    Hi bala,
    do one thing..u wil get the idoc number as 0000000000123456(16 digit)..
    please chek the document numebr in the ztable,say for example in ur ztable it  is 10 character length.so u have extra 6 characters.
    so what u do is use CONVERSIONEXIT function module and delete the leading zeros,
    if u do like this.it will be 10 characters...
    now u can write the select query as u written,it won't give any error..
    Regards,
    Nagaraj

  • How to delete E1EDP19 002 segment frm the inbound ORDERS IDoc?

    Hi ABAP/EDI experts,
    I am implementing an User exit related to inbound Sales order EXIT_SAPLVEDA_001.
    Most of the time my IDocs contain the below segments.
    E1EDP19 001 (QUALF = '001')
    E1EDP19 002 (QUALF = '002')
    Sometimes, IDoc contain only E1EDP19  001 (QUALF = '001') segment.
    My problem is whenever i have two E1EDP19 segments, i want to delete the 1st E1EDP19 segment and retain the second E1EDP19 segment.
    Can anyone tell me the pseudocode for deleting the 1st E1EDP19 segment from the inbound orders IDoc.
    Am i using the correct user exit??
    Thanks,
    Creasy Matt
    Edited by: Creasy Matthew on Jan 22, 2009 12:56 AM

    Hi Matt,
    You can loop on idoc_data internal table. This table will be having all the data and the segments.
    data: l_count type i value 0,
            l_tabix type sy-tabix.
    LOOP AT idoc_data WHERE docnum = idoc_contrl-docnum.
    CASE idoc_data-segnam.
    WHEN e1edp19.
    l_tabix = sy-tabix.
    l_count = l_count + 1.
    if l_count = 2.
       l_tabix = l_tabix -1.
      delete idoc_data index l_tabix.
    endif.
    ENDCASE.
    ENDLOOP.
    I hope this will work.
    Please let me know if any issues.

  • Placing delivery block on the inbound Orders IDoc (SO Process)

    Hi EDI Gurus,
    I have a small question.
    I know we can set a delivery block using E1EDK01-LIFSK.
    But I check a base UOM @ item level. If it is not allowable, then I should place a delivery block.
    I am using user exit EXIT_SAPLVEDA_001.
    But how can I set a delivery block @ header level with information available  @ item level.
    Say:
    case zedidd-segnam.
    when 'E1EDK01'
    XXXXXXXXXXXXX
    when 'E1EDP01'.
    ze1edp01 = zedidd-sdata.
    zint-vbap = zxvbap
    zint-vbak = zxvbap.
    if  ze1edp01-MENEE ne 'EA'.
    place delivery block
    endif.
    How can I do this.
    Can anyone throw some light. Even code/field help will be helpful.
    Thanks,
    Matt

    Throw some light Gurus

  • Problem to update delivery block (sales order header level)

    hi all,
    after few tries, we got message "Field 'LIFSK' cannot be changed, VBAKKOM 0001279765 ready for input".
    this message come when we try to update the delivery block with some value when the delivery block in the sales document is blank (no block).
    please advise how to solve the problem. thanks.

    Well, you said that only some orders are failing - try to find what's so different about them. Also check if there are any other messages in the RETURN table.
    Sometimes these errors might be difficult to catch because the field might not be available for input only at the moment when your BAPI runs, but later, when you go to VA02, it is available. Here is an example. We were trying to update the reason for rejection field. It becomes available, for example, when the delivery line item has been confirmed, but for the lower amount. The program with BAPI was running at the background. Sometimes there was an error in the delivery, which was corrected by a user. So when later in the day we went to research this, we couldn't figure out what's wrong. You might want to check the Changes log on the order and on the delivery.
    And, of course, there is always the debugger - set the whatchpoint for where this message occurs.

  • Updating delivery block using 'BAPI_SALESDOCUMENT_CHANGE'

    Hi!
    I need to update the delivery block field of a sales order.
    I am using  'BAPI_SALESDOCUMENT_CHANGE' and passing
    delivery block also.
      ls_order_header_in-dlv_block = lp_lifsk.
      ls_order_header_inx-dlv_block = lp_lifsk.
    Could you please let me know how to achieve it.
    Thanks.
    -Shreyas
    PS: Helpful answers will be rewarded.

    Hi
    please check the following code ..hope it will help you
    LOOP AT l_i_headr ASSIGNING <l_fs_headr>.
        l_wa_order_in-dlv_block = space(the desired value which u want to update).
        l_wa_header_inx-updateflag = l_c_update.
        l_wa_header_inx-dlv_block = l_c_set.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument    = <l_fs_headr>-vbeln
            order_header_in  = l_wa_order_in
            order_header_inx = l_wa_header_inx
          TABLES
            return           = l_i_return.
    Check for abort messages and error messages
        LOOP AT l_i_return TRANSPORTING NO FIELDS WHERE type EQ l_c_abort OR
                                                        type EQ l_c_error.
    Set the flag to indicate that there is an error.
          l_v_error_flg = l_c_set.
        ENDLOOP.
    *Commit the changes in the database only if there are no errors
        IF l_v_error_flg IS  INITIAL.
    *UPDATE the delivery block to space
    Commit work
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = space.
        ELSE.
    Roll back the changes if there are errors.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        ENDIF.
      ENDLOOP.

  • Delivery block in sales order

    Hello,
    I have an issue regarding delivery block.
    I've read a couple of posts regarding this, but they all solved their issue by using userexit_save_document or userexit_save_document_prepare which is no option for me.
    My issue is the following:
    I've created an order type ZTA (copy of TA) and setup a default delivery block "Z1 - in work" to that order type.
    This prevents that after saving the order it will not be automatically delivered by a job which is running in background.
    So each time I create a ZTA order with VA01, it will set the delivery block Z1. That's fine.
    Now let's say when a customer has a delivery block (e.g. Z5), it will not overwrite the order delivery block Z1, when entering sales-to-party (or ship-to-party)!
    Now I tried to add some code to userexit_move_field_to_vbak like that:
        if not kuwev-lifsd is initial.
          vbak-lifsk = kuwev-lifsd.      " Z1 -> Z5
        else.
          if not kuagv-lifsd is initial.
            vbak-lifsk = kuagv-lifsd.     " Z1 -> Z5
          endif.
        endif.
    Result: It will execute my new code sequence, but will not change the delivery block Z1 to Z5 on the VA01 screen. Maybe because I'm at this step not in update but insert mode?
    I need to show the customer's delivery block while creating the order, means showing the delv. block after saving is too late.
    Is there maybe a better exit to change the order delivery block to the customers delivery block?
    Thanks in advance
    Wolfgang

    Dear Wolf,
    I dont know whether it might help you but , we had a requirement to make the information message of CUSTOMER BLOCK (which we do in XD05) to ERROR message .
    It was done in the include MV45AFZZ but i do not know much technical details.
    What i know is, this include comes much before the SAVE comes.
    Also if you can write the logic to check the BLOCK STATUS from customer master and if it has a value, then fill the same in the respective field in sales order, system might throw that blocking reason.
    If there is no reason, system will put the the default blocking reason from the sales order.
    Better you post the issue in ABAP forum.
    You might get more inputs there.
    Check and revert back.
    Thanks & Regards
    Hegal  K Charles

Maybe you are looking for

  • Are the security updates included in 10.6.7?

    I am new to MAC so I am still getting used to the update feature on Mac vs. PC. Recently I upgraded the Mac OS X from 10.6.6 to 10.6.7 via the software update. Did that include the security patches, or do I need to do an additional update of just tho

  • How to identify if a user master record is locked

    Hi, I want to use function module BAPI_USER_CHANGE to change a user's master record (transaction SU01).  But if the user that I want to change is being modified by another user, this BAPI doesn't update, correctly so.  Is there a way to identify if a

  • Why do I always get this message?

    Photoshop Camera Raw 7.4-Update Installation fehlgeschlagen Fehlercode: U44M1P7

  • RouterServer and sdo_router_partition

    Hi all, I'm trying to use the Oracle Spatial Routing Engine from here (http://www.oracle.com/technology/software/products/spatial/index.html) in conjunction with some of my data loaded into the Oracle Network Model. Using the Network Model java API w

  • How to read and parse a comma delimited file?  Help

    Hi, does anyone know to read and parse a comma delimited file? Should I use StreamTokenizer, StringTokenizer, or the oro RegEx packages? What is the best? I have a file that has several lines of data that is double-quoted and comma delimited like: "a