├── .abapgit.xml ├── LICENSE ├── README.md ├── SDE_702.abap ├── SDE_740.abap ├── SDE_750.abap ├── SDE_750_HR.abap └── src ├── package.devc.xml ├── z_dummy_screen.fugr.lz_dummy_screentop.abap ├── z_dummy_screen.fugr.lz_dummy_screentop.xml ├── z_dummy_screen.fugr.saplz_dummy_screen.abap ├── z_dummy_screen.fugr.saplz_dummy_screen.xml ├── z_dummy_screen.fugr.xml ├── z_dummy_screen.fugr.z_dummy_screen.abap ├── z_itable_explorer.prog.abap ├── z_itable_explorer.prog.xml ├── z_itable_explorer_cls.prog.abap ├── z_itable_explorer_cls.prog.xml ├── zsde2.prog.abap └── zsde2.prog.xml /.abapgit.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E 6 | /src/ 7 | PREFIX 8 | 9 | /.gitignore 10 | /LICENSE 11 | /README.md 12 | /package.json 13 | /.travis.yml 14 | /.gitlab-ci.yml 15 | /abaplint.json 16 | /azure-pipelines.yml 17 | /SDE_702.abap 18 | /SDE_750.abap 19 | /SDE_750_HR.abap 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ysichov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Multi-windows program for viewing SQL tables and links between them 2 | 3 | Basic capabilities: 4 | - multiple windows; 5 | - multilingualism; 6 | - graphical visualization of table links; 7 | - linking tables; 8 | - links by keys; 9 | - hr plugins. 10 | + views from SM30 added 11 | 12 | https://github.com/ysichov/SDE/wiki - detailed description in English 13 | 14 | https://ysychov.wordpress.com/2020/02/10/simple-data-explorer/ - features description in Russian 15 | 16 | https://github.com/ysichov/SDE_abapgit - 7.50 abapgit version 17 | 18 | HR/HCM version 19 | https://github.com/ysichov/SDE/blob/master/SDE_750_HR.abap 20 | - Infotypes texts - PAXXXX-ITXEX fields 21 | -------------------------------------------------------------------------------- /SDE_702.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report YS_SDE - Simple Data Explorer 3 | *& version: alpha 0.5.178.145 4 | *& Written by Yurii Sychov 5 | *& e-mail: ysichov@gmail.com 6 | *& skype: ysichov 7 | *& blog: https://ysychov.wordpress.com/blog/ 8 | *& LinkedIn: https://www.linkedin.com/in/ysychov/ 9 | *&---------------------------------------------------------------------* 10 | report ys_sde. 11 | 12 | class lcl_data_receiver definition deferred. 13 | class lcl_data_transmitter definition deferred. 14 | 15 | types: 16 | begin of selection_display_s, 17 | ind type i, 18 | field_label type lvc_fname, 19 | int_type(1), 20 | inherited type aqadh_type_of_icon, 21 | emitter type aqadh_type_of_icon, 22 | sign type tvarv_sign, 23 | opti type tvarv_opti, 24 | option_icon type aqadh_type_of_icon, 25 | low type aqadh_range_value, 26 | high type aqadh_range_value, 27 | more_icon type aqadh_type_of_icon, 28 | range type aqadh_t_ranges, 29 | name type reptext, 30 | element type text60, 31 | domain type text60, 32 | datatype type string, 33 | length type i, 34 | transmitter type ref to lcl_data_transmitter, 35 | receiver type ref to lcl_data_receiver, 36 | color type lvc_t_scol, 37 | style type lvc_t_styl, 38 | end of selection_display_s, 39 | begin of t_sel_row, 40 | sign type tvarv_sign, 41 | opti type tvarv_opti, 42 | option_icon type aqadh_type_of_icon, 43 | low type aqadh_range_value, 44 | high type aqadh_range_value, 45 | more_icon type aqadh_type_of_icon, 46 | range type aqadh_t_ranges, 47 | end of t_sel_row. 48 | 49 | data: gt_sel type table of selection_display_s. 50 | field-symbols: type any. 51 | 52 | selection-screen begin of screen 101. 53 | parameters: gv_tname type tabname visible length 15 matchcode object dd_bastab_for_view. 54 | selection-screen end of screen 0101. 55 | 56 | "Begin of INCLUDE YS_SDE_CLASSES. 57 | 58 | *----------------------------------------------------------------------* 59 | * CLASS lcl_plugins DEFINITION 60 | *----------------------------------------------------------------------* 61 | * 62 | *----------------------------------------------------------------------* 63 | class lcl_plugins definition. 64 | public section. 65 | types: begin of t_field_links, 66 | tab type tabname, 67 | field type fieldname, 68 | rtab type tabname, 69 | rfield type fieldname, 70 | const type aqadh_range_value, 71 | end of t_field_links, 72 | begin of t_el_links, 73 | element type tablename, 74 | rtab type tabname, 75 | rfield type fieldname, 76 | end of t_el_links. 77 | 78 | class-data: mt_field_links type table of t_field_links, 79 | mt_el_links type table of t_el_links. 80 | class-methods: init. 81 | endclass. "lcl_plugins DEFINITION 82 | 83 | *----------------------------------------------------------------------* 84 | * CLASS lcl_plugins IMPLEMENTATION 85 | *----------------------------------------------------------------------* 86 | * 87 | *----------------------------------------------------------------------* 88 | class lcl_plugins implementation. 89 | method init. 90 | "data elements links 91 | * mt_el_links = VALUE #( 92 | * ( element = 'PERSNO' rtab = 'PA0002' rfield = 'PERNR' ) 93 | * ( element = 'HROBJID' rtab = 'HRP1000' rfield = 'OBJID' ) 94 | * ( element = 'HROBJID' rtab = 'HRP1000' rfield = 'OTYPE' ) 95 | * ( element = 'LGART' rtab = 'T512W' rfield = 'LGART' ) 96 | * ). 97 | 98 | "field to field links 99 | * mt_field_links = VALUE #( 100 | * ( tab = 'PA0001' field = 'PLANS' rtab = 'HRP1000' rfield = 'OTYPE' const = 'S' ) 101 | * ( tab = 'PA0001' field = 'PLANS' rtab = 'HRP1000' rfield = 'OBJID' ) 102 | * ( tab = 'PA0001' field = 'ORGEH' rtab = 'HRP1000' rfield = 'OTYPE' const = 'O' ) 103 | * ( tab = 'PA0001' field = 'ORGEH' rtab = 'HRP1000' rfield = 'OBJID' ) 104 | * ( tab = 'PA0001' field = 'STELL' rtab = 'HRP1000' rfield = 'OBJID' const = 'C' ) 105 | * ( tab = 'PA0001' field = 'STELL' rtab = 'HRP1000' rfield = 'OBJID' ) 106 | * ( tab = 'HRP1000' field = 'OTYPE' rtab = 'HRP1001' rfield = 'OTYPE' ) 107 | * ( tab = 'HRP1000' field = 'OBJID' rtab = 'HRP1001' rfield = 'OBJID' ) 108 | * ( tab = 'HRP1001' field = 'OTYPE' rtab = 'HRP1000' rfield = 'OTYPE' ) 109 | * ( tab = 'HRP1001' field = 'OBJID' rtab = 'HRP1000' rfield = 'OBJID' ) 110 | * ( tab = 'HRP1001' field = 'SCLAS' rfield = 'OTYPE' ) 111 | * ( tab = 'HRP1001' field = 'SOBID' rfield = 'OBJID' ) 112 | * ( tab = 'HRP1002' field = 'TABNR' rtab = 'HRT1002' rfield = 'TABNR' ) 113 | * ( tab = 'PA2006' field = 'QUONR' rtab = 'PTQUODED' rfield = 'QUONR' ) 114 | * ( tab = 'PTQUODED' field = 'QUONR' rtab = 'PA2006' rfield = 'QUONR' ) 115 | * ( tab = 'PTQUODED' field = 'DOCNR' rtab = 'PA2001' rfield = 'DOCNR' ) 116 | * ). 117 | endmethod. "init 118 | endclass. "lcl_plugins IMPLEMENTATION 119 | 120 | *----------------------------------------------------------------------* 121 | * CLASS lcl_ddic DEFINITION 122 | *----------------------------------------------------------------------* 123 | * 124 | *----------------------------------------------------------------------* 125 | class lcl_ddic definition. 126 | public section. 127 | class-methods: get_text_table importing i_tname type tabname 128 | exporting e_checkfield type fieldname 129 | e_tab type tabname. 130 | endclass. "lcl_ddic DEFINITION 131 | 132 | *----------------------------------------------------------------------* 133 | * CLASS lcl_ddic IMPLEMENTATION 134 | *----------------------------------------------------------------------* 135 | * 136 | *----------------------------------------------------------------------* 137 | class lcl_ddic implementation. 138 | method get_text_table. 139 | call function 'DDUT_TEXTTABLE_GET' 140 | exporting 141 | tabname = i_tname 142 | importing 143 | texttable = e_tab 144 | checkfield = e_checkfield. 145 | endmethod. "get_text_table 146 | 147 | endclass. "lcl_ddic IMPLEMENTATION 148 | 149 | class lcl_table_viewer definition deferred. 150 | class lcl_box_handler definition deferred. 151 | class lcl_sel_opt definition deferred. 152 | 153 | *----------------------------------------------------------------------* 154 | * CLASS LCL_DD_DATA DEFINITION 155 | *----------------------------------------------------------------------* 156 | * 157 | *----------------------------------------------------------------------* 158 | class lcl_dd_data definition."drag&drop data 159 | public section. 160 | data: m_row type i, 161 | m_column type lvc_s_col. 162 | endclass. "lcl_dd_data DEFINITION 163 | 164 | *----------------------------------------------------------------------* 165 | * CLASS LCL_DRAGDROP DEFINITION 166 | *----------------------------------------------------------------------* 167 | * 168 | *----------------------------------------------------------------------* 169 | class lcl_dragdrop definition. 170 | public section. 171 | class-methods: 172 | drag for event ondrag of cl_gui_alv_grid 173 | importing es_row_no e_dragdropobj e_row e_column , 174 | drop for event ondrop of cl_gui_alv_grid 175 | importing es_row_no e_dragdropobj e_row. 176 | endclass. "lcl_dragdrop DEFINITION 177 | 178 | *----------------------------------------------------------------------* 179 | * CLASS LCL_SQL DEFINITION 180 | *----------------------------------------------------------------------* 181 | * 182 | *----------------------------------------------------------------------* 183 | class lcl_sql definition. 184 | public section. 185 | class-methods: 186 | exist_table importing i_tab like gv_tname returning value(e_subrc) like sy-subrc. 187 | endclass. "lcl_sql DEFINITION 188 | 189 | *----------------------------------------------------------------------* 190 | * CLASS LCL_SQL IMPLEMENTATION 191 | *----------------------------------------------------------------------* 192 | * 193 | *----------------------------------------------------------------------* 194 | class lcl_sql implementation. 195 | method exist_table. 196 | select count( * ) from dd02l 197 | where tabname = i_tab 198 | and ( tabclass = 'TRANSP' or tabclass = 'CLUSTER' ). 199 | e_subrc = sy-dbcnt. 200 | endmethod. "exist_table 201 | 202 | endclass. "lcl_sql IMPLEMENTATION 203 | 204 | *----------------------------------------------------------------------* 205 | * CLASS lcl_rtti DEFINITION 206 | *----------------------------------------------------------------------* 207 | * 208 | *----------------------------------------------------------------------* 209 | class lcl_rtti definition. 210 | public section. 211 | class-methods: 212 | create_table_by_name importing i_tname type tabname changing c_table type ref to data, 213 | create_struc_handle importing i_tname type tabname exporting e_t_comp type abap_component_tab e_handle type ref to cl_abap_structdescr. 214 | endclass. "lcl_rtti DEFINITION 215 | 216 | *----------------------------------------------------------------------* 217 | * CLASS lcl_rtti IMPLEMENTATION 218 | *----------------------------------------------------------------------* 219 | * 220 | *----------------------------------------------------------------------* 221 | class lcl_rtti implementation. 222 | method create_struc_handle. 223 | data: l_texttab type tabname, 224 | lo_texttab type ref to cl_abap_structdescr, 225 | ls_comp type abap_componentdescr, 226 | lt_components type abap_component_tab, 227 | lt_field_info type table of dfies, 228 | ls_field type dfies. 229 | 230 | lcl_ddic=>get_text_table( exporting i_tname = i_tname importing e_tab = l_texttab ). 231 | e_handle ?= cl_abap_typedescr=>describe_by_name( i_tname ). 232 | 233 | if l_texttab is not initial. 234 | lo_texttab ?= cl_abap_typedescr=>describe_by_name( l_texttab ). 235 | data: l_descr like line of cl_abap_structdescr=>components. 236 | loop at e_handle->components into l_descr. 237 | ls_comp-name = l_descr-name. 238 | ls_comp-type ?= e_handle->get_component_type( ls_comp-name ). 239 | append ls_comp to lt_components. 240 | endloop. 241 | 242 | loop at lo_texttab->components into l_descr. 243 | 244 | call function 'DDIF_FIELDINFO_GET' 245 | exporting 246 | tabname = l_texttab 247 | fieldname = l_descr-name 248 | langu = sy-langu 249 | tables 250 | dfies_tab = lt_field_info 251 | exceptions 252 | not_found = 1 253 | internal_error = 2 254 | others = 3. 255 | 256 | read table lt_field_info into ls_field index 1. 257 | if ls_field-keyflag = abap_false. 258 | ls_comp-name = l_texttab && '_' && l_descr-name. 259 | ls_comp-type ?= lo_texttab->get_component_type( l_descr-name ). 260 | append ls_comp to lt_components. 261 | append ls_comp to e_t_comp. 262 | endif. 263 | endloop. 264 | e_handle = cl_abap_structdescr=>create( lt_components ). 265 | endif. 266 | endmethod. "create_struc_handle 267 | 268 | method create_table_by_name. 269 | data: lo_new_tab type ref to cl_abap_tabledescr, 270 | lo_new_type type ref to cl_abap_structdescr. 271 | 272 | create_struc_handle( exporting i_tname = i_tname importing e_handle = lo_new_type ). 273 | lo_new_tab = cl_abap_tabledescr=>create( 274 | p_line_type = lo_new_type 275 | p_table_kind = cl_abap_tabledescr=>tablekind_std 276 | p_unique = abap_false ). 277 | create data c_table type handle lo_new_tab. "Create a New table type 278 | endmethod. "create_table_by_name 279 | endclass. "lcl_rtti IMPLEMENTATION 280 | 281 | 282 | *----------------------------------------------------------------------* 283 | * CLASS LCL_ALV_COMMON DEFINITION 284 | *----------------------------------------------------------------------* 285 | * 286 | *----------------------------------------------------------------------* 287 | class lcl_alv_common definition. 288 | public section. 289 | constants: c_white(4) type x value '00000001', "white background 290 | c_grey(4) type x value '00000003', "white background 291 | c_green(4) type x value '00000216', "green +underline 292 | c_blue(4) type x value '00000209', " blue font +underline 293 | c_bold(4) type x value '00000020'. 294 | 295 | types: begin of t_tabfields. 296 | include type dfies. 297 | types: empty type xfeld, 298 | end of t_tabfields. 299 | class-data: mt_tabfields type hashed table of t_tabfields with unique key tabname fieldname. 300 | 301 | class-methods: 302 | refresh importing i_obj type ref to cl_gui_alv_grid i_layout type lvc_s_layo optional, 303 | translate_field importing i_lang type ddlanguage optional changing c_fld type lvc_s_fcat. 304 | endclass. "lcl_alv_common DEFINITION 305 | 306 | *----------------------------------------------------------------------* 307 | * CLASS LCL_ALV_COMMON IMPLEMENTATION 308 | *----------------------------------------------------------------------* 309 | * 310 | *----------------------------------------------------------------------* 311 | class lcl_alv_common implementation. 312 | 313 | method refresh. 314 | data l_stable type lvc_s_stbl. 315 | l_stable-row = 'X'. 316 | l_stable-col = 'X'. 317 | if i_layout is supplied. 318 | i_obj->set_frontend_layout( i_layout ) . 319 | endif. 320 | i_obj->refresh_table_display( exporting is_stable = l_stable ). 321 | endmethod. "refresh 322 | 323 | method translate_field. 324 | data: lv_lang like sy-langu, 325 | lt_field_info type table of dfies. 326 | 327 | call function 'DDIF_FIELDINFO_GET' 328 | exporting 329 | tabname = c_fld-ref_table 330 | fieldname = c_fld-fieldname 331 | langu = lv_lang 332 | tables 333 | dfies_tab = lt_field_info 334 | exceptions 335 | not_found = 1 336 | internal_error = 2 337 | others = 3. 338 | 339 | if sy-subrc = 0. 340 | data: l_info type dfies. 341 | read table lt_field_info index 1 into l_info. 342 | if l_info-scrtext_l is initial and l_info-scrtext_m is initial and l_info-scrtext_s is initial. 343 | if l_info-fieldtext is not initial. 344 | move l_info-fieldtext to: c_fld-reptext, c_fld-scrtext_l, c_fld-scrtext_m, c_fld-scrtext_s . 345 | else. 346 | move l_info-fieldname to: c_fld-reptext, c_fld-scrtext_l, c_fld-scrtext_m, c_fld-scrtext_s . 347 | endif. 348 | else. 349 | c_fld-scrtext_l = l_info-scrtext_l. 350 | c_fld-scrtext_m = l_info-scrtext_m. 351 | c_fld-scrtext_s = l_info-scrtext_s. 352 | if l_info-reptext is not initial. 353 | c_fld-reptext = l_info-reptext. 354 | endif. 355 | endif. 356 | endif. 357 | endmethod. "translate_field 358 | endclass. "lcl_alv_common IMPLEMENTATION 359 | 360 | *----------------------------------------------------------------------* 361 | * CLASS LCL_APPL DEFINITION 362 | *----------------------------------------------------------------------* 363 | * 364 | *----------------------------------------------------------------------* 365 | class lcl_appl definition. 366 | public section. 367 | 368 | types: begin of sign_option_icon_s, 369 | sign type tvarv_sign, 370 | option type tvarv_opti, 371 | icon_name(64) type c, 372 | icon type aqadh_type_of_icon, 373 | end of sign_option_icon_s, 374 | 375 | begin of t_obj, 376 | alv_viewer type ref to lcl_table_viewer, 377 | end of t_obj, 378 | 379 | begin of t_lang, 380 | spras type spras, 381 | sptxt type sptxt, 382 | end of t_lang . 383 | 384 | class-data: m_option_icons type table of sign_option_icon_s, 385 | mt_lang type table of t_lang, 386 | mt_obj type table of t_obj, "main object table 387 | m_ctrl_box_handler type ref to lcl_box_handler, 388 | c_dragdropalv type ref to cl_dragdrop. 389 | 390 | class-methods: 391 | init_icons_table, 392 | init_lang, 393 | suppress_run_button, 394 | exit. 395 | endclass. "lcl_appl DEFINITION 396 | 397 | *----------------------------------------------------------------------* 398 | * CLASS LCL_DATA_TRANSMITTER DEFINITION 399 | *----------------------------------------------------------------------* 400 | * 401 | *----------------------------------------------------------------------* 402 | class lcl_data_transmitter definition. 403 | public section. 404 | events: data_changed exporting value(e_row) type t_sel_row, 405 | col_changed exporting value(e_column) type lvc_fname. 406 | methods: emit importing e_row type t_sel_row, 407 | emit_col importing e_column type lvc_fname. 408 | endclass. "lcl_data_transmitter DEFINITION 409 | 410 | *----------------------------------------------------------------------* 411 | * CLASS LCL_DATA_TRANSMITTER IMPLEMENTATION 412 | *----------------------------------------------------------------------* 413 | * 414 | *----------------------------------------------------------------------* 415 | class lcl_data_transmitter implementation. 416 | method emit. 417 | raise event data_changed exporting e_row = e_row. 418 | endmethod. "emit 419 | 420 | method emit_col. 421 | raise event col_changed exporting e_column = e_column. 422 | endmethod. "emit_col 423 | endclass. "lcl_data_transmitter IMPLEMENTATION 424 | 425 | *----------------------------------------------------------------------* 426 | * CLASS LCL_DATA_RECEIVER DEFINITION 427 | *----------------------------------------------------------------------* 428 | * 429 | *----------------------------------------------------------------------* 430 | class lcl_data_receiver definition. 431 | public section. 432 | data: mo_transmitter type ref to lcl_data_transmitter, 433 | lo_tab_from type ref to lcl_table_viewer, 434 | lo_sel_to type ref to lcl_sel_opt, 435 | m_from_field type lvc_fname, 436 | m_to_field type lvc_fname. 437 | methods: constructor 438 | importing io_transmitter type ref to lcl_data_transmitter optional 439 | io_tab_from type ref to lcl_table_viewer optional 440 | io_sel_to type ref to lcl_sel_opt optional 441 | i_from_field type lvc_fname optional 442 | i_to_field type lvc_fname optional, 443 | shut_down, 444 | update for event data_changed of lcl_data_transmitter importing e_row, 445 | update_col for event col_changed of lcl_data_transmitter importing e_column, 446 | on_grid_button_click 447 | for event button_click of cl_gui_alv_grid 448 | importing 449 | es_col_id 450 | es_row_no. 451 | endclass. "lcl_data_receiver DEFINITION 452 | 453 | *----------------------------------------------------------------------* 454 | * CLASS LCL_SEL_OPT DEFINITION 455 | *----------------------------------------------------------------------* 456 | * 457 | *----------------------------------------------------------------------* 458 | class lcl_sel_opt definition. 459 | public section. 460 | 461 | data: mo_viewer type ref to lcl_table_viewer, 462 | mo_sel_alv type ref to cl_gui_alv_grid, 463 | mt_fcat type lvc_t_fcat, 464 | mt_sel_tab type table of selection_display_s, 465 | ms_layout type lvc_s_layo. 466 | 467 | events: selection_done. 468 | 469 | methods: 470 | constructor importing io_viewer type ref to lcl_table_viewer io_container type ref to cl_gui_container, 471 | raise_selection_done, 472 | update_sel_tab, 473 | set_value importing i_field type any i_low type any optional i_high type any optional i_clear type xfeld optional, 474 | update_sel_row changing c_sel_row type selection_display_s. 475 | 476 | private section. 477 | 478 | methods: 479 | init_fcat importing i_dd_handle type i, 480 | handle_doubleclick FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_column es_row_no, 481 | handle_sel_toolbar for event toolbar of cl_gui_alv_grid 482 | importing e_object e_interactive, 483 | on_f4 for event onf4 of cl_gui_alv_grid 484 | importing e_fieldname 485 | es_row_no 486 | er_event_data, 487 | on_grid_button_click for event button_click of cl_gui_alv_grid 488 | importing 489 | es_col_id 490 | es_row_no, 491 | on_data_changed for event 492 | data_changed of cl_gui_alv_grid 493 | importing e_onf4 494 | e_onf4_before 495 | er_data_changed 496 | sender, 497 | on_data_changed_finished for event data_changed_finished of cl_gui_alv_grid 498 | importing e_modified et_good_cells, 499 | handle_user_command for event user_command of cl_gui_alv_grid 500 | importing e_ucomm, 501 | handle_context_menu_request for event context_menu_request 502 | of cl_gui_alv_grid 503 | importing 504 | e_object 505 | sender. 506 | endclass. "lcl_sel_opt DEFINITION 507 | 508 | *----------------------------------------------------------------------* 509 | * CLASS LCL_TABLE_VIEWER DEFINITION 510 | *----------------------------------------------------------------------* 511 | * 512 | *----------------------------------------------------------------------* 513 | class lcl_table_viewer definition. 514 | 515 | public section. 516 | 517 | types: begin of t_column_emitter, 518 | column type lvc_fname, 519 | emitter type ref to lcl_data_transmitter, 520 | end of t_column_emitter. 521 | 522 | data: m_lang type ddlanguage, 523 | m_tabname type tabname, 524 | m_count type i, 525 | mo_alv type ref to cl_gui_alv_grid, 526 | mo_sel type ref to lcl_sel_opt, 527 | mo_box type ref to cl_gui_dialogbox_container, 528 | mr_table type ref to data, 529 | mr_text_table type ref to data, 530 | mo_splitter type ref to cl_gui_splitter_container, 531 | mo_sel_parent type ref to cl_gui_container, 532 | mo_alv_parent type ref to cl_gui_container, 533 | mt_alv_catalog type lvc_t_fcat, 534 | mt_text_components type abap_component_tab, 535 | m_checkfield type fieldname, 536 | mo_column_emitters type table of t_column_emitter, 537 | mo_sel_width type i, 538 | m_visible, 539 | m_std_tbar type x, 540 | m_show_empty. 541 | 542 | methods: 543 | constructor importing i_tname type tabname, 544 | get_where returning value(c_where) type string, 545 | refresh_table for event selection_done of lcl_sel_opt. 546 | 547 | private section. 548 | methods: 549 | create_popup, 550 | create_alv, 551 | create_sel_alv, 552 | set_header, 553 | read_text_table, 554 | update_texts, 555 | read_table importing i_tabname type tabname 556 | i_where type string 557 | i_row_count type i optional 558 | changing cr_tab type ref to data 559 | c_count type i, 560 | link importing i_str type any 561 | i_column type any returning value(r_done) type xfeld, 562 | 563 | create_field_cat importing i_tname type tabname returning value(et_catalog) type lvc_t_fcat, 564 | on_f4 for event onf4 of cl_gui_alv_grid importing e_fieldname es_row_no er_event_data, 565 | 566 | handle_tab_toolbar for event toolbar of cl_gui_alv_grid 567 | importing e_object e_interactive, 568 | 569 | handle_menu_button 570 | for event menu_button of cl_gui_alv_grid 571 | importing e_object e_ucomm, 572 | before_user_command for event before_user_command of cl_gui_alv_grid importing e_ucomm, 573 | handle_doubleclick for event double_click of cl_gui_alv_grid importing e_column es_row_no, 574 | handle_user_command 575 | for event user_command of cl_gui_alv_grid 576 | importing e_ucomm. 577 | endclass. "lcl_table_viewer DEFINITION 578 | 579 | *----------------------------------------------------------------------* 580 | * CLASS LCL_DATA_RECEIVER IMPLEMENTATION 581 | *----------------------------------------------------------------------* 582 | * 583 | *----------------------------------------------------------------------* 584 | class lcl_data_receiver implementation. 585 | 586 | method constructor. 587 | lo_sel_to = io_sel_to. 588 | m_from_field = i_from_field. 589 | m_to_field = i_to_field. 590 | 591 | lo_tab_from = io_tab_from. 592 | mo_transmitter = io_transmitter. 593 | 594 | if mo_transmitter is not initial. 595 | if lo_tab_from is initial. 596 | set handler me->update for io_transmitter. 597 | else. 598 | set handler me->update_col for io_transmitter. 599 | endif. 600 | else. 601 | set handler me->update for all instances. 602 | endif. 603 | endmethod. "constructor 604 | 605 | method shut_down. 606 | if mo_transmitter is not initial. 607 | set handler me->update for mo_transmitter activation space. 608 | else. 609 | set handler me->update for all instances activation space. 610 | endif. 611 | clear lo_sel_to. 612 | endmethod. "shut_down 613 | 614 | method on_grid_button_click. 615 | field-symbols: type standard table, 616 | type any. 617 | check m_from_field = es_col_id-fieldname. 618 | 619 | assign lo_tab_from->mr_table->* to . 620 | field-symbols type any. 621 | read table index es_row_no-row_id assigning . 622 | assign component es_col_id-fieldname of structure to . 623 | 624 | check lo_sel_to is not initial. 625 | field-symbols like line of lo_sel_to->mt_sel_tab. 626 | read table lo_sel_to->mt_sel_tab assigning with key field_label = m_to_field. 627 | clear: -high, -opti, -sign, -range. 628 | -low = . 629 | lo_sel_to->update_sel_row( changing c_sel_row = ). 630 | 631 | if -transmitter is bound. 632 | data: ls_row type t_sel_row. 633 | move-corresponding to ls_row. 634 | -transmitter->emit( exporting e_row = ls_row ). 635 | endif. 636 | 637 | lcl_alv_common=>refresh( lo_sel_to->mo_sel_alv ). 638 | lo_sel_to->raise_selection_done( ). 639 | endmethod. "on_grid_button_click 640 | 641 | method update. 642 | data: l_updated. 643 | field-symbols like line of lo_sel_to->mt_sel_tab. 644 | read table lo_sel_to->mt_sel_tab assigning with key field_label = m_to_field. 645 | if -range[] = e_row-range[]. 646 | l_updated = 'X'."so as not to have an infinite event loop 647 | endif. 648 | move-corresponding e_row to . 649 | 650 | if -transmitter is bound and l_updated is initial. 651 | -transmitter->emit( exporting e_row = e_row ). 652 | endif. 653 | 654 | lcl_alv_common=>refresh( lo_sel_to->mo_sel_alv ). 655 | lo_sel_to->raise_selection_done( ). 656 | endmethod. "update 657 | 658 | method update_col. 659 | 660 | data: lt_sel_row type t_sel_row. 661 | field-symbols: type standard table, 662 | type any. 663 | 664 | check lo_sel_to is not initial. 665 | field-symbols like line of lo_sel_to->mt_sel_tab. 666 | read table lo_sel_to->mt_sel_tab assigning with key field_label = m_to_field. 667 | clear: -sign, -opti, -low, -high, -range. 668 | assign lo_tab_from->mr_table->* to . 669 | 670 | field-symbols type any. 671 | loop at assigning . 672 | assign component e_column of structure to . 673 | read table -range with key low = transporting no fields. 674 | if sy-subrc ne 0. 675 | data ls_range type aqadh_s_ranges. 676 | ls_range-sign = 'I'. 677 | ls_range-opti = 'EQ'. 678 | ls_range-low = . 679 | append ls_range to -range. 680 | endif. 681 | endloop. 682 | 683 | if sy-subrc ne 0." empty column 684 | ls_range-sign = 'I'. 685 | ls_range-opti = 'EQ'. 686 | ls_range-low = ''. 687 | append ls_range to -range. 688 | endif. 689 | 690 | field-symbols type aqadh_s_ranges. 691 | loop at -range assigning . 692 | -low = -low. 693 | lo_sel_to->update_sel_row( changing c_sel_row = ). 694 | exit. 695 | endloop. 696 | 697 | move-corresponding to lt_sel_row. 698 | 699 | if -transmitter is bound. " AND l_updated IS INITIAL. 700 | -transmitter->emit( exporting e_row = lt_sel_row ). 701 | endif. 702 | 703 | lcl_alv_common=>refresh( lo_sel_to->mo_sel_alv ). 704 | lo_sel_to->raise_selection_done( ). 705 | 706 | endmethod. "update_col 707 | endclass. "lcl_data_receiver IMPLEMENTATION 708 | 709 | *----------------------------------------------------------------------* 710 | * CLASS LCL_BOX_HANDLER DEFINITION 711 | *----------------------------------------------------------------------* 712 | * 713 | *----------------------------------------------------------------------* 714 | class lcl_box_handler definition."for memory clearing 715 | public section. 716 | methods: on_box_close for event close of cl_gui_dialogbox_container importing sender. 717 | endclass. "lcl_box_handler DEFINITION 718 | 719 | *----------------------------------------------------------------------* 720 | * CLASS LCL_BOX_HANDLER IMPLEMENTATION 721 | *----------------------------------------------------------------------* 722 | * 723 | *----------------------------------------------------------------------* 724 | class lcl_box_handler implementation. 725 | 726 | method on_box_close. 727 | 728 | data: lv_tabix like sy-tabix. 729 | sender->free( ). 730 | 731 | "Free Memory 732 | field-symbols type lcl_appl=>t_obj. 733 | loop at lcl_appl=>mt_obj assigning . 734 | if -alv_viewer->mo_box = sender. 735 | lv_tabix = sy-tabix. 736 | exit. 737 | endif. 738 | endloop. 739 | if sy-subrc = 0. 740 | free -alv_viewer->mr_table. 741 | free -alv_viewer->mo_alv. 742 | 743 | "shutdown receivers. 744 | if -alv_viewer->mo_sel is not initial. 745 | data l_sel type selection_display_s. 746 | loop at -alv_viewer->mo_sel->mt_sel_tab into l_sel. 747 | if l_sel-receiver is bound. 748 | l_sel-receiver->shut_down( ). 749 | endif. 750 | endloop. 751 | endif. 752 | free -alv_viewer. 753 | 754 | delete lcl_appl=>mt_obj index lv_tabix. 755 | endif. 756 | endmethod. "ON_BOX_CLOSE 757 | endclass. "lcl_box_handler 758 | 759 | *----------------------------------------------------------------------* 760 | * CLASS LCL_TABLE_VIEWER IMPLEMENTATION 761 | *----------------------------------------------------------------------* 762 | * 763 | *----------------------------------------------------------------------* 764 | class lcl_table_viewer implementation. 765 | 766 | method constructor. 767 | m_lang = sy-langu. 768 | mo_sel_width = 0. 769 | m_tabname = i_tname. 770 | create_popup( ). 771 | lcl_rtti=>create_table_by_name( exporting i_tname = m_tabname changing c_table = mr_table ). 772 | create_alv( ). 773 | create_sel_alv( ). 774 | mo_alv->set_focus( mo_alv ). 775 | endmethod. "constructor 776 | 777 | method create_popup. 778 | data: l_top type i, 779 | l_left type i. 780 | 781 | data l_lines type i. 782 | l_lines = lines( lcl_appl=>mt_obj ) - 1. 783 | l_top = 20 + 30 * ( l_lines div 5 ) + ( l_lines mod 5 ) * 50. 784 | l_left = 350 + 300 * ( l_lines div 5 ) + ( l_lines mod 5 ) * 50. 785 | 786 | create object mo_box 787 | exporting 788 | width = '800' 789 | height = '150' 790 | top = l_top 791 | left = l_left 792 | caption = m_tabname 793 | exceptions 794 | cntl_error = 1 795 | cntl_system_error = 2 796 | create_error = 3 797 | lifetime_error = 4 798 | lifetime_dynpro_dynpro_link = 5 799 | event_already_registered = 6 800 | error_regist_event = 7 801 | others = 8. 802 | if sy-subrc <> 0. 803 | return. 804 | endif. 805 | 806 | create object mo_splitter 807 | exporting 808 | parent = mo_box 809 | rows = 1 810 | columns = 2 811 | exceptions 812 | others = 1. 813 | 814 | mo_splitter->set_column_mode( mode = mo_splitter->mode_absolute ). 815 | mo_splitter->set_column_width( id = 1 width = mo_sel_width ). 816 | 817 | call method: 818 | mo_splitter->get_container( exporting 819 | row = 1 820 | column = 1 821 | receiving 822 | container = mo_sel_parent ), 823 | 824 | mo_splitter->get_container 825 | exporting 826 | row = 1 827 | column = 2 828 | receiving 829 | container = mo_alv_parent. 830 | 831 | if lcl_appl=>m_ctrl_box_handler is initial. 832 | create object lcl_appl=>m_ctrl_box_handler. 833 | endif. 834 | set handler lcl_appl=>m_ctrl_box_handler->on_box_close for mo_box. 835 | endmethod. "create_popup 836 | 837 | method create_alv. 838 | 839 | data: ls_layout type lvc_s_layo, 840 | effect type i, 841 | lt_f4 type lvc_t_f4, 842 | 843 | handle_alv type i. 844 | field-symbols: type any table. 845 | 846 | create object mo_alv 847 | exporting 848 | i_parent = mo_alv_parent. 849 | mt_alv_catalog = create_field_cat( m_tabname ). 850 | assign mr_table->* to . 851 | read_text_table( ). 852 | read_table( exporting i_tabname = m_tabname i_where = get_where( ) i_row_count = 100 853 | changing cr_tab = mr_table c_count = m_count ). 854 | 855 | set_header( ). 856 | ls_layout-col_opt = 'X'. 857 | ls_layout-cwidth_opt = 'X'. 858 | ls_layout-sel_mode = 'D'. 859 | 860 | create object lcl_appl=>c_dragdropalv. 861 | 862 | effect = cl_dragdrop=>move + cl_dragdrop=>copy. 863 | 864 | call method lcl_appl=>c_dragdropalv->add 865 | exporting 866 | flavor = 'Line' 867 | dragsrc = 'X' 868 | droptarget = 'X' 869 | effect = effect. 870 | 871 | call method lcl_appl=>c_dragdropalv->get_handle 872 | importing 873 | handle = handle_alv. 874 | 875 | ls_layout-s_dragdrop-grid_ddid = handle_alv. 876 | set handler before_user_command 877 | handle_user_command 878 | handle_menu_button 879 | handle_tab_toolbar 880 | handle_doubleclick 881 | lcl_dragdrop=>drag 882 | on_f4 883 | for mo_alv. 884 | 885 | call method mo_alv->set_table_for_first_display 886 | exporting 887 | i_save = 'X' 888 | i_default = 'X' 889 | is_layout = ls_layout 890 | changing 891 | it_fieldcatalog = mt_alv_catalog 892 | it_outtab = . 893 | 894 | mo_alv->get_frontend_fieldcatalog( importing et_fieldcatalog = mt_alv_catalog ). 895 | 896 | field-symbols type lvc_s_fcat. 897 | loop at mt_alv_catalog assigning where scrtext_l is initial. 898 | lcl_alv_common=>translate_field( changing c_fld = ). 899 | endloop. 900 | 901 | data ls_f4 type lvc_s_f4. 902 | ls_f4-register = 'X'. 903 | loop at mt_alv_catalog assigning . 904 | clear -key. 905 | ls_f4-fieldname = -fieldname . 906 | insert ls_f4 into table lt_f4. 907 | endloop. 908 | mo_alv->register_f4_for_fields( it_f4 = lt_f4 ). 909 | mo_alv->set_frontend_fieldcatalog( exporting it_fieldcatalog = mt_alv_catalog ). 910 | 911 | 912 | mo_alv->set_frontend_fieldcatalog( exporting it_fieldcatalog = mt_alv_catalog ). 913 | 914 | me->handle_user_command( exporting e_ucomm = 'HIDE' ). 915 | mo_alv->set_toolbar_interactive( ). 916 | endmethod. "create_alv 917 | 918 | method create_sel_alv. 919 | if mo_sel is initial. 920 | create object mo_sel 921 | exporting 922 | io_viewer = me 923 | io_container = mo_sel_parent. 924 | set handler refresh_table for mo_sel. 925 | else. 926 | mo_sel->update_sel_tab( ). 927 | endif. 928 | endmethod. "create_sel_alv 929 | 930 | method set_header. 931 | data: lv_text type as4text, 932 | lv_header(80) type c. 933 | 934 | select single ddtext into lv_text 935 | from dd02t 936 | where tabname = m_tabname 937 | and ddlanguage = m_lang. 938 | 939 | lv_header = |{ m_tabname } - { lv_text } ({ m_count })|. 940 | mo_box->set_caption( lv_header ). 941 | endmethod. "set_header 942 | 943 | method read_text_table. 944 | data: l_tab type tabname. 945 | field-symbols: type any table. 946 | 947 | lcl_ddic=>get_text_table( exporting i_tname = m_tabname importing e_tab = l_tab ). 948 | check l_tab is not initial. 949 | lcl_rtti=>create_table_by_name( exporting i_tname = l_tab changing c_table = mr_text_table ). 950 | assign mr_text_table->* to . 951 | select * from (l_tab) into table order by primary key. 952 | endmethod. "read_text_table 953 | 954 | method update_texts. 955 | data: l_text_field type fieldname, 956 | l_replace type string, 957 | lv_clause type string, 958 | l_tab type tabname. 959 | 960 | field-symbols: type any table, 961 | type any table. 962 | field-symbols: type any, 963 | type any, 964 | type any, 965 | type any, 966 | type any, 967 | type any. 968 | 969 | "text fields 970 | lcl_ddic=>get_text_table( exporting i_tname = m_tabname importing e_tab = l_tab ). 971 | check l_tab is not initial. 972 | 973 | assign mr_table->* to . 974 | assign mr_text_table->* to . 975 | 976 | l_replace = l_tab && '_'. 977 | loop at assigning . 978 | data: ls_comp type abap_componentdescr. 979 | loop at mt_text_components into ls_comp. 980 | l_text_field = ls_comp-name. 981 | replace l_replace in l_text_field with ''. 982 | assign component ls_comp-name of structure to . 983 | assign component m_checkfield of structure to . 984 | check sy-subrc = 0. 985 | lv_clause = |{ m_checkfield } = '{ }'|. 986 | loop at assigning where (lv_clause). 987 | exit. 988 | endloop. 989 | if sy-subrc = 0. 990 | assign component 'SPRSL' of structure to . 991 | if sy-subrc = 0. 992 | lv_clause = |{ lv_clause } AND SPRSL = '{ m_lang }'|. 993 | endif. 994 | assign component 'SPRAS' of structure to . 995 | if sy-subrc = 0. 996 | lv_clause = |{ lv_clause } AND SPRAS = '{ m_lang }'|. 997 | endif. 998 | else. 999 | continue. 1000 | endif. 1001 | 1002 | loop at assigning where (lv_clause). 1003 | exit. 1004 | endloop. 1005 | check sy-subrc = 0. 1006 | assign component l_text_field of structure to . 1007 | = . 1008 | endloop. 1009 | endloop. 1010 | 1011 | endmethod. "update_texts 1012 | 1013 | 1014 | method read_table. 1015 | field-symbols: type any table. 1016 | 1017 | assign cr_tab->* to . 1018 | if i_where is not initial. 1019 | try. 1020 | select * from (i_tabname) into corresponding fields of table where (i_where) order by primary key. 1021 | catch cx_sy_dynamic_osql_semantics. 1022 | catch cx_sy_dynamic_osql_syntax. 1023 | catch cx_sy_conversion_no_number. 1024 | endtry. 1025 | else. 1026 | if i_row_count is not supplied. 1027 | select * from (i_tabname) into corresponding fields of table . 1028 | else. 1029 | select * from (i_tabname) into corresponding fields of table up to i_row_count rows. 1030 | endif. 1031 | endif. 1032 | c_count = sy-dbcnt. 1033 | update_texts( ). 1034 | endmethod. "read_table 1035 | 1036 | 1037 | 1038 | method handle_tab_toolbar. 1039 | if m_visible is initial. 1040 | data: lt_toolbar type ttb_button, 1041 | ls_toolbar type stb_button. 1042 | ls_toolbar-function = 'SEL_ON'. 1043 | ls_toolbar-icon = icon_arrow_left. 1044 | ls_toolbar-quickinfo = 'Select-Options'. 1045 | ls_toolbar-butn_type = 0. 1046 | append ls_toolbar to lt_toolbar. 1047 | 1048 | clear ls_toolbar. 1049 | ls_toolbar-butn_type = 3. 1050 | append ls_toolbar to lt_toolbar. 1051 | endif. 1052 | ls_toolbar-function = 'LANGUAGE'. 1053 | ls_toolbar-icon = icon_foreign_trade. 1054 | ls_toolbar-quickinfo = 'Languages'. 1055 | ls_toolbar-butn_type = 2. 1056 | append ls_toolbar to lt_toolbar. 1057 | 1058 | ls_toolbar-function = 'OPTIONS'. 1059 | ls_toolbar-icon = icon_list. 1060 | ls_toolbar-quickinfo = 'Empty columns options'. 1061 | append ls_toolbar to lt_toolbar. 1062 | 1063 | ls_toolbar-function = 'TABLES'. 1064 | ls_toolbar-icon = icon_net_graphic. 1065 | ls_toolbar-quickinfo = 'Table links'. 1066 | ls_toolbar-butn_type = 0. 1067 | append ls_toolbar to lt_toolbar. 1068 | 1069 | clear ls_toolbar. 1070 | ls_toolbar-butn_type = 3. 1071 | append ls_toolbar to lt_toolbar. 1072 | 1073 | append lines of e_object->mt_toolbar to lt_toolbar. 1074 | e_object->mt_toolbar = lt_toolbar. 1075 | endmethod. "handle_tab_toolbar 1076 | 1077 | method create_field_cat. 1078 | data: lv_clause type string, 1079 | lr_struc type ref to data, 1080 | lr_table_descr type ref to cl_abap_structdescr, 1081 | it_tabdescr type abap_compdescr_tab, 1082 | lt_field_info type table of dfies, 1083 | l_fname type fieldname, 1084 | l_tname type tabname, 1085 | l_replace type string, 1086 | l_texttab type tabname, 1087 | lo_str type ref to cl_abap_structdescr . 1088 | 1089 | lcl_rtti=>create_struc_handle( exporting i_tname = i_tname importing e_t_comp = mt_text_components e_handle = lo_str ). 1090 | create data lr_struc type handle lo_str. 1091 | lr_table_descr ?= cl_abap_typedescr=>describe_by_data_ref( lr_struc ). 1092 | it_tabdescr[] = lr_table_descr->components[]. 1093 | 1094 | lcl_ddic=>get_text_table( exporting i_tname = i_tname importing e_checkfield = m_checkfield e_tab = l_texttab ). 1095 | 1096 | l_replace = l_texttab && '_'. 1097 | 1098 | data: l_ind type i, 1099 | ls like line of it_tabdescr, 1100 | ls_tf like line of lcl_alv_common=>mt_tabfields. 1101 | field-symbols: like line of et_catalog. 1102 | loop at it_tabdescr into ls where name ne 'MANDT'. 1103 | l_ind = sy-tabix. 1104 | append initial line to et_catalog assigning . 1105 | -col_pos = l_ind. 1106 | read table lcl_alv_common=>mt_tabfields into ls_tf with key tabname = i_tname fieldname = ls-name. 1107 | if sy-subrc ne 0. 1108 | l_tname = i_tname. 1109 | l_fname = ls-name. 1110 | 1111 | if l_texttab is not initial. 1112 | 1113 | l_fname = ls-name. 1114 | replace l_replace in l_fname with ''. 1115 | if sy-subrc = 0. 1116 | l_tname = l_texttab. 1117 | endif. 1118 | endif. 1119 | call function 'DDIF_FIELDINFO_GET' 1120 | exporting 1121 | tabname = l_tname 1122 | fieldname = l_fname 1123 | langu = sy-langu 1124 | tables 1125 | dfies_tab = lt_field_info 1126 | exceptions 1127 | not_found = 1 1128 | internal_error = 2 1129 | others = 3. 1130 | if sy-subrc ne 0. 1131 | continue. 1132 | endif. 1133 | clear ls_tf. 1134 | 1135 | read table lt_field_info index 1 into ls_tf. 1136 | ls_tf-fieldname = ls-name. 1137 | 1138 | "check empty field 1139 | if ls_tf-domname ne 'MANDT'. 1140 | data: dref type ref to data, 1141 | l_x type xstring. 1142 | field-symbols type any. 1143 | 1144 | if ls_tf-rollname is not initial. 1145 | create data dref type (ls_tf-rollname). 1146 | assign dref->* to . 1147 | lv_clause = |{ l_fname } NE ''|. 1148 | select single (l_fname) into 1149 | from (l_tname) 1150 | where (lv_clause). 1151 | if sy-subrc ne 0. 1152 | ls_tf-empty = 'X'. 1153 | endif. 1154 | elseif ls_tf-datatype = 'RAWSTRING'. 1155 | lv_clause = |{ ls_tf-fieldname } NE ''|. 1156 | select single (ls_tf-fieldname) into l_x 1157 | from (l_tname) 1158 | where (lv_clause). 1159 | if sy-subrc ne 0. 1160 | ls_tf-empty = 'X'. 1161 | endif. 1162 | endif. 1163 | endif. 1164 | insert ls_tf into table lcl_alv_common=>mt_tabfields. 1165 | endif. 1166 | -style = lcl_alv_common=>c_white. 1167 | move-corresponding ls_tf to . 1168 | -no_zero = 'X'. 1169 | -f4availabl = 'X'. 1170 | if ls_tf-tabname ne m_tabname. 1171 | -style = lcl_alv_common=>c_grey. 1172 | endif. 1173 | 1174 | if ls_tf-checktable is not initial. 1175 | -style = lcl_alv_common=>c_blue. 1176 | endif. 1177 | 1178 | read table lcl_plugins=>mt_field_links with key tab = i_tname field = ls_tf-fieldname transporting no fields. 1179 | if sy-subrc = 0. 1180 | -style = lcl_alv_common=>c_green. 1181 | endif. 1182 | 1183 | read table lcl_plugins=>mt_el_links with key element = ls_tf-rollname transporting no fields. 1184 | if sy-subrc = 0. 1185 | -style = lcl_alv_common=>c_green. 1186 | endif. 1187 | 1188 | if ls_tf-keyflag = 'X'. 1189 | -style = -style bit-or lcl_alv_common=>c_bold. 1190 | endif. 1191 | endloop. 1192 | endmethod. "create_field_cat 1193 | 1194 | method on_f4. 1195 | 1196 | field-symbols: type standard table. 1197 | assign mr_table->* to . 1198 | read table index es_row_no-row_id assigning . 1199 | call function 'F4IF_FIELD_VALUE_REQUEST' 1200 | exporting 1201 | tabname = m_tabname 1202 | fieldname = e_fieldname 1203 | callback_program = sy-repid 1204 | callback_form = 'CALLBACK_F4_TAB' "callback_method - doesn't work for local class 1205 | exceptions 1206 | field_not_found = 1 1207 | no_help_for_field = 2 1208 | inconsistent_help = 3 1209 | no_values_found = 4 1210 | others = 5. 1211 | endmethod. "on_f4 1212 | 1213 | method link. 1214 | data: i_viewer type ref to lcl_table_viewer, 1215 | ls_link type lcl_plugins=>t_field_links. 1216 | 1217 | field-symbols: type any, 1218 | type lcl_appl=>t_obj. 1219 | clear r_done. 1220 | "field to field links 1221 | loop at lcl_plugins=>mt_field_links into ls_link where tab = m_tabname and field = i_column. 1222 | assign component ls_link-field of structure i_str to . 1223 | if i_viewer is initial. 1224 | if ls_link-rtab is initial. 1225 | i_viewer = me. 1226 | else. 1227 | append initial line to lcl_appl=>mt_obj assigning . 1228 | create object -alv_viewer 1229 | exporting 1230 | i_tname = ls_link-rtab. 1231 | i_viewer = -alv_viewer. 1232 | endif. 1233 | endif. 1234 | if ls_link-const is initial. 1235 | i_viewer->mo_sel->set_value( i_field = ls_link-rfield i_low = i_clear = 'X' ). 1236 | else. 1237 | i_viewer->mo_sel->set_value( i_field = ls_link-rfield i_low = ls_link-const i_clear = 'X' ). 1238 | endif. 1239 | endloop. 1240 | if sy-subrc = 0. 1241 | i_viewer->mo_sel->set_value( i_field = 'SPRSL' i_low = m_lang i_clear = 'X' ). 1242 | i_viewer->mo_sel->raise_selection_done( ). 1243 | r_done = 'X'. 1244 | endif. 1245 | check r_done is initial. 1246 | 1247 | data l_field type lcl_alv_common=>t_tabfields. 1248 | read table lcl_alv_common=>mt_tabfields with key tabname = m_tabname fieldname = i_column into l_field transporting rollname. 1249 | "data element to field links 1250 | data l_el_link type lcl_plugins=>t_el_links. 1251 | loop at lcl_plugins=>mt_el_links into l_el_link where element = l_field-rollname . 1252 | if i_viewer is initial. 1253 | append initial line to lcl_appl=>mt_obj assigning . 1254 | create object -alv_viewer 1255 | exporting 1256 | i_tname = l_el_link-rtab. 1257 | i_viewer = -alv_viewer. 1258 | endif. 1259 | assign component i_column of structure i_str to . 1260 | i_viewer->mo_sel->set_value( i_field = l_el_link-rfield i_low = i_clear = 'X' ). 1261 | endloop. 1262 | if sy-subrc = 0. 1263 | i_viewer->mo_sel->set_value( i_field = 'SPRSL' i_low = m_lang i_clear = 'X' ). 1264 | i_viewer->mo_sel->raise_selection_done( ). 1265 | r_done = 'X'. 1266 | endif. 1267 | check r_done is initial. 1268 | 1269 | "dictionary key links plugin 1270 | data: lt_keys type table of dd05p, 1271 | ls_key type dd05p. 1272 | read table lcl_alv_common=>mt_tabfields into l_field with key tabname = m_tabname fieldname = i_column . 1273 | assign component i_column of structure i_str to . 1274 | check is not initial. 1275 | data: l_column(30). 1276 | l_column = i_column. 1277 | call function 'DD_FORKEY_GET' 1278 | exporting 1279 | feldname = l_column 1280 | tabname = m_tabname 1281 | tables 1282 | forkeytab = lt_keys 1283 | exceptions 1284 | not_equal = 1 1285 | not_found = 2 1286 | not_valid = 3 1287 | others = 4. 1288 | 1289 | if sy-subrc < 2. 1290 | append initial line to lcl_appl=>mt_obj assigning . 1291 | data: l_table type tabname. 1292 | l_table = l_field-checktable. 1293 | create object -alv_viewer 1294 | exporting 1295 | i_tname = l_table. 1296 | loop at lt_keys into ls_key. 1297 | assign component ls_key-forkey of structure i_str to . 1298 | check sy-subrc = 0. 1299 | -alv_viewer->mo_sel->set_value( i_field = ls_key-checkfield i_low = i_clear = 'X' ). 1300 | endloop. 1301 | -alv_viewer->mo_sel->set_value( i_field = 'SPRSL' i_low = m_lang i_clear = 'X' ). 1302 | -alv_viewer->mo_sel->raise_selection_done( ). 1303 | endif. 1304 | endmethod. "link 1305 | 1306 | method handle_menu_button. 1307 | if e_ucomm = 'LANGUAGE'. 1308 | call method e_object->add_function 1309 | exporting 1310 | fcode = 'TECH' 1311 | text = 'Technical name'. "Teхническое имя 1312 | data ls_lang type lcl_appl=>t_lang. 1313 | loop at lcl_appl=>mt_lang into ls_lang. 1314 | data: lv_lang type ui_func, 1315 | lv_text type gui_text. 1316 | 1317 | call function 'CONVERSION_EXIT_ISOLA_OUTPUT' 1318 | exporting 1319 | input = ls_lang-spras 1320 | importing 1321 | output = lv_lang 1322 | exceptions 1323 | unknown_language = 1 1324 | others = 2. 1325 | 1326 | lv_text = ls_lang-sptxt. 1327 | call method e_object->add_function 1328 | exporting 1329 | fcode = lv_lang 1330 | text = lv_text. 1331 | endloop. 1332 | elseif e_ucomm = 'OPTIONS'. 1333 | call method e_object->add_function 1334 | exporting 1335 | fcode = 'HIDE' 1336 | text = 'Hide empty columns'. "Спрятать пустые столбцы 1337 | call method e_object->add_function 1338 | exporting 1339 | fcode = 'SHOW' 1340 | text = 'Show empty columns'. "Отобразить пустые столбцы 1341 | endif. 1342 | endmethod. "handle_menu_button 1343 | 1344 | method before_user_command. 1345 | data l_url(100) type c. 1346 | case e_ucomm. 1347 | when '&INFO'. 1348 | l_url = 'https://ysychov.wordpress.com/2020/02/10/simple-data-explorer/'. 1349 | 1350 | call function 'CALL_BROWSER' 1351 | exporting 1352 | url = l_url. 1353 | endcase. 1354 | endmethod. "before_user_command 1355 | 1356 | method handle_doubleclick. 1357 | data: lt_keys type table of dd05p. 1358 | field-symbols: type standard table, 1359 | type any. 1360 | check es_row_no-row_id is not initial. 1361 | assign mr_table->* to . 1362 | read table index es_row_no-row_id assigning . 1363 | link( exporting i_str = i_column = e_column ). 1364 | endmethod. "handle_doubleclick 1365 | 1366 | method handle_user_command. 1367 | data: 1368 | it_fields type lvc_t_fcat, 1369 | lv_clause type string, 1370 | lv_sel_width type i, 1371 | ls_lang type lcl_appl=>t_lang. 1372 | 1373 | field-symbols: like line of it_fields, 1374 | type any table, 1375 | type any. 1376 | 1377 | mo_alv->get_frontend_fieldcatalog( importing et_fieldcatalog = it_fields[] ). 1378 | assign mr_table->* to . 1379 | if e_ucomm = 'SEL_ON' and m_visible is initial. 1380 | create_sel_alv( ). 1381 | m_visible = 'X'. 1382 | if mo_sel_width = 0. 1383 | lv_sel_width = 500. 1384 | else. 1385 | lv_sel_width = mo_sel_width. 1386 | endif. 1387 | 1388 | mo_splitter->set_column_width( exporting 1389 | id = 1 1390 | width = lv_sel_width ). 1391 | 1392 | mo_alv->set_toolbar_interactive( ). 1393 | return. 1394 | endif. 1395 | 1396 | loop at it_fields assigning . 1397 | case e_ucomm. 1398 | when 'HIDE'. "hide select options 1399 | clear m_show_empty. 1400 | lv_clause = |{ -fieldname } IS NOT INITIAL|. 1401 | loop at assigning where (lv_clause). 1402 | exit. 1403 | endloop. 1404 | 1405 | if sy-subrc ne 0. 1406 | -no_out = 'X'. 1407 | endif. 1408 | 1409 | when 'SHOW'. 1410 | 1411 | m_show_empty = 'X'. 1412 | -no_out = ' '. 1413 | when 'TECH'. "technical field name 1414 | -scrtext_l = -scrtext_m = -scrtext_s = -reptext = -fieldname. 1415 | when 'TABLES'. 1416 | data: lt_obj type sdg1_obj, 1417 | ls_obj type sdg1_obj1. 1418 | ls_obj-obj_name = m_tabname. 1419 | ls_obj-type = 'TABL'. 1420 | append ls_obj to lt_obj. 1421 | call function 'REPOSITORY_STRUCTURE_GRAPH' 1422 | exporting 1423 | type = 'TABL' 1424 | tables 1425 | objects = lt_obj. 1426 | set titlebar 'SDE'. 1427 | return. 1428 | when others. "header names translation 1429 | read table lcl_appl=>mt_lang with key spras = e_ucomm into ls_lang. 1430 | if sy-subrc = 0. 1431 | lcl_alv_common=>translate_field( exporting i_lang = ls_lang-spras changing c_fld = ). 1432 | if mo_sel is bound. 1433 | field-symbols type selection_display_s. 1434 | read table mo_sel->mt_sel_tab assigning with key field_label = -fieldname. 1435 | if sy-subrc = 0. 1436 | -name = -scrtext_l. 1437 | if -name is initial. 1438 | -name = -reptext. 1439 | endif. 1440 | endif. 1441 | endif. 1442 | endif. 1443 | endcase. 1444 | endloop. 1445 | 1446 | read table lcl_appl=>mt_lang with key spras = e_ucomm transporting no fields. 1447 | if sy-subrc = 0. 1448 | m_lang = e_ucomm. 1449 | set_header( ). 1450 | endif. 1451 | 1452 | call method mo_alv->set_frontend_fieldcatalog 1453 | exporting 1454 | it_fieldcatalog = it_fields[]. 1455 | lcl_alv_common=>refresh( mo_alv ). 1456 | if mo_sel is bound. 1457 | if e_ucomm = 'HIDE' or e_ucomm = 'SHOW'. 1458 | mo_sel->update_sel_tab( ). 1459 | endif. 1460 | lcl_alv_common=>refresh( mo_sel->mo_sel_alv ). 1461 | endif. 1462 | endmethod. "handle_user_command 1463 | 1464 | method get_where."dynamic where clause 1465 | 1466 | data: lt_where type rsds_twhere, 1467 | ls_where type rsds_where, 1468 | l_where type rsdswhere, 1469 | lt_range type rsds_trange. 1470 | 1471 | 1472 | field-symbols: type rsds_range, 1473 | type rsds_frange. 1474 | 1475 | if mo_sel is not initial. 1476 | append initial line to lt_range assigning . 1477 | -tablename = m_tabname. 1478 | data: ls_tab type selection_display_s. 1479 | loop at mo_sel->mt_sel_tab into ls_tab where range is not initial. 1480 | append initial line to -frange_t assigning . 1481 | if sy-subrc = 0. 1482 | -fieldname = ls_tab-field_label. 1483 | -selopt_t = ls_tab-range. 1484 | endif. 1485 | endloop. 1486 | 1487 | call function 'FREE_SELECTIONS_RANGE_2_WHERE' 1488 | exporting 1489 | field_ranges = lt_range 1490 | importing 1491 | where_clauses = lt_where. 1492 | 1493 | loop at lt_where into ls_where where tablename = m_tabname. 1494 | loop at ls_where-where_tab into l_where. 1495 | condense l_where-line. 1496 | c_where = |{ c_where } { l_where-line }|. 1497 | endloop. 1498 | endloop. 1499 | endif. 1500 | endmethod. "get_where 1501 | 1502 | method refresh_table. 1503 | data: ls_row type t_sel_row. 1504 | read_table( exporting i_tabname = m_tabname i_where = get_where( ) changing cr_tab = mr_table c_count = m_count ). 1505 | set_header( ). 1506 | field-symbols type selection_display_s. 1507 | loop at mo_sel->mt_sel_tab assigning . 1508 | if -transmitter is not initial. 1509 | move-corresponding to ls_row. 1510 | -transmitter->emit( e_row = ls_row ). 1511 | endif. 1512 | endloop. 1513 | 1514 | lcl_alv_common=>refresh( mo_sel->mo_sel_alv ). 1515 | lcl_alv_common=>refresh( mo_alv ). 1516 | 1517 | data l_emit type t_column_emitter. 1518 | loop at mo_column_emitters into l_emit. 1519 | l_emit-emitter->emit_col( l_emit-column ). 1520 | endloop. 1521 | endmethod. "refresh_table 1522 | endclass. "lcl_table_viewer IMPLEMENTATION 1523 | 1524 | *----------------------------------------------------------------------* 1525 | * CLASS LCL_SEL_OPT IMPLEMENTATION 1526 | *----------------------------------------------------------------------* 1527 | * 1528 | *----------------------------------------------------------------------* 1529 | class lcl_sel_opt implementation. 1530 | method constructor. 1531 | data: ls_layout type lvc_s_layo, 1532 | effect type i, 1533 | handle_alv type i. 1534 | 1535 | mo_viewer = io_viewer. 1536 | create object mo_sel_alv 1537 | exporting 1538 | i_parent = io_container. 1539 | update_sel_tab( ). 1540 | create object lcl_appl=>c_dragdropalv. 1541 | effect = cl_dragdrop=>copy. " + cl_dragdrop=>move. 1542 | 1543 | call method lcl_appl=>c_dragdropalv->add 1544 | exporting 1545 | flavor = 'Line' 1546 | dragsrc = 'X' 1547 | droptarget = 'X' 1548 | effect = effect. 1549 | 1550 | call method lcl_appl=>c_dragdropalv->get_handle 1551 | importing 1552 | handle = handle_alv. 1553 | 1554 | ls_layout-s_dragdrop-col_ddid = handle_alv. 1555 | init_fcat( handle_alv ). 1556 | 1557 | ls_layout-cwidth_opt = 'X'. 1558 | ls_layout-ctab_fname = 'COLOR'. 1559 | ls_layout-stylefname = 'STYLE'. 1560 | 1561 | "fields for F4 event handling 1562 | data: gt_f4 type lvc_t_f4, 1563 | gs_f4 type lvc_s_f4. 1564 | gs_f4-register = 'X'. 1565 | gs_f4-chngeafter = 'X'. 1566 | gs_f4-fieldname = 'LOW'. 1567 | insert gs_f4 into table gt_f4. 1568 | gs_f4-fieldname = 'HIGH'. 1569 | insert gs_f4 into table gt_f4. 1570 | 1571 | mo_sel_alv->register_f4_for_fields( it_f4 = gt_f4 ). 1572 | mo_sel_alv->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_enter ). 1573 | mo_sel_alv->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ). 1574 | 1575 | set handler handle_user_command 1576 | handle_sel_toolbar 1577 | handle_doubleclick 1578 | lcl_dragdrop=>drag 1579 | lcl_dragdrop=>drop 1580 | on_data_changed 1581 | on_data_changed_finished 1582 | on_grid_button_click 1583 | handle_context_menu_request for mo_sel_alv. 1584 | set handler on_f4 for mo_sel_alv. 1585 | 1586 | call method mo_sel_alv->set_table_for_first_display 1587 | exporting 1588 | i_save = 'X' 1589 | i_default = 'X' 1590 | is_layout = ls_layout 1591 | changing 1592 | it_outtab = mt_sel_tab[] 1593 | it_fieldcatalog = mt_fcat. 1594 | 1595 | mo_sel_alv->set_toolbar_interactive( ). 1596 | 1597 | endmethod. "constructor 1598 | 1599 | method init_fcat. 1600 | data ls_fcat type lvc_s_fcat. 1601 | ls_fcat-style = '00000003'. 1602 | ls_fcat-fieldname = 'IND'. 1603 | ls_fcat-coltext = '№'. 1604 | ls_fcat-outputlen = 3. 1605 | append ls_fcat to mt_fcat. 1606 | ls_fcat-fieldname = 'FIELD_LABEL'. 1607 | ls_fcat-coltext = 'Label'. 1608 | ls_fcat-outputlen = 30. 1609 | ls_fcat-dragdropid = i_dd_handle. 1610 | ls_fcat-emphasize = 'X'. 1611 | append ls_fcat to mt_fcat. 1612 | clear ls_fcat. 1613 | ls_fcat-fieldname = 'SIGN'. 1614 | ls_fcat-coltext = 'Sign'. 1615 | ls_fcat-tech = 'X'. 1616 | append ls_fcat to mt_fcat. 1617 | ls_fcat-fieldname = 'OPTI'. 1618 | ls_fcat-coltext = 'Option'. 1619 | ls_fcat-tech = 'X'. 1620 | append ls_fcat to mt_fcat. 1621 | clear ls_fcat. 1622 | ls_fcat-fieldname = 'OPTION_ICON'. 1623 | ls_fcat-coltext = 'Option'. 1624 | ls_fcat-outputlen = 4. 1625 | ls_fcat-style = cl_gui_alv_grid=>mc_style_button. 1626 | append ls_fcat to mt_fcat. 1627 | clear ls_fcat. 1628 | ls_fcat-fieldname = 'LOW'. 1629 | ls_fcat-coltext = 'From data'. 1630 | ls_fcat-edit = 'X'. 1631 | ls_fcat-lowercase = 'X'. 1632 | ls_fcat-outputlen = 45. 1633 | ls_fcat-style = cl_gui_alv_grid=>mc_style_f4. 1634 | append ls_fcat to mt_fcat. 1635 | ls_fcat-fieldname = 'HIGH'. 1636 | ls_fcat-coltext = 'To data'. 1637 | append ls_fcat to mt_fcat. 1638 | clear ls_fcat. 1639 | ls_fcat-fieldname = 'MORE_ICON'. 1640 | ls_fcat-coltext = 'Range'. 1641 | ls_fcat-outputlen = 4. 1642 | ls_fcat-style = cl_gui_alv_grid=>mc_style_button. 1643 | append ls_fcat to mt_fcat. 1644 | clear ls_fcat. 1645 | ls_fcat-fieldname = 'RANGE'. 1646 | ls_fcat-tech = 'X'. 1647 | append ls_fcat to mt_fcat. 1648 | clear ls_fcat. 1649 | ls_fcat-fieldname = 'INHERITED'. 1650 | ls_fcat-coltext = 'Inh.'. 1651 | ls_fcat-outputlen = 4. 1652 | ls_fcat-icon = 'X'. 1653 | ls_fcat-seltext = 'Inherited'. 1654 | append ls_fcat to mt_fcat. 1655 | ls_fcat-fieldname = 'Emitter'. 1656 | ls_fcat-coltext = 'Emit.'. 1657 | ls_fcat-seltext = 'Emitter'. 1658 | append ls_fcat to mt_fcat. 1659 | clear ls_fcat. 1660 | ls_fcat-fieldname = 'NAME'. 1661 | ls_fcat-coltext = 'Field name'. 1662 | ls_fcat-style = '00000003'. 1663 | ls_fcat-outputlen = 60. 1664 | append ls_fcat to mt_fcat. 1665 | clear ls_fcat. 1666 | ls_fcat-fieldname = 'ELEMENT'. 1667 | ls_fcat-coltext = 'Data element'. 1668 | ls_fcat-style = '00000209'. 1669 | ls_fcat-outputlen = 15. 1670 | append ls_fcat to mt_fcat. 1671 | clear ls_fcat. 1672 | ls_fcat-fieldname = 'DOMAIN'. 1673 | ls_fcat-coltext = 'Domain'. 1674 | ls_fcat-style = '00000209'. 1675 | ls_fcat-outputlen = 15. 1676 | append ls_fcat to mt_fcat. 1677 | clear ls_fcat. 1678 | ls_fcat-fieldname = 'DATATYPE'. 1679 | ls_fcat-coltext = 'Type'. 1680 | ls_fcat-style = '00000003'. 1681 | ls_fcat-outputlen = 5. 1682 | append ls_fcat to mt_fcat. 1683 | clear ls_fcat. 1684 | ls_fcat-fieldname = 'LENGTH'. 1685 | ls_fcat-coltext = 'Length'. 1686 | ls_fcat-style = '00000003'. 1687 | ls_fcat-outputlen = 5. 1688 | append ls_fcat to mt_fcat. 1689 | 1690 | clear ls_fcat. 1691 | ls_fcat-fieldname = 'TRANSMITTER'. 1692 | ls_fcat-tech = 'X'. 1693 | append ls_fcat to mt_fcat. 1694 | ls_fcat-fieldname = 'RECEIVER'. 1695 | append ls_fcat to mt_fcat. 1696 | ls_fcat-fieldname = 'CHANGE'. 1697 | append ls_fcat to mt_fcat. 1698 | 1699 | endmethod. "init_fcat 1700 | 1701 | method raise_selection_done. 1702 | raise event selection_done. 1703 | data: ls_row type t_sel_row. 1704 | field-symbols type selection_display_s. 1705 | loop at mt_sel_tab assigning ." WHERE change IS NOT INITIAL. 1706 | if -transmitter is not initial. 1707 | move-corresponding to ls_row. 1708 | -transmitter->emit( e_row = ls_row ). 1709 | endif. 1710 | endloop. 1711 | endmethod. "raise_selection_done 1712 | 1713 | method update_sel_tab. 1714 | data: l_tfield type lcl_alv_common=>t_tabfields. 1715 | if mt_sel_tab[] is not initial. 1716 | data lt_copy type table of selection_display_s. 1717 | lt_copy = mt_sel_tab. 1718 | endif. 1719 | clear mt_sel_tab[]. 1720 | mo_viewer->mo_alv->get_frontend_fieldcatalog( importing et_fieldcatalog = mo_viewer->mt_alv_catalog ). 1721 | data l_catalog type lvc_s_fcat. 1722 | loop at mo_viewer->mt_alv_catalog into l_catalog where domname ne 'MANDT'. 1723 | data lv_ind like sy-tabix. 1724 | lv_ind = sy-tabix. 1725 | read table lcl_alv_common=>mt_tabfields with key tabname = l_catalog-tabname fieldname = l_catalog-fieldname into l_tfield. 1726 | if l_tfield-empty = '' or mo_viewer->m_show_empty is not initial. 1727 | "check l_catalog-no_out is initial. 1728 | field-symbols type selection_display_s. 1729 | append initial line to mt_sel_tab assigning . 1730 | data ls_copy type selection_display_s. 1731 | read table lt_copy into ls_copy with key field_label = l_catalog-fieldname. 1732 | if sy-subrc = 0. 1733 | move-corresponding ls_copy to . 1734 | else. 1735 | -option_icon = icon_led_inactive. 1736 | -more_icon = icon_enter_more. 1737 | endif. 1738 | -ind = lv_ind. 1739 | -field_label = l_catalog-fieldname. 1740 | -int_type = l_catalog-inttype. 1741 | -element = l_catalog-rollname. 1742 | -domain = l_catalog-domname. 1743 | -datatype = l_catalog-datatype. 1744 | -length = l_catalog-outputlen. 1745 | 1746 | lcl_alv_common=>translate_field( exporting i_lang = mo_viewer->m_lang changing c_fld = l_catalog ). 1747 | 1748 | -name = l_catalog-scrtext_l. 1749 | 1750 | data: l_style type lvc_s_styl, 1751 | l_color type lvc_s_scol. 1752 | if l_tfield-keyflag = 'X'. 1753 | "append initial line to -style assigning