Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3193

Re: Dispute Management Export Parameter SCMG_ATTR_RETURN_VALUE

$
0
0

Hi Vinny,

 

Sorry it has been some years since I've been into this code; I can't remember what resolved the issue and it was never documented as it should have been; we were seriously resource challenged at the time.  If I had to guess, I would say that we were likely not setting the ch_is_valid parameter.  here's the code from our BAdI; hope it helps. 

 

METHOD if_ex_scmg_vldt_bfr_str_c~validate.

 

 

*&---------------------------------------------------------------------*

*& Implementation Name        : ZSCMG_VLDT_BFR_STR_C

*& Implementation Short Text  : QSI: Custom Validations before saving in F_DM

*& Definition name            : SCMG_VLDT_BFR_STR_C

*& Interface name             : IF_EX_SCMG_VLDT_BFR_STR_C

*& Name of implementing class : ZCL_IM_SCMG_VLDT_BFR_STR_C

*&

*&---------------------------------------------------------------------*

*& Description: This method is validate the Reason (field REASON_CODE) and

*               Case Type (field CASE_TITLE) during the change process; all

*               other QSI custom validation have already occured prior to

*               this BAdI call

*

* Available parameters:

* IM_CASE      Importing   Type Ref To IF_SCMG_CASE          "Case Interface

* FLT_VAL      Importing   Type SCMGPROCESS                 "Supported Process

* CH_IS_VALID  Changing    Type SRMBOOLEAN                   "Boolean: Possible Values IF_SRM=>TRUE / FALSE

* CH_MESSAGES  Changing    Type SCMG_T_ATTR_RETURN_VALUE     "Case Attributes: Value with Message for Feedback

*======================================================================*

*  M O D I F I C A T I O N  L O G 146

*

*  Date      Issue No.  Transport   Person          Changes

*  --------  ---------- ----------  --------------- --------------------

*  03/18/13  148314     DE0K907128  mhammond        Initial implementation

*  04/03/13  148314     DE0K907586  mhammond        Add validation of field CASE_TITLE

*  10/21/13  173416     DE0K909696  sarveti         new workflow

*======================================================================*

 

 

* local structures

  DATA: ls_messages   TYPE scmg_attr_return_value,

        ls_tvarvc     TYPE tvarvc,

        ls_reason_txt TYPE scmgattr_reasont,

        ls_dm         TYPE zzf_dm_validate.                 "ticket 173416

 

 

* local variables

  DATA: lv_srmadid       TYPE srmadid,

        lv_attr_value    TYPE string,

        lv_reason        TYPE scmg_reason_code,

        lv_case_title    TYPE scmg_case_title,

        lv_case_title_db TYPE scmg_case_title,

        lv_fld_name      TYPE rvari_vnam,

        lv_reason_txt    TYPE text80.

 

 

* local reference variables

  DATA: lv_attribute  TYPE REF TO if_srm_edit_attribute_value.

 

 

 

 

* check that this is a F_DM action

  CHECK flt_val = 'F_DM'.

 

 

* first check the Case Type - get the current value

  CLEAR: lv_srmadid, lv_attr_value.

  MOVE 'CASE_TITLE' TO lv_srmadid.

 

 

  CALL METHOD im_case->get_single_attribute_value

    EXPORTING

      im_srmadid = lv_srmadid

    RECEIVING

      re_value   = lv_attr_value.

 

 

  MOVE lv_attr_value TO lv_case_title.

 

 

* check that the case type is valid in z table

  SELECT SINGLE zz_f_dm_case_ty

    FROM zzf_dm_casety

    INTO lv_case_title_db

    WHERE zz_f_dm_case_ty = lv_case_title.

 

 

  IF sy-subrc <> 0.

