Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CL_ALV_CHANGED_DATA_PROTOCOL Popup not complete

0 Likes
1,955

Hi Guys,

I have a problem during the visualization of the Error Popup Message using the CL_ALV_CHANGED_DATA_PROTOCOL class.

I linked it to an ALV Grid, and try to use this class to display the protocol results, but when I call the method Display_Protocol I can see all messages (with Icon and Description), the only thing missing is the information of the "Column Description": the column (of the original ALV Grid) that gives the error.

The funny thing is that double-clicking one row of the popup the corresponding cell of the ALV is selected, so I think that the link is ok, but I cannot understand why it doesn't display the "name of the column" in the popup.

Everything works well If I use this class catching the event DATA_CHANGED, so I think that the problem should be on HOW I create the istance (because of catching the event I receive the object yet bounded), but I create it with the same values of the one I would get inside the event... that's why I don't understand why it doesn't work.

Do you know if it is a problem related to the class or if it works well?

Tanks,

Claudio

PS: I post below the code of the procedure that create the object, I trust you

In this code the object go_Error is declared "Type Ref To CL_ALV_CHANGED_DATA_PROTOCOL." in a global include.


form CHECK_ALV_0200_0110 Changing pc_Error Type Char01.
 
  Data: lt_MatchK1 Type tp_Matches1_Key_t,
        l_Message  Type Char100,
        l_MessX    Type String,
        l_QtaRes   Type ZDM_AMT_ASSIGNED,
        l_QtaAcc   Type ZDM_AMT_ACCRUED,
        l_QtaStep  Type ZDM_AMT_ASSIGNED.
 
  Field-Symbols: <fs_Table>    Type Standard Table,
                 <fs_Master>   Type Standard Table,
                 <fs_Mod_Cell> Type LVC_S_MODI,
                 <fs_Line>     Type Any,
                 <fs_Field>    Type Any,
                 <fs_Any>      Type Any.
 
 
  Data lt_Matches_Alv_Mod Type tp_Matches1_Alv_t.
  Data ls_Modi Type LVC_S_MODI.
  Data: l_Row_ID Type I,
        l_Tabix  Type I.
 
  Field-Symbols: <fs_Match_ALV> Type tp_Matches1_Alv_s.
 
  Free go_Error.
 
  CREATE OBJECT go_Error
    EXPORTING
*      i_container =
      i_calling_alv = go_0200_Alv
      .
 
* Validation Checks
  Clear pc_Error.
  Clear ls_Modi.
  Loop At gt_Matches1_Alv Assigning <fs_Match_ALV>.
    l_Tabix = Sy-Tabix.
    Check <fs_Match_ALV>-Status Eq con_Status_Temp.
 
*   Set the Modified Row for the CL_ALV_CHANGED_DATA_PROTOCOL object
      Append <fs_Match_ALV> To lt_Matches_Alv_Mod.
      Add 1 To ls_Modi-Row_Id.
      ls_Modi-FieldName = 'AMT_DEDUCTED'.
      Write <fs_Match_ALV>-Amt_Deducted To ls_Modi-Value Currency <fs_Match_ALV>-Waers.
      Condense ls_Modi-Value No-Gaps.
      ls_Modi-Tabix = l_Tabix.
      Append ls_Modi To: go_Error->mt_Mod_Cells,
                         go_Error->mt_Good_Cells.
      l_Row_ID = ls_Modi-Row_Id.
*   -----------------------------------------------------------------
 
    Clear l_Message.
 
    If <fs_Match_ALV>-Amt_Deducted Eq 0.
      pc_Error = con_X.
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '005'
*          i_msgv1     =
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
      Continue.
    EndIf.

    Perform Get_ResQtaDispute1 Using lt_MatchK1
                                     <fs_Match_ALV>
                               Changing l_QtaRes.
    Perform Get_ResQtaAccrued1 Using <fs_Match_ALV>
                               Changing l_QtaAcc.
 
    Add <fs_Match_ALV>-Amt_Deducted To l_QtaStep.
 
    If l_QtaStep > l_QtaRes.
*     Store the Error
      pc_Error = con_X.
      Write l_QtaRes To l_Message Currency <fs_Match_ALV>-Waers.
 
      Condense l_Message No-Gaps.
 
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '002'
          i_msgv1     = l_Message
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
    EndIf.
 
    If l_QtaStep > l_QtaAcc.
*     Store the Error
      pc_Error = con_X.
      Write l_QtaAcc To l_Message Currency <fs_Match_ALV>-Waers.
 
      Condense l_Message No-Gaps.
 
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '002'
          i_msgv1     = l_Message
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
    EndIf.
  EndLoop.
 
  If pc_Error Eq con_X.
