Multiple Hotspots in a ALV Grid single column
Hi Experts,
My ALV Grid report output looks like below....
If you observe below output, column 3 has multiple documents each one separated by ' ; '. Now, I would like to assign hotspot on each documents like DOC1, DOC2, DOC3, etc.
Heading#: COL1 | COL2 | COL3 |
Records1: 1 | xxxxx | _DOC1_ ; DOC2 ; *DOC3*
Records2: 2 | xxxxx | _DOC1_ ; DOC5 ;
I know, we can assign hotspot for entire column. but my requirement is multiple hot spots in a single column.
Please help me on this?
Thanks in Advance
Raghu
As I mentioned earlier,
My ALV Grid report output looks like below....
Heading#: FIELD1 | FIELD2 | FIELD3 |
Records1: 1 | xxxxx | DOC1 ; DOC2 ; DOC3
Records2: 2 | xxxxx | DOC1 ; DOC5 ;
If you observe above output, field 3 has multiple documents each one separated by ' ; '.
When I click on DOC1, it supposed to display related picture on the POP-Up Screen. Similarly when I click on DOC2, it supposed to display that document picture on POP-up screen.
Before going to do this, first I need to assign hotspots on each documents like DOC1, DOC2, DOC3, etc.
Please help me.
Similar Messages
-
Multiple Input Rows In ALV Grid (Editable)
Hi,
I have an editable ALV grid and need to have multiple blank rows ready for input. Something similar to what happens when you click the "New Entries" button in SM30 (Table Maintainance).
There is a local function for appending lines in the ALV grid toolbar but this only allows a single entry.
I have replaced the local function with my own button (same icon etc) and on user_command event, I am appending several blank lines to my output table.
However these lines are not being shown on the screen. I have looked through the layout and field catalog but there is no field to allow blank lines to be shown.
My 2 questions are:
1. Is there some standard way of entering multiple entries in ALV Grid Editable.
2. If not then how to allow blank lines to be shown as ready for input.
Also if someone could suggest a way to do error checking for all entries on the screen especially duplicate entries I will be extremely grateful.
Many Thanks,
PreetHi, Preet!
You can easily do whatever checks you wish. You should declare an event handling method for event DATA_CHANGED and call the ADD_PROTOCOL_ENTRY method of the ER_DATA_CHANGED event parameter (it's an object of the class CL_ALV_CHANGED_DATA_PROTOCOL). You must not forget to set handler for your ALV grid.
For example, this piece of code checks for all changed fields resulting in error message if they are initial. In short, this makes all the fields obligatory.
METHODS: on_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
SET HANDLER your_object->on_data_changed FOR your_alv_grid.
METHOD on_data_changed.
DATA: s_mod_cell TYPE lvc_s_modi.
LOOP AT er_data_changed->mt_mod_cells INTO s_mod_cell.
IF s_mod_cell-value IS INITIAL.
* issue message 'Make an entry in all required fields'
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING i_msgid = '00'
i_msgno = '055'
i_msgty = 'E'
i_fieldname = s_mod_cell-fieldname
i_row_id = s_mod_cell-row_id.
ENDIF.
ENDMETHOD.
Furthermore, if you make your class inherited from CL_GUI_ALV_GRID you can make use of protected attribute MT_OUTTAB which is a data object referencing your output table. Then you can have:
FIELD-SYMBOLS: <outtab> TYPE STANDARD TABLE.
ASSIGN me->mt_outtab->* TO <outtab>.
* do whatever you want with <outtab>
Hope this helps.
Kind regards,
Igor
P.S. Regarding the blank lines that you need, what's wrong with standard ALV grid buttons "Append row" and "Insert row" which appear whenever the grid is editable (unless you deliberately remove them)? They work just fine with me (just like on SM30). I don't see reason for programatically appending lines to your internal table. -
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 background column headings
HI EVERYONE,
I was able to execute the ALV grid report in background .But columns heading is reeating for
each page.
Can't we just just have the Column Headings once for all pages.?For the IS_LAYOUT parameter it is possible to set NO_COLHEAD = 'X'. Then the header is gone. Then you have to create first line in table with texts. But then all fields must be character fields.
Regards
Roy -
Hey,
How to know number of rows and columns in alv grid are used.Hi,
You can count the number of rows , by using describe statemet,
describe table itab lines v_lines.
itab is table used to display in ALV
Thanks & Regards,
Navneeth K. -
ALV Grid Single Row Selection Only
Hi,
I have a requirement to select a single row in an ALV grid using class
I tried with layout-sel_mode = 'B' its not working, and don't want to use
call method g_grid->get_selected_rows
importing
et_row_no = lt_row_no.
and check for number of rows and giving error message " select only one row".
Is there any other way to tackle this issue
Thanks
aRsHi,
DATA:
* Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
* Information about 1 row
g_selected_row LIKE lvc_s_row.
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
DESCRIBE TABLE gi_index_rows LINES l_lines.
Here the L_Lines will contain the number of rows selected
Regards
Sudheer -
Multiple Hotspots handling in ALV Block List
Hello All,
This is my fisrt thread in the SDN though I am wokring in SAP area from past 5 years.
Some business background of te block list report.
Mine reprot is completing the flow of SD .
first block displays the SO items.
second block displays the Billing Information
Third Block displays the Shippinng Information.
Now comes to the problem.
I have come accross a strange situation in the ALV Block list hotspot handling.
In the first report the i want to have the hotspot for two columns.
1. SO Document (VBAK-VBELN) and Materials status(MARA-MSTAE).
In the User_command problem is
slis_selfield is not retruning the field name (slis_selfield-fieldname) please can any body tell about this.
see why I need this information is
based on the field I want to decide the flow.
if it is Materialstatus(Mstae) I would like to take him to Mara related information.
If it is Sales Order Document(vbeln) I would like to take him to SO related information.
I hope I am clear my requirement. if not please let me know.
I am expecting some possible answers for it.
Thanks and Regards,
Shankar
PS: It is returning the tablename but it doesnt solve the problem bcz both columns(or fields) belongs to the same row. so I really cant distinguish from where i have got the hotspot click.Can you debug why the fieldname is not returned? This is strange.
Usually I use this code and it always works:
FORM f_user_command USING f_ucomm TYPE sy-ucomm "#EC CALLED
i_selfield TYPE slis_selfield.
CHECK f_ucomm = '&IC1'.
CLEAR wa_report.
READ TABLE t_report
INTO wa_report
INDEX i_selfield-tabindex.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CASE i_selfield-fieldname.
* Drill down to STR
WHEN 'BANFN'.
CHECK wa_report-banfn IS NOT INITIAL.
SET PARAMETER ID 'BAN' FIELD wa_report-banfn.
CALL TRANSACTION 'ME53N' AND SKIP FIRST SCREEN.
* Drill down to STO
WHEN 'EBELN'.
CHECK wa_report-ebeln IS NOT INITIAL.
SET PARAMETER ID 'BES' FIELD wa_report-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDCASE. -
ALV Grid Exporting to Excel - Columns out of order
Hi,
In my ALV grid everything is in order as it is in the structure. When however I export to excel from ALV grid, the columns are out of order. First it lists the string columns, then number columns and lastly date columns. Is there a way to make excel keep the same order as it is in ALV grid?
Thanks,
SergiyI am not much of an ABAPer but I was able to set the column position during data declaration with
gs_fcat_line-col_pos = 1, for example.
That would put the column in the first position in ALV as well as the excel export.
Thanks for your inputs.
Sergiy -
ALV Grid with Multiple Headers
Dear All ,
I want to know is it possible to display Multiple header in the ALV Grid Display it is possible in List Display that i dne but i want in
My requirment is :
Header 1 | Header 2
SubHeader 1 | SubHeader 2 | SubHeader 3 | SubHeader 4
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
Header line 1 and Header line 2 in this format .
How it could be possible Please suggest or its not at all possible . Please suggest .
Thanks & Regards,
Aryan>
Aryan@sap wrote:
> That i will do in end but i want with ALV Grid . If it wont be possible with ALV grid i will finally do with ALV List .
> If any solution possible through ALV Grid then Please Suggest .
Then go for ALV List. But i am not sure if you can achieve this using the method suggested by Soumyaprakash.
You can give it a try though.
It is possible because that I have seen in standard here i cant paste the screen shot . but how its comming tht i am not able to analysis .
This is news to me now. Which standard code are you referring to?
Good luck !! -
Select single column but multiple rows in JTable
Hi
I have a jTable and want to be able to select multiple rows but only in a single column.
I've set these properties which makes selection almost the way I would like it.
table1.setCellSelectionEnabled(true);
table1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);the only problem now is that the user can select multiple columns.
Is there a simple way to restrict selection to single column?
regards
abqtable.setCellSelectionEnabled(true);
table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
DefaultListSelectionModel model =
(DefaultListSelectionModel)table.getColumnModel().getSelectionModel();
model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); -
Hi all,
Please let me know how to hanldle event handling , making a cell in editable mode ,double click and hotspot creation,colorign a single cell,calling a transatcion when clicked on hotspot in a alv grid display program (not using OO concepts).
Looikng forward for a positive response.
Reagrds,
Mohinder.Hi,
You can create your own custom status and asign it to your
ALV GRID. Here is a sample code to add custom status and handling events.
http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
Reward Points if found helpfull..
Cheers,
Chandra Sekhar. -
Hi Friends,
Let me know how to handle the event raised by clicking the hotspot of an ALV grid that is placed over one splitter container.
I am explaining the problem in detail:
(1) I have to display an ALV grid and when any hotspot of that ALV grid is clicked,
the row-id should be captured and used to fetch corresponding records from
child table (primarykey-foreign key relationship) and the resulting grid should be
displayed on the same screen at the same time and for any further click, the
child grid is to be refreshed.
(2) For this, I have created one custom container, placed one splitter container having two rows & one column over it and placed the ALV grids over that by getting the corresponding containers of the splitter.
(3) Now, when the hotspot is clicked the SY-UCOMM is empty (even it is not entering the PAI block if I do not place the back button). So, I am not able to get the row-id of the clicked row & without that, can't proceed any further.
(4) Rest of the things are working fine and I have tested that also.
Please help me out as I am new to this field and started practicing ABAP just a month back.
Thanks & Regards
Aditya P. SrivastavaHi Aditya
Here is the complete for the same,
<b>Some Prerequisites in terms of screen, custom control & flow logic</b>
<i>Screen Name: 9000, Custom Container name : CONTAINER.
flow logic in screen 9000
PROCESS BEFORE OUTPUT.
MODULE status_9000.
MODULE init_9000.
PROCESS AFTER INPUT.
MODULE user_command_9000.</i>
<b>
Here goes the code,</b>
REPORT zkb_2alv_grids.
DATA: i_t000 TYPE TABLE OF t000,
w_t000 TYPE t000,
i_tcurr TYPE TABLE OF tcurr.
Declaration for all the objects required
DATA: o_container TYPE REF TO cl_gui_custom_container,
o_splitter TYPE REF TO cl_gui_easy_splitter_container,
o_container_top TYPE REF TO cl_gui_container,
o_container_bottom TYPE REF TO cl_gui_container,
o_salv_table1 TYPE REF TO cl_salv_table,
o_salv_table2 TYPE REF TO cl_salv_table,
o_salv_columns TYPE REF TO cl_salv_columns_table,
o_salv_column TYPE REF TO cl_salv_column_table.
DATA: o_events TYPE REF TO cl_salv_events_table.
CLASS lcl_handle_events DEFINITION
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS: on_link_click
FOR EVENT link_click
OF cl_salv_events_table
IMPORTING row column.
ENDCLASS. "lcl_handle_events DEFINITION
CLASS lcl_handle_events IMPLEMENTATION
CLASS lcl_handle_events IMPLEMENTATION.
METHOD on_link_click.
READ TABLE i_t000 INTO w_t000 INDEX row.
SELECT * FROM tcurr
INTO TABLE i_tcurr
WHERE fcurr = w_t000-mwaer.
o_salv_table2->refresh( ).
ENDMETHOD. "lcl_handle_events
ENDCLASS. "lcl_handle_events IMPLEMENTATION
START-OF-SELECTION.
DATA: event_handler TYPE REF TO lcl_handle_events.
Select Data
SELECT * FROM t000 INTO TABLE i_t000.
CALL SCREEN 9000.
*& Module init_9000 OUTPUT
text
MODULE init_9000 OUTPUT.
DATA: lv_cx_salv_msg TYPE REF TO cx_salv_msg,
lw_bal_s_msg TYPE bal_s_msg.
IF NOT o_container IS BOUND.
Create a Custom Control
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTAINER'
repid = sy-repid
dynnr = '9000'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Create splitter control
CREATE OBJECT o_splitter
EXPORTING
parent = o_container
orientation = 0
sash_position = 30
with_border = 1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assign the left and right control that were splitted
o_container_top = o_splitter->top_left_container.
o_container_bottom = o_splitter->bottom_right_container.
ENDIF. " IF NOT o_container IS BOUND.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
r_container = o_container_top
IMPORTING
r_salv_table = o_salv_table1
CHANGING
t_table = i_t000.
CATCH cx_salv_msg INTO lv_cx_salv_msg.
lv_cx_salv_msg->if_alv_message~get_message(
RECEIVING
r_s_msg = lw_bal_s_msg ).
MESSAGE ID lw_bal_s_msg-msgid
TYPE lw_bal_s_msg-msgty
NUMBER lw_bal_s_msg-msgno
WITH lw_bal_s_msg-msgv1 lw_bal_s_msg-msgv2
lw_bal_s_msg-msgv3 lw_bal_s_msg-msgv4.
ENDTRY.
Column Settings
o_salv_columns = o_salv_table1->get_columns( ).
o_salv_column ?= o_salv_columns->get_column( 'MWAER' ).
o_salv_column->set_cell_type( 5 ).
o_events = o_salv_table1->get_event( ).
CREATE OBJECT event_handler.
SET HANDLER event_handler->on_link_click FOR o_events.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
r_container = o_container_bottom
IMPORTING
r_salv_table = o_salv_table2
CHANGING
t_table = i_tcurr.
CATCH cx_salv_msg INTO lv_cx_salv_msg.
lv_cx_salv_msg->if_alv_message~get_message(
RECEIVING
r_s_msg = lw_bal_s_msg ).
MESSAGE ID lw_bal_s_msg-msgid
TYPE lw_bal_s_msg-msgty
NUMBER lw_bal_s_msg-msgno
WITH lw_bal_s_msg-msgv1 lw_bal_s_msg-msgv2
lw_bal_s_msg-msgv3 lw_bal_s_msg-msgv4.
ENDTRY.
Display the ALV Grid
o_salv_table1->display( ).
o_salv_table2->display( ).
ENDMODULE. " init_9000 OUTPUT
*& Module user_command_9000 INPUT
text
MODULE user_command_9000 INPUT.
CASE sy-ucomm .
WHEN 'BACK' OR 'EXIT' OR 'CANC'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. " user_command_9000 INPUT
*& Module status_9000 OUTPUT
text
MODULE status_9000 OUTPUT.
SET PF-STATUS '9000'.
ENDMODULE. " status_9000 OUTPUT
Regards
Kathirvel -
Hi All,
Can any one give suggestion for this
multiple row selection in ALV grid without using CTRL key
Thanks
Surendrahi suri,
if you are using OOPS ALV then take one extra column in fieldcatalog in editable mode dont take it in filnal ITAB jst in fcat
and u will get cell for selection of row.
wa_fieldcat1-row_pos = 1.
wa_fieldcat1-col_pos = 1.
wa_fieldcat1-fieldname = 'SEL'.
wa_fieldcat1-tabname = 'IT_OUTPUT'.
wa_fieldcat1-no_out = 'X'.
wa_fieldcat1-edit = 'X'.
APPEND wa_fieldcat1 TO it_fieldcat1.
CLEAR wa_fieldcat1.
in this way u will get sel for selection. -
Hi all,
I need the list output of one program in my program in a grid(single column).
I am doing the below..
TYPES: BEGIN OF tp_ascitab ,
line(150),
END OF tp_ascitab.
DATA: dt_ascitab TYPE TABLE OF tp_ascitab,
ds_ascitab TYPE tp_ascitab.
SUBMIT zlist_program WITH p-gmn EQ matno
WITH p-plant EQ plant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gmn_info_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listobject = gmn_info_tab
listasci = dt_ascitab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF dg_gridcont IS INITIAL.
Create controls
CREATE OBJECT dg_gridcont
EXPORTING container_name = 'GRID_CONT'.
ENDIF.
CREATE OBJECT dg_grid
EXPORTING i_parent = dg_gridcont.
ds_layout-no_hgridln = 'X'.
ds_layout-no_toolbar = 'X'.
CALL METHOD dg_grid->set_table_for_first_display
EXPORTING
is_layout = ds_layout
CHANGING
it_fieldcatalog = dt_fcat[]
it_outtab = dt_ascitab.
The table dt_ascitab has data in correct format until it is passed to grid.
After that, there is change in alignmentt. The grid output has data with
improper alignment. Could anyone help me with this.
thanks,
Keerthi.Hi Keerthi,
Try Using following FM before Method 'set_table_for_first_display'
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_buffer_active = ' '
i_structure_name = 'structure in which format u need output'
i_client_never_display = 'X'
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = dt_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Hope, it will help u. -
Hi SDN,
I have a ALV grid with columns U1 and U2. I want to filter the records only when U1 = X <b>AND</b> U2 = X . But I need all other combinations of U1 and U2.
Is it possible to make <b>AND</b> operator work in ALV grid filter? If so please let me know. If this functionality is not available directly how to achieve it.
Points will be asigned
thanksHi,
ls_filter-fieldname = 'U1'.
ls_filter-low = 'X'.
ls_filter-high = space.
ls_filter-option = 'EQ'.
ls_filter-sign = 'I'.
append ls_filter to lt_filter.
ls_filter-fieldname = 'U2'.
ls_filter-low = 'X'.
ls_filter-high = space.
ls_filter-option = 'EQ'.
ls_filter-sign = 'I'.
append ls_filter to lt_filter.
call method grid2->set_table_for_first_display
exporting
i_default = gc_enable_set_default
i_save = gc_var_maint_user_specific
is_variant = gs_variant_item
is_print = gs_print
is_layout = gs_layout_item
it_toolbar_excluding = gt_toolbar_excluding
changing
it_fieldcatalog = gt_fieldcat_lvc_item[]
it_outtab = gt_outtab_item[]
it_filter = lt_filter[].
a®
Maybe you are looking for
-
Greetings all, I'm trying to setup KDE4, but I'm running into that fun white screen. I can get into kdm all right, but when I try to log into kde it just goes straight to the white screen and mouse pointer. I can't get anywhere else. I installed KDE4
-
Hello SDN Team, I would like to know what are the Movement types used in PP Module.. Regards Vijay
-
Hooking up to a wireless display?
Just to check, is it supported yet? When I look for it in the start menu {sidenote, yay hybrids!} it just takes me to the display, but no option to actually connect a wireless display. C# newbie, learning on the go. I will probably ask a lot of follo
-
I put together a playlist on iTunes, but it shows in reverse order on my iPod. What did I do wrong and how can I fix it? Thanks!
-
Suggestions needed to implement Audit Logging
In our project we have a requirement to implement Audit logging. i.e., we need to track any changes in the form of CREATE, UPDATE and DELETE of any field in the database. We have some UI also which will present this change history to the user. After