Skip to Content
0
Former Member
Oct 12, 2009 at 02:42 PM

RS_SELFIELD-FIELDNAME is not populating in user command

231 Views

Hi,

The field name is not been captured in the user command form.

DATA: BEGIN OF LT_TAB OCCURS 0,
       BELNR LIKE BSEG-BELNR,
       GJAHR LIKE BSEG-GJAHR,
       WRBTR TYPE I,
       WAERS LIKE BKPF-WAERS,
      END OF LT_TAB.


DATA: LAYOUT     TYPE SLIS_LAYOUT_ALV,
      IT_EVENTS  TYPE SLIS_T_EVENT,
      FCAT       TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      REC_FCAT   TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

START-OF-SELECTION.

  FCAT-COL_POS       = 1.
  FCAT-FIELDNAME     = 'BELNR'.
  FCAT-TABNAME       = 'LT_TAB'.
  FCAT-REF_FIELDNAME = 'BELNR'.
  FCAT-REF_TABNAME   = 'BSEG'.
  APPEND FCAT.
FCAT-COL_POS       = 2.
  FCAT-FIELDNAME     = 'GJAHR'.
  FCAT-TABNAME       = 'LT_TAB'.
  FCAT-REF_FIELDNAME = 'GJAHR'.
  FCAT-REF_TABNAME   = 'BSEG'.
  APPEND FCAT.

  FCAT-COL_POS       = 3.
  FCAT-FIELDNAME     = 'WRBTR'.
  FCAT-TABNAME       = 'LT_TAB'.
  FCAT-DATATYPE      = 'INT4'.
  FCAT-INTTYPE       = 'I'.
  FCAT-DO_SUM        = 'X'.
  APPEND FCAT.

  DO 10 TIMES.
    LT_TAB-WRBTR = SY-INDEX.
    APPEND LT_TAB.
  ENDDO.


*CALLING ALV
  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
      I_CALLBACK_PROGRAM = 'YZ_PLR'
      I_CALLBACK_USER_COMMAND = 'ONLINE_HELP'.

  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
      IS_LAYOUT   = LAYOUT
      IT_FIELDCAT = FCAT[]
      I_TABNAME   = 'LT_TAB'
      IT_EVENTS   = IT_EVENTS[]
    TABLES
      T_OUTTAB    = LT_TAB[].
  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

  FORM ONLINE_HELP USING F_UCOMM LIKE SY-UCOMM
       RS_SELFIELD TYPE SLIS_SELFIELD.

    WRITE RS_SELFIELD-FIELDNAME.
  ENDFORM.

In the above form ONLINE_HELP:

RS_SELFIELD-FIELDNAME is not populating and we need to track this value to raise different exception but I am getting the other values like:

TABNAME

TABINDEX

VALUE

Thanks,

Gaurav