CRM Order Status

Hello Friends,
I am using the following code for updating the status of order but it is not working .Please suggest me where i am wrong
LV_GUID16 = '48E8B1011F9F0114E10080000ADC1080'.
APPEND LV_GUID16 TO LT_GUID16.
CALL FUNCTION 'CRM_ORDER_READ'
  EXPORTING
    IT_HEADER_GUID       = LT_GUID16
  IMPORTING
    ET_ORDERADM_H        = LT_ORDERADM_H
    ET_ORDERADM_I        = LT_ORDERADM_I
    ET_STATUS            = LT_STATUS_WRKT
  EXCEPTIONS
    DOCUMENT_NOT_FOUND   = 1
    ERROR_OCCURRED       = 2
    DOCUMENT_LOCKED      = 3
    NO_CHANGE_AUTHORITY  = 4
    NO_DISPLAY_AUTHORITY = 5
    NO_CHANGE_ALLOWED    = 6
    OTHERS               = 7.
IF SY-SUBRC = 0.
  READ TABLE LT_ORDERADM_H INTO WA_ORDERADM_H INDEX 1.
  IF SY-SUBRC = 0.
  Change into Loop
    READ TABLE LT_STATUS_WRKT INTO LS_STATUS_WRK2
                          WITH KEY STATUS = 'E0005'
                             USER_STAT_PROC = 'ZOBAORD1'
                                     ACTIVE = 'X'.
    IF SY-SUBRC = 0.
      LWA_STAT-REF_GUID = LS_STATUS_WRK2-GUID.
      LWA_STAT-REF_KIND = 'A'.
      LWA_STAT-STATUS = 'E0003'.
      LWA_STAT-USER_STAT_PROC = 'ZOBAORD1'.
      LWA_STAT-ACTIVATE = 'X'.
      APPEND LWA_STAT TO LT_STAT.
      CLEAR  LT_INPUT_FIELD_NAMESM.
      LS_INPUT_FIELDS-REF_GUID   = LS_STATUS_WRK2-GUID.
      LS_INPUT_FIELDS-REF_KIND = 'A'.
      LS_INPUT_FIELDS-OBJECTNAME = 'STATUS'.
      LS_LOGICAL_KEY-USER_STAT_PROC = 'ZOBAORD1'.
      LS_LOGICAL_KEY-STATUS         = 'E0003'.
      LS_INPUT_FIELDS-LOGICAL_KEY = LS_LOGICAL_KEY.
      LS_INPUT_FIELD_NAMESM-FIELDNAME = 'ACTIVATE'.
      LS_INPUT_FIELD_NAMESM-CHANGEABLE = ''.
      APPEND LS_INPUT_FIELD_NAMESM TO LT_INPUT_FIELD_NAMESM.
      LS_INPUT_FIELDS-FIELD_NAMES[] =  LT_INPUT_FIELD_NAMESM[].
      INSERT LS_INPUT_FIELDS INTO TABLE LT_CTINPUT_FIELDSM.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          IT_STATUS         = LT_STAT             "mod by Richa
        CHANGING
          CT_INPUT_FIELDS   = LT_CTINPUT_FIELDSM
        EXCEPTIONS
          ERROR_OCCURRED    = 1
          DOCUMENT_LOCKED   = 2
          NO_CHANGE_ALLOWED = 3
          NO_AUTHORITY      = 4
          OTHERS            = 5.
      IF SY-SUBRC = 0.
        DATA : LIT_RET          TYPE TABLE OF BAPIRET2,
               LIT_OBJ_TO_SAVE  TYPE TABLE OF BAPIBUS20001_GUID_DIS,
               LIT_SAVED_OBJ    TYPE TABLE OF BAPIBUS20001_OBJECT_ID.
        APPEND LV_GUID16 TO LIT_OBJ_TO_SAVE.
        CALL FUNCTION 'BAPI_BUSPROCESSND_SAVE'
          TABLES
            OBJECTS_TO_SAVE = LIT_OBJ_TO_SAVE
            SAVED_OBJECTS   = LIT_SAVED_OBJ
            RETURN          = LIT_RET.

