‎2007 Sep 17 3:40 AM
Experts!!
Is it possible to have a header in grid alv but the header wud be the value of that field??
example::<b>
name</b>
shine
jastine
raphael
shine , jastine , raphael would be my header in alv instead of using the fieldname.
could you help me guys on how to do this.
many points...
‎2007 Sep 17 3:47 AM
ya it is possible to give Grid name as field name
you can pass your field value to local variable and then send to grid object (heading)
check below code here in grid title we are printing :-
text-033 Program name
text-034 Date
text-035 Time
FORM sub_set_table_display .
DATA: lv_date TYPE c LENGTH 10 ,
lv_time TYPE c LENGTH 8 ,
lv_text TYPE string.
Set table for First Display
<b>WRITE sy-datum TO lv_date DD/MM/YYYY.
WRITE sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.
CONCATENATE text-033 text-034 lv_date text-035 lv_time INTO lv_text RESPECTING BLANKS.
gs_layo-grid_title = lv_text.
gs_layo-smalltitle = gc_flag .</b>
IF gs_variant-report IS INITIAL.
gs_variant-report = sy-repid.
ENDIF.
IF NOT p_layout IS INITIAL.
gs_variant-variant = p_layout.
ENDIF.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
is_variant = gs_variant
i_save = gc_save
i_default = abap_true
is_layout = gs_layo
CHANGING
it_outtab = gt_final[]
it_fieldcatalog = gt_fcat.
ENDFORM. " sub_set_table_display
For more detail check BCALV * OR RSDEMO * in SE38
Rewards if useful................
Minal
‎2007 Sep 17 3:57 AM
Hi could you give me other sample.Assume that we dont know the expected value of that field.Meaning if i have field amount we dont know yet its value. then again its value would be my header in alv..
points will be rewarded...