*   If there was at least one error, Display the Popup
    go_Error->mt_FieldCatalog[]   = gt_0200_FCat[].
    go_Error->ms_Layout-Zebra     = con_X.
    Get Reference Of lt_Matches_Alv_Mod[] Into go_Error->Mp_Mod_Rows.
 
    CALL METHOD go_error->display_protocol
*      EXPORTING
*        i_container        =
*        i_display_toolbar  =
*        i_optimize_columns =
        .
 
  EndIf.
EndForm.

Hi Guys,

I have a problem during the visualization of the Error Popup Message using the CL_ALV_CHANGED_DATA_PROTOCOL class.

I linked it to an ALV Grid, and try to use this class to display the protocol results, but when I call the method Display_Protocol I can see all messages (with Icon and Description), the only thing missing is the information of the "Column Description": the column (of the original ALV Grid) that gives the error.

The funny thing is that double-clicking one row of the popup the corresponding cell of the ALV is selected, so I think that the link is ok, but I cannot understand why it doesn't display the "name of the column" in the popup.

Everything works well If I use this class catching the event DATA_CHANGED, so I think that the problem should be on HOW I create the istance (because of catching the event I receive the object yet bounded), but I create it with the same values of the one I would get inside the event... that's why I don't understand why it doesn't work.

Do you know if it is a problem related to the class or if it works well?

Tanks,

Claudio

PS: I post below the code of the procedure that create the object, I trust you

In this code the object go_Error is declared "Type Ref To CL_ALV_CHANGED_DATA_PROTOCOL." in a global include.


form CHECK_ALV_0200_0110 Changing pc_Error Type Char01.
 
  Data: lt_MatchK1 Type tp_Matches1_Key_t,
        l_Message  Type Char100,
        l_MessX    Type String,
        l_QtaRes   Type ZDM_AMT_ASSIGNED,
        l_QtaAcc   Type ZDM_AMT_ACCRUED,
        l_QtaStep  Type ZDM_AMT_ASSIGNED.
 
  Field-Symbols: <fs_Table>    Type Standard Table,
                 <fs_Master>   Type Standard Table,
                 <fs_Mod_Cell> Type LVC_S_MODI,
                 <fs_Line>     Type Any,
                 <fs_Field>    Type Any,
                 <fs_Any>      Type Any.
 
 
  Data lt_Matches_Alv_Mod Type tp_Matches1_Alv_t.
  Data ls_Modi Type LVC_S_MODI.
  Data: l_Row_ID Type I,
        l_Tabix  Type I.
 
  Field-Symbols: <fs_Match_ALV> Type tp_Matches1_Alv_s.
 
  Free go_Error.
 
  CREATE OBJECT go_Error
    EXPORTING
*      i_container =
      i_calling_alv = go_0200_Alv
      .
 
* Validation Checks
  Clear pc_Error.
  Clear ls_Modi.
  Loop At gt_Matches1_Alv Assigning <fs_Match_ALV>.
    l_Tabix = Sy-Tabix.
    Check <fs_Match_ALV>-Status Eq con_Status_Temp.
 
*   Set the Modified Row for the CL_ALV_CHANGED_DATA_PROTOCOL object
      Append <fs_Match_ALV> To lt_Matches_Alv_Mod.
      Add 1 To ls_Modi-Row_Id.
      ls_Modi-FieldName = 'AMT_DEDUCTED'.
      Write <fs_Match_ALV>-Amt_Deducted To ls_Modi-Value Currency <fs_Match_ALV>-Waers.
      Condense ls_Modi-Value No-Gaps.
      ls_Modi-Tabix = l_Tabix.
      Append ls_Modi To: go_Error->mt_Mod_Cells,
                         go_Error->mt_Good_Cells.
      l_Row_ID = ls_Modi-Row_Id.
*   -----------------------------------------------------------------
 
    Clear l_Message.
 
    If <fs_Match_ALV>-Amt_Deducted Eq 0.
      pc_Error = con_X.
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '005'
*          i_msgv1     =
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
      Continue.
    EndIf.

    Perform Get_ResQtaDispute1 Using lt_MatchK1
                                     <fs_Match_ALV>
                               Changing l_QtaRes.
    Perform Get_ResQtaAccrued1 Using <fs_Match_ALV>
                               Changing l_QtaAcc.
 
    Add <fs_Match_ALV>-Amt_Deducted To l_QtaStep.
 
    If l_QtaStep > l_QtaRes.
*     Store the Error
      pc_Error = con_X.
      Write l_QtaRes To l_Message Currency <fs_Match_ALV>-Waers.
 
      Condense l_Message No-Gaps.
 
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '002'
          i_msgv1     = l_Message
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
    EndIf.
 
    If l_QtaStep > l_QtaAcc.