LV_GUID16 = '48F35A4FB49200D1E10080000ADC1080'.
APPEND LV_GUID16 TO LT_GUID16.
CALL FUNCTION 'CRM_ORDER_READ'
  EXPORTING
    IT_HEADER_GUID       = LT_GUID16
  IMPORTING
    ET_ORDERADM_H        = LT_ORDERADM_H
    ET_ORDERADM_I        = LT_ORDERADM_I
    ET_STATUS            = LT_STATUS_WRKT
  EXCEPTIONS
    DOCUMENT_NOT_FOUND   = 1
    ERROR_OCCURRED       = 2
    DOCUMENT_LOCKED      = 3
    NO_CHANGE_AUTHORITY  = 4
    NO_DISPLAY_AUTHORITY = 5
    NO_CHANGE_ALLOWED    = 6
    OTHERS               = 7.
IF SY-SUBRC = 0.
  READ TABLE LT_ORDERADM_H INTO WA_ORDERADM_H INDEX 1.
  IF SY-SUBRC = 0.
  Change into Loop
    READ TABLE LT_STATUS_WRKT INTO LS_STATUS_WRK2
                          WITH KEY STATUS = 'E0005'
                             USER_STAT_PROC = 'ZOBAORD1'
                                     ACTIVE = 'X'.
    IF SY-SUBRC = 0.
      LWA_STAT-REF_GUID = LV_GUID16.
      LWA_STAT-REF_KIND = 'A'.
      LWA_STAT-STATUS = 'E0003'.
      LWA_STAT-REF_HANDLE = '0000000000'.
      LWA_STAT-USER_STAT_PROC = 'ZOBAORD1'.
      LWA_STAT-ACTIVATE = 'X'.
      APPEND LWA_STAT TO LT_STAT.
      CLEAR  LT_INPUT_FIELD_NAMESM.
      LS_INPUT_FIELDS-REF_GUID   = LV_GUID16.
      LS_INPUT_FIELDS-REF_KIND = 'A'.
      LS_INPUT_FIELDS-REF_HANDLE = '0000000000'.
      LS_INPUT_FIELDS-OBJECTNAME = 'STATUS'.
      LS_LOGICAL_KEY-USER_STAT_PROC = 'ZOBAORD1'.
      LS_LOGICAL_KEY-STATUS         = 'E0003'.
      LS_INPUT_FIELDS-LOGICAL_KEY = LS_LOGICAL_KEY.
      LS_INPUT_FIELD_NAMESM-FIELDNAME = 'ACTIVATE'.
     LS_INPUT_FIELD_NAMESM-CHANGEABLE = ''.
      APPEND LS_INPUT_FIELD_NAMESM TO LT_INPUT_FIELD_NAMESM.
      LS_INPUT_FIELDS-FIELD_NAMES[] =  LT_INPUT_FIELD_NAMESM[].
      INSERT LS_INPUT_FIELDS INTO TABLE LT_CTINPUT_FIELDSM.
      CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
      CALL FUNCTION 'CRM_ORDER_INITIALIZE'
        EXPORTING
          IV_INITIALIZE_WHOLE_BUFFER = 'X'
        EXCEPTIONS
          OTHERS                     = 2.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          IT_STATUS         = LT_STAT             "mod by Richa
        CHANGING
          CT_INPUT_FIELDS   = LT_CTINPUT_FIELDSM
        EXCEPTIONS
          ERROR_OCCURRED    = 1
          DOCUMENT_LOCKED   = 2
          NO_CHANGE_ALLOWED = 3
          NO_AUTHORITY      = 4
          OTHERS            = 5.
      IF SY-SUBRC = 0.
  CALL FUNCTION 'DIALOG_SET_WITH_DIALOG'.
        CALL FUNCTION 'CRM_STATUS_UPDATE_DIALOG'.
        DATA : LIT_RET          TYPE TABLE OF BAPIRET2,
               LIT_OBJ_TO_SAVE  TYPE TABLE OF BAPIBUS20001_GUID_DIS,
               LIT_SAVED_OBJ    TYPE TABLE OF BAPIBUS20001_OBJECT_ID.
        APPEND LV_GUID16 TO LT_OBJECTS_TO_SAVE.
        CALL FUNCTION 'CRM_ORDER_SAVE'
          EXPORTING
            IT_OBJECTS_TO_SAVE         = LT_OBJECTS_TO_SAVE
           IV_UPDATE_TASK_LOCAL       = 'X'
  IV_SAVE_FRAME_LOG          = FALSE
  IV_NO_BDOC_SEND            = FALSE
  IT_ACTIVE_SWITCH           =
         IMPORTING
           ET_SAVED_OBJECTS           = LT_SAVED_OBJECTS
  ET_EXCEPTION               =
  ET_OBJECTS_NOT_SAVED       =
