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

layout selection in ALV grid.

Former Member
0 Likes
854

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.

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.

6 REPLIES 6
Read only

Former Member
0 Likes
814

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.

Read only

0 Likes
814

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.

Read only

Former Member
0 Likes
814

create 2 field catalog based on the codition pas the catalog to alv first display

Read only

0 Likes
814

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.

Read only

0 Likes
814

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

Read only

Former Member
0 Likes
814

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