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'er
you 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
Similar Messages
-
How to Display Sub-Columns using ALV
Hi experts,
Could someone tell me how to display sub-columns under a parent column using ALV. Do we have any standard Program which has this scenario. points are guaranteed for the right answer.
Thanks in advance
Sreenivasyou 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 -
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 hide selection column from alv grid
hi
i want to hide selection columns form alv grid.. how can i do it.. Is there any fm for that?
regards
palakHi,
the ALV Grid Control allows you to directly hide key columns with NO_OUT (field KEY_SEL is not used).
Field name:NO_OUT
Comp. type:LVC_NOOUT
Dtype(length):Char(1)
SPACE, 'X'
If you set this field, you hide the relevant column in the list. Nevertheless, the column is available in the field selection and can be interactively selected by the user as a display field. The ALV displays the contents of hidden fields on the detail screen for a row in the grid control.
Regards,
Neenu.
Edited by: Neenu Jose on Oct 21, 2008 10:46 AM -
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.kcheck this thread, check the sample code in my post
Re: multiple headers in ALV. -
How to display Insert button in ALV Grid
Hi All,
When I create an ALV Grid, I dont see the Insert Row and Delete Row buttons in the toolbars by default. But when I see the class CL_GUI_ALV_GRID, I see two attributes named MC_FC_LOC_INSERT_ROW and MC_FC_LOC_DELETE_ROW. These attributes, I feel are for the insert and delete functionalities only.
Then How can we display them in our toolbar..
Please help me out.
Points are guaranteed for useful answers.
Thanks in advance.
Regards,
Himanshuhi,
1) define local CLASS : DEFINITION.
METHODS:
*for event double click
handle_dclick for event double_click OF cl_gui_alv_grid
importing ES_ROW_NO,
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive.
PRIVATE SECTION.
ENDCLASS.
2)
implmentation:
METHOD handle_toolbar.
* § 2.In event handler method for event TOOLBAR: Append own functions
* by using event parameter E_OBJECT.
* DATA: ls_toolbar TYPE stb_button.
* append a separator to normal toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'PICK'.
ls_toolbar-icon = ICON_MASTER_DATA_ACT.
ls_toolbar-quickinfo = 'Debitor anzeigen'.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO e_object->mt_toolbar.
endmethod.
3) after creating grid
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_dclick FOR grid.
SET HANDLER event_receiver->handle_toolbar FOR grid.
A. -
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. -
How to display MANDT field in ALV Grid display?
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = LV_REPID
I_STRUCTURE_NAME = 'ZSTR_TRAIL'
I_SAVE = 'A'
TABLES
T_OUTTAB = it_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
In the above code, I m using structure ZSTR_TRAIL, having MANDT field as the first field.
But I am not able see the MANDT field column in the ALV output, but the internal table it_output is
is populated with the client number in MANDT field.
What should I do to display the MANDT field?
All the fields in the internal table it_output are displayed properly except the MANDT field.Hi Mohana,
When you directly declare your structure in teh function module it will skip the Mandt field while displaying the out put.
So if you would like to display the mandt field too then insted of defining it in the stucture parameter, you will have to manually fill the fieldcatalog.
Ex :
wa_fieldcat-col_pos = 1.
wa_fieldcat-row_pos = 1.
wa_fieldcat-fieldname = 'MANDT'.
wa_fieldcat-tabname = 'it_final'.
wa_fieldcat-ref_fieldname = 'MANDT'.
wa_fieldcat-ref_tabname = 'ZSTR_TRAIL'.
wa_fieldcat-outputlen = '20'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = 2.
wa_fieldcat-row_pos = 2.
wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-tabname = 'it_final'.
wa_fieldcat-ref_fieldname = 'ERDAT'.
wa_fieldcat-ref_tabname = 'VBAK'.
wa_fieldcat-reptext_ddic = 'X' .
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
it_fieldcat = it_fieldcat
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final
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.
This will fix your issue.
Regards,
Kittu
Edited by: Kittu on Nov 5, 2009 8:25 AM -
How to add a column in alv grid report to show the serial no.
i need to add column to show the row no. of the report say as :
1
2
3
this has to be the first column
how to maintain a variable for this and how to use it??
please helpone simple way is in your final itab declare a slno type i field
data : begin of itab occurs 0,
slno type i,
<other fields>
end of itab.
after filling the data in itab.
loop at itab.
itab-slno = sy-tabix.
modify itab.
endloop.
in fieldcatalog also you have to define that slno field as the first column.
but it will change its order if you are sorting the output or filtering the output.
regards
shiba dutta -
Hi,
How to display sub headings in alv grid
output format should be:
<COL_HEADING1> <COL_HEADING2>
<SUB_HEADING1> <SUB_HEADING2> <SUB_HEADING1><SUB_HEADING2>
and i want separate templet with side headings?
could you tell me grid supports this?
thanks in advance
cheers
sriniHi Srinivas,
Look ALV grid Multiple Header ... ? which has got a slightly more comprehensive information
Regards,
Anand Mandalika. -
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. -
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 ?? -
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. -
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 -
How to group values in a column in ALV Grid
Hi ,
i have got a report layout like below.
1 4
1 5
1 6
2 7
2 8
2 8
now i want to group the 1st column like below
1 4
5
6
2 7
8
8
How can i get this in ALV grid display.....pls help me out if any of u have got a sample code.Hi,
Here is a sample program which shows how to do sorting.
report zsudheer
no standard page heading.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
<b>data: sort type slis_t_sortinfo_alv.</b>
data: begin of imara occurs 0,
matnr type mara-matnr,
matkl type mara-matkl,
labor type mara-labor,
brgew type mara-brgew,
maktx type makt-maktx,
end of imara.
* Selection Screen
selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for imara-matnr .
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform write_report.
* Get_Data
form get_data.
select mara~matnr mara~matkl mara~labor mara~brgew makt~maktx
into corresponding fields of table imara
from mara
inner join makt
on mara~matnr = makt~matnr
where mara~matnr in s_matnr
and makt~spras = sy-langu.
endform.
* WRITE_REPORT
form write_report.
perform build_field_catalog.
<b>perform build_sort.</b>
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_sort = sort
it_fieldcat = fieldcat
tables
t_outtab = imara.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Number'.
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Group'.
fc_tmp-fieldname = 'MATKL'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '12'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Sort Group'.
fc_tmp-fieldname = 'LABOR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '12'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Gross Weight'.
fc_tmp-fieldname = 'BRGEW'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '12'.
fc_tmp-do_sum = 'X'.
fc_tmp-col_pos = 4.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Description'.
fc_tmp-fieldname = 'MAKTX'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '40'.
fc_tmp-col_pos = 5.
append fc_tmp to fieldcat.
endform.
* FORM build_sort *
form build_sort.
data: tmp_sort type line of slis_t_sortinfo_alv.
clear sort. refresh sort.
<b> clear tmp_sort.
tmp_sort-fieldname = 'MATKL'.
tmp_sort-tabname = 'IALV'.
tmp_sort-up = 'X'.
append tmp_sort to sort.
clear tmp_sort.
tmp_sort-fieldname = 'LABOR'.
tmp_sort-tabname = 'IALV'.
tmp_sort-up = 'X'.
tmp_sort-subtot = 'X'.
append tmp_sort to sort.</b>
endform.
Regards,
Sudheer
Maybe you are looking for
-
I have all my music on external hard drive. It doesn't all import to Itunes
I have about 76 gigs of music on my external hard drive. I just got a new ipod and I need to put the music on it. When I try to put the music on the hard drive into ITunes I only get 60 gigs of music in ITunes. I found a specific album that didn't im
-
Requested stream does not exist?
So, I created several Encore projects about a month ago (this is a large project, 15 DVDs). I receive final edits back from my client, completed them in Premiere Pro CS6, and then exported them to m2v/wav via AME. I successfully re-linked one projec
-
Error when activating DTP for InfoCube
Hi I encountered an error '**** Error from PSA ****' 'Error when activating Data Transfer Process DTP_436DF8XYKE2Y97CUX9W7FM0JH' while trying to activate the DTP for an infocube. Does anyone know why this happens and how to fix it ? I'm on support p
-
Is samba included in Solaris 9 / x86?
Hello... I have Solaris 9 x86 platform, and I need Samba to make my HD visible from a MS Win network... is Samba included in my Solaris? or I must download it...? from where? Thanks!
-
Can I set Photoshop as my default editor in "Photos"?
In iPhoto, I was able to set Photoshop elements as the default editor. I can't seem to do this with Apple Photos.