Sub columns in alv grid display
hi everyone,
can anyone tell me the way in which we can include sub-column headings in alv grid display. i.e., for example as shown below.
column1 column2 column3
scol1 scol2 scol3 scol4 scol5 scol6........................
thanks in advance. Here we are generating the column headings by using fm field catalog merge.
regards,
rajsekhar.k
check this thread, check the sample code in my post
Re: multiple headers in ALV.
Similar Messages
-
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. -
Want to display more than 300 charcters in a column using ALV grid display
Hi Guru's,
I am trying to display more than 500 charcters in a column using alv grid display but it in the output it is showing only 128 characters. Can you help me to display all the characters in particular column Or is there any limitation in maximum of no of charcters for a column?
Thanks,
Radha.Hi Paurl,
Define a work area say
wa_layout type slis_layout_alv.
then fill this work area as
wa_layout-zebra = X
wa_layout-colwidth_optimize = X.
wa_layout-max_linesize = 300.
Then in FM 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = wa_layout
etc.
you provided this for the field which is displayed in alv grid will have more than 128 characters.
from this code i want,how it refers to particular field.
when i mentioned field catalog-OUTPUTLEN = '300'.
it is not displayed the field morethan 128 characters.
it only displays 128 characters.
please provide me clear and breif information with suitable code.
i am trying what your sending but it is not displayed more than 128 characters.
if you don't mind please spend for me some time for this and
give me clear and breif information with suitable code.
Thanks & Regards,
Radhakrishna. -
How to insert the checkbox as a separate column in alv grid display
Hi
How to insert the checkboxes as a separate column in alv grid display with using the reuse_alv_fieldcatlog_mege.
example
matnr maktx ersda checkbox
10 books 28/03/2009 checkbox
Thanks
chinnuHi,
Check the following code.
TYPE-POOLS: slis.
TYPES:
BEGIN OF ty_output,
chk TYPE c,
number TYPE i,
name(20) TYPE c,
END OF ty_output.
DATA: gt_output TYPE STANDARD TABLE OF ty_output,
gs_output TYPE ty_output.
DATA: wa_layout TYPE slis_layout_alv.
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
After you populate the data, build the field catlog like shown below.
wa_fieldcatalog TYPE slis_fieldcat_alv.
wa_fieldcatalog-fieldname = 'CHK'.
wa_fieldcatalog-outputlen = '3'.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-seltext_m = 'CHK'.
wa_fieldcatalog-checkbox = 'X'.
wa_fieldcatalog-edit = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
wa_fieldcatalog-fieldname = 'NUMBER'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-seltext_m = 'NUMBER'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NAME'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '3'.
wa_fieldcatalog-seltext_m = 'NAME'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_layout-box_fieldname = 'CHK' .
wa_layout-box_tabname = 'GT_OUTPUT' .
Now call the FM
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 = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND_GRID'
* I_CALLBACK_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 = wa_layout
it_fieldcat = it_fieldcatalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* 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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_output
* 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. -
How to Display Sub-Columns using ALV Grid
Hi ,
Could someone tell me how to display sub-columns under a parent column using ALV Grid. Do we have any standard Program which has this scenario. Please let me know.
Thanks,
Abaper.
Message was edited by:
ABAP'eryou can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
check below
BCALV_DND_01 Drag ALV Row to Tree Folder
BCALV_DND_02 Drag Icons from Tree to Rows of the Grid
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
Rewards if useful............
Minal -
Max number of columns in Alv grid display.
Is there any limitation on number of fields that can be displayed using alv grid display.
Please tell how i can display 199 fields using ALV.
Thanks in advance.I am not sure of the maximum of columns possible.
If you see the col_pos field in the field catalog table it can have only 2 digits. so i would assume it would be only 99 columns, but not sure.
Would get you more information soon.
Thanks,
Balaji -
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. -
Hi SAP Friends,
I need some help from u...I have an requirement of ALV grid report. It was already there byt now i have to divide one column in to twosub columns as folows
Total
A in USD | B in INR
plz help me in the above ..check this thread, check the sample code in my post
Re: multiple headers in ALV. -
Calculating Totals for a column in ALV Grid Display
Hi All,
I frustrated with the problem of simple calculating total for a column. I wrote the following code:
LW_CATALOG-TABNAME = P_GV_STRUCT.
LW_CATALOG-FIELDNAME = 'ZSUMMS'.
LW_CATALOG-DO_SUM = GC_X.
APPEND LW_CATALOG TO G_FIELDCAT_TAB.
CLEAR LW_CATALOG.
It is not working. Could you please suggest the solution?
It would be great help to me.
Advanced Thanks,
Phani KumarPhani,
Did u try playing around with any of these layout fields ?
no_sumchoice(1), " no choice for summing up
no_totalline(1), " no total line
no_subchoice(1), " no choice for subtotals
no_subtotals(1), " no subtotals possible
no_unit_splitting " no sep. tot.lines by inh.units
totals_before_items, " diplay totals before the items
totals_only(1), " show only totals
totals_text(60) , " text for 1st col. in total line
subtotals_text(60) , " text for 1st col. in subtotals
b. Addtionally... not a solution.. but u know...
just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ? -
Split columns in ALV Grid Display.
Hi
Currently we are displaying the output as below :
currently :
Docid | Created | Posted |
| | |
Needed :
Docid | Created | Posted |
|X1 |X2 |X3 |X4 |
| | | | |
now some columns have to be splitted as above like Created is splitted into X1 and X2, Posted into X3 and X4 .I am using Set_table for_first_display method to display the current result, so is there any option in the method that can split the columns into two .
Edited by: Varun on Jan 27, 2011 7:30 PM
Edited by: Varun on Jan 29, 2011 2:25 PMI am not sure of the maximum of columns possible.
If you see the col_pos field in the field catalog table it can have only 2 digits. so i would assume it would be only 99 columns, but not sure.
Would get you more information soon.
Thanks,
Balaji -
Totas and sub totals in ALV grid display
Hi all,
how can I get the total for an integer field in internal table. I am using the following code, but unable to display the total. Can anyone give the reason for the same.
Thank you,
Usha
REPORT ZTEST_SUB .
TABLES : vbak.
TYPE-POOLS: slis.
SELECT-OPTIONS : s_vkorg FOR vbak-vkorg,
s_kunnr FOR vbak-kunnr,
s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN : SKIP,
BEGIN OF LINE,
COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '2' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
DATA: BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg,
kunnr LIKE vbak-kunnr,
vbeln LIKE vbak-vbeln,
test type I,
END OF gt_vbak.
START-OF-SELECTION.
PERFORM f_read_data.
loop at gt_vbak.
gt_vbak-test = 1.
modify gt_vbak.
endloop.
PERFORM f_display_data.
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak UP TO p_max ROWS WHERE
kunnr IN s_kunnr AND
vbeln IN s_vbeln AND
vkorg IN s_vkorg.
ENDFORM.
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-ref_FIELDname = &2.
ls_fieldcat-do_sum = &3.
ls_fieldcat-cfieldname = &4.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
ls_sort-group = '*'.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' '' ''.
m_fieldcat 'VBELN' '' '' ''.
m_fieldcat 'TEST' '' 'X' ''.
m_sort 'VKORG' ''.
m_sort 'KUNNR' ''.
m_sort 'VBELN' ''.
m_sort 'TEST' 'X'.
ls_layout-cell_merge = 'X'.
LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = lt_fieldcat
IT_SORT = lt_sort
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = gt_vbak
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.
endform.hi
REPORT ZTEST_SUB .
TABLES : vbak.
TYPE-POOLS: slis.
SELECT-OPTIONS : s_vkorg FOR vbak-vkorg,
s_kunnr FOR vbak-kunnr,
s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN : SKIP,
BEGIN OF LINE,
COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '2' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
DATA: BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg,
kunnr LIKE vbak-kunnr,
vbeln LIKE vbak-vbeln,
test type I,
END OF gt_vbak.
START-OF-SELECTION.
PERFORM f_read_data.
loop at gt_vbak.
gt_vbak-test = 1.
modify gt_vbak.
endloop.
PERFORM f_display_data.
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak UP TO p_max ROWS WHERE
kunnr IN s_kunnr AND
vbeln IN s_vbeln AND
vkorg IN s_vkorg.
ENDFORM.
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-ref_FIELDname = &2.
ls_fieldcat-do_sum = &3.
ls_fieldcat-cfieldname = &4.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
ls_sort-group = '*'.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' '' ''.
m_fieldcat 'VBELN' '' '' ''.
m_fieldcat 'TEST' '' 'X' ''.
m_sort 'VKORG' ''.
m_sort 'KUNNR' ''.
<b> m_sort 'VBELN' 'X'.</b>
*m_sort 'TEST' 'X'.
ls_layout-cell_merge = 'X'.
LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = lt_fieldcat
IT_SORT = lt_sort
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = gt_vbak
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.
endform.
Message was edited by: Ashok Parupalli -
ALV grid display the subtotal not getting for one column at the output
Hi,
I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
Eventhough that column has some values.
So can anyone give the proper solution.
Waiting quick response.
Best Regards,
BansiHi
see this link .
https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
or try this program.
REPORT zalv.
DATA:
t_sflight TYPE TABLE OF sflight,
fs_sflight TYPE sflight.
DATA:
r_container TYPE REF TO cl_gui_custom_container,
r_grid TYPE REF TO cl_gui_alv_grid.
*FIELD CATALOG
DATA:
t_fcat TYPE lvc_t_fcat,
fs_fcat TYPE lvc_s_fcat.
*SORTING THE BASIC LIST
DATA:
t_sort TYPE lvc_t_sort,
fs_sort TYPE lvc_s_sort.
fs_fcat-fieldname = 'PRICE'.
fs_fcat-do_sum = 'X'.
APPEND fs_fcat TO t_fcat.
fs_sort-spos ='1'.
fs_sort-fieldname = 'CARRID'.
fs_sort-down = 'X'.
fs_sort-group = '*'.
fs_sort-subtot = 'X'.
APPEND fs_sort TO t_sort.
SELECT * FROM sflight INTO TABLE t_sflight.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN1'.
SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
**& Module HANDLER OUTPUT
MODULE list OUTPUT.
CREATE OBJECT r_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT r_grid
EXPORTING
i_parent = r_container.
CALL METHOD r_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_fieldcatalog = t_fcat
it_outtab = t_sflight
it_sort = t_sort.
ENDMODULE. "list OUTPUT
Regards
Hareesh Menon -
ALV GRID Display Column Width problem when filtering
Hello All,
When i displaying ALV Grid Display ,i selected one column and set filter for that.
the problem is column width at display is 12 charecters but in filter it is allowing only 10 charecters to enter which is wrong. i am unable to set filter.please give solution.
Thanks
Sandeep.Ghello i am calling perform, ineed to set OUTPUTLEN according to field length how can i do that.
FORM fill_fieldcat USING p_field TYPE slis_fieldcat_alv-fieldname
p_text TYPE slis_fieldcat_alv-seltext_l
p_flag TYPE c.
wa_fieldcat-fieldname = p_field.
wa_fieldcat-seltext_l = p_text.
wa_fieldcat-no_out = p_flag.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat. -
ALV grid display with more than 1000 columns
Hi Friends,
I have to prepare a report output which have 1015 columns.
User will give 100 weeks of data to retrieve. I have to display the output in day wise.
100*7 + 315 = 1015 columns.
I am using ALV grid display for this in 4.6C.
My Question is, whether I have to declare the output table type with 1015 fields.?
Is there any other way to do this, without declaring 1015 cloumns.
Please guide me to solve this.
Regards,
Viji.I'm thinking when your End-user will press Ctrl + P feeding A4 size to printer
Thomas:
Maybe the functional consultant is pulling your leg?
May be OP is pulling our legs or something further?
Cheers -
Kindly help to develop alv grid display
Hi ,
I have a requirement in which I need to display ALV GRID display and in its tool bar 4 butons are required. In the same view down to alv display i want to develop a tabstrip and its functionalities.I have designed classic alv using SALV_WD_TABLE component. I want a good GRID Display, not like flat field names that comes in list display, looking for bulged fields(like what comes for ALV GRID in normal abap) display with print version etc hidden and buttons at the top of ALV. Kindly help
Highly rewarded
Kindly help
Regards,
Lakshmi
Edited by: Lakshmi Menon on Nov 27, 2008 4:49 PMWell Web Dynpro is generally output in HTML so the output formatting is never going to quite look like a desktop application (which is the case with the ALV Grid). You have very little control over the look of the column headers. In fact you can only manipulate what is available via the Portal Theme.
There is a new Tradeshow Plus theme available in NetWeaver 7.01 which uses a gradiant background for the column headers. This gives them a little more depth:
http://www.flickr.com/photos/tjung/3068850120/
The other option is next year when NetWeaver Business Client version 3.0 comes out, you will be able to render Web Dynpro applications using the NWBC Smart Client Rendering. This will render Web Dynpro applications using desktop libraries instead of HTML/Browser. This gives Web Dynpro a more SAPGUI/Desktop appears of course.
http://www.flickr.com/photos/tjung/2685619882/in/set-72157606418550143/
Maybe you are looking for
-
Propper Compressions: from Final Cut Pro to DVD Studio Pro?
Ok, so i have a project on Final Cut Pro, what are the right compressions that i would need to do to get my project to DVD Studio Pro?
-
Ok, my first pacman upgrade error ever I haven't been able to solve by a search in this forum, I'm afraid it might not be so straight forward. Last night doing a pacman -Syu gave me an error that said gcc-fortran was missing, found this http://bbs.ar
-
Why is my paid Creative Cloud Membership running in Trial Mode?
I have applied suggestion found in Help and Forum. Nothing Works. Suggestion 1. Unistall Adobe Creative Cloud reboot computer reinstall. Sign into Adobe with account. Done. Ground Hog Day. Same result. Trial Mode still Suggestion 2. Download and run
-
How do I programmatically set the scale range for the two y-scales of the two plots
hi, I am using labview 8.2 To programmatically assign a range to the y-scale of a plot I use a Property Node for the plot display and adjust Y.Scale.Range.Minimum. How can I assign the ranges of a plot with multiple y-scales? miethe
-
How to create data stores in ODI ?
Hi all, I am new to this ODI part.Can anyone please help me as how to create data stores in ODI. A prompt reply will be highly aprreciated. Thanks Saurabh.