Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

abap objects

Former Member
0 Kudos
102

hi all,

please send me some documents on abap objects...

thanks,

ashu.

1 ACCEPTED SOLUTION
3 REPLIES 3

Former Member

Former Member
0 Kudos
66

Hi,

Cockpit to organise the Zdevelopments or related transactions.

Features:

1. One point of access for related transactions and z developments.

2. Centralized creation maintenance and display of the help text for the all transactions and zdevelopments.

3. User dependent view based on the authorization.

4. Flexible for new transaction to be added to the cockpit.

5. User friendly.

6. Internet site can be browsed.

7. Presentation server applications can be run.

8. Different related transactions or zdevelopments can be clubbed together under one parent node.

Technical Details:

1. Define two custom containers one for the transaction tree and the other for help text.

g_custom_container TYPE REF TO cl_gui_custom_container

g_custom_container_help TYPE REF TO cl_gui_custom_container

2. Define reference to column tree class.

g_tree TYPE REF TO cl_gui_column_tree

3. Define reference to the editor class.

g_editor TYPE REF TO cl_gui_textedit.

4. Define reference to the editor class.

g_editor TYPE REF TO cl_gui_textedit.

5. The second custom container is linked to the custom control “EDITOR”.

CREATE OBJECT g_custom_container_help

EXPORTING

Container name = 'V_HELP'

EXCEPTIONS

Cntl_error = 1

Cntl_system_error = 2

Create_error = 3

Lifetime_error = 4

Lifetime_dynpro_dynpro_link = 5.

IF sy-subrc <> 0.

ENDIF.

CREATE OBJECT g_editor EXPORTING parent = g_custom_container_help.

6. The first custom container is linked to the custom control “COLUMN TREE”.

CREATE OBJECT g_custom_container

EXPORTING

Container name = 'TREE_CONTAINER'

EXCEPTIONS

Cntl_error = 1

Cntl_system_error = 2

Create_error = 3

Lifetime_error = 4

Lifetime_dynpro_dynpro_link = 5.

IF sy-subrc <> 0.

ENDIF.

CREATE OBJECT g_tree

EXPORTING

Parent = g_custom_container

Node_selection_mode = cl_gui_column_tree=>node_sel_mode_single

Item_selection = 'X'

Hierarchy_column_name = 'Column1'

Hierarchy_header = hierarchy_header

EXCEPTIONS

Cntl_system_error = 1

Create_error = 2

Failed = 3

Illegal_node_selection_mode = 4

Illegal_column_name = 5

Lifetime_error = 6.

IF sy-subrc <> 0.

ENDIF.

7. Add the second column to the tree, which will contain the icon for help.

CALL METHOD g_tree->add column

EXPORTING

Name = 'Column2'

Width = 8

Header_text = 'Help'

EXCEPTIONS

Column_exists = 1

Illegal_column_name = 2

Too_many_columns = 3

Illegal_alignment = 4

Different_column_types = 5

Cntl_system_error = 6

Failed = 7

Predecessor_column_not_found = 8.

IF sy-subrc <> 0.

ENDIF.

8. Define the events, which will be passed to the backend.

" Node double click

Event-eventid = cl_gui_column_tree=>eventid_node_double_click.

Event-appl_event = 'X'. " Process PAI if event occurs

APPEND event TO events.

" Item double click

Event-eventid = cl_gui_column_tree=>eventid_item_double_click.

Event-appl_event = 'X'.

APPEND event TO events.

" Expand no children

Event-eventid = cl_gui_column_tree=>eventid_expand_no_children.

Event-appl_event = 'X'.

APPEND event TO events.

" Link click

Event-eventid = cl_gui_column_tree=>eventid_link_click.

Event-appl_event = 'X'.

APPEND event TO events.

CALL METHOD g_tree->set_registered_events

EXPORTING

Events = events

EXCEPTIONS

Cntl_error = 1

Cntl_system_error = 2

Illegal_event_combination = 3.

