‎2007 Jul 23 2:18 PM
while displaying the data in an internal table to the grid display,suppose we want to suppress a particular field by not displaying the values in it,then what is the procedure
‎2007 Jul 23 2:21 PM
Hello,
In the Field catalog use the attribute Tech = 'X'.
Regards,
Deepu.K
‎2007 Jul 23 2:21 PM
Hello,
In the Field catalog use the attribute Tech = 'X'.
Regards,
Deepu.K
‎2007 Jul 23 2:23 PM
in the field catalog
use if statement for the block that catalog as follows.
wa_fieldcat-fieldname = 'ZSIZ_PATT' . "Size & Pattern
wa_fieldcat-tabname = 'IT_GREEN_REQPLAN2' .
wa_fieldcat-outputlen = 40 .
wa_fieldcat-seltext_l = text-012 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*
IF LV_CONDITION = 'YES'.
wa_fieldcat-fieldname = 'ZOVN_TYPE' . "Oven Type
wa_fieldcat-tabname = 'IT_GREEN_REQPLAN2' .
wa_fieldcat-outputlen = 40 .
wa_fieldcat-seltext_l = text-013 .
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDIF.
so when LV_CONDITION = 'YES' ZOVN_TYPE displayed otherwise its not display
Rewards if useful
‎2007 Jul 23 2:28 PM
hi,
put condition over field catalog like this and get the field invisible
only use of x_fldcat-no_out = 'X'. will give you the result.
jus look at the code how i used this in code.
CLEAR T_STAS1.
data:t_index like sy-tabix.
t_index = 1.
loop at i_fldcat into x_fldcat WHERE
fieldname = 'IDNRK' or
fieldname = 'MAKTX' or
fieldname = 'MEINS' or
FIELDNAME = 'MENGE1' OR
FIELDNAME = 'MENGE2' OR
FIELDNAME = 'MENGE3' OR
FIELDNAME = 'MENGE4' OR
FIELDNAME = 'MENGE5' OR
FIELDNAME = 'MENGE6' OR
FIELDNAME = 'MENGE7' OR
FIELDNAME = 'MENGE8'.
if stlal-low ne ''.
if x_fldcat-fieldname = 'IDNRK'.
x_fldcat-seltext_l = 'Component'.
x_fldcat-outputlen = 25.
x_fldcat-reptext_ddic = 'Component'.
x_fldcat-inttype = c_c.
endif.
if x_fldcat-fieldname = 'MAKTX'.
x_fldcat-seltext_l = 'Component Description'.
x_fldcat-outputlen = 25.
x_fldcat-reptext_ddic = 'Component Description'.
x_fldcat-inttype = c_c.
endif.
if x_fldcat-fieldname = 'MEINS'.
x_fldcat-seltext_l = 'UOM'.
x_fldcat-reptext_ddic = 'UOM'.
x_fldcat-ddictxt = c_l.
endif.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE1'.
read table t_stas1 with key stlal = '01'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
X_FLDCAT-TECH = 'X'.
ELSE.
PERFORM VAR_BOM USING T_STAS1-STLAL.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
endif.
ENDIF.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE2'.
read table t_stas1 with key stlal = '02'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING T_STAS1-STLAL.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
endif.
ENDIF.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE3'.
read table t_stas1 with key stlal = '03'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING T_STAS1-STLAL.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
endif.
ENDIF.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE4'.
read table t_stas1 with key stlal = '04'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING T_STAS1-STLAL.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
endif.
ENDIF.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE5'.
read table t_stas1 with key stlal = '05'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING T_STAS1-STLAL.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
ENDIF.
endif.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE6'.
read table t_stas1 with key stlal = '06'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING 6.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
ENDIF.
endif.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE7'.
read table t_stas1 with key stlal = '07'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING 7.
if sy-subrc = 0.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
ENDIF.
endif.
ENDIF.
CLEAR W_BOM.
if x_fldcat-fieldname = 'MENGE8'.
read table t_stas1 with key stlal = '08'.
if sy-subrc NE 0.
x_fldcat-no_out = 'X'.
ELSE.
PERFORM VAR_BOM USING 8.
if sy-subrc = 0.
CONCATENATE '' T_BOM-STKTX INTO W_BOM separated BY SPACE.
IF T_BOM-STLST = '1'.
X_FLDCAT-EMPHASIZE = 'C511'.
ENDIF.
x_fldcat-seltext_l = W_BOM.
x_fldcat-reptext_ddic = W_BOM.
x_fldcat-ddictxt = c_l.
ENDIF.
endif.
ENDIF.
modify i_fldcat from x_fldcat index T_INDEX.
T_INDEX = T_INDEX + 1.
CLEAR X_FLDCAT.
regards
vijay