* get the attribute required for the error messaging...

    CLEAR lv_attribute.

 

 

    CALL METHOD im_case->get_single_attribute

      EXPORTING

        im_srmadid      = lv_srmadid

      RECEIVING

        re_value_object = lv_attribute.

 

 

    MOVE: lv_attribute  TO ls_messages-attr_value,

          'E'           TO ls_messages-type,

          'ZZ_FDM'      TO ls_messages-id,

          '001'         TO ls_messages-number,

          lv_case_title TO ls_messages-message_v1,

          'Case Type'   TO ls_messages-message_v2.

 

 

    APPEND ls_messages TO ch_messages.

    CLEAR ls_messages.

    ch_is_valid = if_srm=>false.

 

 

  ENDIF.

 

 

* validate the reason code

  CLEAR: lv_srmadid, lv_attr_value.

  MOVE 'REASON_CODE' TO lv_srmadid.

 

 

  CALL METHOD im_case->get_single_attribute_value

    EXPORTING

      im_srmadid = lv_srmadid

    RECEIVING

      re_value   = lv_attr_value.

 

 

  MOVE lv_attr_value TO lv_reason.

 

 

 

 

* Start of Insert 173416

* validate the Reason code

  CLEAR ls_dm.

  SELECT SINGLE *

     FROM zzf_dm_validate

     INTO ls_dm

     WHERE case_type = lv_case_title

     AND reason_code = lv_reason.

*    End of Insert 173416

 

 

* Start of Delete 173416

** ensure that the reason code is valid for the case type (confusingly stored in field CASE_TITLE)

*    CONCATENATE 'ZFDM' lv_case_title 'RC' INTO lv_fld_name SEPARATED BY '_'.

*    CONDENSE lv_fld_name NO-GAPS.

*    TRANSLATE lv_fld_name TO UPPER CASE.

*

*    SELECT SINGLE *

*      FROM tvarvc

*      INTO ls_tvarvc

*      WHERE name = lv_fld_name

*        AND low  = lv_reason.

 

 

* End of Delete 173416

 

 

  IF sy-subrc <> 0.

 

 

* get the attribute required for the error messaging...

    CLEAR: lv_srmadid, lv_attribute.

    MOVE 'REASON_CODE' TO lv_srmadid.

 

 

    CALL METHOD im_case->get_single_attribute

      EXPORTING

        im_srmadid      = lv_srmadid

      RECEIVING

        re_value_object = lv_attribute.

 

 

* get the reason code text...

    SELECT SINGLE *

      FROM scmgattr_reasont

      INTO ls_reason_txt

      WHERE langu = sy-langu

        AND case_type = flt_val

        AND reason_code = lv_reason.

 

 

* format the message...

    IF sy-subrc = 0.

      CONCATENATE '(' ls_reason_txt-description ')' INTO lv_reason_txt.

      CONCATENATE lv_reason lv_reason_txt INTO lv_reason_txt SEPARATED BY space.

    ELSE.

      SELECT SINGLE *

        FROM scmgattr_reasont

        INTO ls_reason_txt

        WHERE langu = 'E'

          AND case_type = flt_val

          AND reason_code = lv_reason.

      IF sy-subrc = 0.

        CONCATENATE '(' ls_reason_txt-description ')' INTO lv_reason_txt.

        CONCATENATE lv_reason lv_reason_txt INTO lv_reason_txt SEPARATED BY space.

      ELSE.

        MOVE lv_reason TO lv_reason_txt.

      ENDIF.

    ENDIF.

 

 

    MOVE: lv_attribute  TO ls_messages-attr_value,

          'E'           TO ls_messages-type,

          'ZZ_FDM'      TO ls_messages-id,

          '003'         TO ls_messages-number,

          lv_reason_txt TO ls_messages-message_v1,

          'Reason Code' TO ls_messages-message_v2,

          lv_case_title TO ls_messages-message_v3.

 

 

    APPEND ls_messages TO ch_messages.

    CLEAR ls_messages.

    ch_is_valid = if_srm=>false.

 

 

  ENDIF.

 

 

ENDMETHOD.


Viewing all articles
Browse latest Browse all 3193

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>