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: 

hi all oops gui status

Former Member
0 Kudos
103

hi all

i am new to oops,

in my following code, i want to know how to creat gui status

from function group SALV_METADATA_STATUS and copy the gui status SALV_TABLE_STANDARD into the Zmy program.

could anyone give the steps in detail how to copy this and how and where.

class lcl_handle_events definition.

public section.

methods: on_user_command for event added_function of cl_salv_events

importing e_salv_function,

on_double_click for event double_click of cl_salv_events_table

importing row column.

endclass.

data : event_handler type ref to lcl_handle_events.

start-of-selection.

select * into corresponding fields of table ispfli from spfli up to 100 rows .

call method cl_salv_table=>factory

importing

r_salv_table = gr_table

changing

t_table = ispfli.

gr_table->set_screen_status(

pfstatus = 'SALV_TABLE_STANDARD'(001)

report = sy-repid

set_functions = gr_table->c_functions_all ).

gr_events = gr_table->get_event( ).

create object event_handler.

set handler event_handler->on_user_command for gr_events.

set handler event_handler->on_double_click for gr_events.

gr_selections = gr_table->get_selections( ).

gr_selections->set_selection_mode( 1 ).

gr_table->display( ).

class lcl_handle_events implementation.

method on_user_command.

  • Get the selection rows

data: lr_selections type ref to cl_salv_selections.

data: lt_rows type salv_t_row.

data: ls_rows type i.

data: message type string.

case e_salv_function.

when 'MYFUNCTION' .

lr_selections = gr_table->get_selections( ).

lt_rows = lr_selections->get_selected_rows( ).

read table lt_rows into ls_rows index 1.

read table ispfli into xspfli index ls_rows.

concatenate xspfli-carrid xspfli-connid xspfli-cityfrom xspfli-cityto into message separated by space.

message i001(000) with 'You pushed the button!' message .

endcase.

Endmethod.

method on_double_click.

data: message type string.

data: row_c(4) type c.

row_c = row.

concatenate 'Row' row_c 'Column' column into message separated by space.

message i001(000) with 'You double-clicked on ' message.

endmethod.

thanx

rocky

1 REPLY 1

former_member199581
Active Participant
0 Kudos
29

The GUI status is copied in standard way.

Go to SE80, put Function Group SALV_METADATA_STATUS, right-click the status you want and copy it in you program.

Now you can use it.

Hope this helps,

Roby.