Triggering event through Change Management for Sales order

I am working on three different scenarios of workflow which is triggered on change of sales order.  I am trying to put conditions in SWEC for the workflows to start but not sure how to go about it.  I created change doc object VERKBELEG and assigned bus2032 and changed as my event.  I inserted a value in condition editor like vbap_(fieldname)_new etc.  Nothing seem to be working.
I would like to know once we assign event here in SWEC, should we also assign and activate it in the triggering tab of workflow or just create an entry in the linkage table.
Please guide me as to how I need to work on the sales order change.  I am basically want to trigger a sales order only when a field value is updated or inserted which pertains to my requirement.
Thank you very much.

Karthik,
My problem is still not resolved.  I am trying to put something like this.  Let me know if you have were able to do this in any other way.
DATA : i_cdhdr LIKE cdhdr OCCURS 0 WITH HEADER LINE.
DATA : lt_editpos LIKE cdshw OCCURS 0 WITH HEADER LINE.
DATA : it_vbap LIKE vbap OCCURS 0 WITH HEADER LINE.
DATA : flag(1) TYPE c.
DATA : text LIKE message-msgtx.
DATA: BEGIN OF ITAB OCCURS 10.
        INCLUDE STRUCTURE cdshw.
DATA:   UDATE LIKE CDHDR-UDATE,
        USERNAME LIKE CDHDR-USERNAME,
        CHANGENR LIKE CDHDR-CHANGENR,
        VBELN(10),
        POSNR(6),
        ETENR(4),
        INDTEXT(200),
  END OF ITAB.
data : lv_vbeln like vbap-vbeln.
data : lv_posnr like vbap-posnr.
SELECT vbeln posnr FROM vbap INTO TABLE it_vbap WHERE
                                       vbeln = '               ' AND
                                       posnr = .
i_cdhdr-objectclas = 'VERKBELEG'.
i_cdhdr-objectid   =  '      '.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
     EXPORTING
          objectclass       = 'VERKBELEG'
          objectid          = '            '
          username          = space
          time_of_change    = i_cdhdr-utime
     TABLES
          i_cdhdr           = i_cdhdr
     EXCEPTIONS
          no_position_found = 1
          OTHERS            = 2.
IF sy-subrc EQ 0 AND NOT i_cdhdr[] IS INITIAL.
  sort i_cdhdr by CHANGENR UDATE UTIME descending.
  LOOP AT i_cdhdr.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
         EXPORTING
              changenumber      = i_cdhdr-changenr
         TABLES
              editpos           = lt_editpos
         EXCEPTIONS
              no_position_found = 1
              OTHERS            = 2.
  ENDLOOP.
**change in fname is eq lprio delete the records.
loop at lt_editpos.  
    if lt_editpos-fname = 'LPRIO' and
       lt_editpos-CHNGIND = 'U' and
       lt_editpos-F_NEW = '03' and
       lt_editpos-tabname = 'VBAP'.
      flag = 'X'.
        concatenate lt_editpos-fname lt_editpos-f_new into text.
      exit.
    elseif lt_editpos-fname = 'KEY' and
           lt_editpos-CHNGIND = 'I' and
           lt_editpos-tabname = 'VBAP'.
      lv_vbeln = lt_editpos-tabkey+3(10).
      lv_posnr = lt_editpos-tabkey+13(6).
      select single * from vbap into it_vbap where
                                       vbeln eq lv_vbeln and
                                       posnr eq lv_posnr.
      if sy-subrc = 0 and it_vbap-lprio = '03'.
        flag = 'X'.
         concatenate lv_vbeln lv_posnr it_vbap-lprio into text.
        exit.
      endif.
    endif.
  endloop.
endif.

