Two header line in one column of alv grid.
Hi Experts,
My requirement is that I have to create an ALV report with columns having two lines of
headings. Like a main heading called Consultants under which 5 to 10 columns of departments
and then Contractors underwhich there would be 5 to 10 departments. Right now my report has
the depts of contractors and consultants in one line but the headings above that I am not
able to generate.
Will anybody please be able to provide a sample code if this is possible.
like,,,
Heading 1 | Heading 2 | Heading3 | line 1
hed4 | hed5 | hed6 | | hed7 | hed8 | line 2
Unfortunately the current ALV framework doesn't support multiple line headers in ALV. There are some nasty hacks available. But none of them are full-proof.
BTW there are many posts related to similar requirements.
BR,
Suhas
Similar Messages
-
Display two lines under one column in ALV
Hello Friends,
I have a situation... i need to display two or three lines under single column in ALV report.
example:
col1 col2 col3 col4
AAA 10 456.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
EDEHFKHEKFHEKJCFEKJFHKEJHFKEHFEFJK
DJFHGCGD
AAA 20 121.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
BBB 10 11.78 TEST PURPOSE HBDFJEHBEJBE EBDF B EFH EJ
EFKBEJF KEFHEKJFHEJ KFEHKE HFKEH
MEFBHEJFB EFBEJ EFGJEGF JEGFEGEKJE KEFHK
EFKEFEKLKL
Anyone has idea?
Thanks in advance
Regards
RaghuHi,
You can do this by doing some additional coding..
Ex..
** Let's assume you are using the internal table t_output for displaying the ALV...
** and t_final contains the data..t_text which contains the multiple lines texts...for the
** column col4...
DATA: s_output LIKE LINE OF t_output.
DATA: v_flag TYPE xfeld.
LOOP AT t_final INTO s_final.
* Clear the work areas.
CLEAR: v_flag,
s_output.
* Move all the data.
MOVE ls_final TO s_output.
LOOP AT t_text WHERE col1 = s_final-col1.
* First time move all the columns to the output internal table...for the rest of the records
* just populate the col4..
IF v_flag IS INITIAL. " For the first time.
s_output-col4 = t_text-text. " Move the text.
APPEND s_output TO t_output.
v_flag = 'X'.
ELSE.
clear s_output.
s_output-col4 = t_text-text. " Move the text.
APPEND s_output TO t_output.
ENDIF.
ENDLOOP.
* IF there is no text found just append the output internal table with blank col4.
IF sy-subrc <> 0.
APPEND s_output TO t_output.
ENDIF.
ENDLOOP.
Hope the example is clear...
Thanks
Naren -
Reused alv grid - Sum one column of ALV Grid
I'd like that one column of my alv grid to be sum...
How can i do that abap'ly speaking...
regardshi,
DATA: lr_field type ref to cl_salv_wd_field.
*For total calculations...
if wd_comp_controller->gref_model_efforts is not initial.
CALL METHOD wd_comp_controller->gref_model_efforts->if_salv_wd_std_functions~set_aggregation_allowed
EXPORTING
value = abap_true.
lr_field = wd_comp_controller->gref_model_efforts->if_salv_wd_field_settings~get_field( 'BILLABLE_VALUE' ). "The column name for which total needs to be done.
lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type =
if_salv_wd_c_aggregation=>aggrtype_total ).
endif.
Refer this :
Alv subtotal and total
Thanx. -
Display value and description of one field in alv grid
Hi Folks,
I want to display value and description of one field as one column in alv grid.
for example iam having Xfield = 01,02,03.
and 01 iam having text value as xxx,
01 xxx
02 yyy
03 zzz
Im report display the values are displaying as 01,02,03..
but i want to display it as 01 xxx,02 yyy, 03 zzz.
Please do needful.
Thx.Hi, swetha
You can do this with "concatenate".
example:
In you code check where you final internal table is getting filled up before that do this concatenate and then append it.
data t_text type string.
t_text = textfield
CONCATENATE 'Xfield'
t_text
INTO wa_workarea SEPARATED BY space.
cheers,
Bhavana -
Two header line in ALV display
Hi ,
I want two header lines in ALV report using reuse_alv_grid_display .
Like
Factory-Sales
Qty Value
10 1000
How to do that please helpHi,
I am giving the example code for 3 header line display. This may help you.
First declare Form,
FORM TOP-OF-PAGE .
FREE TTOP .
FREE HTOP .
CLEAR TTOP .
HTOP-TYP = 'H' .
HTOP-INFO = 'LLYODS STEEL INDUSTRIES LIMITED, WARDHA' .
APPEND HTOP TO TTOP .
CLEAR HTOP .
HTOP-TYP = 'S' .
HTOP-INFO = MAT .
APPEND HTOP TO TTOP .
CLEAR HTOP .
HTOP-TYP = 'S' .
HTOP-INFO = PONO .
APPEND HTOP TO TTOP .
CLEAR HTOP .
HTOP-TYP = 'S' .
HTOP-INFO = item .
APPEND HTOP TO TTOP .
CLEAR HTOP .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = TTOP
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
After that declare this form in your Grid or List like below.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = BTAB
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Himanshu -
How to set two different UIE in one cell in ALV table
Hi all,
I have a hierachy ALV table. For some reason I want to have two UI elements in one column. For example, the text and a menu next to the text. Is it possiable to do that?
best regards,
WenwenHi,
thank you for your answer. Yes, now I also find the class CL_SALV_WD_MULTI_CELL_EDITOR which could be used to set different UIE in one cell. But it is quite limited, just the following UIE could be used
- LinkToAction
- LinkToURL
- FileDownload
- Button
- ToggleButton
best regards,
Wenwen -
Display one or more rows for a particular column in alv grid display
Hi,
My requirement in the report is to display users for a particular workitem id.If a workitem is in the inbox of one or more users(approvers) i have to display all the user names in one field in alv grid output (output-approver id).There are other fields which display details of the workitem also.
Is there a way to populate multiple rows for a single column or creating one more internal table for users in the alv output table.
Please suggest.
regards,
Sravanthi ChilalALV only can show flat internal table data.
you should set a sort on the field which you want to show only once.
Then on the output of the ALV, the field with the same value will show only once. -
How to get one column of ALV table as dropdown by key.
Hi experts,
How can I get one column of ALV table as dropdown and editable. If user wants to change that column value he can just select from that dropdown and click on update button. Can I provide tool tip to that column as " Select from drop down to change the status "?
Please Help.
Thanks,
PratibhaYou just need to change the cell editor of that column in ALV.
So first get access to the alv model object (adjusting the code below for your ALV Component Usage name - mine was ALV_ADV):
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_adv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
Then access the column object you want to change:
DATA l_column TYPE REF TO cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'REGION' ).
Then create the cell editor for DDLB and set it as the new cell editor for this column:
DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
create object ddlb
exporting
selected_key_fieldname = 'REGION'.
ddlb->set_tooltip( `Select from drop down to change the status` ).
l_column->set_cell_editor( ddlb ). -
Display concatenad fields under one column in alv.
How can I concatenate three or four fields(Taken from different tables) and can display under one column in ALV report?
I want to display:
final_column = production orderStatusmaterial type+maintenance status (concatenation of four fields).
production order: caufvd-aufnr
status: tj02t-txt04
material type: mara-mtart
maintenance status:mara-pstat
I want to display only final_column in my alv output screen.
Kindly guide.
Thanks and regards.
Thanks and regards.
Message was edited by:
cinthia nazneenPlease go through the below code and do the same for appearing the four fields of different table into One Field catalog at Display by Concatenating .
DATA :v_tmp type string .
Loop at itab1.
Read table itab2 key field1 = itab1-field1 .
Read table itab3 key field1 = itab1-field1 .
Read table itab4 key field1 = itab1-field1 .
Concatenate itab1-field1 itab2-field1 itab3-field1 itab4-field1 into v_tmp.
fieldcatalog-fieldname = 'V_TMP'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endloop.
Reward points if it is usefull .....
Girish -
Icon and text together in one column in alv list
Hello Everyone,
I want to display icon and text together in one column in ALV list.
I am using reuse_alv_grid_display function module.
Currently, i am able to see icon only in the column but i want to see both icon and text in one column in ALV.
Please let me know if this scenario is possible in ALV and how.
Thanks in advance.
Regards, TarunHi,
Check this code....
REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
TYPE-POOLS: SLIS,icon.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV/
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
ICON(1),
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
loop at itab.
if sy-tabix = 1 or sy-tabix = 2.
itab-icon = '1'.
elseif sy-tabix = 10 or sy-tabix = 20.
itab-icon = '2'.
else.
itab-icon = '3'.
endif.
modify itab index sy-tabix.
endloop.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-HOTSPOT = 'X'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-lights_fieldname = 'ICON'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
vijay -
Hi Everyone,
I would like to know how to hide a column in alv grid. Is there any specific field to set in the field catalog.
Thanks in advance,
Prabs.Hello friends,
I am using the following lines of code, but invisible of my column ( message ) is not working, would be nice if some one can give me any tip.
Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.
LOOP AT pt_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'DUMMY'.
<lfs_fieldcat>-coltext = 'Message'.
<lfs_fieldcat>-no_out = 'X'.
ENDCASE.
ENDLOOP.
I have also set the field catalog to no_out = 'X'.
PS: Do I need to append the field catalog to internal table ??
I am using the function
CALL METHOD lalv->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'abc'
IS_LAYOUT = ps_layout
CHANGING IT_OUTTAB = xyz.
Do I have to implicit set the field catalog in ps_layout ?? -
Disable re-order columns in ALV Grid
Hi,
I want to disable the option of move/re-order of columns in ALV grid.
Ex: My grid is displaying 5 fields in the order F1, F2, F3, F4 & F5. I can move the columns by dragging then on their header so I can change the fields order to F2, F3, F1, F4 & F5. I want to disable this option of re-arranging the columns in the ALV grid.
Its not related FIX_COLUMN in field catalog.
Thanks & Regards,
Adithya M.Hi Hima,
FIX_COLUMN is is used to fix the respective columns from moving when horizontal scroll bar is moved.
I want to disable re-arranging of columns, i.e, after displaying the grid the user should not be able to re-arrange/drag the column from one position to other.
Thanks & Regards,
Adithya M -
Add List box for one field in ALV GRID
Hi All,
I need to add drop down list box for one field in ALV Grid.
If any body knows, please help.
Thanks in advance.
Regards
MangleshHi,
Here is the ex where i have used for date parameter in the sel screen
type-pools: vrm.
data: name type vrm_id,
list type vrm_values,
value like line of list.
parameters : p_date like p_date2
as listbox visible length 15.
at selection-screen output.
name = 'P_DATE'.
value-key = '1'.
value-text = 'Today'.
append value to list.
value-key = '2'.
value-text = 'Last 7 days'.
append value to list.
value-key = '3'.
value-text = 'Last 30 days'.
append value to list.
value-key = '4'.
value-text = 'Last 90 days'.
append value to list.
value-key = '5'.
value-text = 'Last year'.
append value to list.
Call the ''VRM_SET_VALUES' to display the values in Listbox
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
at selection-screen.
if sy-ucomm = 'CLI1'.
sscrfields-ucomm = 'ONLI'(001).
endif.
if p_date = '1'.
p_date11 = sy-datum .
elseif p_date = '2'.
p_date11 = ( sy-datum - 7 ).
elseif p_date = '3'.
p_date11 = ( sy-datum - 30 ).
elseif p_date = '4'.
p_date11 = ( sy-datum - 90 ).
elseif p_date = '5'.
p_date11 = ( sy-datum - 365 ).
endif.
Hope this helps u..
Please reward points if useful.
Regards,
Sreenivas -
Maximum number of character we can print in a column uing ALV grid display
Hi frnds,
My requirment is to print 500 charcter data in a column using ALV grid display.
Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
Regards,
SandipanHi Sandipan,
refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
857823 - ALV grid: Strings with a maximum of 128 characters
Symptom
Entries in cells of the type CHAR or string are truncated after 128
characters in the SAP GUI.
also refer,
ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
(Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
Cause and Prerequisites
The data table that is sent to the front end only allows character values
with the length 128.
Solution
This is the standard system behavior and cannot be changed. -
Hide a Column in ALV Grid Output
Hi,
I want to hide a column in ALV Grid Output through program.
I am using lwa_fieldcat-NO_OUT = 'X'. to hide the column in output but it is not working, column in not hided in the output.
Kindly suggest.It should work..
see the code :
d_fieldcat_wa-fieldname = 'MATNR'.
d_fieldcat_wa-seltext_l = 'material number'.
d_fieldcat_wa-no_out = 'X'. * hide particular field
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
if not please paste your code here.
Thanks
Seshu
Maybe you are looking for
-
Using Graphics2D from a method
Hello everyone, I am still trying to make a method that will use Graphics2D to draw a line etc... Here is what I tried... int drawx() { Graphics2D g2D = (Graphics2D)g; // Get a 2D device context g2D.setPaint(Color.blue); Point2D.Float h2a = new Point
-
Hello GURUs I have doubt about following. Please can all help me. 1. Does the order of table in from clause make difference. what should be the order. . largest to snmallest. 2. Does where clause order make difference. also left side to right side of
-
Recovery media order for windows 8 64bit
Hello..i bought my note book before 6 months.. The model no is hp15 d017tu and i have windows 8 64bit os..before some days i had a problem in usb device so i gave it to solve in hp care and they changed modem so they reset it fully..and problem is th
-
OIM 11g API - Getting process form attached to a process definition
Hi, Is it possible to get the process form name which is attached to a resource object ( through process definition) through API ?.Thanks.
-
Notifying PBX if Voip calls can't be completed from WAN
I have 10 2621XMs each connected directly to G3 PBXs. They supply VOIP call lines to the PBX via a direct T1 (NM-HDV-1T1-24). However, when the direct T1 is up between the PBX and the CISCO router, how do I tell the PBX that VOIP calls can't be compl