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

alv

Former Member
0 Likes
460

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
435

Hello,

In the Field catalog use the attribute Tech = 'X'.

Regards,

Deepu.K

3 REPLIES 3
Read only

Former Member
0 Likes
436

Hello,

In the Field catalog use the attribute Tech = 'X'.

Regards,

Deepu.K

Read only

Former Member
0 Likes
435

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

Read only

Former Member
0 Likes
435

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