IF sy-subrc <> 0.

ENDIF.

9. Add initial parent nodes to the tree control, which is displayed in screen shot 1.

CALL METHOD g_tree->add_nodes_and_items

EXPORTING

Node_table = node_table

Item_table = item_table

Item_table_structure_name = 'S_NAME'

EXCEPTIONS

Failed = 1

Cntl_system_error = 3

Error_in_tables = 4

Dp_error = 5

Table_structure_name_not_found = 6.

IF sy-subrc <> 0.

ENDIF.

Node table & item table are filled with the images, text and nodekey for the parent nodes.

Node-node_key = 'DWV'.

Node-relatkey = 'TRANSACTION'.

Node-relatship = cl_gui_column_tree=>relat_last_child.

Node-hidden = ' '.

Node-disabled = ' '.

Node-isfolder = 'X'.

CLEAR node-n_image.

CLEAR node-exp_image.

Node-expander = 'X'. " The node is marked with a '+'

APPEND node TO node_table.

  • Node with key 'DWV'

CLEAR item.

Item-node_key = 'DWV'.

Item-item_name = 'Column1'.

Item-class = cl_gui_column_tree=>item_class_text.

Item-text = 'Vendor Profile Maintenance'.

APPEND item TO item_table.

CLEAR item.

Item-node_key = 'DWV'.

Item-item_name = 'Column2'. "

Item-class = cl_gui_column_tree=>item_class_text.

APPEND item TO item_table.

10. Set the initial screen by expanding the root node Transaction.

CALL METHOD g_tree->expand_node

EXPORTING

Node_key = 'TRANSACTION'

EXCEPTIONS

Failed = 1

Illegal_level_count = 2

Cntl_system_error = 3

Node_not_found = 4

Cannot_expand_leaf = 5.

IF sy-subrc <> 0.

ENDIF.

11. Define the application class to handle the events added in step 8.

CLASS lcl_application DEFINITION.

PUBLIC SECTION.

METHODS:

handle_node_double_click

FOR EVENT node_double_click

OF cl_gui_column_tree

IMPORTING node_key,

handle_expand_no_children

FOR EVENT expand_no_children

OF cl_gui_column_tree

IMPORTING node_key,

handle_item_double_click

FOR EVENT item_double_click

OF cl_gui_column_tree

IMPORTING node_key item_name,

handle_link_click

FOR EVENT link_click

OF cl_gui_column_tree

IMPORTING node_key item_name.

ENDCLASS. "LCL_APPLICATION DEFINITION

CLASS lcl_application IMPLEMENTATION.

METHOD handle_node_double_click.

*&--this method handles the node double click event of the tree

*&--control instance

PERFORM hadle_doubleclick USING node_key.

ENDMETHOD. "HANDLE_NODE_DOUBLE_CLICK

METHOD handle_item_double_click.

*&--this method handles the item double click event of the tree

*&--control instance

PERFORM hadle_doubleclick USING node_key.

ENDMETHOD. "HANDLE_ITEM_DOUBLE_CLICK

METHOD handle_link_click.

*this method handles the link click event of the tree

*control instance

PERFORM show_help USING node_key

item_name.

ENDMETHOD. "HANDLE_LINK_CLICK

METHOD handle_expand_no_children.

PERFORM expand_no_children USING node_key.

ENDMETHOD. "HANDLE_EXPAND_NO_CHILDREN

ENDCLASS. "LCL_APPLICATION

12. Assign event handlers in the application class to each desired event.

SET HANDLER g_application->handle_node_double_click FOR g_tree.

SET HANDLER g_application->handle_item_double_click FOR g_tree.

SET HANDLER g_application->handle_expand_no_children FOR g_tree.

SET HANDLER g_application->handle_link_click FOR g_tree.

13. Write the logic to be performed under the handlers, which needs to be called when a particular event is triggered.

<b><REMOVED BY MODERATOR></b>

regards,

vijay

Message was edited by:

Alvaro Tejada Galindo