Reg.Double click concept in classes
Hello,
I had developed a program which is extracting data from kna1 and vbak table.Now i am facing a problem when iam using a concept called doubleclick.In my first screen data from kna1 table is displayed.Now i want to see respective data from vbak table when i double click one particular custnumber.How can i use concept doubleclick for that.can anybody explain me in detail.
Hello Priyanka
The sample report ZUS_SDN_TWO_ALV_GRIDS_0 shows how to display sales orders per customer using two ALV grids.
*& Report ZUS_SDN_TWO_ALV_GRIDS_0
*& Description: Display KNA1 in 1st ALV grid,
*& select VBAK data by double-clicking
*& SDN: Reg.Double click concept in classes
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
REPORT zus_sdn_two_alv_grids.
DATA:
gd_repid TYPE syrepid,
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gs_knb1 TYPE knb1,
gt_header TYPE STANDARD TABLE OF kna1,
gt_position TYPE STANDARD TABLE OF vbak.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_customer TYPE kunnr READ-ONLY.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
define local data
DATA:
ls_header LIKE LINE OF gt_header.
CHECK ( sender = go_grid1 ).
READ TABLE gt_header INTO ls_header INDEX e_row-index.
CHECK ( ls_header-kunnr IS NOT INITIAL ).
md_customer = ls_header-kunnr.
Triggers PAI of the dynpro with the specified ok-code
cl_gui_cfw=>set_new_ok_code( 'DETAIL' ). " not 4.6c
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DETAIL'
IMPORTING
RC =
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM kna1 INTO TABLE gt_header UP TO 500 ROWS.
Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
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.
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999 " full-screen
EXCEPTIONS
cntl_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.
Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
NO_AUTODEF_PROGID_DYNNR =
NAME =
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.
Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNA1'
is_layout = gs_layout
CHANGING
it_outtab = gt_header
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gs_layout-grid_title = 'Sales Order per Customer'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
is_layout = gs_layout
CHANGING
it_outtab = gt_position " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
SET TITLEBAR 'xxx'.
Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM entry_show_details .
define local data
DATA:
ld_title TYPE lvc_title.
SELECT * FROM vbak INTO TABLE gt_position
WHERE kunnr = lcl_eventhandler=>md_customer. " Sold-to-party
CONCATENATE 'Sales Order of customer' lcl_eventhandler=>md_customer
INTO ld_title
SEPARATED BY space.
CALL METHOD go_grid2->set_gridtitle
EXPORTING
i_gridtitle = ld_title.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe
Similar Messages
-
Hi All,
I have created an alv report using alv class. I have handled the double click event in that i am calling transaction using row currenlty selected. But after doing subtotalling the list and then i double click a line it is passing wrong data.
Points are awarded,
Regards,
Bharat Mistry
Message was edited by: Bharat MistryHi Bharat,
Read the internal table contents in double click event with e_row-index , then you will get the data of that particular row.
check below code :
local class to handle semantic checks
CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA: g_event_receiver TYPE REF TO lcl_event_receiver.
LOCAL CLASS Definition
*§4.Define and implement event handler to handle event DATA_CHANGED.
CLASS lcl_event_receiver DEFINITION.
public section.
METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_double_click.
read table gt_outtab index e_row-index into
Regards
Appana
*Reward Points for helpful answers
Message was edited by: L Appana -
Off topic... - Open .class file on double click
Hi, I'm using windows and with the assoc and ftype commands in CMD i can make files open with a certain program and load some parameters. But I'd like to use the ftype command to open the file without the extension within.
Here is my example:
C:\Users\myUserName\Documents\Java>
ftype JavaClassFile=C:\Program Files\Java\jdk1.6.0_01\bin\java.exe %*And then :
C:\Users\Viktor\Documents\Java>Hi.class(same thing on double click)
I get this error, wich is obvious:
Exception in thread "main" java.lang.NoClassDefFoundError: C:\Users\Viktor\Docum
ents\Java\Hi/classSo how can I make it open with java and leave out the .class extension in the filename?To be more accurate I'd like it to open
java Hiinstead of
java Hi.class -
I have an app written with Visual Studio 2013. The app has code for opening a file using the standard OpenFileDialog and also has code (AutoOpenFile()) for opening a file when a user double-clicks on a file that is handled by the app. I have not yet created
an installer for the app, so I won't be able to test it's AutoOpenFile() code...unless there is a way to simulate the process of auto-opening the double-clicked file without actually installing the app on my PC. Anyone?Thanks for your reply, Wyck. I already have the necessary code in my app for opening a file when I double-click on it. The problem is that the app is not currently installed on my PC. Until I do install it, is there a way I can test-run that code
by double-clicking on an associated file?
You lost me at: you want to test-run code that is not on your PC.
O_o
You want to double-click a file, and then...what do you want to have happen? You want to run...something...that is not on your PC??
The "simulation" is to launch your app from the command line and pass in the name of the file you wanted to simulate a "double-click" of.
Regardless, you cannot get the shell to have a double-click of a file cause your application to launch unless you modify the registry to do so. (This is tantamount to "install" to me.)
In the spirit of continuing to be helpful, though, I'll assume that this is what you want to do and I'll show you how to get it done with the least amount of tampering with your registry.
Here are minimally invasive registry modifications you need to make to get it to launch a program when you double-click your file. It's pretty small.
EXAMPLE ONLY:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.wyck]
@="Wyck.Document"
[HKEY_CLASSES_ROOT\Wyck.Document\shell\open\command]
@="c:\\windows\\system32\\notepad.exe \"%1\""
[You have to save the above with your appropriate modifications to a file with the
.reg extension (e.g.: test.reg) and then you'll have to double-click the test.reg file to "merge" these settings into your registry.]
The example above registers a file extension called .wyck and assigns a completely arbitrary class name to it called
Wyck.Document.
Then it associates a shell open command with the Wyck.Document class that causes
notepad.exe to be passed the filename of the file you double-clicked (that's what the
%1 does). You are welcome to replace all the specific names with your own extensions and class names and replace notepad.exe with the path to your (test) executable.
This executable will be launched, but not with a debugger attached. To facilitate debugging it, you'll want to temporarily add some code to your program to pause when the program launches, possibly by showing a message box right at the very beginning
of your main function that says "attach debugger now" so that you can attach a debugger to the process that was started by the shell, and then dismiss the message box and continue debugging.
When you are done with your testing, you can simply manually delete those two registry keys using
regedit. -
When user double-clicks on a file, then I want my program to open it...
Ok, so I have been having a lot of trouble finding the answer to what I at first thought was a simple question.
I do not know, at all, how to make my program able to open files in the normal sense. Normal sense meaning user double-clicks my_file.xxx, or for that matter right-clicks my_file.xxx and selects open with, and then my_app.jar starts up and opens the file.
I have already created the app, and it runs nicely. This app has a menu bar with the usual File >> Open which works just fine reading my_file.xxx. My_app.jar can also saves my_file.xxx. So I am not having trouble with I/O.
So if someone can give me even the slightest hint in the right direction I'd be very thankful.
p.s. I am working on a mac but my_app.jar will be running mostly on windows so cross-platform is very important.Actually, I was more wondering what kind of code I
need to add to my program to make it possible at all.
My file input and output is all done from a Utilites
class which I made but quite obviously any OS will
not know to call Utiities.load(...arguments...).
But, my goal is to have my program work as seamlessly
as possible with a normal person's desktop.I'm sorry, you're right, I completely misread your post. I would definitely take the tactic of writing a .reg file and executing it. That seems to be the accepted way of creating registry entries on Java if you have to do such a thing.
Here is a link to the type of .reg file you're going to need to associate a file with a certain program, and you'll need to modify it slightly to do a 'java -jar myJar' type of thing. Then, just point Runtime.getRuntime().exec() at it, and you should be good to go.
The only thing I'd be worried about is how to find the JAVA_HOME. If you launched your installer via WebStart (or had the user double-click the jar for the first time), though, you could just use
System.getProperty("java.home"); -
Project locks up when user double clicks click box
I have a series of practice questions in my Captivate 5 projects that use click boxes to select the question's answers. The project pauses at the click boxes (which all appear at the same time), and a feedback caption appears. A second later, a continue button appears. The project again pauses until the user clicks the continue button. Then the project goes to the next slide. My problem is that when the user double clicks a click box, or clicks it right when it appears (the cursor changes from arrow to a hand), the continue button does not appear.
I am just considering deleting the continue button but my intent there was to allow as much time as the user needed to read the feedback captions after clicking the click box. Any help on this is appreciated.
Options selected on click box: hand cursor, and pause project until user clicks.
Thanks.Actually, I was more wondering what kind of code I
need to add to my program to make it possible at all.
My file input and output is all done from a Utilites
class which I made but quite obviously any OS will
not know to call Utiities.load(...arguments...).
But, my goal is to have my program work as seamlessly
as possible with a normal person's desktop.I'm sorry, you're right, I completely misread your post. I would definitely take the tactic of writing a .reg file and executing it. That seems to be the accepted way of creating registry entries on Java if you have to do such a thing.
Here is a link to the type of .reg file you're going to need to associate a file with a certain program, and you'll need to modify it slightly to do a 'java -jar myJar' type of thing. Then, just point Runtime.getRuntime().exec() at it, and you should be good to go.
The only thing I'd be worried about is how to find the JAVA_HOME. If you launched your installer via WebStart (or had the user double-click the jar for the first time), though, you could just use
System.getProperty("java.home"); -
Editable ALV- Quantity field value is getting changed while double clicking
Hi all,
I have created Editable ALV grid using Class concepts. Quantity field is editable in dat. but after changing value and if im double clicking on that field, value is getting changed. eg: 45 is changing to .045. How can i resolve this problem.
Could u plz help.Hi Anu,
One question from my side.
U have displayed the ALV.In that grid u have quantity field.U have changed the value of that field to 45.
When u press enter the value has been changed to .045.Is this u r problem.
U can do onething anu.
Declare one varaible with the local field.
Pass u r quantity field value into that variable.
While displaying thriugh SET_TABLE_FIRST_DISPLAY in your internal table pass this variable.
It will solve u r problem.I think.
Let me if yu have any problem
IF u want u can refer to the program BCALV_EDIT* in se38.
There also u have needful info
Thanks, -
Event double -click doens't work
Dear All,
Pls help event double -click doens't work.
What can the reason be for it ?
Regards
Ilhan
data tree1 type ref to cl_gui_alv_tree.
data mr_toolbar type ref to cl_gui_toolbar.
include <icon>.
data: gt_sflight type ZQMCOMP occurs 0, "Output-Table
gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog
ok_code like sy-ucomm. "OK-Code
* TREE_EVENT_RECEIVER *
class tree_event_receiver definition.
public section.
methods on_doubleclick
for event link_click of cl_gui_alv_tree
importing node_key fieldname.
ENDCLASS. "lcl_handler DEFINITION
* CLASS tree_event_receiver IMPLEMENTATION
class tree_event_receiver implementation.
METHOD on_doubleclick.
MESSAGE I000(38) WITH fieldname.
ENDMETHOD. "on_doubleclick
endclass.
start-of-selection.
end-of-selection.
call screen 100.
*& Module PBO OUTPUT
* process before output
module pbo output.
set pf-status 'MAIN100'.
if tree1 is initial.
perform init_tree.
endif.
call method cl_gui_cfw=>flush.
endmodule. " PBO OUTPUT
*& Module PAI INPUT
* process after input
module pai input.
case ok_code.
when 'EXIT' or 'BACK' or 'CANC'.
perform exit_program.
when others.
call method cl_gui_cfw=>dispatch.
endcase.
clear ok_code.
call method cl_gui_cfw=>flush.
endmodule. " PAI INPUT
*& Form build_fieldcatalog
* build fieldcatalog for structure sflight
form build_fieldcatalog.
data: ls_fieldcatalog type lvc_s_fcat.
ls_fieldcatalog-fieldname = 'DUNS'.
ls_fieldcatalog-col_pos = 7.
ls_fieldcatalog-coltext = 'Duns'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'MONAT'.
ls_fieldcatalog-col_pos = 8.
ls_fieldcatalog-coltext = 'Monat'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'ZE'.
ls_fieldcatalog-col_pos = 13.
ls_fieldcatalog-coltext = 'Ze'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'MATKOSTEN'.
ls_fieldcatalog-col_pos = 14.
ls_fieldcatalog-coltext = 'Mat.Kosten'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'ANTEIL'.
ls_fieldcatalog-col_pos = 15.
ls_fieldcatalog-coltext = 'Anteil'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'GESMAT'.
ls_fieldcatalog-col_pos = 16.
ls_fieldcatalog-coltext = 'Ges.Mat'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'GESLOH'.
ls_fieldcatalog-col_pos = 17.
ls_fieldcatalog-coltext = 'Ges.Lohn'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
clear ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'GESAMT'.
ls_fieldcatalog-col_pos = 19.
ls_fieldcatalog-coltext = 'Gesamt'.
APPEND ls_fieldcatalog TO gt_fieldcatalog.
call function 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZQMCOMP'
CHANGING
ct_fieldcat = gt_fieldcatalog.
endform. " build_fieldcatalog
*& Form build_hierarchy_header
* build hierarchy-header-information
* -->P_L_HIERARCHY_HEADER strucxture for hierarchy-header
form build_hierarchy_header changing
p_hierarchy_header type treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy-Kopf'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'Hierarchy-Kopf !'.
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
endform. " build_hierarchy_header
*& Form exit_program
* free object and leave program
form exit_program.
call method tree1->free.
leave program.
endform. " exit_program
*& Form build_header
* build table for html_header
* --> p1 text
* <-- p2 text
form build_comment using
pt_list_commentary type slis_t_listheader
p_logo type sdydo_value.
data: ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = 'LIBOLO '.
append ls_line to pt_list_commentary.
clear ls_line.
clear ls_line.
ls_line-typ = 'A'.
ls_line-info = 'Liste'.
append ls_line to pt_list_commentary.
* p_logo = 'ENJOYSAP_LOGO'.
endform.
* FORM create_hierarchy *
FORM create_hierarchy.
data: ls_sflight type ZQMCOMP,
lt_sflight type ZQMCOMP occurs 0.
* get data
select * from ZQMCOMP into table lt_sflight.
* sort lt_sflight by carrid connid fldate.
* add data to tree
data: l_carrid_key type lvc_nkey,
l_connid_key type lvc_nkey,
l_last_key type lvc_nkey.
loop at lt_sflight into ls_sflight.
on change of ls_sflight-KUNDE.
perform add_carrid_line using ls_sflight
changing l_carrid_key.
endon.
on change of ls_sflight-MONAT.
perform add_connid_line using ls_sflight
l_carrid_key
changing l_connid_key.
endon.
perform add_complete_line using ls_sflight
l_connid_key
changing l_last_key.
endloop.
* calculate totals
call method tree1->update_calculations.
* this method must be called to send the data to the frontend
call method tree1->frontend_update.
endform. " create_hierarchy
*& Form add_carrid_line
* add hierarchy-level 1 to tree
* -->P_LS_SFLIGHT sflight
* -->P_RELEATKEY relatkey
* <-->p_node_key new node-key
form add_carrid_line using ps_sflight type ZQMCOMP
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value,
ls_sflight type ZQMCOMP.
* set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-style =
cl_gui_column_tree=>style_intensifd_critical.
append ls_item_layout to lt_item_layout.
* add node
l_node_text = ps_sflight-KUNDE.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " add_carrid_line
*& Form add_connid_line
* add hierarchy-level 2 to tree
* -->P_LS_SFLIGHT sflight
* -->P_RELEATKEY relatkey
* <-->p_node_key new node-key
form add_connid_line using ps_sflight type ZQMCOMP
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value,
ls_sflight type sflight.
* set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@3Y@'.
ls_item_layout-style =
cl_gui_column_tree=>style_intensified.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
append ls_item_layout to lt_item_layout.
* add node
l_node_text = ps_sflight-MONAT.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " add_connid_line
*& Form add_cmplete_line
* add hierarchy-level 3 to tree
* -->P_LS_SFLIGHT sflight
* -->P_RELEATKEY relatkey
* <-->p_node_key new node-key
form add_complete_line using ps_sflight type ZQMCOMP
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value.
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
append ls_item_layout to lt_item_layout.
l_node_text = ps_sflight-QMART.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = ps_sflight
i_node_text = l_node_text
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " add_complete_line
*& Form register_events
* text
* --> p1 text
* <-- p2 text
form register_events.
data: lt_events type cntl_simple_events,
l_event type cntl_simple_event.
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_click.
append L_EVENT to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
append L_EVENT to lt_events.
* set Handler
data: l_event_receiver type ref to tree_event_receiver.
create object l_event_receiver.
set handler l_event_receiver->on_doubleclick for tree1.
call method tree1->set_registered_events
exporting
events = lt_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
endform. " register_events
*& Form change_toolbar
* text
* --> p1 text
* <-- p2 text
form change_toolbar.
* get toolbar control
call method tree1->get_toolbar_object
importing
er_toolbar = mr_toolbar.
check not mr_toolbar is initial.
* add seperator to toolbar
call method mr_toolbar->add_button
exporting
fcode = ''
icon = ''
butn_type = cntb_btype_sep
text = ''
quickinfo = 'This is a Seperator'. "#EC NOTEXT
* add Standard Button to toolbar (for Delete Subtree)
call method mr_toolbar->add_button
exporting
fcode = 'DELETE'
icon = '@18@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'Delete subtree'. "#EC NOTEXT
* add Dropdown Button to toolbar (for Insert Line)
call method mr_toolbar->add_button
exporting
fcode = 'INSERT_LC'
icon = '@17@'
butn_type = cntb_btype_dropdown
text = ''
quickinfo = 'Insert Line'. "#EC NOTEXT
endform. " change_toolbar
*& Form init_tree
* text
* --> p1 text
* <-- p2 text
FORM init_tree.
* create fieldcatalog for structure sflight
perform build_fieldcatalog.
* create container for alv-tree
data: l_tree_container_name(30) type c,
l_custom_container type ref to cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
if sy-batch is initial.
create object l_custom_container
exporting
container_name = l_tree_container_name
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
endif.
* create tree control
create object tree1
exporting
parent = l_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
* create Hierarchy-header
data l_hierarchy_header type treev_hhdr.
perform build_hierarchy_header changing l_hierarchy_header.
* create info-table for html-header
data: lt_list_commentary type slis_t_listheader,
l_logo type sdydo_value.
perform build_comment using
lt_list_commentary
l_logo.
* repid for saving variants
data: ls_variant type disvariant.
ls_variant-report = sy-repid.
* create emty tree-control
call method tree1->set_table_for_first_display
exporting
I_STRUCTURE_NAME = 'ZQMCOMP'
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary
* i_logo = l_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
changing
it_outtab = gt_sflight "table must be emty !!
it_fieldcatalog = gt_fieldcatalog.
* create hierarchy
perform create_hierarchy.
* add own functioncodes to the toolbar
perform change_toolbar.
* register events
perform register_events.
* adjust column_width
call method tree1->COLUMN_OPTIMIZE.
ENDFORM. " init_treeHi,
to do so, you need to declare those fields in the form CREATE_HIERARCHY.
For example, to add FLDATE node, you should do:
ON CHANGE OF LS_SFLIGHT-CARRID.
PERFORM ADD_CARRID_LINE USING LS_SFLIGHT
CHANGING L_CARRID_KEY.
ENDON.
ON CHANGE OF LS_SFLIGHT-CONNID.
PERFORM ADD_CONNID_LINE USING LS_SFLIGHT
L_CARRID_KEY
CHANGING L_CONNID_KEY.
ENDON.
ON CHANGE OF LS_SFLIGHT-FLDATE.
PERFORM ADD_FLDATE_LINE USING LS_SFLIGHT
L_CONNID_KEY
CHANGING L_FLDATE_KEY.
ENDON.
ON CHANGE OF LS_SFLIGHT-PRICE.
PERFORM ADD_PRICE_LINE USING LS_SFLIGHT
L_FLDATE_KEY
CHANGING L_PRICE_KEY.
ENDON.
and then create the new FORMS PERFORM ADD_PRICE_LINE and
PERFORM ADD_FLDATE_LINE by copy of the existent
PERFORM ADD_CONNID_LINE and change the L_NODE_TEXT in the form.
I suposed you are new to ALV's, so i have a sugestion for you.
Instead of CL_GUI_ALV_TREE try to use some examples of CL_GUI_ALV_TREE_SIMPLE. It's much more simple to understand and to work with. For example Report BCALV_TREE_SIMPLE_DEMO.
In this case, to add more nodes to the the you just need to add 3 lines of code in
perform build_sort_table.
Regards, -
How to go to different screen by Double Clicking a Tree Node
Hi guys,
I have a tool where i have a top panel and a bottompanel. On the top panel, i add Tab buttons so that if anyone is clicked, it will repaint the bottom panel with corresponding Tab screen(New screen will come with the top panel remaining same). There are Actions, Conditions,Trees tabs on the main panel. There is also a Home Tab on the main panel which when clicked brings up a tree structure on the left hand side of the bottom panel which has some parent and child nodes depending on whether they are files or directories. There are folders(parent nodes) with names Trees & Conditions also related to the Tabs on the main panel under which i have some file names. I am including the method which creates the nodes. The problem is that when i double click any file(not a directory), it should take me to the screen which is actually populated when i select the Trees/Conditions tab and select the corresponding file name from the drop down provided in that screen and click a view button. So, it is something like adding an actionListener or SelectionListener. But, i am unable to do it. Can anyone suggest me how to do it?
The class involving the following looks something like this.
public class MainHomePanel extends AbstractDtPanel {And the AbstractDtPanel looks something like this.
public abstract class AbstractDtPanel extends JPanelFinally, the method to create the Nodes is given below
private void createNodes(DefaultMutableTreeNode top) {
DefaultMutableTreeNode parentFolder = null;
DefaultMutableTreeNode innerFolder = null;
DefaultMutableTreeNode fileNames = null;
ArrayList folderName = new ArrayList();
ArrayList innerFolderNames = new ArrayList();
ArrayList fileNameArray = new ArrayList();
CommonUtil cu = new CommonUtil();
folderName =cu.getFolderNames(sessionData.getSysPath());
if(folderName != null && folderName.size() > 0) {
for(int i =0; i<folderName.size(); i++) {
parentFolder = new DefaultMutableTreeNode((String)folderName.get(i));
top.add(parentFolder);
innerFolderNames = new ArrayList();
innerFolderNames = cu.getInnerFolderNames(sessionData.getSysPath(), (String)folderName.get(i));
for(int k=0; k<innerFolderNames.size();k++) {
innerFolder = new DefaultMutableTreeNode((String)innerFolderNames.get(k));
parentFolder.add(innerFolder);
fileNameArray = new ArrayList();
fileNameArray = cu.getFileNames(sessionData.getSysPath(), (String)folderName.get(i),(String)innerFolderNames.get(k));
for(int j=0; j<fileNameArray.size(); j++) {
fileNames = new DefaultMutableTreeNode(fileNameArray.get(j));
innerFolder.add(fileNames);
}Sorry, a small mistake. The "createNodes" method is in the "MainHomePanel" class.
-
Error when double clicking any field in Alv grid
Hi All,
I have created a custom container. To that custom container I am displaying an alv grid with all editable fields using oops concept.
Hence when I am double clicking on any on the field of the table I am getting a dump " an exception condition ERROR raised in CL_GUI_ALV_GRID_BASE in method SET_DRAG_DROP_ROWS".
Kindly helpHi,
Check the PF-STATUS. It seems that you have assigned F6 shortcut key for some event.
Remove the F6 assignment & activate the pf-status.
Best regards,
Prashant -
JDeveloper IDE Crashing using double click on DataAction in struts-diagram.
Hello,
Has anyone had this problem with Jdeveloper10g?
We have a workspace for an application that has grown fairly large. The
problem happens when we try to drag a DataAction from the Component Palette
onto the struts-diagram when in the the JDeveloper10g IDE and then
double click the icon to create a data action. We get this message:
An Error has occurred in the Java VM
An operation has failed because an error has occurred in the Java VM. The current
activity may fail and the system may have been left in an unstable state. The following
is a stack trace.
java.lang.StackOverflowError
If further errors occur, you should restart the application.
If the error was an OutOfMemoryError, try closing some components, such as some
diagrams, or increase the Java heap size.
Also, report the problem on the JDeveloper forum on otn.oracle.com, or contact Oracle
support, giving the information in this message.
The Version of JDeveloper we are using is: 10.1.2.1.0 Build 1913 but we also had the
same problem using this same workspace in Build 1811. If we try a different workspace
there is no problem and we don't see the issue. Neither do we see the problem if we drag
either a DataPage or a plain Action from the Component Palette and the double click
either of those to create a Jsp page or an action.
We have spent hours using diffing software recursively on the workspace directories trying
to determine what may have gone wrong. We have eliminated a great deal from the problem
workspace including deleting everything from the struts-diagram (In a copy of the ws of course).
We really can't afford to rebuild the workspace from scratch and this problem causes us a
significant headache. It seems like a serious bug in JDeveloper itself.
Any help would be appreciated.
Thanks,Problem Solved! This condition is caused by a circular dependency set up when the view was checked as a depndency for the model. We had a small class in the view that was being used in the model so the model was made dependant on the view and this causes an infinite loop condition of some sort when double clicking on a newly dropped in DataAction as described below.
-
Preventing Double Click on Link in List
Hello folks,
APEX 4.1
I'm supporting an application right now (which I didn't build I should add), which contains a navigation list entry which triggers an insert into a table (via a before header process fired by a request value which is set when the link is clicked.
I've had a look through the forum's search function for references to "links", "clicks", "double clicks" and "Disabled" and came up with lots of suggestions regarding disabling a button and links in reports, but nothing for links from navigation lists:
e.g. {thread:id=9405085}
Note that some of the example suggest using the javascript pseudo-protocol. I want to avoid that method at all costs.
Rather than verbosely explain the problem, I've set up a demo page on apex.oracle.com to demonstrate it:
Workspace: JC_DEMO
Username: DEMO_USER
password: demo
the pages in question are 9999 and 10000.
(p.s. I knocked this example up as fast as I could - the app hasn't been done to my usual standards! :-) )Okay I've solved this, or at least I've provided a solution to this particular problem on my "real" app - will amend the test case accordingly in due course but thought I'd share it on this thread anyway.
1) List Template: I took a copy of the existing List template and edited it. Under the "Sub List Entry" section, I amended both the "Sub List Template Current" and "Sub List Template Noncurrent" entries to the following:
<li><a class="#A02#" href="#LINK#">#TEXT#</a></li>In other words, I added a reference to "User Attribute No.2" (#A02#). The reason I used A02 is due to having already used A01 already for something else. Don't be too concerned about this.
2) List: I amended the "List Template" of my list to point at the amended template from step 1. Note also that my list is referenced in a list region on page Zero.
3) List Entry: I amended the list entry I wanted to disable double-clicks, Adding the following text to the 2nd entry in the "User Defined Attributes" section:
single_clickFrom step 1, you should note that this has the effect of adding the class "single_click" to the list entry. "single_click" is not referenced in any of my CSSs incidentally.
4) Page Ready Javascript: On Page Zero, I have a "Before Footer" region called "Page Ready Javascript", into which I put javascript that I want executed on page ready. The basic template for this region is as follows:
<script>
try{
$(function() {
/* code you want to execute */
catch(e){
/* error catching code */
</script>Within the page ready function (starting with '$'), I have the following code:
$(".single_click").click( function(){
window.location = $(this).attr('href');
$(this).unbind('click'); /* do this because .click adds to the existing click event */
$(this).click( function(){
return false;
return false;
});Note that I'm using the "single_click" class as my jquery selector. The result of all of this is that, if you click on the relevant link in my navigation list, no matter how many times you do, it will only request the page once.
Already I can see a few things I'm not happy about but its at least a reasonable starting point. Comments/critiques welcome. -
Double click on list field in ALV grid control
Hello all,
I developed a report with a ALV grid control. I would like to move some functionality from marking a line and pressing a button in the status line to double clicking a specific field in the output list and execute a command there (i.e. double click on PO number and go to PO display TAC then). Can anybody provide some example coding for that?
Thanks so much for your help!
TorstenHere is your sample program. Copy this code into a z program. Create the screen 100 with a container in it and name it "ALV_CONTAINER". Create the gui-status with "BACK".
report zrich_0001.
tables: ekko.
data: begin of i_alv occurs 0,
ebeln type ekko-ebeln,
end of i_alv.
* CLASS cl_event_receiver DEFINITION Handles Double Click
class cl_event_receiver definition.
public section.
methods handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column.
private section.
endclass.
* CLASS CL_EVENT_RECEIVER IMPLEMENTATION Handles Double Click
class cl_event_receiver implementation.
method handle_double_click.
perform drill_down using e_row-index.
endmethod.
endclass.
data: alv_container type ref to cl_gui_custom_container.
data: event_receiver type ref to cl_event_receiver.
data: alv_grid type ref to cl_gui_alv_grid.
data: layout type lvc_s_layo.
data: fieldcat type lvc_t_fcat.
selection-screen begin of block b1 with frame title text-001 .
select-options: s_ebeln for ekko-ebeln.
selection-screen end of block b1.
start-of-selection.
perform get_data.
call screen 100.
* Module status_0100 OUTPUT
module status_0100 output.
set pf-status '0100'.
set titlebar '0100'.
data: variant type disvariant.
variant-report = sy-repid.
variant-username = sy-uname.
* Create Controls
create object alv_container
exporting
container_name = 'ALV_CONTAINER'.
create object alv_grid
exporting
i_parent = alv_container.
* Create Event Receiver
create object event_receiver.
* Populate Field Catalog
perform get_fieldcatalog.
call method alv_grid->set_table_for_first_display
exporting
is_layout = layout
is_variant = variant
i_save = 'U'
i_structure_name = 'I_ALV'
changing
it_outtab = i_alv[]
it_fieldcatalog = fieldcat[].
* handler for ALV grid
set handler event_receiver->handle_double_click for alv_grid.
endmodule.
* Module USER_COMMAND_0100 INPUT
module user_command_0100 input.
case sy-ucomm.
when 'BACK' or 'CANC'.
if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
if sy-subrc = 0.
set screen 0.
leave screen.
else.
leave program.
endif.
when 'EXIT'.
if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
leave program.
endcase.
endmodule.
* FORM GET_DATA
form get_data.
select * into corresponding fields of table i_alv
from ekko
where ebeln in s_ebeln.
sort i_alv ascending by ebeln.
endform.
* Form Get_Fieldcatalog - Set Up Columns/Headers
form get_fieldcatalog.
data: ls_fcat type lvc_s_fcat.
refresh: fieldcat.
clear: ls_fcat.
ls_fcat-reptext = 'PO Number'.
ls_fcat-coltext = 'PO Number'.
ls_fcat-fieldname = 'EBELN'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '12'.
ls_fcat-col_pos = 1.
append ls_fcat to fieldcat.
endform.
* DRILL_DOWN
form drill_down using index.
read table i_alv index index.
if sy-subrc = 0.
set parameter id 'BES' field i_alv-ebeln.
call transaction 'ME23' and skip first screen.
if not alv_container is initial.
call method alv_container->free.
clear: alv_container.
free : alv_container.
endif.
endif.
endform.
Regards,
Rich Heilman -
Double click on the node,ALV tree, subscreen
Hi,
I have a small requirement in ALV Tree
left side i get a tree and when i double click on one of it , i'm trying to display the subscreen. even though i am setting the paramaters to the screen but i'm unable to get those values in the subscreen.
example
Name Description subscreen 0101
xyz xyz desc (double click on this) name = XYZ
ABC abs desc descrip = xyz desc
This is what the requirement is:
Please help me out with the solution.
BhavanaHi Bhavana,
Register your double click event in the ALV Tree program. Then call the respective subscreen using sy-ucomm value.
IF NOT r_ucomm IS INITIAL.
CASE r_ucomm.
WHEN '&F03'.
SET SCREEN 100.
LEAVE SCREEN.
endif.
Refer the below code for setting the registering the event.
CALL METHOD tree->get_registered_events
IMPORTING
events = l_events_s.
l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
APPEND l_event TO l_events_s.
CALL METHOD tree->set_registered_events
EXPORTING
events = l_events_s
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
CREATE OBJECT l_events_receiver.
SET HANDLER l_events_receiver->handle_item_click FOR tree.
CLASS lcl_events_receiver DEFINITION. "#EC *
PUBLIC SECTION.
METHODS:
handle_item_click FOR EVENT item_double_click OF cl_gui_alv_tree
IMPORTING node_key fieldname.
ENDCLASS. "lcl_handle_events DEFINITION
CLASS lcl_events_receiver IMPLEMENTATION.
METHOD handle_item_click.
PERFORM employee_data USING node_key fieldname.
CALL SCREEN 300.
ENDMETHOD. "HANDLE_ITEM_DOUBLE_CLICK
ENDCLASS. "lcl_events_receiver IMPLEMENTATION
Thanks.
Ganesh R K
Edited by: Ganesh.rk83 on Jun 23, 2011 11:21 AM -
Double click on field in OOALV
Hi.
I want display the data in the second list when i am dobule click on that particular field in First List.
If i dobule click on any another field i do not want to display second list in Object Oriented ALV.
How it is possible when dobule click on that particular field value in the First list. Explain it with Good Example if Possible.
Thank You.
Regards.
Krishna.Source from one of the website. you execute this program you will get idea
REPORT ZALV_OOINTERACTIVE.
*Class definition for handling double click
CLASS event_class DEFINITION DEFERRED.
*Internal table and work area declarations for dd02l and dd03l
DATA : it_dd02l TYPE TABLE OF dd02l,
wa_dd02l TYPE dd02l,
it_dd03l TYPE TABLE OF dd03l,
wa_dd03l TYPE dd03l.
*data declarations for ALV Main list
DATA : ty_lay1 TYPE lvc_s_layo,
it_fieldcat TYPE lvc_t_fcat ,
ty_fieldcat TYPE lvc_s_fcat ,
c_alv1 TYPE REF TO cl_gui_alv_grid,
c_cont1 TYPE REF TO cl_gui_custom_container,
event_receiver TYPE REF TO event_class.
*data declarations for ALV Interactive list
DATA : ty_lay2 TYPE lvc_s_layo,
it_fcat TYPE lvc_t_fcat ,
ty_fcat TYPE lvc_s_fcat ,
c_alv2 TYPE REF TO cl_gui_alv_grid,
c_cont2 TYPE REF TO cl_gui_custom_container.
**Select options for multiple values and NOT ranges
SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
* Initialization event
INITIALIZATION.
*Start of selection event
START-OF-SELECTION.
*fetch data into table and field characteristics
PERFORM fetch_data.
*ALV display for output
PERFORM alv_output.
*& Form FETCH_DATA
* text
* --> p1 text
* <-- p2 text
FORM fetch_data .
*Select the table details
SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l
WHERE tabname IN s_table
AND tabclass = 'TRANSP'.
ENDFORM. " FETCH_DATA
* CLASS lcl_event_receiver DEFINITION
CLASS event_class DEFINITION.
*Handling double click
PUBLIC SECTION.
METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .
ENDCLASS. "lcl_event_receiver DEFINITION
* CLASS lcl_event_receiver IMPLEMENTATION
CLASS event_class IMPLEMENTATION.
METHOD handle_double_click.
DATA : ls_dd02l LIKE LINE OF it_dd02l.
*Reading the selected data into a variable
READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.
* *Select the field details of the selected table
SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
WHERE tabname EQ ls_dd02l-tabname.
*calling the ALV containing the field values
CALL SCREEN 101.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*& Module pbo_100 OUTPUT
MODULE pbo_100 OUTPUT.
*set pf-status 'XXX'.
*set titlebar 'XXX'.
ENDMODULE. " PBO_100 OUTPUT
*& Module alv_100 OUTPUT
MODULE alv_100 OUTPUT.
*Check if there is no custom container in screen 100
IF c_cont1 IS INITIAL.
*Creating object of container
CREATE OBJECT c_cont1
EXPORTING
container_name = 'CCONT'.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Creating object of alv
CREATE OBJECT c_alv1
EXPORTING
i_parent = c_cont1.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*alv layout
PERFORM alv_100_layout.
*alv field catalogue
PERFORM alv_100_fieldcat.
*Displaying the ALV grid
CALL METHOD c_alv1->set_table_for_first_display
EXPORTING
is_layout = ty_lay1
CHANGING
it_outtab = it_dd02l[]
it_fieldcatalog = it_fieldcat.
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 object of the event class and setting handler for double click
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_double_click FOR c_alv1.
ENDIF.
ENDMODULE. " ALV_100 OUTPUT
*& Module pai_100 INPUT
MODULE pai_100 INPUT.
ENDMODULE. " pai_100 INPUT
* MODULE PBO_101 OUTPUT
MODULE pbo_101 OUTPUT.
* SET PF-STATUS 'XXX'.
* SET TITLEBAR 'XXX'.
ENDMODULE. " PBO_101 INPUT
* MODULE ALV_101 OUTPUT
MODULE alv_101 OUTPUT.
*Check if the Custom container exists.
IF c_cont2 IS INITIAL.
*Creating container object
CREATE OBJECT c_cont2
EXPORTING
container_name = 'CDCONT'.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*creating ALV grid for interactive list
CREATE OBJECT c_alv2
EXPORTING
i_parent = c_cont2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*ALV layout
PERFORM alv_101_layout.
*ALV fieldcatalogue
PERFORM alv_101_fieldcat.
*Sorting the output by field position
SORT it_dd03l BY position.
*ALV for display field details
CALL METHOD c_alv2->set_table_for_first_display
EXPORTING
is_layout = ty_lay2
CHANGING
it_outtab = it_dd03l[]
it_fieldcatalog = it_fcat.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDMODULE. " ALV_101 OUTPUT
*& Module PAI_101 INPUT
MODULE pai_101 INPUT.
ENDMODULE. " PAI_101 INPUT
*& Form ALV_OUTPUT
* text
* --> p1 text
* <-- p2 text
FORM alv_output .
CALL SCREEN 100.
ENDFORM. " ALV_OUTPUT
*& Form ALV_100_LAYOUT
* text
* --> p1 text
* <-- p2 text
FORM alv_100_layout .
ty_lay1-grid_title = 'TABLES'.
ty_lay1-zebra = 'X'.
ty_lay1-no_toolbar = 'X'.
ENDFORM. " ALV_100_LAYOUT
*& Form ALV_100_FIELDCAT
* text
* --> p1 text
* <-- p2 text
FORM alv_100_fieldcat .
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'TABNAME'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'TableName'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'TABCLASS'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'CATEGORY'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'AS4USER'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'CREATED'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'AS4DATE'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'DATE'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'AS4TIME'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'TIME'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 6.
ty_fieldcat-fieldname = 'CONTFLAG'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'Delivery Class'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ENDFORM. " ALV_100_FIELDCAT
*& Form ALV_101_LAYOUT
* text
* --> p1 text
* <-- p2 text
FORM alv_101_layout .
ty_lay2-grid_title = 'FIELDS'.
ty_lay2-zebra = 'X'.
ty_lay2-no_toolbar = 'X'.
ENDFORM. " ALV_101_LAYOUT
*& Form ALV_101_FIELDCAT
* text
* --> p1 text
* <-- p2 text
FORM alv_101_fieldcat .
REFRESH it_fieldcat.
REFRESH it_fcat.
CLEAR ty_fcat.
ty_fcat-row_pos = 1.
ty_fcat-col_pos = 1.
ty_fcat-fieldname = 'FIELDNAME'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'Fieldname'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat.
ty_fcat-row_pos = 1.
ty_fcat-col_pos = 2.
ty_fcat-fieldname = 'CHECKTABLE'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'CHECKTABLE'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat.
ty_fcat-row_pos = 1.
ty_fcat-col_pos = 3.
ty_fcat-fieldname = 'KEYFLAG'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'Key Flag'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat.
ENDFORM. " ALV_101_FIELDCAT
Selection screen
Maybe you are looking for
-
Color profile reset after screensaver
Running Leopard 10.5.1. Dual screen setup with my external monitor having configured as a custom color profile to compensate for a little bit of gamma. Strange thing that always when the screen saver comes on, and I move the mouse so that the screen
-
Hi, I've got the unenviable task of rewriting the data storage back end for a very complex legacy system which analyses time series data for a range of different data sets. What I want to do is bring this data kicking an screaming into the 21st centu
-
Adding Z totaltables to report painter FGI3.
Hello All, In the tcode FGI3 that is report painter. There is report type 020. In this report i have Zreports. To these Zreports tables must be assigned and should be available in FGI3 tcode .This is done through SPRO settings. Can anybody tell me ho
-
TS3999 my Mac and Ipad calendars stopped syncing
my mac and ipad calendars stopped syncing. What do I need to do to get them to sync again?
-
Hello, I have a problem, that appears in Plug-in 1.3.1_08 (1.4 is ok). The Microsoft Internet Explorer sucks, running my Applet. It occurs, when AWT Frame uses method show(). In a correct situation (for example Java Plug-in 1.4), the applet appears i