cancel
Showing results for 
Search instead for 
Did you mean: 

Change request number as change request description

former_member314998
Participant
0 Kudos

Hi Experts,

      I have a requirement where Change request description should be change request number and automatically need to be filled up while creating change request.

   I need your valuable input for achieve the same.

Thanks in advance.

Samrat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Please refer

Answers (2)

Answers (2)

luisguereca
Explorer
0 Kudos

SAP MDG has a specific BADI USMD_CREQUEST_INTEGRATION Method GET_CREQUEST_ATTRIBUTES to change CR header values, you can update these values:

  • CR description
  • CR note
  • CR due date
  • CR reason
  • CR priority

You have available these values when you enter int he BADI (you can add a logic to get other values):

  • Data model
  • Entity
  • Edition
  • CR type
Former Member
0 Kudos

There are a couple of ways to do it:

  • Enhance the CR genil model. Go to transaction GENIL_MODEL_BROWSER. Then, create an enhancement for genil model CR. In the enhancement, use a new custom handler class. This custom handler class must be a child of the original handler class. In there, redefine the GET_ATTRIBUTES method to default the values as you like. Make sure you call the super method always before adding your own logic in the redefined method.
  • Enhance the CR Header feeder class GET_DATA method. In there, you can always check if the description is blank and if so set it to the change number field.
former_member314998
Participant
0 Kudos

Hi Abdullah ,

   I have created custom handler class and redefine the GET_ATTRIBUTES method but getting dump while assigning custom handler class in the root of the component CR in GENIL_MODEL_BROWSER.

Short Text

    Exception condition "NO_ACTIVE_DATA_MODEL" triggered

Please give your valuable input.

Thanks ,

Samrat

Former Member
0 Kudos

Which class did you inherit from?

former_member314998
Participant
0 Kudos

Hi Abdullah ,

   I have inherited from class CL_USMD_CR_GIL_ROOT and redefined the below method.

METHOD GET_ATTRIBUTES.

   DATA:

     ls_crequest_data    TYPE usmd_s_crequest,

     ls_attributes       TYPE bss_cril_root_attributes,

     lo_conv_som_gov_api TYPE REF TO if_usmd_conv_som_gov_api,

     lo_conv_error       TYPE REF TO cx_usmd_conv_som_gov_api,

     lo_gov_error        TYPE REF TO cx_usmd_gov_api,

     lo_gov_core_error   TYPE REF TO cx_usmd_gov_api_core_error.

   TRY.

       CALL METHOD me->get_conv_api_reference

         IMPORTING

           ro_conv_som_gov_api = lo_conv_som_gov_api.

     CATCH cx_usmd_conv_som_gov_api INTO lo_conv_error.

       RETURN.

   ENDTRY.

   CASE iv_cont_obj->get_name( ).

     WHEN 'CR_Root'.

       TRY.

           CALL METHOD lo_conv_som_gov_api->if_usmd_conv_som_gov_cr~get_crequest_attributes

             RECEIVING

               rs_crequest = ls_crequest_data.

         CATCH cx_usmd_gov_api_core_error INTO lo_gov_core_error.

           IF lo_gov_core_error IS BOUND.

             CALL METHOD lo_conv_som_gov_api->remove_messages_from_msg_cont

               EXPORTING

                 it_messages = lo_gov_core_error->mt_messages.

             .

           ENDIF.

           RETURN.

         CATCH cx_usmd_gov_api INTO lo_gov_error.

           IF lo_gov_error IS BOUND.

             CALL METHOD lo_conv_som_gov_api->remove_messages_from_msg_cont

               EXPORTING

                 it_messages = lo_gov_error->mt_messages.

             .

           ENDIF.

           RETURN.

       ENDTRY.

       ls_attributes-due_date      = ls_crequest_data-usmd_due_date.

       ls_attributes-priority      = ls_crequest_data-usmd_priority.

       ls_attributes-reason        = ls_crequest_data-usmd_reason.

       ls_attributes-reason_rej    = ls_crequest_data-usmd_reason_rej.

       ls_attributes-type          = ls_crequest_data-usmd_creq_type.

       ls_attributes-status        = ls_crequest_data-usmd_creq_status.

       ls_attributes-text          = lo_conv_som_gov_api->mv_crequest_id.

       ls_attributes-created_at    = ls_crequest_data-usmd_created_at.

       ls_attributes-created_by    = ls_crequest_data-usmd_created_by.

       ls_attributes-changed_at    = ls_crequest_data-usmd_changed_at.

       ls_attributes-changed_by    = ls_crequest_data-usmd_changed_by.

       ls_attributes-released_at   = ls_crequest_data-usmd_released_at.

       ls_attributes-released_by   = ls_crequest_data-usmd_released_by.

       ls_attributes-edition       = ls_crequest_data-usmd_edition.

       ls_attributes-replic_mode   = ls_crequest_data-usmd_replic_mode.

       ls_attributes-cr_id         = lo_conv_som_gov_api->mv_crequest_id.

       iv_cont_obj->set_attributes( ls_attributes ).

   ENDCASE.