To define a class inside a method
Hi,
Iam new to OOPS ABAP.
I had one doubt,
Can we define and implement a new class inside a method... end method (like below)
Method M1
Class C1 Defination.
Class C1 Implementation
Method
Endmethod
Endmethod
Please suggest me on this how to proceed.
Regards
Srinivas
Hi Rich Heilman/Naimesh
The requirement is
In XI Proxy(XI proxy is related to creation of materials in SAP),there are macros defined, and my client told us to find out wheather is it possible to replace the macros with the classes and methods.
Can i define a global class and call that method inside the class.
Method M1
Define a global class oref
create object.
Call method oref->m2.
Endmethod
Can i do it in the above way.Please suggest.
Regards
Srinivas
Similar Messages
-
Inner class inside a method - how does it access method's local variable?
hello All:
I've learnt that, an inner class, if defined inside a method, it can access the method's local variables, only when they are defined as "final".
Anyone can help explain the rationale behind it?
Thanks a lot!
SwayfathomBoat wrote:
In java, everything is about pass-by-reference.
Wrong! Nothing in Java is ever pass-by-reference.
Java uses pass-by-value everywhere.
It makes sense to me if the reason of enforcing a variable to be "final" is to prevent it being messed up.No, the reason is that a copy is made and if the variable weren't final then it could change later on and the developer could be confused because his inner class didn't "see" that change.
The variable being final prevents that scenario.
However, if a copy of the variable is made inside the inner class, i dont see how possible it could affect variables outside of class?Such a copy is made, but the language designers wanted to hide that fact from the developer. By forcing all accessed variables to be declared final the developer has no way to realize that he's actually working on a copy. -
Class inside main method?
can we write class inside tne main method in java? If yes kindly explain with example.
> can we write class inside tne main method in java? If
yes kindly explain with example.
The Java? Tutorial - Nested Classes
~ -
Access instance method of a class inside instance method of another class
Hi Friends
I have to use one c1->m1.
c1 is a public instantiation and m1 is a public Instance Method.
I called this m1 method by creating c1 object for class c1.
But problem is inise M1 method,i have a statement
CALL METHOD mo_central_person->if_hrbas_pd_object~read_infty.
here mo_central_person is of type some other class c2.
As without creating the object,i didn't use the above interface method.
Can please suggst me how to handle this.
Regards,
Sreeclass a definition.
public section.
methods : display,
disp.
data : a(10) type c value '10',
b(5) type c value 'abc'.
endclass.
class a implementation.
method display.
write : a.
endmethod.
method disp.
write : b.
endmethod.
endclass.
class b definition inheriting from a.
public section.
methods : display1.
data : c(7) type c value '7'.
endclass.
class b implementation.
method display1.
call method display( ).
write c.
endmethod.
endclass.
start-of-selection.
data : o_obj type ref to b.
create object o_obj.
call method o_obj->display1.
the method display is in class a.
we can call this method in class b using the following statement.
method display1.
call method display( ).
write c.
endmethod. -
In which case we need a class with all methods defined as abstract ?
In which case we need : A class with all methods defined as abstract (or should we go for Interface always in this case)
The concept of interface and abstract class overlaps sometime, but we can have the following thumb rule to use them for our specific need:
1) Interface: This should be use for code structuring. They standardize your application by providing a specific contract within and outside. If you think abstract class also provide structure, then reconsider as it limits the structure re-usability when there are many super-classes to inherit from. Java allow multiple inheritance by interface and not by Abstract class.
2) Abstract Class: This should be use for code-reusability. Interface doesn't have any code so can't be used for code-reusability.
Actually we can use both to provide the best.Taking a refernce to J2EE framework, the "Servlet" is an interface. It laids down the contract/structure for any code to be a servlet.
But the "GenericServlet" class is an abstract class which provides implementation of some of the methods defined in the "Servlet" interface and leave some method abstract.
Thus we see that the "Servlet" interface standardise the structure and the "GenericServlet" abstract class gives code re-usability.
Original Question:
In which case we need a class with all methods defined as abstract ?To this question, as all methods are abstarct we don't have option for code-reusability. so why not add standard structure concept to your application. So if there is not any restriction on making the field variable(if any) as final, we should go with the interface concept. -
Creation of class inside Method
Hi Forums,
I am new to WebDynpro-Abap and i am trying to practice WebDynpro-Abap with the help of standard Tutorial avl in the SDN.
In the Tutorial 4, i am getting the following error,
The type <b>CL_WDABAP_FLIGHT_MODEL=>get_bookings is unknown or not found</b>
but in that tutorial,they specify the encounter of the above error like
<u>Simply create a ZCL_WDABAP_FLIGHT_MODEL class in your get_bookings method.</u>
But i don't know,where to Create the class inside the get_bookings method
can any body tell me the steps to create ZCL_WDABAP_FLIGHT_MODEL class in the get_bookings method and the remaining steps to execute the particular application.
Thanks in Advance,
AshokHi Ashok,
Follow the steps for creation of Class and the method,
STEPS TO CREATE CLASS:
1) CREATE ZIT_FLIGHTTAB(AN INTERNAL TABLE) IN SE11 UNDER DATA TYPE->TABLE TYPE.
2) GIVE LINE TYPE AS SFLIGHT. SAVE,CHECK AND ACTIVATE THE INTERNAL TABLE.
3) CREATE GLOBAL CLASS ZNET_NET310_FLIGHTMODEL_## USING TRANSACTION CODE SE24.
4) IN THE ATTRIBUTES TAB, ENTER AS FOLLOWS,
ATTRIBUTE LEVEL VISIBILITY TYPING ASSOCIATED TYPE
TY_FLIGHTS STATIC ATTRIBUTE PUBLIC TYPE SFLIGHT
ZIT_OUTTAB STATIC ATTRIBUTE PUBLIC TYPE TY_FLIGHTS
5) IN THE METHODS TAB, ENTER AS FOLLOWS,
METHOD LEVEL VISIBILITY DESCRIPTION
READ_FLIGHTS STATIC METHOD PUBLIC READ FLIGHT DATA
6) CLICK ON PARAMETERS, ENTER AS FOLLOWS,
PARAMETER TYPE TYPING METHOD ASSOCIATED TYPE
I_CARRID IMPORTING TYPE SFLIGHT-CARRID
I_CONNID IMPORTING TYPE SFLIGHT-CONNID
E_FLIGHTS EXPORTING TYPE ZIT_FLIGHTTAB
7) DOUBLE CLICK ON METHOD:READ_FLIGHTS AND ENTER FOLLOWING SORCE CODE IN BETWEEN METHOD AND ENDMETHOD.
SELECT * FROM SFLIGHT INTO TABLE ZIT_OUTTAB WHERE CARRID = I_CARRID AND CONNID = I_CONNID.
E_FLIGHTS[] = ZIT_OUTTAB[].
8) SAVE CHECK AND ACTIVATE CLASS.
NOTE :
PLEASE FOLLOW SAME STEPS FOR OTHER METHODS THAT COMES IN FOLLOWING EXCERCISE IN SAME CLASS i.e ZCL_NET310_FLIGHTMODEL_##.
In next few tutorials you will need to create more methods. Follow steps to add new methods as and when required.
Regards,
Achyut -
SUBMIT inside a method & the automation queue
Hi,
I call a method via a tree toolbar button in that calls a standard SAP report using the SUBMIT AND RETURN command. This is done within a screen with several docking containers and split screens attached.
The problem is that when I press the toolbar button, the report (which also has docking container) is presented partially inside my screen.
When I put a BREAK-POINT on the SUBMIT statement it is good and I can see SAP's report with no issues and I do not see my screen. When I take the break point off it is back to the original problem.
This leaves me to think that it is an automation queue problem or something like that.
How can I get over this?
Thanks,
ItayHello Itay
I tried to simulate your situation. Perhaps you get from this sample report (which was copied from BCALV_TREE_DEMO and the adjusted) some ideas how to solve your problem. In my report all controls are displayed properly.
[code]&----
*& Report ZUS_SDN_BCALV_TREE_DEMO_8 *
*& Based on: BCALV_TREE_DEMO *
REPORT zus_sdn_bcalv_tree_demo.
DATA:
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_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid TYPE REF TO cl_gui_alv_grid.
data:
gt_knb1 type standard table of knb1. " dummy
*$Comment: begin
DATA:
gd_delete_nkey TYPE lvc_nkey.
*$Comment: end
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA tree1 TYPE REF TO cl_gui_alv_tree.
DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
INCLUDE <icon>.
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tb_event_rcvr.
*include bcalv_toolbar_event_receiver.
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tree_event_rcvr.
*include bcalv_tree_event_receiver.
DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
DATA: gt_sflight TYPE sflight OCCURS 0, "Output-Table
gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
ok_code LIKE sy-ucomm. "OK-Code
START-OF-SELECTION.
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.
Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
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_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
Create ALV grid
CREATE OBJECT go_grid
EXPORTING
i_parent = go_cell_right
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.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
CHANGING
it_outtab = gt_knb1
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
CALL METHOD go_docking->link
EXPORTING
repid = syst-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.
CALL SCREEN 100.
END-OF-SELECTION.
*& 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.
translate ok_code to upper case.
CASE ok_code.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
PERFORM exit_program.
*$Comment: begin
WHEN 'DELETE'.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = gd_delete_nkey " = folder 'AA'
I_UPDATE_PARENTS_EXPANDER = SPACE
I_UPDATE_PARENTS_FOLDER = SPACE
EXCEPTIONS
node_key_not_in_model = 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.
CALL METHOD tree1->update_calculations
EXPORTING
no_frontend_update = ' '. " do frontend update
*$Comment: end
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.
get fieldcatalog
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = gt_fieldcatalog.
SORT gt_fieldcatalog BY scrtext_l.
change fieldcatalog
DATA: ls_fieldcatalog TYPE lvc_s_fcat.
LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
CASE ls_fieldcatalog-fieldname.
WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
ls_fieldcatalog-no_out = 'X'.
ls_fieldcatalog-key = ''.
WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
ls_fieldcatalog-do_sum = 'X'.
ENDCASE.
MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
ENDLOOP.
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 Header'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'This is the Hierarchy Header !'. "#EC NOTEXT
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.
LIST HEADING LINE: TYPE H
CLEAR ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'ALV-tree-demo: flight-overview'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
STATUS LINE: TYPE S
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'valid until'. "#EC NOTEXT
ls_line-info = 'January 29 1999'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ls_line-key = 'time'.
ls_line-info = '2.00 pm'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ACTION LINE: TYPE A
CLEAR ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'actual data'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
p_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "build_comment
*& Form create_hierarchy
text
--> p1 text
<-- p2 text
FORM create_hierarchy.
DATA: ls_sflight TYPE sflight,
lt_sflight TYPE sflight OCCURS 0.
get data
SELECT * FROM sflight INTO TABLE lt_sflight
UP TO 200 ROWS . "#EC CI_NOWHERE
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-carrid.
PERFORM add_carrid_line USING ls_sflight
CHANGING l_carrid_key.
ENDON.
*$Comment: begin
IF ( ls_sflight-carrid = 'AA' ).
gd_delete_nkey = l_carrid_key.
ENDIF.
*$Comment: end
ON CHANGE OF ls_sflight-connid.
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 sflight
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 = '@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-carrid.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
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
is_node_layout = ls_node
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 sflight
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-connid.
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 sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
ls_item_layout-editable = 'X'.
APPEND ls_item_layout TO lt_item_layout.
CLEAR ls_item_layout.
ls_item_layout-fieldname = 'PLANETYPE'.
ls_item_layout-alignment = cl_gui_column_tree=>align_right.
APPEND ls_item_layout TO lt_item_layout.
l_node_text = ps_sflight-fldate.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
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
is_node_layout = ls_node
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.
define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
define the events which will be passed to the backend
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_checkbox_change.
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.
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.
set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->handle_node_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_node_ctmenu_selected
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_selected
FOR tree1.
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
Add SUBMIT-Button
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'SUBMIT'
icon = '@15@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'SUBMIT report'. "#EC NOTEXT
set event-handler for toolbar-control
CREATE OBJECT toolbar_event_receiver.
SET HANDLER toolbar_event_receiver->on_function_selected
FOR mr_toolbar.
SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
FOR mr_toolbar.
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 = go_cell_left
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
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_tree[/code]
<b>INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8 *
CLASS lcl_toolbar_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: on_function_selected
FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode,
on_toolbar_dropdown
FOR EVENT dropdown_clicked OF cl_gui_toolbar
IMPORTING fcode
posx
posy.
ENDCLASS. "lcl_toolbar_event_receiver DEFINITION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
METHOD on_function_selected.
DATA: ls_sflight TYPE sflight.
CASE fcode.
WHEN 'SUBMIT'.
SUBMIT zus_sdn_two_alv_grids AND RETURN.
WHEN 'DELETE'.
get selected node
DATA: lt_selected_node TYPE lvc_t_nkey.
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
DATA l_selected_node TYPE lvc_nkey.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
delete subtree
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = l_selected_node
i_update_parents_expander = ''
i_update_parents_folder = 'X'.
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_last_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_first_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_first_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_last_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_NS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_next_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Next Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
ENDCASE.
update frontend
CALL METHOD tree1->frontend_update.
ENDMETHOD. "on_function_selected
METHOD on_toolbar_dropdown.
create contextmenu
DATA: l_menu TYPE REF TO cl_ctmenu,
l_fc_handled TYPE as4flag.
CREATE OBJECT l_menu.
CLEAR l_fc_handled.
CASE fcode.
WHEN 'INSERT_LC'.
l_fc_handled = 'X'.
insert as last child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LC'
text = 'Insert New Line as Last Child'. "#EC NOTEXT
insert as first child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FC'
text = 'Insert New Line as First Child'. "#EC NOTEXT
insert as next sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_NS'
text = 'Insert New Line as Next Sibling'. "#EC NOTEXT
insert as last sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LS'
text = 'Insert New Line as Last Sibling'. "#EC NOTEXT
insert as first sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FS'
text = 'Insert New Line as First Sibling'. "#EC NOTEXT
ENDCASE.
show dropdownbox
IF l_fc_handled = 'X'.
CALL METHOD mr_toolbar->track_context_menu
EXPORTING
context_menu = l_menu
posx = posx
posy = posy.
ENDIF.
ENDMETHOD. "on_toolbar_dropdown
ENDCLASS. "lcl_toolbar_event_receiver IMPLEMENTATION[/code]
<b>INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8 *
class lcl_tree_event_receiver definition.
public section.
methods handle_node_ctmenu_request
for event node_context_menu_request of cl_gui_alv_tree
importing node_key
menu.
methods handle_node_ctmenu_selected
for event node_context_menu_selected of cl_gui_alv_tree
importing node_key
fcode.
methods handle_item_ctmenu_request
for event item_context_menu_request of cl_gui_alv_tree
importing node_key
fieldname
menu.
methods handle_item_ctmenu_selected
for event item_context_menu_selected of cl_gui_alv_tree
importing node_key
fieldname
fcode.
methods handle_item_double_click
for event item_double_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_button_click
for event button_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_link_click
for event link_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_header_click
for event header_click of cl_gui_alv_tree
importing fieldname.
endclass.
class lcl_tree_event_receiver implementation.
method handle_node_ctmenu_request.
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'. "#EC NOTEXT
endmethod.
method handle_node_ctmenu_selected.
case fcode.
when 'USER1' or 'USER2' or 'USER3'.
message i000(0h) with 'Node-Context-Menu on Node ' node_key
'fcode : ' fcode. "#EC NOTEXT
endcase.
endmethod.
method handle_item_ctmenu_request .
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'.
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'.
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'.
endmethod. -
Post Author: lkamesam
CA Forum: Integrated Solutions
Hi,
I am running Crystal Reports version 10 from IBM Rational 6.0.1 build 20050725_1800 XML data source. When I try to run the report under WAS 6.0.1 I get the following error:
Does any body have any clue how to resolve my problem? Thanks
Error 500: Error while defining class: com.crystaldecisions.data.xml.CRDB_XMLImpl This error indicates that the class: OCA.OCAdbdll.DbDLLOperations could not be located while defining the class: com.crystaldecisions.data.xml.CRDB_XMLImpl This is often caused by having the class at a higher point in the classloader hierarchy Dumping the current context classloader hierarchy: ==> indicates defining classloader *** indicates classloader where the missing class could have been found ==>[0] com.ibm.ws.classloader.CompoundClassLoader@163dd786 Local ClassPath: C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\classes;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\bobj_platform_jsf.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cecore.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\celib.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\ceplugins.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cereports.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cesession.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\clientlogic.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\Concurrent.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CorbaIDL.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CRDBXMLExternal.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CRDBXMLServer.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalCharting.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalCommon.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalContentModels.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalExporters.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalExportingBase.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalFormulas.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalQueryEngine.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalReportEngine.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalReportingCommon.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\ebus405.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\icu4j.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\jrcerom.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\jsf_common.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\keycodeDecoder.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\log4j.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\MetafileRenderer.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rasapp.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rascore.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rpoifs.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\serialization.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\URIUtil.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\webreporting-jsf.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\webreporting.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\xercesImpl.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\xmlParserAPIs.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent; Delegation Mode: PARENT_FIRST [1] com.ibm.ws.classloader.JarClassLoader@338761606 Local Classpath: Delegation mode: PARENT_FIRST [2] com.ibm.ws.classloader.ProtectionClassLoader@38e75786 [3] com.ibm.ws.bootstrap.ExtClassLoader@7e475784 [4] sun.misc.Launcher$AppClassLoader@7e5a5784 [5] sun.misc.Launcher$ExtClassLoader@7e565784 -Original exception- java.lang.NoClassDefFoundError: OCA/OCAdbdll/DbDLLOperations at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code)) at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:576) at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code)) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code)) at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) at com.crystaldecisions.reports.queryengine.driver.i.<init>(Unknown Source) at com.crystaldecisions.reports.queryengine.driver.i.case(Unknown Source) at com.crystaldecisions.reports.queryengine.av.ak(Unknown Source) at com.crystaldecisions.reports.queryengine.av.else(Unknown Source) at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source) at com.crystaldecisions.reports.queryengine.av.do(Unknown Source) at com.crystaldecisions.reports.queryengine.as.new(Unknown Source) at com.crystaldecisions.reports.queryengine.at.long(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source) at com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source) at com.crystaldecisions.reports.common.ab.a(Unknown Source) at com.crystaldecisions.reports.common.ab.if(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.a(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory.createReportSource(Unknown Source) at com.crystaldecisions.report.web.a.a.K(Unknown Source) at com.crystaldecisions.report.web.event.aa.a(Unknown Source) at com.crystaldecisions.report.web.event.aa.a(Unknown Source) at com.crystaldecisions.report.web.event.bx.a(Unknown Source) at com.crystaldecisions.report.web.event.b1.broadcast(Unknown Source) at com.crystaldecisions.report.web.event.as.a(Unknown Source) at com.crystaldecisions.report.web.WorkflowController.if(Unknown Source) at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source) at com.crystaldecisions.report.web.ServerControl.a(Unknown Source) at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source) at com.crystaldecisions.report.web.viewer.taglib.ServerControlTag.doEndTag(Unknown Source) at com.crystaldecisions.report.web.viewer.taglib.ReportServerControlTag.doEndTag(Unknown Source) at com.ibm._jsp._sample._jspx_meth_crviewer_viewer_0(_sample.java:135) at com.ibm._jsp._sample._jspService(_sample.java:77) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629) at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117) at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171) at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtensionProcessor.java:230) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2837) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220) at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021) atFor those who would have the same problem, here is how I could eventually fix it.
Since the Flex Test Drive is sometimes out of sync with flash builder 4, I recreated a project using other help pages on Adobe site :
Entry point :
http://help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08- 7ffd.html
As suggested, I used the New Project wizard to create a new project, with :
Application server type : J2EE
Check the radio button "Use remote object access service : BlazeDS"
Then, as indicated in following pages (section "Accessing BlazeDS")... :
file:///C:/Mes%20documents%20C/Commun/Developpement/Documentation/HT-Tracks/AccessingData/ help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffe.ht ml#WSbde04e3d3e6474c4-19a3f0e0122be55e1b7-8000
...I selected the "Data / Connect to Data/Services..." menu option, which started the Data/service connection wizard.
There, I selected a BlazeDS (and not Web Services) service type, and everything went fine.
Suggestion to adobe staff : maybe it would be useful to update the Flex Test Drive to reflect Flash Builder 4 ?
Very nice product anyway, so far, congratulations...
Rgds
Marc. -
How to catch exception for class CL_HR_RE512W for method CHECK_CUMULATION
Hi,
How do I catch an exception when using method CHECK_CUMULATION in class CL_HR_RE512W.
This method calls an instance method READ which raises NO_ENTRY if a wage type is missing on T512W.
There is no obvious catch class to use?
My code:
data: r_512w type ref to cl_hr_re512w.
start-of-selection.
create OBJECT r_512w.
call method r_512w->check_cumulation
exporting
p_molga = molga
p_lgart = lgart
p_cumul = cumul
p_date = date
receiving
p_has_cumulation = p_flg.
If lgart = '9999', for example, then we get an error message:
'No entry in table T512W for key 08 9999 25.08.2009'Hi Gemini Twin,
Check this link:
https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+Objects+-+Defining+a+Class-based+exceptions
Hope this information is help to you.
Regards,
José -
How do i create a single instance of a class inside a servlet ?
how do i create a single instance of a class inside a servlet ?
public void doGet(HttpServletRequest request,HttpServletResponseresponse) throws ServletException, IOException {
// call a class here. this class should create only single instance, //though we know servlet are multithreaded. if, at any time 10 user comes //and access this servlet still there would one and only one instance of //that class.
How do i make my class ? class is supposed to write some info to text file.i have a class MyClass. this class creates a thread.
i just want to run MyClass only once in my servlet. i am afriad, if there are 10 users access this servlet ,then 10 Myclass instance wouldbe created. i just want to avoid this. i want to make only one instance of this class.
How do i do ?
they have this code in the link you provided.
public class SingletonObject
private SingletonObject()
// no code req'd
public static SingletonObject getSingletonObject()
if (ref == null)
// it's ok, we can call this constructor
ref = new SingletonObject();
return ref;
public Object clone()
throws CloneNotSupportedException
throw new CloneNotSupportedException();
// that'll teach 'em
private static SingletonObject ref;
}i see, they are using clone !, i dont need this. do i ? shouldi delete that method ?
where do i put my thread's run method in this snippet ? -
How to learn technics in wrting class, objects and methods
Hi ,
I am new this oops methodology. I know java language but don't know the basics. I mean to say I have no idea how to write classes and methods. I can write one single class with all the methods and I can call that class from an another class but this is not the way... I knew it but I am kinda confuse how to write the well structured oops style classes and methods....
Can anybody help me please........
ThanksA short simple (overly simple) explanation is that objects are like little machines, which operate independantly from other objects (other little machines). You design an application as a collection of these little machine/objects, interacting with each other. Then you drill down another layer of detail, and design the machines themselves. You do this by defining the classes, which are like blueprints to make a little machine/object.
In java, this is largely expressed by the interface definition at the higher level, and the class definition at the lower level. The interfaces say how various objects may talk to each other, and the class definitions say how any individual object may talk at all.
This is a very basic description, and in fact isn't entirely accurate; if they want to lots of people on this forum could pick it apart. But hopefully it gets the idea across. (As my language design prof said, quoting somebody else, "teaching is just a series of lies.")
There are resources on the web about object-oriented programming, object-oriented design, etc. mutmansky's right, a college course is best, but you can still learn a lot from docs on the web. -
How to use user defined exception class
Hi all
I just need som help with creating a user defined exception class.
Im writing a small/simple text editor.
My exception class looks like this:
public class myExcp extends Throwable
private String message;
public myExcep(String message)
this.message = message;
public void display()
System.out.println(message);
I would like to use it when a user tries to open a exe-file instead of a txt file.
Here is some code from the editor:
if (e.getSource() == open)
saveOld();
if (fc.showOpenDialog(null)== JFileChooser.APPROVE_OPTION)
readFile(fc.getSelectedFile().getAbsolutePath());
saveas.setEnabled(true);
So, should I use exception here or at the readFile method?
readfile:
private void readFile(String fileName)
try
String tmp = fileName.substring(fileName.length() -4, fileName.length());
if (!tmp.equals(".exe"))
FileReader r = new FileReader(fileName);
textarea.read(r, null);
r.close();
currentFile = fileName;
label.setText(currentFile);
changed = false;
catch (IOException e)
JOptionPane.showMessageDialog (this, "Cannot find the file " + fileName);
Where and how do I use my exception class.
Do I need to create an instance? Where?
Should the exception class extend Exception instead?
Thank you in advance /Extend Exception, not Throwable. It's a checked exception that way.
Follow the Sun coding standards and make that exception class name start with a capital letter.
When you extend Exception, override all four ctors.
What's that display method you added? Isn't getMessage() good enough?
You need to create a new instance just before you throw the exception, of course.
Sounds like a terrible design, by the way. Exceptions shouldn't be used like "go to" for app logic. They should signal unrecoverable conditions. You can easily recover from the situation you've described simply by displaying a pop-up that tells the user to open only text-readable file types. I think that's a better solution.
% -
Load a class inside class?
Hi all!
I am creating a console based program and I wonder how i can load an outside class inside my main class?
I have a case switch funktion and when you chosse case '3' i want the class to run another class file and the continute with the rest of the code in the main class file.
Is there a way to do this?It really depends on what you mean by "run another class file". Do you mean you want to execute its static main() method, just as if it were run from the command line? If so then just do this:String[] params = // the parameters you want to pass to the class
TheClass.main(params); -
Delete Class Objects and methods
Hi, i have created a class file for a game. Now i have 3 to 4
games in one Main File. So after playing one game user can choose
another. Now can anybody tell me how to delete the first class
Object or methods, which was used in First game. So that i can
remove the garbage collections from Flash to make it with fast
process?A short simple (overly simple) explanation is that objects are like little machines, which operate independantly from other objects (other little machines). You design an application as a collection of these little machine/objects, interacting with each other. Then you drill down another layer of detail, and design the machines themselves. You do this by defining the classes, which are like blueprints to make a little machine/object.
In java, this is largely expressed by the interface definition at the higher level, and the class definition at the lower level. The interfaces say how various objects may talk to each other, and the class definitions say how any individual object may talk at all.
This is a very basic description, and in fact isn't entirely accurate; if they want to lots of people on this forum could pick it apart. But hopefully it gets the idea across. (As my language design prof said, quoting somebody else, "teaching is just a series of lies.")
There are resources on the web about object-oriented programming, object-oriented design, etc. mutmansky's right, a college course is best, but you can still learn a lot from docs on the web. -
Customer Defined Data Classes on Cluster Tables?
Hi all,
I noticed that there is no option within db13 to change the storage option to a customer defined data class, for cluster tables. I am sure this is by design but wanted to check to see if anyone has had any luck defining a data class on a cluster table.
We could move a cluster table to a DB2 tablespace and define the new Data Class through dbacockpit/db02, but there is no option to change the data class definition in the data dictionary (se13) to use the new Data Class for the table itself.
Mainly what we are aiming for is to be able to move 2 tables into their own tablespaces on the target server, during a migration. Sapinst is looking at the Data Classes to create DDLDB6.XML, which defines the tablespace assignments to the target server, so perhaps there is a preferred method of making this change, if it does exist.
Thanks for any insights,
DerekHi guys,
Thanks for the helpful answers. I should add some more detail.
Our tablespaces have already been moved to new tablespaces on the source system, with DB6CONV, and we have updated our data classes through db02, with no problems. So sapinst uses the data class definitions to create the custom tablespaces, and then uses the data class assignments to assign the table to a tablespace.
However, the cluster tables do not seem to support the data class assignment in se13, the option is not available as it is for normal tables. Let me see if I can post a screenshot somewhere with a cluster table versus a normal table. For example, there is no option to change the data class for table CDCLS in se13.
I am wondering if this is a limitation of the version of R/3 we are using, or if the limitation for cluster tables is something that is intended on all versions of R/3.
If we can't use db13 to make the assignment, we may try the custom definition in the STR file as Kiran mentioned.
Maybe you are looking for
-
My IPAD has a blank screen. It is on and working because I can hear the ping of my emails arriving. I turned off and on as best I could which is tricky as the screen is blank. I synced with itunes and checked for updates. All ok. Screen is still
-
Was upgrading to Itunes 10.7 for windows but Itunes installer stops working while installing. Can anyone help me !!!
-
Hi, I'm pretty good with actions, I use it every day. (I'm running v 7). I have a bunch, a couple thousand 35mm slides to scan in and make each one a .jpg. I'm scanning in 20 slides at one time, making a 300 meg file. I want to have actions rememb
-
HTTP 1.0/1.1 support
Does iWS 4.1support both http 1.0 and 1.1 or just 1.1 ?
-
Max number of records for 'BAPI_PBSRVAPS_GETDETAIL'.
Hi All, Can you suggest me the number of records to be fed to the 'BAPI_PBSRVAPS_GETDETAIL'. I am using a few location products for 9 key figures.Whenever number of records in selection table increases BAPI behaves in a strange way and the code writt