*     Store the Error
      pc_Error = con_X.
      Write l_QtaAcc To l_Message Currency <fs_Match_ALV>-Waers.
 
      Condense l_Message No-Gaps.
 
      CALL METHOD go_Error->Add_Protocol_Entry
        EXPORTING
          i_msgid     = 'ZDMV'
          i_msgty     = 'E'
          i_msgno     = '002'
          i_msgv1     = l_Message
*          i_msgv2     =
*          i_msgv3     =
*          i_msgv4     =
          i_fieldname = 'AMT_DEDUCTED'
          i_row_id    = l_Row_ID
*          i_tabix     =
          .
    EndIf.
  EndLoop.
 
  If pc_Error Eq con_X.
*   If there was at least one error, Display the Popup
    go_Error->mt_FieldCatalog[]   = gt_0200_FCat[].
    go_Error->ms_Layout-Zebra     = con_X.
    Get Reference Of lt_Matches_Alv_Mod[] Into go_Error->Mp_Mod_Rows.
 
    CALL METHOD go_error->display_protocol
*      EXPORTING
*        i_container        =
*        i_display_toolbar  =
*        i_optimize_columns =
        .
 
  EndIf.
EndForm.

4 REPLIES 4
Read only

Former Member
0 Likes
1,347

i am doubtful on the field AMT_DEDUCTED , how you populated the fieldcatalog for this field. Check the field any label's maintained for that reference field data element.

Read only

0 Likes
1,347

Hi,

the field AMT_DEDUCTED is a part of one Structure created in DDIC, I did the field catalog calling the FM "LVC_FIELDCATALOG_MERGE" and giving it the name of the structure, but I think it's ok because of the ALV Grid is displayed correctly and resizing the field I see the 3 text defined (according to its dimension).

Thank you for your reply,

Claudio

Read only

0 Likes
1,347

is it correct name. any mistake in the name mentioned.

Edited by: Vijay Babu Dudla on Nov 3, 2008 10:00 AM

Read only

0 Likes
1,347

Hi, the fieldcatalog for this field is filled as follw:


ROW_POS	0
COL_POS	11
FIELDNAME	AMT_DEDUCTED
TABNAME	1
CURRENCY	
CFIELDNAME	WAERS
QUANTITY	
QFIELDNAME	
IFIELDNAME	
ROUND	0
EXPONENT	
KEY	
KEY_SEL	
ICON	
SYMBOL	
CHECKBOX	
JUST	
LZERO	
NO_SIGN	
NO_ZERO	
NO_CONVEXT	
EDIT_MASK	
EMPHASIZE	
FIX_COLUMN	
DO_SUM	
NO_SUM	
NO_OUT	
TECH	
OUTPUTLEN	0
CONVEXIT	
SELTEXT	
TOOLTIP	
ROLLNAME	
DATATYPE	CURR
INTTYPE	P
INTLEN	15
LOWERCASE	
REPTEXT	Amount Assigned
HIER_LEVEL	0
REPREP	
DOMNAME	WERTV8
SP_GROUP	
HOTSPOT	
DFIELDNAME	
COL_ID	0
F4AVAILABL	
AUTO_VALUE	
CHECKTABLE	
VALEXI	
WEB_FIELD	
HREF_HNDL	0
STYLE	0
STYLE2	0
STYLE3	0
STYLE4	0
DRDN_HNDL	0
DRDN_FIELD	
NO_MERGING	
H_FTYPE	
COL_OPT	
NO_INIT_CH	
DRDN_ALIAS	
REF_FIELD	
REF_TABLE	ZDM_DMV_MATCH_1_ALV
TXT_FIELD	
ROUNDFIELD	
DECIMALS_O	
DECMLFIELD	
DD_OUTLEN	21
DECIMALS	2
COLTEXT	
SCRTEXT_L	Amount Assigned
SCRTEXT_M	Amount Assigned
SCRTEXT_S	Amt. Ass.
COLDDICTXT	
SELDDICTXT	
TIPDDICTXT	
EDIT	
TECH_COL	0
TECH_FORM	0
TECH_COMP	
HIER_CPOS	0
H_COL_KEY	
H_SELECT	
DD_ROLL	
DRAGDROPID	0
MAC	
INDX_FIELD	0
INDX_CFIEL	0
INDX_QFIEL	0
INDX_IFIEL	0
INDX_ROUND	0
INDX_DECML	0
GET_STYLE	
MARK	

and the texts are correctly valued in the SE11.

Thanks,

Claudio