cancel
Showing results for 
Search instead for 
Did you mean: 

ET_SERVICE_I fields not getting updated using CRM_ORDER_MAINTAIN

Former Member
0 Kudos

Hi Experts,

I am working on data migration program to upload service requests using crm_order_maintain. The issue with IT_SERVICE_I fileds not getting updated. All the remaining parameters like it_appointment, it_service_h, it_orgman, it_partner... Only the fields of IT_SERVICE_I are not updating. Am able to see the values in debugging for the fields.

I tried in many ways by passing Object Guid and Item Guid for ref_guid field of it_service_i. But still the fields are not getting updated. I am not sure what am missing. Please find below my code.

Please suggest.

CALL FUNCTION 'GUID_CREATE'

       IMPORTING

         ev_guid_16 = lv_item_guid.

     CLEAR gt_service_i.

*    gs_service_i-ref_handle = '0000000001'.

     gs_service_i-ref_guid = lv_item_guid.

     gs_service_h-ref_kind = 'B'.

     gs_service_i-zzafld0000XX = <fs_excel_data>-XX.

     gs_service_i-zzafld0000YY = <fs_excel_data>-YY

     gs_service_i-zzafld0000ZZ = <fs_excel_data>-ZZ.

  

     APPEND gs_service_i TO gt_service_i.

     CLEAR gs_service_i.

*** Input fields for IT_SERVICE_I

*    gs_input_fields-ref_handle = '0000000001'.

     gs_input_fields-ref_guid lv_item_guid.

*    READ TABLE lt_obj_guid INTO  gs_service_i-ref_guid INDEX 1.

     gs_input_fields-ref_kind = 'B'.

     gs_input_fields-objectname = 'SERVICE_I'.

     gs_field_line-fieldname = 'ZZAFLD0000XX'.

     INSERT gs_field_line INTO TABLE gs_input_fields-field_names.

     gs_field_line-fieldname = 'ZZAFLD0000YY'.

     INSERT gs_field_line INTO TABLE gs_input_fields-field_names.

     gs_field_line-fieldname = 'ZZAFLD0000ZZ'.

     INSERT gs_field_line INTO TABLE gs_input_fields-field_names.

   

     INSERT gs_input_fields INTO TABLE gt_input_fields.


CALL FUNCTION 'CRM_ORDER_MAINTAIN'

       EXPORTING

         it_appointment    = lt_appointment

         it_orgman         = lt_orgman

         it_ext_ref        = lt_ext_ref

         it_partner        = lt_partner

         it_text           = lt_text

         it_activity_h     = lt_activity_h

         it_status         = lt_status

         it_srv_req_h      = lt_srvreq_h

         it_service_h      = lt_service_h

         it_service_i      = lt_service_i

       CHANGING

         ct_orderadm_h     = ct_ordradm_h2

         ct_input_fields   = ct_input_fields

         ct_doc_flow       = ct_docflow

       EXCEPTIONS

         error_occurred    = 1

         document_locked   = 2

         no_change_allowed = 3

         no_authority      = 4

         OTHERS            = 5.


Thanks & Regards,

Varma

Accepted Solutions (0)

Answers (3)

Answers (3)

binson
Advisor
Advisor
0 Kudos

Hello Varma,

Were you able to resolve this issue? I am facing the same issue now.

If you could solve the issue, could you please share the solution?

Regards,

Binson

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

Try to maintain the data in webui and keep debugger in CRM_ORDER_MAINTAIN and check what values are passed into the table input_fields and SERVICE_I then pass those fields and values in code and try.

Regards,

Deepika.

Former Member
0 Kudos

Hi Deepika,

I have checked what values are passing to it_service_i and input_fileds while creating from web ui, and maintained same values. Ref_guid as item guid (checked with object_guid as well), ref_kind as B (checked with A as well) and the field names. Tried by calling order maintain twice for service_i.

While uploading from excel, in debugging i can see same values what it is passing from web ui. But still those fileds are not updating.

Thanks & Regards,

Varma

dharmakasi
Active Contributor
0 Kudos

Hi Varma,

Are you creating item in your program, there is no item details passed to changing paramters of order_maintain FM? You have to create item first and then update service_i.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

       EXPORTING

         it_appointment    = lt_appointment

         it_orgman         = lt_orgman

         it_ext_ref        = lt_ext_ref

         it_partner        = lt_partner

         it_text           = lt_text

         it_activity_h     = lt_activity_h

         it_status         = lt_status

         it_srv_req_h      = lt_srvreq_h

         it_service_h      = lt_service_h

         it_service_i      = lt_service_i

      CHANGING

         ct_orderadm_h     = ct_ordradm_h2

         ct_input_fields   = ct_input_fields

         ct_doc_flow       = ct_docflow

       EXCEPTIONS

         error_occurred    = 1

         document_locked   = 2

         no_change_allowed = 3

         no_authority      = 4

         OTHERS            = 5.

Best Regards,

Dharmakasi.

dharmakasi
Active Contributor
0 Kudos

Hi Varma,

Try updating et_service_I using separate order maintain after the main order maintaian.

In general we have to update always sale_I and service_I after item creation using a separate order maintain function module.

Best Regards,

Dharmakasi

Former Member
0 Kudos

Hi Dharmakasi,

I tried using separate order maintain for service_i.. But still facing the same issue.

Thanks & Regards,

Varma

faisal_pc
Active Contributor
0 Kudos

Hi Varma,

Try with ref_kind = 'A' (Not for header and item place. For create and change we use A and B. I believe you are creating.).

Thanks,

Faisal

Former Member
0 Kudos

Hi Faisal,

I tried with ref_kind = 'A' for service_i, but no change.

Thanks & regards,

Varma

dharmakasi
Active Contributor
0 Kudos

Hi Varma,

You are not creating item itself? Then how system will update service_I entries..

If you are updating existing document items you have to pass item guid into ref_guide field..

Best Regards

Dharmakasi.