2009 Jun 03 8:48 PM
Hi All,
I have one requirement to change the existing program. Currently it is displaying all the fields in the ALV grid. Now i need to make the selection screen with two options for Header data selection and Item data selection. So now if I select the Header data only to be displayed (in the coding I made the changes in the field catalog and hidded some fields using
WHEN 'FKART'
if p_header = 'X'.
<fc>-no_out = 'X'.
endif.
so now it should not display the FKART field in the output. My question is, If I select some different layout in the ALV GRID even this hidden header fields are also getting displayed. Please help me and give me the solution for this.
Regards,
AL.
2009 Jun 03 8:54 PM
It should work if you use no_out = 'X'. Are you defining col position in fieldcatalog if so use properly other wise it will over write.
2009 Jun 03 9:08 PM
Hi Seshu,
can u explain me bit clearly about the col position. Right now I have defined all the fields using a Zstructure and defined the same as internal table. suppose if i have 50 fields in the zstructure which have corresponding 1 to 50 col position. my question is ' If I change the order of the fields in the ALV grid layout does it affects the col position?'. For eg. Now i defined one layout in the ALV grid for all the item fields and made it as default. so now If i execute the program selecting for header display it picks this defaults item layout, but then the item fields should be empty and that's my probelm even some of the item fields with values are getting displayed when i select the Header option the selection screen.
Regards,
AL.
2009 Jun 03 9:16 PM
create 2 field catalog based on the codition pas the catalog to alv first display
2009 Jun 04 3:22 PM
Hi Avinash,
Thank u. I did the same, created a structure only for the header fields and passed into fieldcatalog merge and ALV first display. Now its working fine.Thank u.
Regards,
Anbu.
2009 Jun 05 1:53 AM
Hi Anbu,
Dont forget to Assign for those who tried to help you with points,
That is the way to convey thanks in SDN.
Thanks & regards,
Dileep .C
2009 Jun 04 2:30 AM
Hi Anbu,
You can try like this, Modify your Col Position like this...
IF P_HEARDER = 'X'.
COL_POS = COL_POS + 1.
FIELDCATALOG-COL_POS = COL_POS.
FIELDCATALOG-FIELDNAME = 'FKART'.
FIELDCATALOG-OUTPUTLEN = 10.
FIELDCATALOG-NO_OUT = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
ELSE.
COL_POS = COL_POS + 1.
FIELDCATALOG-COL_POS = COL_POS.
FIELDCATALOG-FIELDNAME = 'FKART'.
FIELDCATALOG-OUTPUTLEN = 10.
APPEND FIELDCATALOG TO FIELDCATALOG.
ENDIF.
Thanks & regards,
Dileep .C