04-06-2011 6:54 AM
Hi Experts,
Hi have created a maintenance screen where I am showing sales division, child account and parent account. I am showing this maintenance screen in tcode zorder and tcode zhorder.
Now my requirement is to hide sales division in both tcodes. I have used the following fieldcatalog:
FORM BUILD_FIELDCATALOG .
REFRESH:LT_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = C_TABNAME1
I_STRUCTURE_NAME = C_TABNAME
CHANGING
CT_FIELDCAT = LT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
CLEAR:WA_LAYOUT,WA_COMMON_GRID_SETTINGS.
LOOP AT LT_FIELDCAT ASSIGNING <FS_FIELDCAT>.
<FS_FIELDCAT>-EDIT = C_FLAG.
<FS_FIELDCAT>-EMPHASIZE = C_FLAG.
ENDLOOP.
Preparing Layout
WA_LAYOUT-ZEBRA = WA_LAYOUT-COLWIDTH_OPTIMIZE = C_FLAG.
Displaying Output table in ALV Grid format
WA_COMMON_GRID_SETTINGS-EDT_CLL_CB = C_FLAG.
ENDFORM. " BUILD_FIELDCATALOG
Pleased help me in sorting out this problem,.
thanku in advance...
04-06-2011 7:04 AM
Hi,
set fieldcat field TECH to 'X' for sales division entry.
Regards,
Klaus
04-06-2011 7:04 AM
Hi,
set fieldcat field TECH to 'X' for sales division entry.
Regards,
Klaus
04-06-2011 7:11 AM
Hi Klaus,
thanku for ur responce but i havnt get u what have u said..
sorry for inconvience,,
thanku..so much..
04-06-2011 7:07 AM
Hi Anusha,
If you dont want to display the field sales division in both tcodes, why couldnt you remove this field from the final INTERNAL table.
If that is not your actual requirment, you can modify your field catalog like below.
LOOP AT LT_FIELDCAT ASSIGNING <FS_FIELDCAT>.
IF <FS_FIELDCAT>-FIELDNAME = < sales division >.
<FS_FIELDCAT>-NO_OUT = X.
ENDIF.
ENDLOOP.
Regards
HM
04-06-2011 7:07 AM
Hi,
try out this
LOOP AT LT_FIELDCAT ASSIGNING <FS_FIELDCAT>.
<FS_FIELDCAT>-EDIT = C_FLAG.
<FS_FIELDCAT>-EMPHASIZE = C_FLAG.
***new code
IF <FS_FIELDCAT>-FIELDNAME = fld to hide.
<FS_FIELDCAT>-NO_OUT = 'X',
ENDIF.
ENDLOOP.
04-06-2011 7:12 AM
In the field catalog you can use two fields<br />
- NO_OUT : if set to 'X' the field wont be displayed by default, but if user can maintain layout he will be able to display the field, and can even create a default layout which will display this field<br />
- TECH : if set to 'X' the field wont be displayed, and user cannot display it<br />
(check documentation at <a class="jive-link-external" href="http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/frameset.htm" target="_newWindow">Fields of the Field Catalog</a>)<br />
<br />
Regards,<br />
Raymond
04-06-2011 7:15 AM
Hello Anusha,
As mentioned by Klaus mark the field as 'technical'. In other words,
LOOP AT LT_FIELDCAT ASSIGNING <FS_FIELDCAT>.
<FS_FIELDCAT>-EDIT = C_FLAG.
<FS_FIELDCAT>-EMPHASIZE = C_FLAG.
IF <FS_FIELDCAT>-fieldname = <fieldwhich you dont want to display>.
<FS_FIELDCAT>-tech = 'X'. "Technical field
ENDIF.
ENDLOOP.
A 'technical' field is for purely technical purposes & is not displayed in the layout management as 'hidden' field. But if you mark it as 'NO_OUT' the user can display it via layout management.
BR,
Suhas
04-06-2011 7:24 AM