Similar Messages

  • Change pointer for Sales Order

    Hi,
    Using change pointers I want to create an IDOC when ever a specific field in the sales order line item is changed. I have activated the change pointer for message type ORDRSP. Also maintained the following entries in BD52
    VERKBELEG(Object) VBAP(Table) ABGRU(field).
    After this when I change this field at the sales order line item, it inserts entries into change pointer table.
    But my problem is creating IDOC's from those change pointer entries. I am not sure which function module (MASTERIDOC_CREATE_XXXXX) works for this.
    Anyhelp on this highly appreciated.
    Thanks
    Ram

    Hi Ram,
    I don't think so you can use change pointer for sales order changes. Usually, it is done through transaction code<b> NACE</b> - configuring condition for output type.
    You can setup requeirement in procedure control to trigger IDoc ORDRSP for any changes in item level.
    Hope this will help you and give an idea.
    Regards,
    Ferry Lianto

  • New/Change Indicator for Sales Order IDoc

    Hi Gurus,
    Does anyone knows if there's a field in the IDoc Segment for ORDERS that shows or indicate if it's a new or changed order.
    We are sending IDocs to our freight company for sales order, but we are trying to see if there's a way we can let them know if its a new or changed IDoc for sales order.
    Is there any field for this or any work around on this?
    Thanks for your help.

    Segment Field ACTION is not been changed. I've just tested it and made changes to the Sales Order, the ACTION field is still carrying "000".
    Like thomas said, can this be because I'm using message type ORDRSP instead of ORDCHG?
    Does this make any difference?
    Edited by: Basil Balogun on May 10, 2011 4:54 PM
    Edited by: Basil Balogun on May 10, 2011 9:43 PM

  • Order change management in Sales order(MTO Scenario)

    Dear All,
    Iam trying to map OCm functionality.How is 'Initial object' created based on changes to the direct assignment of change numbers by using direct assignment.What exactly is this?I have a sales order of 10 pc. against which a prod. order is also created for 10 pc. If there is a change in qty. of sales order from 10 pc. to 15 pc.Is it possible to refelect the same in existing Prod.Order using OCM or any other functionality.

    Hi
    order cahage management is tio track the changes made in production order .
    It is no way to update the production order with changes made in sales order.
    Regards
    YMREDDY

  • Create and Change functionality for Sales order

    Hii All,
                Can any one please suggest me any Standard program or BAPI or IDOC for Sales order, it should cover create as well as change fuctionality of Sales order.
    this is very urgent to me.
    Suitable Answer will be Rewarded.
    Thankyou,
    Shobha.

    For change you can use:
    BAPI_SALESORDER_CHANGE         Sales order: Change Sales Order
    For create you have the following choices:
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESDOCU_CREATEFROMDATA with business object 'BUS2032'
    The difference between the create ones is the functionality you get e.g. create_from_data2 is the 'most powerful' but you also have to provide the most data. It just depends on what you want it to do.
    In terms of IDOCS:
    message type:
    SALESORDER_CREATEFROMDAT201 or
    SALESORDER_CREATEFROMDAT202 or
    ORDERS05
    Hope that helps,
    Michael
    Here is an example we use, you might want to populate additional fields or leave fields out in case you want different data to be transferred to the IDOC - however some fields are mandatory.
    create the order header structure
      ls_header-doc_type   = ls_screen-order_type.
      ls_header-sales_org  = gc_vkorg_aa01.
      ls_header-distr_chan = gc_distr_aa.
      ls_header-division   = gc_divis_aa.
      ls_header-purch_no   = ls_screen-po_num.
      ls_header-po_method  = ls_screen-po_source.
      ls_header-ship_cond  = ls_screen-ship_cond.
    create partner input table (sold to)
      ls_partner-partn_role = gc_role_sold.
      ls_partner-partn_numb = ls_screen-sold_to.
      APPEND ls_partner TO lt_partner.
    create partner input table (ship to)
      ls_partner-partn_role = gc_role_ship.
      ls_partner-partn_numb = ls_screen-ship_to.
      APPEND ls_partner TO lt_partner.
    items are added by looping at a table
        ls_item-material = <fs_upload>-matnr.
        ls_item-req_qty  = <fs_upload>-quantity.
      process the quantity, it needs to be three decimals, because it
      will be moved into a string in the BAPI and divided by 1000 before
      it is moved back into a number field (1.500 => 001500 => 1.5)
        ls_item-req_qty = ls_item-req_qty * 1000.
      truncate remaining decimal places if exist (1.2525 => 1252.5 => 1252 => 1.252)
        ls_item-req_qty = trunc( ls_item-req_qty ).
        price is taken from the file
          ls_item-cond_type = gc_cond_so_upld_price.
          ls_item-cond_val1 = <fs_upload>-price.
        condition one (price) is multiplied by 10 in the BAPI
          ls_item-cond_val1 = ls_item-cond_val1 / 10.
        no discount
          ls_item-cd_type2   = gc_cond_so_upld_disc.
          ls_item-cd_value2  = 0.
        ls_item-item_categ = ls_screen-item_cat.
          APPEND ls_item TO lt_item.
    then BAPI is called
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA'
        EXPORTING
          order_header_in           = ls_header
          business_object           = gc_bus_obj
        IMPORTING
          SALESDOCUMENT             = lv_vbeln
          RETURN                    = ls_return
        tables
          order_items_in            = lt_item
          order_partners            = lt_partner.
      IF ls_return-type NE gc_msgty_error AND
         ls_return-type NE gc_msgty_abend.
      No errors where found
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ELSE.
      There was an error or abend
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.

  • Triggering event in u201Cchange statusu201D for Sales Document (SD) with TCode VKM1

    Hi guys, Iu2019m trying to trigger a new event in an u201CStatus Management u2013 Tcode BSVWu201D for a Sales Document when I use the transaction to release it (Tcode VKM1 -> CtrF10 to release), so the change is done in u201COverall blocked statusu201D field .
    For this, I created a new entry on the u201CSystem/user status eventu201D Tcode BSVZ using:
    StatusOT = VBK
    Schema = blank
    BusinessOT = BUS2032
    Event = u201CCustom Eventu201D
    I did test with and without status restriction (I0002 = REL) but nothing happened in TCode SWEL, no event were triggered so I donu2019t know what to do.
    The field affected for the status in the document is VA03-># Sales Order-> GoTo -> Header -> Status -> u201COverall blocked statusu201D.
    I appreciate any help.
    Thanks a lot
    Felipe Uribe

    Hi,
    You have to
    1) Mention the status profile used
    2) specify the bus. Obj and event to be triggered
    3) Then select the status which the event is to be created. System status starts with 'I' and User status starts with 'E'. You can get the status in table TJ02T for system status text & TJ30T for User status texts.
    See this [Link|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0334534-aa28-2b10-a3a2-9ed4135727ed].
    Regards,
    Surjith

  • Change status for sales order in crmd_order

    Hi,
    I am creating a report which has to change for all sales order with status "Open" to status "Processed". Is there any function or bapi to do this ?? Supposing, there is no function, which tables do i have to change ???
    thanks in advance!!!
    Maria

    Mmmm it doesn't work... I have tried this:
        CALL FUNCTION 'CRM_STATUS_CHANGE_EXTERN_OW'
          EXPORTING
      CHECK_ONLY                = ' '
            OBJNR                     = i_crmd_orderadm_h-guid
            USER_STATUS               = 'I1003'
      SET_INACT                 = ' '
      IV_REF_KIND               =
      IV_OBJECT_TYPE            =
      IV_NO_1O_MAINTAIN         =
    IMPORTING
      STONR                     =
    EXCEPTIONS
       OBJECT_NOT_FOUND          = 1
       STATUS_INCONSISTENT       = 2
       STATUS_NOT_ALLOWED        = 3
       OTHERS                    = 4.
    If sy-subrc = 0.
    endif.
    But noting has change in tag Status in tx. CRMD_ORDER.. still have in "system status": In process and in "User status": Order Rep Processed.
    Thanks in advance !!!

  • Change Documents for Sales Order (VA03)

    Hello,
    Is it possible to track changes to the text (VA03 - Header Detail - Text Tab) from a Sales Order by using change documents?
    Thanks in advance for your help,
    CL

    I don't think that is possible. These are getting stored in Longtext (ie STXH & STXL) by retrieving this also we need to use fm READ_TEXT.
    and also in change document table CDPOS fields VALUE_NEW & VALUE_OLD have length limit of 254.

  • Creating change log for sales order

    hi all,
    i want to create change log for any given sales order if it exists.
    can any one tell me how to do that??

    Hi Gouri,
    CDHDR and CDPOS are the tables for all change history.
    CDHDR contains the details such as who made the change, when, using what tcode and the change type ie. update, delete.
    CDPOS contains the field name which was changed, its old value and its new value.
    The change document object is VERKBELEG for sales documents.
    The object value is the SD document number with leading zeros.
    The following link will be also useful.
    http://www.sap-img.com/ab024.htm
    Regards,
    Nitin.

  • Change indicator for sales orders

    Hi All,
    I would like to know when a change is done to a sales order (in VA02), in order to automatically change its status to the default.
    Does SAP stores a flag that indicates whether the order was changed?
    Thanks!
    Amit

    Hi Amit,
    Whenever any changes done to any object(eg. Sales Order, Material Master, Customer Master,etc.) in SAP, it is recorded in change document table CDHDR. This table records following important fields,
    Object Value
    Old Value
    New Value
    Change date
    Time
    Transaction(By which changes are done)
    So you can find all the changes done to your sales order in this table.
    Just Run SE16 >> Table CDHDR >> put your sales order no in field OBJECT VALUE and execute.
    I hope this answers your question.
    Regards,
    Mohit

  • Report for Sales Order Change History   CDPOS and CDHDR

    How to take a report of the data for the Sales Order Change history for a particular period of time. It is required to take a report of all the Sales Orders for which the basic price has been changed. Please let me know the procedure. I could not get the data from the table CDPOS and CDHDR
    Helpful answer would be rewarded.
    Regards
    Praveen

    Dear Praveen Kumar
    Have you tried with VBAP where sale order details at item level would be stored.
    Moreover, to my knowledge, there won't be any changes as for as pricing is concerned at sale order level but there is at billing level.  Normally, any price increase / decrease would reflect in billing.  So why dont you to table join through SQVI VBAP (for sale order details) and VBRP (for billing details) so that you can compare the selling price in sale order with billing. 
    Thanks
    G. Lakshmipathi

  • User Exist for Sales Order

    Hi All,
    When the Route changes in the Sales Order, I want to add the Forwarding agent to the Partfner function atutomatically. So I written the code in the User-Exist "userexit_check_vbap" with the following logic.
    IF sales order is creating with VA01, Add an entry
    and Changing the Sales order with VA02, modifiy an exisiting entry as follow.
    But at the time of Creating with VA01, it is sucessfully adding an entry, but
    whenever you the change Route for sales order with va02, Modify statement is working fine and showing the correct Partner function in the Partner Tab.
    If you save the document and open it again then Changed Route is sucessfully saved but not the partner function. It always having the partner function which you given at the time of creation.
    Can we write the modify statement in the "Userexist_check_vbap"
    READ TABLE xvbpa WITH KEY parvw = 'ZR'
                                posnr = xvbap-posnr.
      IF sy-subrc NE 0.
        SELECT SINGLE * FROM lfa1 INTO CORRESPONDING FIELDS OF xvbpa
            WHERE lifnr = tdlnr.
        xvbpa-mandt  = xvbap-mandt.
        xvbpa-vbeln  = xvbap-vbeln.
        xvbpa-posnr  = xvbap-posnr.
        xvbpa-fehgr  = '08'.
        xvbpa-nrart  = 'LI'.
        xvbpa-lifnr  = tdlnr.
        xvbpa-updkz  = 'I'.
        CLEAR: xvbpa-kunnr, xvbpa-stceg.
        xvbpa-parvw  = 'ZR'.
        APPEND xvbpa.
      ELSE.
        xvbpa-lifnr  = tdlnr.
        MODIFY xvbpa TRANSPORTING lifnr WHERE parvw = 'ZR'
                                          AND posnr = xvbap-posnr.
      ENDIF.
    Please suggest me , how can i solve this problem.
    Thanks and Warm Regards,
    Vijay

    I solved the problem by pass the following value
    xvbpa-updkz  = 'U'.
    It solved my problem.

  • How to implement Approval hierarchy for Sales Order in Order Management.

    Hi,
    We need approval process for sale orders in Order Management module. Currently we are using credit HOLD option for orders at shipping level. The issue we are facing now is we can not cancel those orders who contains Service Line item in it while on HOLD. The restriction raised at the time of cancelling the order that the Line Item is "fulfilled". Service line item's get fulfilled.
    Is that any other possibility to have Approval hierarchy for Sales Orders in Order Management Module? If it is possible can anybody share the related document or implementation guide?
    Thanks with anticipation in advance.
    Many Regards
    Kaleem Bhatti

    I copied the standard order header workflow and the "Book Order, Manual" workflow to custom workflows.  I then modified the "Book Order, Manual" workflow to put another completely custom workflow (call this "Approvals") in between the "Book Eligible" and "Book" steps.
    The "Approvals" step assessed the sales order, changed the order header to the pending approval flow_status_code, and sent out the appropriate notifications.  The "Approvals" step returned a Complete/Incomplete where complete would proceed to "Book" and incomplete would go back to "Book Eligible."  The new workflow was then assigned to the order type needed.  I don't still have access to that environment (job change) or I would give more definite instructions.

  • User Exit/BADI for Sales Order Line Partner Change

    I am looking for a user exit or BADI which gets triggered when partner function of a sales order line is changed.
    My detailed requirement is-We have created a new Partner Function - END CUSTOMER(EC). Requirement is to trigger a business logic whenever the End Customer partner function is changed from its default value to anything else.
    If you have any suggestions please let me know.

    Hi
    have a look at function module EXIT_SAPLV09A_004 .
    Cheers

  • Program for mass change in the sales order.

    Hi,
      I have a requirement where If we make changes in  the availability check rule of the material master(for e.g. 02 to 01),then the same rule should be changed in the sales order as well.
      Though this will be changed for the new orders but is there any program which we can run manually or in the background in order to make changes in the old sales orders.
    Regards
    Karan

    Hi,
            U cannot change checking group or checking rule for availabillity check at sales order level, u can change requirements type.
            If u want to change requirements type determined into sales orders, which  r already created go to t.code MASS and select the object type sales orders and press execute, select sales order item data on tables tab,and select requirements type on fields tab and press execute.specify sales documents number from and to and item numbers, and press execute and specify the new value and press carryout mass change button and then save.
    with regards,
    kirankumar vemula

Maybe you are looking for