CHANGING
  CV_LOG_HANDLE              =
         EXCEPTIONS
           DOCUMENT_NOT_SAVED         = 1
           OTHERS                     = 2
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT = 'X'.
        COMMIT WORK AND WAIT.

Similar Messages

  • Changing  a crm order status

    Hi!!! I wrote a post some weeks ago but i didn't solve my problem... I need to make a change in a crm badi (ORDER_SAVE) to get the following results: when i create a new order it is created by default with status "open" and i want it to become "in process" so that it is created automatically in R/3..
    In this badi i have tried some things, like using function CRM_ORDER_MAINTAIN, CRM_STATUS_CHANGE_INTERN_VB.. but i it doesn't work..
    Has anyone any idea to do this ??
    thanks in advance !!

    ok, my source code is the following...
      LOOP AT i_crmd_orderadm_h.
        CLEAR: str_stat, lv_stat, ti_crm_jest.
        REFRESH: ti_crm_jest.
        SELECT *
          FROM crm_jest
            INTO TABLE ti_crm_jest
              WHERE objnr = i_crmd_orderadm_h-guid.
        LOOP AT ti_crm_jest.
          str_stat-stat   = ti_crm_jest-STAT.
          str_stat-inact  = 'X'.
          APPEND str_stat TO lv_stat.
          CLEAR str_stat.
        ENDLOOP.
        ls_input_fields-ref_guid         = i_crmd_orderadm_h-guid.
        ls_input_fields-ref_kind         = 'A'.
        ls_input_fields-objectname       = 'STATUS'.
        ls_input_field_names-fieldname   = 'ACTIVATE'.
        INSERT ls_input_field_names
                       INTO TABLE ls_input_fields-field_names.
        INSERT ls_input_fields INTO TABLE lt_input_fields.
        CLEAR ls_status.
        REFRESH lt_status.
        ls_status-ref_guid = i_crmd_orderadm_h-guid.
        ls_status-ref_kind = 'A'.
        ls_status-status   = 'E0002'.
        ls_status-activate = ' '.
        APPEND ls_status TO lt_status.
        CALL FUNCTION 'CRM_ORDER_MAINTAIN'
          EXPORTING
            IT_STATUS         = lt_status
          CHANGING
            CT_INPUT_FIELDS   = lt_input_fields
          EXCEPTIONS
            ERROR_OCCURRED    = 1
            DOCUMENT_LOCKED   = 2
            NO_CHANGE_ALLOWED = 3
            NO_AUTHORITY      = 4
            OTHERS            = 5.
        CLEAR ls_status.
        REFRESH lt_status.
        ls_status-ref_guid = i_crmd_orderadm_h-guid.
        ls_status-ref_kind = 'A'.
        ls_status-status   = 'E0003'.
        ls_status-activate = 'X'.
        APPEND ls_status TO lt_status.
        CALL FUNCTION 'CRM_ORDER_MAINTAIN'
          EXPORTING
            IT_STATUS         = lt_status
          CHANGING
            CT_INPUT_FIELDS   = lt_input_fields
          EXCEPTIONS
            ERROR_OCCURRED    = 1
            DOCUMENT_LOCKED   = 2
            NO_CHANGE_ALLOWED = 3
            NO_AUTHORITY      = 4
            OTHERS            = 5.
        CALL FUNCTION 'CRM_STATUS_CHANGE_INTERN_VB'
          EXPORTING
            OBJNR  = i_crmd_orderadm_h-guid
          TABLES
            STATUS = lv_stat.
        clear lv_stat.
        str_stat-stat = 'I1054'.
        str_stat-inact = 'X'.
        APPEND str_stat TO lv_stat.
        CLEAR str_stat.
        str_stat-stat = 'I1003'.
        str_stat-inact = ' '.
        APPEND str_stat TO lv_stat.
        CLEAR str_stat.
        CALL FUNCTION 'CRM_STATUS_CHANGE_INTERN_VB'
          EXPORTING
            OBJNR  = ti_crm_jest-objnr
          TABLES
            STATUS = lv_stat.
        data: lt_basket_guid       TYPE  crmt_object_guid_tab.
        INSERT i_crmd_orderadm_h-guid INTO TABLE lt_basket_guid.
        CALL FUNCTION 'CRM_ORDER_SAVE'
          EXPORTING
            IT_OBJECTS_TO_SAVE   = lt_basket_guid
            iv_update_task_local = 'X'
          IMPORTING
            et_saved_objects     = lt_saved_objects
          EXCEPTIONS
            DOCUMENT_NOT_SAVED   = 1
            OTHERS               = 2.
        IF NOT lt_saved_objects IS INITIAL.
          COMMIT WORK.
        endif.
      ENDLOOP.
    Yes.. i know it's a little "dirty" code, but it's the only way to make the report work well... my problem is that the order is replicated in R/3 but when i check the order in CRM the system status has changed but the user status no...

  • How to update user status in CRM Order depending the delivery status in R/3

    Hi All,
    In my scenario the partial delivery allowed to the customer while creating the CRM Order. But as per my requirement the status should be updated when the complete order and delivery takes place.
       Let me describe you clearly:
    Suppose I want to deliver 5 quantities products to the customer but initially I want to deliver only 3 quantities and rest 2 quantities later. When I do the post goods issue of 3 quantities in R/3 system the status should not change in CRM system. When I will do the rest 2 quantities in post goods issue in R/3 then the user status should change in CRM Order. But in current when I do the delivery of 3 quantities the user status is changing in CRM Order.
    I need the user status should change in CRM only when the entire deliverytakes place in R/3.
    Thanx
    Chinmaya

    Whenever an item is fully delivered, by standard, a "Completely Delivered" status will be updated into the item. If the I suppose by referring to that you will know an item is partial or completely delivered. When all items in the order is fully delivered, the standard header status will set to "Completed". So, you will also know if the whole order is partial or completely delivered.
    If you want to add a user status, the simplest, you can make use of the ORDER_SAVE Badi. Just call the function CRM_STATUS_MAINTAIN_OW. You can update both header and item status.

  • Updating service order status in CRM from R3 after the invoice is created

    Hi all ;
    I need to update the user status of an service order in CRM when the invoice related to it in R3 is created, so I have already know  the service order no .
    How can i achieve this by sending BDOC from R3 to CRM? Which BDOC should i use?and is it enough to fill only status data in BDOC?
    Thanks.

    Hi sushant,
    When the R/3 Order status is set to 'Completed' then the system status for order in CRM system is automatically changed to 'Completed'.
    So firstly check whether the User status ('Completed')in SAP CRM has the Business transaction event set to 'FINI'. So when the system status is set to 'Completed' the user status will also change to 'Completed.'
    Secondly even check what are the statuses of item in the Orders.
    regards,
    Anubhav

  • Initial load of sales orders from R3 to CRM without statuses

    1) Some sales orders were uploaded into CRM without statuses in the headers or line items. 
    2) Some sales orders were uploaded without status, ship-to, sold-to, payer.....If I deleted them and use R3AR2, R3AR4 to upload each individual then no problem.
    Any ideas or suggestions?
    Thanks.

    Hi,
       Request load of adapter objects uses different extractor modules for extracting the data from external system to CRM. While your initial load of sales docs. will use a different extraction logic bases on the filter conditions specfied on trx.
    R3AC1
       There may be a problem in the extraction of data from the source system (don't know if you are using a R/3). Can you please de-register the R/3 (i suppose) outbound queue using trx.
    SMQS
    , and then debug the extraction (R/3 outbound) before the data is sent to CRM using FM
    CRS_SEND_TO_SERVER
       If this goes well, you may try debugging the mapper in CRM inbound and the validation module in CRM as a last resort. Also, please refer to trx.
    SMW01
    to see if the Bdocs are fully processed.
    Hope this helps...Reward if helpful.
    Regards,
    Sudipta.

  • Status determination in CRM order connected with delivery in R/3

    Hi Experts,
    I need to determine status "completed" in CRM order always when a delivery took place in R/3.
    Of course this is no problem, when all positions were delivered. But in R/3 we do have only one delivery per order and a Badi determines the order "completed". This global status is not transfered to CRM.
    So I am thinging of doing the same in CRM, implementing a BADI that determines status "completed" in the moment the order has a delivery.
    Can anybody help me to find the correct BADI and Methode to do so?
    Thanks,
    Cristina

    Hi Cristina,
    basically it's the same case as mine with the difference you have to read another status type in STATUS TAB.
    In my case requirement was to read invoice status and cover quantity if the invoice status was completed.
    In your case you have to read delivery status and change the overall status of CRM order according to your delivery status.
    I suggest using two BADIs:
    <b>CRM_ORDER_FIELDCHECK</b>
    <b>METHOD if_ex_crm_order_fieldcheck~fieldcheck</b>
    or <b>ORDER_SAVE
    method IF_EX_ORDER_SAVE~PREPARE</b>.
    Basically in both cases you have to call FM <b>CRM_ORDER_CHANGE_STATUS_GET</b>
    to read your delivery status. (I suggest testing in SE37 to check the reading of your status).
    Once there write your code concerning the overall status.
    In my case the final code in badi CRM_ORDER_FIELDCHECK was:
       CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS_GET'
          EXPORTING
           iv_ref_guid                  = wa_fieldcheck-ref_guid
           iv_ref_kind                  = 'B'
         IMPORTING
           et_change_status_ord_i       = t_status_i_tab
           es_change_status_ord_i       = i_status_i
           et_return                    = i_return
         EXCEPTIONS
           parameter_error              = 1
           inconsistent_data            = 2
           no_return_values             = 3
           OTHERS                       = 4.
        IF sy-subrc <> 0.
        ELSE.
    CHECK i_status_i-invoice_status = 'C'.
    LOOP AT ct_input_field_names INTO i_fields_names_tab.
            check i_fieldS_names_tab-fieldname = 'QUANTITY'.
            i_fields_names_tab-changeable = 'A'.
            MODIFY ct_input_field_names FROM i_fields_names_tab.
          ENDLOOP.
        ENDIF.
    <b>Please let me know if it helps and do not forget to reward with points</b>,
    AndreA

  • Relation between CRM Order, Order Status by partner

    Hi,
    Can any one give me an idea to get Order, Order Status based on Partner in CRM.?
    Are there database tables or fm for that.? i can easily get them in R/3 but not in CRM.
    thanks,
    Macs.

    Pls let me close this.

  • Run time error while closing the CRM Order using BAPI

    Hi Experts,
    Need your invaluable suggestions here.Apologies for the lengthy mail, intention is to give clear idea of the issue.
    I am facing an issue while closing the CRM orders. According to our business process, when an issue is solved we will keep the order in resolved status only. We will not directly close the order from the CRM tool, instead we have created a custom program for the same purpose.
    For the custom program we will give input as the order number and execute it, this will close the order.
    Here close the order means assigning it to Close status as well assign the reason code.
    We have created some reason codes for closed status.
    So when the program is run the Order moves from resolved status to closed status along with reason code.
    But of late we are facing some problems with this program, it is giving run time error for some CRM orders.
    Run time error message : The ABAP/4 Open SQL array insert results in duplicate database records.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught in procedure "CRM_SERVICE_OS_UPD_OST_DU" "(FUNCTION)", nor was it propagated by a RAISING clause.
    Please find my code which have used in the custom program
    Closing the resolved SOs in the system
        CALL FUNCTION 'CRM_STATUS_CHANGE_EXTERN_OW'
            EXPORTING
              objnr                     = iv_guid
              user_status          = lc_status_closed
           EXCEPTIONS
             object_not_found          = 1
             status_inconsistent       = 2
             status_not_allowed       = 3
             OTHERS                        = 4.
        IF sy-subrc <> 0.
          WRITE :  'Error at maintaining status'.
        ENDIF.
    Set reason code
    build lt_subject
        ls_subject-ref_guid = iv_guid.
        ls_subject-katalogart = 'A2'.
        ls_subject-codegruppe = 'ZR000003'.
        ls_subject-code       = 'ZR33'.                      " Reason code
        ls_subject-mode       = 'A'.
        APPEND ls_subject TO lt_subject.
    build lt_ossset
        ls_osset-ref_guid        = iv_guid.
        ls_osset-subject_profile = 'ZREASON03'.
        ls_osset-profile_type    = 'G'.
        ls_osset-subject         = lt_subject.
        APPEND ls_osset TO lt_osset.
    build lt_service_os
        ls_service_os-ref_guid  = iv_guid.
        ls_service_os-ref_kind  = 'A'.
        ls_service_os-osset     = lt_osset.
        APPEND ls_service_os TO lt_service_os.
    build lt_input_fields
        REFRESH: lt_input_fields, lt_field_names.
        CLEAR  : ls_input_fields, ls_field_names.
        ls_field_names-fieldname    = 'CODE'.
        APPEND ls_field_names TO lt_field_names.
        ls_field_names-fieldname    = 'CODEGRUPPE'.
        APPEND ls_field_names TO lt_field_names.
        ls_field_names-fieldname    = 'KATALOGART'.
        APPEND ls_field_names TO lt_field_names.
        ls_field_names-fieldname    = 'SERVICE_PROFILE'.
        APPEND ls_field_names TO lt_field_names.
        ls_input_fields-ref_guid    = iv_guid.
        ls_input_fields-ref_kind    = 'A'.
        ls_input_fields-objectname  = 'SERVICE_OS'.
        ls_input_fields-field_names = lt_field_names.
        APPEND ls_input_fields TO lt_input_fields.
         CALL FUNCTION 'CRM_ORDER_MAINTAIN'
          EXPORTING
            it_service_os     = lt_service_os
          CHANGING
            ct_input_fields   = lt_input_fields
          EXCEPTIONS
            error_occurred    = 1
            document_locked   = 2
            no_change_allowed = 3
            no_authority      = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
          WRITE :  'Error at maintaining reason'.
        ENDIF.
        CALL FUNCTION 'CRM_ORDER_SAVE'
          EXPORTING
            it_objects_to_save   = lt_header_guid
            iv_update_task_local = lv_update_task_local
          IMPORTING
            et_saved_objects     = lt_saved_objects
          EXCEPTIONS
            document_not_saved   = 1
            OTHERS               = 2.
        IF sy-subrc <> 0.
          WRITE : 'Error at saving'.
        ELSE.
          WRITE : 'Successfully Closed'.
          COMMIT WORK AND WAIT.
        ENDIF.
    Run time error is coming at COMMIT WORK AND WAIT statement.
    Please let me know any corrections are required in the above program.
    When I analyzed the run time error I have found that it trying to insert the record in CRMD_SRV_OSSET for that CRM order, but already one record is present in the table for the same CRM order number.
    For most of the CRM orders there is no entry in this table so they are closing successfully but for a few orders for which there is an entry we are getting the above run time error.
    There is nothing wrong with the orders which have an entry already in the table CRMD_SRV_OSSET, I need to close these kind of orders with out run time error.
    Kindly provide your feedback.

    Hi Dinakar,
    You posted this in APO PPDS forum. This question should go to PP forum where someone could answer it.
    Please close this thread and open a new thread in PP forum so that you could get help quickly from the relevant experts.
    Regards - Pawan

  • Error in Action when CRM Order is updated as Error from R/3 update

    Hi,
    Currently we are in CRM 6.0 SP04 and R/3 4.7 SP14
    Process:
    1) B2B user places order through ISA
    2) Order gets replicated R/3 from CRM through middleware (Scenario A setting)
    3) If there are any changes in order on either side, changes gets replicated.
    Requirement:
    We have a requirement from business to trigger workflow in CRM if order is in error. Following are the possible scenarios
    1) Error while saving order in CRM
    2) No errors in CRM. However, Order will get error in R/3 because of inconsistent configuration or master data between CRM and R/3. The BDOC will be green while replicating to R/3 and acknowledgement to CRM.
    3) BDOC status is in error
    Solution approach:
    We created an action to trigger event when order status set to "Contains error". The condition for Action trigger are Order have error free flag NE X(BUS 2000115 )  OR Status = I1030 OR status = I1056.
    Issues:
    1)     Scenario : Order is successfully create in CRM without any error. Order gets replicated to R/3 u2013 BDOC is green. However, the order gets error status in R/3 because of inconsistent configuration or master data. The acknowledgement BDOC updates the error status in CRM. However, Action does not get trigger when the order is updated as Error from R/3.
    Pls advise possible solution and also suggest any other way to achieve the required functionality to generate workflow for CRM order updated as Error from R/3.
    Regards,
    Anil Rithe

    Hi Anil,
    Try this, implement ORDER_SAVE BAdI.  This BAdI is triggered every time an order is saved, you could put in your logic to see if the order has errors, if yes trigger your workflow.
    I haven't tested but this should work for your case when the crm order is set to error status after the replication to R/3(the BDOC scenario).
    This may not be the most efficient method of doing, but this would definitely work.
    Make sure you use proper checks at the beginning  of your order_save BAdI implementation as this badi would get executed on save of every 1-order object.
    ~Kiran

  • How can we process the CRM Order again for second time in debugging mode

    Hi,
    Can anybody please tell me how can we process the CRM ORDER for second time.  that I want to process in debugging mode.
    Thanks,
    bsv

    Hi bsv,
    Are you trying to reprocess a BDOC for debugging purpose?
    If the BDOC is not with a final status, you will be able to reprocess it using the reprocess button in the smw01 search result list.
    And you may put /h on the popup when you click on the 'reprocess' button.
    If it is allowed to make some changes in the CRM ORDER for testin purpose, it would be easier to perform debugging.
    A more 'careless' way is to deactivate the outbound or inbound queue in transaction smqs or smqr, then in smq1 or smq2 to locate the interested queue, and click on button 'debug LUW'.
    Hongyan

  • Custom Sales Order Status

    Hi gurus,
    My client has a requirement to create custom order statuses.
    Currenlty std SAP provides with only a few statusses which doesnt give enuf visibility to the Sales Representatives abt which stage the Order is:
    Open (When SO is created & delv is not yet being created)
    Being Processed (when a Delivery Document for a few items is created)
    Completed (When Delivery Document is created for all the items)
    Now the Sales Representative wants to see statuses which would show at which stage the item fulfillement is, in case of a MTO item.
    Thus a rought estimate of the order statuses that are expected at sales order level are:
    Open
    Productiom order released
    Production order confirmed
    Being processed (when a Delivery Document for a few items is created)
    Delivery created (When Delivery for all items relevant for delivery is created)
    Shipped(PGI is done )
    Can anyone explain me step by step how to acheive this ?
    I have gone thru thread for User Status Profiles. However I am unable to know how to make use of it for my scenario, which includes displaying the update of succeding document Transaction (eg Production Order/Delivery Doc. Transactions) in Sales order.
    This is due to the fact that we are using SAP CRM for our front end which has visibility only to a Sales Order.
    ( Also this configuration has to be done in ECC as CRM will only download it -- in case someone suggests to do it in CRM )
    Thanks in Advance
    Vinit

    Hi Vinit
    Can you please explain as to how did you achieve this?

  • How to obtain GUID of a CRM Order Object

    Hello, I want to retrieve an external reference number of a CRM Order. First I should obtain the GUID of a CRM Order Object(component type CRMT_OBJECT_GUID). My problem is, which FM should I use?
    Thanks.

    Hello sasi,
    thanx for your help, with which I go a step further. What I need is to obtain a service order GUID(at last the external reference number) according to a notification number in SAP Support Desk. In CRM_JCDS, CRM_JEST I got a lot of infos but not the notification number, so that I could not establish a relationship between them. And I'm not quite clear what you mean by FM STATUS_TEXT_EDIT(why I should edit the status text)? Can you explain more?
    Greetings.
    Nuno.

  • CRM orders and Confirmations

    Hello Guys,
    I need some clear understanding about the reporting on CRM Orders and Confirmations cube. I guess I am a bit confused now.
    In the scenario that we have, there are service orders created and when the work on the order is done, confirmation is created. We need reporting on whether the order was completed on time based on SLA.
    But the problem is that the status on the service order is not always set to completed when a confirmation is made and there is a custom defined "User Status" that is set. So how do I look at the information on Confirmations as to when it was done, and relate it to the service order?
    There is a BC report of "Delayed Orders" but I am not sure how an order is determined to be delayed? If anyone has worked on this, Please share the information. I am thoroughly confused.
    Doniv

    Hi
    well, the regular extractor does bring some statuses, so I would verify that first.
    we extract both Header and Line statuses but there is a logic on the CRM side that makes sure that when the call is closed on the header it is also closes all the lines.
    but if a line was closed it does not affect the header status.
    here is an example of how we enhanced our extractor - 0crm_srv_process_i:
    Pick up SP line's system status, get only the largest stat code
    in the range if there are multiple sys stats
    the wanted stats are Open, In Process, Released, Completed
       SELECT stat
       INTO l_struct-zzsys_status
       FROM crmv_index_jest
       WHERE item = l_struct-item_guid
       AND inact <> 'X'
       AND stat in ('I1002','I1003','I1004','I1005')
       ORDER BY stat DESCENDING.
         EXIT.
       ENDSELECT.
    Reg's
    Edan

  • Sale Order Status Report

    Dear Expert.
    I want Sales Order Status report as below mentioned format required quarry base report from Date to To Date.
    Location-OrderSeries-OrderNo-CardCode-CardName-ItemCode-Item Descripotion-Inv.UOM-Order Qty-Allocated Qty-DeliverQty-Peniding Qty adn Pending Order Value.

    Hi,
    You can check this :
    select t3.location as 'Location',t0.series as 'Order Series',
    t0.docnum as 'Order No.',t0.cardcode as 'Business Partner Code',
    t0.cardname as 'Business Partner Name', t1.itemcode as 'Item',
    t1.dscription as 'Item Name', t2.invntryUom as 'Inventory UoM',t1.quantity as 'Order Qty',
    t1.QtyToship as 'Allocated Qty- Qty to Ship', t1.delivrdQty as 'Delivered Qty',
    t1.OrderedQty as 'Ordered Qty', t1.openCreQty as 'Pending Qty',
    t1.Opensum as 'Pending Order Row Value'
    from ORDR t0 inner join RDR1 t1 on t1.docentry = t0.docentry
    inner join OITM t2 on t2.itemcode = t1.itemcode
    inner join OLCT t3 on t3.code = t1.loccode
    where t0.docdate >= '2011.01.01' and t0.docdate <= '2011.12.31'
    Hope it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Sale Order Status Change after delivery of materials from projects

    have ETO sccenario which consists of all modules such as SD,PS.PP etc. Materials will be procured from external vendors & manufactured inhouse through project systems. After delivery of materials from project systems, billing & invoicing will be done at sales level.
    On delivery of materials from projects, sale order status remain open. Request you to look into the matter & suggest about status change of sale order after delivery / billing.
    Regards,
    Ranjan

    Hi,
    In sale order, WBSE is assigned. Delivery of materials are through cns0. then subsequently picking / packing / billing will happen at sales level. Billing is of delivery related. Please suggest to fix the issue.
    Thanks & Regards,
    Biplab Ranjan

Maybe you are looking for