select * from makt into table @data(lt_makt) where matnr like '100-%'.
try.
" setup SALV
cl_salv_table=>factory(
importing r_salv_table = data(lo_salv)
changing t_table = lt_makt
).
" prepare SALV
lo_salv->get_functions( )->set_all( ). " activate toolbar
lo_salv->get_columns( )->get_column( 'MANDT' )->set_technical( ).
lo_salv->get_columns( )->get_column( 'SPRAS' )->set_output_length( 8 ).
lo_salv->get_columns( )->get_column( 'MAKTX' )->set_visible( abap_false ).
lo_salv->get_sorts( )->add_sort( 'MATNR' ).
lo_salv->get_sorts( )->add_sort( 'SPRAS' ).
lo_salv->get_display_settings( ) ->set_striped_pattern( cl_salv_display_settings=>true ).
lo_salv->get_layout( )->set_key( value salv_s_layout_key( report = sy-repid )
).
lo_salv->get_layout( )->set_save_restriction(
cl_salv_layout=>restrict_none
).
lo_salv->get_selections( )->set_selection_mode(
cl_salv_selections=>multiple
).
" Display SALV
lo_salv->display( ).
catch
cx_salv_msg
cx_salv_not_found
cx_salv_data_error
cx_salv_existing into data(lo_x).
message lo_x type 'E'.
endtry.
Friday, July 22, 2016
Subscribe to:
Post Comments (Atom)
SAP ABAP: Determine Timezone for Plant
DATA: lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY, l_tzone TYPE tznzone. " get time zone for plant ...
-
Sometimes the backend doesn't return the selected rows of an SALV. For my case get_metadata( ) was the solution: go_salv-> get_met...
-
GUIDs or UUIDs can be created with the class cl_system_uuid . try . data (lv_uuid) = cl_system_uuid => if_system_uuid_static...
-
AA PR-AUF(E) Prozessauftrag (eröffnet) AB PR-AUF(F) Prozessauftrag (freigegeben) AC FE...
No comments:
Post a Comment