Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Is it possible to create ALV grid for dynamic column but same internal table?


Dear scn members,

I am stucking to create alv report  for dynamic column.

I tried below way, but its not working.can anyone help me on this.

   CLEAR LS_FIELDCAT.
   if it_FINAL-W_4015 eq '0.00'.


  LS_FIELDCAT-ROW_POS     = '1'.
  LS_FIELDCAT-COL_POS     = '9'.

  LS_FIELDCAT-FIELDNAME   = 'W_4016'.
  LS_FIELDCAT-KEY         = ''.
  LS_FIELDCAT-OUTPUTLEN   = '15'.
  LS_FIELDCAT-DO_SUM       = 'X'.
  LS_FIELDCAT-SELTEXT_L 'HRA'.
  APPEND LS_FIELDCAT TO GT_FIELDCAT.
  CLEAR LS_FIELDCAT .

else.
  LS_FIELDCAT-ROW_POS     = '1'.
  LS_FIELDCAT-COL_POS     = '9'.
   LS_FIELDCAT-FIELDNAME   = 'W_4027'.
  LS_FIELDCAT-KEY         = ''.
  LS_FIELDCAT-OUTPUTLEN   = '15'.
  LS_FIELDCAT-DO_SUM       = 'X'.
  LS_FIELDCAT-SELTEXT_L 'HRA'.
  APPEND LS_FIELDCAT TO GT_FIELDCAT.
  CLEAR LS_FIELDCAT .
  endif.

  CLEAR LS_FIELDCAT.

Note:

I am using static internal table but field only dynamic which means one field is null then i am picking another field from same internal table.

with regards,

siva.

Not what you were looking for? View more on this topic or Ask a question