‎2007 Aug 23 7:42 AM
hi everyone:
I have a problem about ALV. The question is I want to show two headers in the gt_item .(Hierachy)
I want to use these in the event "change_fieldcatlog"
LOOP AT I_FIELDCAT.
CASE I_FIELDCAT-FIELDNAME
WHEN 'MESSWERT'.
I_FIELDCAT-ROW_POS = 1.
I_FIELDCAT-SEL_L = '1111'.
I_FIELDCAT-SEL_M = '1111'.
I_FIELDCAT-SEL_S = '1111'.
APPEND I_FIELDCAT.
so I want to add another label in the next row. but I write like this below , it doesn't work .
I_FIELDCAT-ROW_POS = 2
I_FIELDCAT-SEL_L = text-004.
I_FIELDCAT-SEL_M = text-004.
I_FIELDCAT-SEL_S = text-004.
APPEND I_FIELDCAT
ENDCASE.
ENDLOOP.
So who can help me ?
thank you in advacne .
Regards
Nick
‎2007 Aug 23 8:18 AM
Hii Nick, in your program I found that you have created only one fieldcat structure, actually we need 2 structures one is for workarea and one for body.
like this
It_Fieldcat type SLIS_T_FIELDCAT_ALV
Is_Fieldcat type SLIS_FIELDCAT_ALV
now you can write the code
LOOP AT It_FIELDCAT into Is_Fieldcat.
CASE Is_FIELDCAT-FIELDNAME
WHEN 'MESSWERT'.
Is_FIELDCAT-ROW_POS = 1.
Is_FIELDCAT-SEL_L = '1111'.
Is_FIELDCAT-SEL_M = '1111'.
Is_FIELDCAT-SEL_S = '1111'.
APPEND Is_FIELDCAT to It_Fieldcat.
clear Is_Fieldcat.
Is_FIELDCAT-ROW_POS = 2
Is_FIELDCAT-SEL_L = text-004.
Is_FIELDCAT-SEL_M = text-004.
Is_FIELDCAT-SEL_S = text-004.
APPEND Is_FIELDCAT to It_Fieldcat.
Clear Is_Fieldcat.
Hope it will works.
Reward points if helpful.
‎2007 Aug 23 8:18 AM
Hii Nick, in your program I found that you have created only one fieldcat structure, actually we need 2 structures one is for workarea and one for body.
like this
It_Fieldcat type SLIS_T_FIELDCAT_ALV
Is_Fieldcat type SLIS_FIELDCAT_ALV
now you can write the code
LOOP AT It_FIELDCAT into Is_Fieldcat.
CASE Is_FIELDCAT-FIELDNAME
WHEN 'MESSWERT'.
Is_FIELDCAT-ROW_POS = 1.
Is_FIELDCAT-SEL_L = '1111'.
Is_FIELDCAT-SEL_M = '1111'.
Is_FIELDCAT-SEL_S = '1111'.
APPEND Is_FIELDCAT to It_Fieldcat.
clear Is_Fieldcat.
Is_FIELDCAT-ROW_POS = 2
Is_FIELDCAT-SEL_L = text-004.
Is_FIELDCAT-SEL_M = text-004.
Is_FIELDCAT-SEL_S = text-004.
APPEND Is_FIELDCAT to It_Fieldcat.
Clear Is_Fieldcat.
Hope it will works.
Reward points if helpful.