ALV: Possible entries

SAP Tech Pro

SAP Technical Blog
Magzter [CPS] IN

ALV: Possible entries

ALV: Possible entries


report bcalv_f4 .
data: g_grid type ref to cl_gui_alv_grid.
data: gt_bad_cells type lvc_t_modi.
data: gt_fieldcat type lvc_t_fcat.
data: g_row_id type lvc_s_roid-row_id.
field-symbols:  type any.

*&---------------------------------------------------------------------*
*&      Form  f4_set
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_GRID        text
*      -->RT_FIELDCAT   text
*      -->RT_BAD_CELLS  text
*      -->R_ROW_ID      text
*      -->RS_OUTTAB     text
*----------------------------------------------------------------------*
form f4_set using r_grid type ref to cl_gui_alv_grid
                    rt_fieldcat type lvc_t_fcat
                    rt_bad_cells type lvc_t_modi
                    r_row_id type lvc_s_roid-row_id
                    rs_outtab.
  g_grid = r_grid.
  gt_fieldcat = rt_fieldcat.
  gt_bad_cells = rt_bad_cells.
  g_row_id     = r_row_id.
  assign rs_outtab to .

endform.                                                    "f4_set

*&---------------------------------------------------------------------*
*&      Form  f4_tree_set
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->RT_FIELDCAT  text
*      -->R_ROW_ID     text
*      -->RS_OUTTAB    text
*----------------------------------------------------------------------*
form f4_tree_set using rt_fieldcat type lvc_t_fcat
                    r_row_id type lvc_index
                    rs_outtab.
  gt_fieldcat = rt_fieldcat.
  g_row_id     = r_row_id.
  assign rs_outtab to .

endform.                    "f4_tree_set

*&---------------------------------------------------------------------*
*&      Form  f4
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->IT_DUMMY       text
*      -->R_SHLP         text
*      -->R_CALLCONTROL  text
*----------------------------------------------------------------------*
form f4 tables it_dummy structure seahlpres
                changing r_shlp type shlp_descr_t
                         r_callcontrol like ddshf4ctrl.
  data: ls_interface type ddshiface.
  data: ls_fieldcat type lvc_s_fcat.
  data: ls_bad_cells type lvc_s_modi.
  data: l_tabix type sy-tabix,
        f_type,
        field_s type string..

  field-symbols: .

  loop at r_shlp-interface into ls_interface.
    l_tabix = sy-tabix.

    check ls_interface-f4field is initial
        and not ls_interface-valtabname is initial.

    read table gt_fieldcat into ls_fieldcat
               with key ref_table = ls_interface-valtabname
                        ref_field = ls_interface-valfield.
    if sy-subrc = 0.
      read table gt_bad_cells into ls_bad_cells
                 with key fieldname = ls_fieldcat-fieldname
                          row_id    = g_row_id.
      if sy-subrc = 0.
        ls_interface-value = ls_bad_cells-value.
        ls_interface-internal = ' '.
        modify r_shlp-interface from ls_interface index l_tabix.
      else.
        assign component ls_fieldcat-fieldname of structure
                to .

        if sy-subrc = 0 and
           not (  is initial and
                 ls_fieldcat-no_init_ch ca 'FB' ).          "Y9CK052000

*<<C_NUMERIC.
            field_s = .
            ls_interface-value = field_s.
          else.
            ls_interface-value = .
          endif.
         clear f_type.
*>>>Y7AK058537

          ls_interface-internal = 'X'.
          modify r_shlp-interface from ls_interface index l_tabix.
        endif.
      endif.
    endif.
  endloop.

endform.                    "f4

Add comment

Before Buying, Compare Prices at Topprice.in

Topprice.in