TYPES:
BEGIN OF ty_s_flight,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
fldate TYPE s_date,
price TYPE s_price,
END OF ty_s_flight.
DATA gt_flight TYPE STANDARD TABLE OF t_flight.
SELECT carrid connid fldate price FROM sflight INTO TABLE gt_flight.
DATA gr_flight TYPE REF TO cl_gui_alv_grid.
CREATE OBJECT gr_flight
EXPORTING
i_parent = cl_gui_container=>screen0.
gr_flight->set_table_for_first_display(
EXPORTING
i_structure_name = 'TY_S_FLIGHT'
CHANGING
it_outtab = gt_flight ).
CLASS z2ui5_cl_app_demo_43 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
TYPES:
BEGIN OF t_flight,
carrid TYPE string,
connid TYPE string,
fldate TYPE string,
price TYPE string,
END OF t_flight.
DATA: mt_flight TYPE STANDARD TABLE OF t_flight.
ENDCLASS.
CLASS z2ui5_cl_app_demo_43 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
SELECT carrid connid fldate price FROM sflight INTO TABLE mt_flight.
DATA(page) = z2ui5_cl_xml_view=>factory( )->page(
)->scroll_container( height = '70%' vertical = abap_true
)->table( items = client->_bind( mt_flight )
)->columns(
)->column( )->text( 'Carrid' )->get_parent(
)->column( )->text( 'Connid' )->get_parent(
)->column( )->text( 'Fldate' )->get_parent(
)->column( )->text( 'Price' )->get_parent(
)->get_parent(
)->items( )->column_list_item( )->cells(
)->text( '{CARRID}'
)->text( '{CONNID}'
)->text( '{FLDATE}'
)->text( '{PRICE}' ).
client->view_display( page->stringify( ) ).
ENDMETHOD.
ENDCLASS.
page->scroll_container( height = '70%' vertical = abap_true
)->table( items = view->_bind( t_tab ) ).
)->columns(
)->column( )->text( 'Carrid' )->get_parent(
)->column( )->text( 'Connid' )->get_parent(
)->column( )->text( 'Fldate' )->get_parent(
)->column( )->text( 'Price' )->get_parent(
)->get_parent(
)->items( )->column_list_item( )->cells(
)->text( '{CARRID}'
)->text( '{CONNID}'
)->text( '{FLDATE}'
)->text( '{PRICE}' ).
tab->header_toolbar( )->overflow_toolbar(
)->title( 'title of the table'
)->button(
text = 'left side button'
icon = 'sap-icon://account'
press = client->_event( 'BUTTON_SORT' )
)->segmented_button( selected_key = mv_key
)->items(
)->segmented_button_item(
key = 'BLUE'
icon = 'sap-icon://accept'
text = 'blue'
)->segmented_button_item(
key = 'GREEN'
icon = 'sap-icon://add-favorite'
text = 'green'
)->get_parent( )->get_parent(
)->toolbar_spacer(
)->generic_tag(
text = 'Project Cost'
design = 'StatusIconHidden'
status = 'Error'
)->object_number(
state = 'Error'
emphasized = 'false'
number = '3.5M'
unit = 'EUR'
)->get_parent(
)->toolbar_spacer(
)->button(
text = 'Sort'
icon = 'sap-icon://sort-descending'
press = client->_event( 'BUTTON_SORT' )
)->button(
icon = 'sap-icon://edit'
press = client->_event( 'BUTTON_POST' ) ).
page->table(
mode = 'SingleSelectLeft'
items = client->_bind_edit( t_tab ) ).
tab->items(
)->column_list_item( selected = '{SELKZ}'
)->cells(
...
IF check_editable_active = abap_true.
tab->items( )->column_list_item( )->cells(
)->input( '{TITLE}'
)->input( '{VALUE}'
)->input( '{INFO}'
)->input( '{DESCR}'
)->checkbox( selected = '{CHECKBOX}' enabled = abap_true ).
ELSE.
tab->items( )->column_list_item( )->cells(
)->text( '{TITLE}'
)->text( '{VALUE}'
)->text( '{INFO}'
)->text( '{DESCR}'
)->checkbox( '{CHECKBOX}' ).
ENDIF.
DATA(tab) = page->table( items = view->_bind_edit( t_tab ) ).
view->page( 'abap2UI5 - Selection-Screen'
)->simple_form('Input' )->content( 'f'
)->label( 'Input with value help'
)->input(
value = view->_bind( screen-colour )
placeholder = 'fill in your favorite colour'
suggestion_items = view->_bind_one_way( mt_suggestion ) )->get(
)->suggestion_items( )->get(
)->list_item( text = '{VALUE}' additional_text = '{DESCR}'
)->get_parent( )->get_parent(
)->label( 'Date'
)->date_picker( view->_bind( screen-date )
)->label( 'Date and Time'
)->date_time_picker( view->_bind( screen-date_time )
)->label( 'Time Begin/End'
)->time_picker( view->_bind( screen-time_start )
)->time_picker( view->_bind( screen-time_end ) ).
)->label( 'Checkbox'
)->checkbox(
selected = view->_bind( screen-check_is_active )
text = 'this is a checkbox'
enabled = abap_true
)->label( 'Combobox'
)->combobox(
selectedkey = view->_bind( screen-combo_key )
items = view->_bind_one_way( VALUE ty_t_combo(
( key = 'BLUE' text = 'green' )
( key = 'GREEN' text = 'blue' )
( key = 'BLACK' text = 'red' )
( key = 'GRAY' text = 'gray' ) )
) )->get( )->item( key = '{KEY}' text = '{TEXT}'
)->get_parent( )->get_parent(
)->label( 'Segmented Button'
)->segmented_button( view->_bind( screen-segment_key ) )->get(
)->items( )->get(
)->segmented_button_item( key = 'BLUE' icon = 'sap-icon://accept' text = 'blue'
)->segmented_button_item( key = 'GREEN' icon = 'sap-icon://add-favorite' text = 'green'
)->segmented_button_item( key = 'BLACK' icon = 'sap-icon://attachment' text = 'black'
)->get_parent( )->get_parent(
)->label( 'Switch disabled'
)->switch( enabled = abap_false customtexton = 'A' customtextoff = 'B'
)->label( 'Switch accept/reject'
)->switch( state = screen-check_switch_01 customtexton = 'on' customtextoff = 'off' type = 'AcceptReject'
)->label( 'Switch normal'
)->switch( state = screen-check_switch_02 customtexton = 'YES' customtextoff = 'NO' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |