Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report ZTORO_TEST
- *&
- *&---------------------------------------------------------------------*
- *&
- *&
- *&---------------------------------------------------------------------*
- REPORT ZTORO_TEST.
- *DATA: sflight TYPE STANDARD TABLE OF sflight.
- TYPES: BEGIN OF ty_data_general_additional,
- miwarpl type mhio-warpl,
- mabnum type mhio-ABNUM,
- row_color type char4,
- END OF ty_data_general_additional.
- TYPES: BEGIN OF ty_data_general,
- iwerk type viaufks-IWERK,
- swerk type viaufks-SWERK,
- bukrs type viaufks-bukrs,
- auart type viaufks-auart,
- aufnr type viaufks-aufnr,
- ktext type viaufks-ktext,
- gstrp type viaufks-gstrp,
- gltrp type viaufks-gltrp,
- ftrms type viaufks-ftrms,
- addat type viaufks-addat,
- tplnr type viaufks-tplnr,
- pltxt type iflotx-pltxt,
- equnr type viaufks-equnr,
- eqktx type eqkt-eqktx,
- bautl type viaufks-bautl,
- plnty type viaufks-plnty,
- plnnr type viaufks-plnnr,
- plnal type viaufks-plnal,
- zaehl type viaufks-zaehl,
- strat type plko-strat,
- warpl type viaufks-warpl,
- wapos type viaufks-wapos,
- abnum type mhio-abnum,
- plandate type mhio-gstrp,
- mzaehl type mhis-zaehl,
- zpuffn type t351p-puffn,
- zsttag type mpos-zsttag,
- * kzyk1 type t351p-kzyk1,
- point type mmpt-point,
- kridate type imrg-idate,
- checkidate type imrg-idate
- .
- include TYPE ty_data_general_additional.
- TYPES: END OF ty_data_general.
- data: gt_data type TABLE OF ty_data_general.
- CLASS lcl_test DEFINITION INHERITING FROM zcl_falv.
- PUBLIC SECTION.
- class-data:
- mr_changed type REF TO CL_ALV_CHANGED_DATA_PROTOCOL,
- mo_container type REF TO CL_GUI_CONTAINER,
- mo_bdc TYPE REF TO zalrcl_bdc_ext.
- methods: get_data,
- prepare_layout.
- PROTECTED SECTION.
- "redefinition of event handler
- METHODS:
- EVF_MENU_BUTTON REDEFINITION ,
- * EVF_BEFORE_USER_COMMAND REDEFINITION,
- evf_user_command REDEFINITION ,
- menu_1_1,
- menu_1_2,
- menu_1_3,
- menu_1_4,
- menu_1_5,
- menu_1_6,
- menu_1_7,
- menu_1_8,
- hide_additional IMPORTING iv type abap_bool OPTIONAL.
- PRIVATE SECTION.
- METHODs show_applog.
- METHODs hide_applog .
- ENDCLASS. "lcl_test DEFINITION
- DATA falv TYPE REF TO lcl_test.
- DATA: lo_falv TYPE REF TO zcl_falv.
- CLASS lcl_test2 DEFINITION INHERITING FROM zcl_falv.
- PUBLIC SECTION.
- PROTECTED SECTION.
- * METHODS:
- ** EVF_MENU_BUTTON REDEFINITION ,
- * evf_user_command REDEFINITION .
- ** EVF_AFTER_USER_COMMAND REDEFINITION.
- ** menu_1_1,
- ** menu_1_2,
- ** menu_1_3,
- ** menu_1_4,
- ** menu_1_5,
- ** menu_1_6,
- ** menu_1_7,
- ** menu_1_8,
- ** hide_additional IMPORTING iv type abap_bool OPTIONAL.
- PRIVATE SECTION.
- * METHODs EVF_USER_COMMAND_internal.
- ** METHODs show_applog.
- ** METHODs hide_applog .
- ENDCLASS.
- *----------------------------------------------------------------------*
- * CLASS lcl_test IMPLEMENTATION
- *----------------------------------------------------------------------*
- *
- *----------------------------------------------------------------------*
- CLASS lcl_test IMPLEMENTATION.
- * METHOD EVF_BEFORE_USER_COMMAND.
- * BREAK-POINT.
- * ENDMETHOD.
- METHOD menu_1_1.
- data:
- lt_ROW_NO TYPE LVC_T_ROID,
- lv_warpl type rmipm-warpl,
- lv_LRMDT type rmipm-LRMDT
- .
- FIELD-SYMBOLS: <fs_outab> like LINE OF gt_data,
- <fs_no> like LINE OF lt_ROW_NO.
- me->GET_SELECTED_ROWS(
- importing
- ET_ROW_NO = lt_ROW_NO
- ).
- LOOP AT lt_ROW_NO ASSIGNING <fs_no> .
- CLEAR: lv_warpl, lv_LRMDT.
- READ TABLE gt_data ASSIGNING <fs_outab> INDEX <fs_no>-ROW_ID.
- CASE <fs_outab>-WARPL.
- WHEN space.
- mr_changed->ADD_PROTOCOL_ENTRY(
- exporting
- I_MSGID = 'ZALR_BC'
- I_MSGTY = 'E'
- I_MSGNO = 000
- I_MSGV1 = 'Работы не подлежат планированию в ППР/ нет плана '
- I_FIELDNAME = 'WARPL'
- I_ROW_ID = <fs_no>-ROW_ID
- ).
- CONTINUE.
- WHEN OTHERS.
- lv_warpl = <fs_outab>-WARPL.
- CASE <fs_outab>-POINT.
- WHEN space.
- data: lt_fields TYPE TABLE OF SVAL.
- FIELD-SYMBOLS: <fs_sval> like LINE OF lt_fields.
- APPEND INITIAL LINE TO lt_fields ASSIGNING <fs_sval>.
- <fs_sval>-TABNAME = 'MPOS'.
- <fs_sval>-FIELDNAME = 'ZSTTAG'.
- CALL FUNCTION 'POPUP_GET_VALUES'
- EXPORTING
- * NO_VALUE_CHECK = ' '
- POPUP_TITLE = 'Введите дата начала ППР'
- * START_COLUMN = '5'
- * START_ROW = '5'
- * IMPORTING
- * RETURNCODE =
- TABLES
- FIELDS = lt_fields
- EXCEPTIONS
- ERROR_IN_FIELDS = 1
- OTHERS = 2
- .
- IF SY-SUBRC <> 0.
- * Implement suitable error handling here
- mr_changed->ADD_PROTOCOL_ENTRY(
- exporting
- I_MSGID = sy-MSGID
- I_MSGTY = sy-MSGTY
- I_MSGNO = sy-MSGNO
- I_MSGV1 = sy-MSGV1
- I_MSGV2 = sy-MSGV2
- I_MSGV3 = sy-MSGV3
- I_MSGV4 = sy-MSGV4
- I_FIELDNAME = 'ZSTTAG'
- I_ROW_ID = <fs_no>-ROW_ID
- * I_TABIX = lv
- ).
- else.
- READ TABLE lt_fields ASSIGNING <fs_sval> INDEX 1.
- LV_LRMDT = <fs_outab>-ZSTTAG = <fs_sval>-VALUE.
- ENDIF.
- WHEN OTHERS.
- "! Нужно спросить у консультанта
- mr_changed->ADD_PROTOCOL_ENTRY(
- exporting
- I_MSGID = 'ZALR_BC'
- I_MSGTY = 'E'
- I_MSGNO = 000
- I_MSGV1 = 'Для заказа Торо '
- I_MSGV2 = <fs_outab>-AUFNR
- I_MSGV3 = ' нет даты начального пкета ППР/дата КР'
- I_FIELDNAME = 'AUFNR'
- I_ROW_ID = <fs_no>-ROW_ID
- ).
- CONTINUE.
- ENDCASE.
- "!bdc
- * data:
- IF mo_bdc is INITIAL.
- CREATE OBJECT mo_bdc.
- else.
- free mo_bdc.
- CREATE OBJECT mo_bdc.
- ENDIF.
- * ls_bdc_opt-updmode = 'L'.
- * ls_bdc_opt-dismode = 'N'.
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'SAPLIWP3'
- i_dynpro = '0140' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = '/00'
- , i_fnam = 'RMIPM-WARPL' i_fval = LV_WARPL
- .
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'SAPLIWP3'
- i_dynpro = '0103' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = '=ZS'
- .
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'SAPLIWP3'
- i_dynpro = '7000' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = '=SOFF'
- , i_fnam = 'RMIPM-LRMDT' i_fval = lv_LRMDT
- , i_fnam = 'RMIPM-CONF_TIME' i_fval = '00:00:01'
- .
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'RMSTRA00'
- i_dynpro = '0001' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = 'ZYK'
- .
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'RMSTRA00'
- i_dynpro = '0001' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = '=BACK'
- .
- mo_bdc->add_dynpro(
- EXPORTING
- i_program = 'SAPLIWP3'
- i_dynpro = '0103' ).
- CALL METHOD mo_bdc->add_field
- EXPORTING
- : i_fnam = 'BDC_OKCODE' i_fval = '=BU'
- .
- mo_bdc->CALL_TRANSACTION(
- exporting
- I_TCODE = 'IP10' " Код транзакции
- I_MODE = 'L'
- * I_UPD = 'N'
- I_UPD = 'A'
- * I_OPT = " Строка парам. для выполнения Call Transaction using
- * receiving
- * T_MSG = " Тип таблицы для BDCDATA
- ).
- * CALL METHOD lo_bdc->call_transaction
- * EXPORTING
- * i_tcode = 'ZALRT_BOOKVAL_ADA'
- * i_opt = lt_bdc_opt
- * RECEIVING
- * t_msg = lt_bdc_msg.
- ENDCASE.
- ENDLOOP.
- ENDMETHOD.
- METHOD menu_1_2.
- endmethod.
- METHOD menu_1_3.
- endmethod.
- METHOD menu_1_4.
- endmethod.
- METHOD menu_1_5.
- endmethod.
- METHOD menu_1_6.
- endmethod.
- METHOD menu_1_7.
- endmethod.
- METHOD menu_1_8.
- DATA falv2 TYPE REF TO lcl_test2.
- DATA: lo_falv2 TYPE REF TO zcl_falv.
- LCL_TEST2=>create( exporting i_subclass = cl_abap_classdescr=>describe_by_name( p_name = 'LCL_TEST2' )
- I_POPUP = abap_true
- CHANGING ct_table = gt_data rv_falv = lo_falv2 ) .
- falv2 ?= lo_falv2.
- falv2->display( ).
- me->DISPLAY( ).
- * me->re
- * BREAK-POINT.
- *LEAVE TO screen 0.
- *me->display( ).
- * BREAK-POINT.
- * falv2->MAIN_CONTAINER->FREE(
- ** exceptions
- ** CNTL_ERROR = 1
- ** CNTL_SYSTEM_ERROR = 2
- ** OTHERS = 3
- * ).
- * if sy-subrc <> 0.
- ** message id sy-msgid type sy-msgty number sy-msgno
- ** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- * endif.
- ** free: falv2.
- ** me->MAIN_CONTAINER->FREE( ).
- ** cl_gui_cfw=>flush( ).
- * falv2->FREE( ).
- ** me
- * falv2->set_visible( abap_false ).
- * falv2->parent->set_visible( abap_false ).
- * falv2->main_container->set_visible( abap_false ).
- * call SCREEN me->screen.
- *BREAK-POINT .
- *me->DISPLAY( ).
- * me->set_visible( abap_true ).
- * me->parent->set_visible( abap_true ).
- * me->main_container->set_visible( abap_true ).
- **
- * me->pbo( iv_dynnr = '0100' ).
- * cl_gui_cfw=>flush(
- * EXCEPTIONS
- * cntl_system_error = 1
- * cntl_error = 2
- * OTHERS = 3
- *).
- ** me->FIRST_OUTPUT = abap_true.
- *me->display( iv_force_grid = abap_true ).
- *** CLEAR first_output.
- * IF me->split_container IS NOT INITIAL.
- * "! When I use embedded applog then although it's container is hidden
- * "! then you can still see the place for it until some pbo will happen.
- * "! I force dummy user-command to get rid of it
- * CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
- * EXPORTING
- * functioncode = 'DUMMY' " Function code
- * EXCEPTIONS
- * function_not_supported = 1
- * OTHERS = 2.
- * IF sy-subrc <> 0.
- * ENDIF.
- * ENDIF.
- * me->f
- * me->REFRESH_TABLE_DISPLAY(
- ** exporting
- ** IS_STABLE =
- ** I_SOFT_REFRESH =
- ** exceptions
- ** FINISHED = 1
- ** OTHERS = 2
- * ).
- * if sy-subrc <> 0.
- ** message id sy-msgid type sy-msgty number sy-msgno
- ** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- * endif.
- * .
- * me->DISPLAY( ).
- * exporting
- * IV_FORCE_GRID = SPACE
- * IV_START_ROW =
- * IV_START_COLUMN =
- * IV_END_ROW =
- * IV_END_COLUMN =
- * ).
- * falv->title_v1 = 'ZDEMO_FALV05'.
- ** "Set Gui status to fully dynamic (no standard buttons of ALV Grid)
- * falv->gui_status->fully_dynamic = abap_true .
- * falv->GET_DATA( ).
- * falv->prepare_layout( ).
- *
- *
- * data gr_table2 type REF TO cl_salv_table.
- * cl_salv_table=>factory(
- * importing
- * r_salv_table = gr_table2
- * changing
- * t_table = GT_DATA ).
- *
- * CALL METHOD gr_table2->set_screen_status
- * EXPORTING
- * report = 'SALV_DEMO_TABLE_POPUP_CALL'
- * pfstatus = 'SALV_POPUP'.
- * data: lr_functions2 type ref to cl_salv_functions_list.
- * lr_functions2 = gr_table2->get_functions( ).
- * lr_layout2 = gr_table2->get_layout( ).
- * MOVE sy-repid TO ls_layout_key2-report.
- * CALL METHOD lr_layout2->set_key
- * EXPORTING
- * value = ls_layout_key2.
- * lr_layout2->set_key( ls_layout_key2 ).
- * lr_layout2->set_default( abap_true ).
- * lr_layout2->set_save_restriction( ).
- * gr_table2->set_screen_popup(
- * start_column = 1
- * end_column = 50
- * start_line = 1
- * end_line = 20 ).
- * gr_table2->display( ).
- * lcl_test=>CREATE(
- ** exporting
- ** I_PARENT =
- ** I_APPLOGPARENT =
- ** I_POPUP = ABAP_FALSE
- ** I_APPLOG_EMBEDDED = ABAP_FALSE
- ** I_SUBCLASS =
- * changing
- * CT_TABLE =
- * RV_FALV =
- *).
- * me->DISPLAY( ).
- ** exporting
- *** IV_FORCE_GRID = SPACE
- ** IV_START_ROW =
- ** IV_START_COLUMN =
- ** IV_END_ROW =
- ** IV_END_COLUMN =
- * ).
- * DATA: lo_falv2 TYPE REF TO zcl_falv.
- *DATA falv2 TYPE REF TO lcl_test2.
- *me->CREATE_BY_COPY(
- * exporting
- ** I_PARENT =
- ** I_APPLOGPARENT =
- * I_POPUP = ABAP_TRUE
- * receiving
- * RV_FALV = lo_falv2
- *).
- *falv2 ?= lo_falv2.
- *falv2->DISPLAY( ).
- * DATA falv2 TYPE REF TO lcl_test2.
- *
- * DATA: lo_falv2 TYPE REF TO zcl_falv.
- ***lcl_test=>
- * lcl_test=>create( exporting i_subclass = cl_abap_classdescr=>describe_by_name( p_name = 'LCL_TEST2' )
- * I_POPUP = abap_true
- * CHANGING ct_table = gt_data rv_falv = lo_falv2 ) .
- *
- * falv2 ?= lo_falv2.
- ** falv->title_v1 = 'ZDEMO_FALV05'.
- *** "Set Gui status to fully dynamic (no standard buttons of ALV Grid)
- ** falv->gui_status->fully_dynamic = abap_true .
- ** falv->GET_DATA( ).
- ** falv->prepare_layout( ).
- *
- *
- *falv2->display( ).
- **
- ** cl_gui_cfw=>SET_NEW_OK_CODE(
- ** exporting
- ** NEW_CODE = 'BACK' " New OK_CODE
- *** importing
- *** RC = " Return code
- ** ).
- ** cl_gui_cfw=>FLUSH(
- *** exceptions
- *** CNTL_SYSTEM_ERROR = 1
- *** CNTL_ERROR = 2
- *** OTHERS = 3
- ** ).
- *** if sy-subrc <> 0.
- **** message id sy-msgid type sy-msgty number sy-msgno
- **** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- *** endif.
- *
- * me->DISPLAY( ).
- *me->FCODE_BOUNCER( ).
- ** me->REFRESH_TABLE_DISPLAY( ).
- ** me->SOFT_REFRESH( ).
- **me->REFRESH_TABLE_DISPLAY(
- *** exporting
- *** IS_STABLE =
- *** I_SOFT_REFRESH =
- *** exceptions
- *** FINISHED = 1
- *** OTHERS = 2
- **).
- **if sy-subrc <> 0.
- *** message id sy-msgid type sy-msgty number sy-msgno
- *** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- **endif.
- ** DATA: sflight TYPE STANDARD TABLE OF sflight.
- **
- **
- **
- ** SELECT * UP TO 100 ROWS
- ***Begin SMD
- *** INTO CORRESPONDING FIELDS OF TABLE @sflight
- ** INTO CORRESPONDING FIELDS OF TABLE sflight
- ***End SMD
- **
- ** FROM sflight.
- ** DATA: zfalv TYPE REF TO zcl_falv.
- **
- *** data(falv) = zcl_falv=>create( changing ct_table = sflight ).
- ** zcl_falv=>create( CHANGING ct_table = sflight rv_falv = zfalv ).
- ***End SMD
- **
- ** "Add title variable
- ** zfalv->title_v1 = 'ZDEMO_FALV01'.
- **
- ** "Display full screen grid
- ** zfalv->display( ).
- endmethod.
- METHOD prepare_layout.
- me->hide_additional( ).
- me->layout->SET_SEL_MODE( IV_VALUE = 'A' ).
- me->LAYOUT->SET_INFO_FNAME( 'ROW_COLOR' ).
- "In default when we use full screen FALV, Grid toolbar is switched off, we must turn it on )
- me->layout->set_no_toolbar( abap_false ).
- me->add_button(
- EXPORTING
- iv_function = zcl_falv_dynamic_status=>b_01
- iv_icon = icon_activate
- iv_butn_type = me->BUTTON_MENU
- iv_text = 'Операции'
- ).
- me->add_button(
- EXPORTING
- iv_function = zcl_falv_dynamic_status=>b_02
- iv_icon = icon_active_inactive
- iv_butn_type = me->BUTTON_MENU
- iv_text = 'Массовые операции'
- ).
- mo_container = me->split_container->GET_CONTAINER( ROW = 2 COLUMN = 1 ).
- CREATE OBJECT mr_changed
- EXPORTING
- I_CALLING_ALV = me.
- FIELD-SYMBOLS: <fs_fcat> like LINE OF me->FCAT.
- LOOP AT me->FCAT ASSIGNING <fs_fcat>.
- <fs_fcat>-COLTEXT = <fs_fcat>-SCRTEXT_L.
- ENDLOOP.
- mr_changed->MT_FIELDCATALOG = me->FCAT.
- ENDMETHOD.
- METHOD hide_additional.
- data:
- lo_struct_descr type REF TO cl_abap_structdescr,
- lt_struct_fields type cl_abap_structdescr=>COMPONENT_TABLE,
- ls type TY_DATA_GENERAL_ADDITIONAL.
- FIELD-SYMBOLS: <fs_struct> like LINE OF LT_STRUCT_FIELDS.
- CASE IV.
- WHEN abap_true.
- lo_struct_descr ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( ls ).
- LT_STRUCT_FIELDS = lo_struct_descr->GET_COMPONENTS( ).
- LOOP AT LT_STRUCT_FIELDS ASSIGNING <fs_struct>.
- me->COLUMN( |{ <fs_struct>-NAME }| )->SET_NO_OUT( abap_true ).
- ENDLOOP.
- WHEN OTHERS.
- ENDCASE.
- ENDMETHOD.
- method get_data.
- FIELD-SYMBOLS: <fs> like LINE OF gt_data.
- SELECT *
- from viaufks
- into CORRESPONDING FIELDS OF TABLE gt_data.
- TYPES:
- BEGIN OF ty_r_key1,
- key1 type string,
- found type string,
- END OF ty_r_key1,
- BEGIN OF ty_r_key2,
- key1 type string,
- key2 type string,
- found type string,
- END OF ty_r_key2,
- BEGIN OF ty_r_key3,
- key1 type string,
- key2 type string,
- key3 type string,
- found type string,
- END OF ty_r_key3,
- BEGIN OF ty_r_key4,
- key1 type string,
- key2 type string,
- key3 type string,
- key4 type string,
- found type string,
- END OF ty_r_key4,
- BEGIN OF ty_range_key,
- pltxt type HASHED TABLE OF ty_r_key1 WITH UNIQUE KEY KEY1 ,
- eqktx type HASHED TABLE OF ty_r_key1 WITH UNIQUE KEY KEY1 ,
- point type HASHED TABLE OF ty_r_key1 WITH UNIQUE KEY KEY1 ,
- mzaehl type HASHED TABLE OF ty_r_key2 WITH UNIQUE KEY KEY1 KEY2 ,
- abnum type HASHED TABLE OF ty_r_key3 WITH UNIQUE KEY KEY1 KEY2 KEY3 ,
- strat type HASHED TABLE OF ty_r_key4 WITH UNIQUE KEY KEY1 KEY2 KEY3 KEY4 ,
- END OF ty_range_key.
- data:
- ls_r type ty_range_key,
- ls_key1 LIKE LINE OF ls_r-PLTXT,
- ls_key2 LIKE LINE OF ls_r-mzaehl,
- ls_key3 LIKE LINE OF ls_r-abnum,
- ls_key4 LIKE LINE OF ls_r-strat,
- lv_ZAEHL type mhis-ZAEHL.
- FIELD-SYMBOLS:
- <fs_key1> like ls_key1,
- <fs_key2> like ls_key2,
- <fs_key3> like ls_key3,
- <fs_key4> like ls_key4.
- *BREAK-POINT.
- READ TABLE gt_data ASSIGNING <fs> INDEX 1.
- <fs>-WARPL = '3'.
- <fs>-TPLNR = '3300.3302.01.01.01.01.04'.
- LOOP AT gt_data ASSIGNING <fs>.
- clear: ls_key1.
- READ TABLE ls_r-PLTXT ASSIGNING <fs_key1> WITH TABLE KEY KEY1 = <FS>-TPLNR.
- IF sy-subrc ne 0.
- SELECT SINGLE PLTXT as found TPLNR as key1
- from iflotx
- into CORRESPONDING FIELDS OF ls_key1
- WHERE
- TPLNR = <FS>-TPLNR AND
- spras = 'R'.
- IF sy-subrc ne 0.
- ls_key1-KEY1 = <FS>-TPLNR.
- ENDIF.
- INSERT ls_key1 INTO TABLE ls_r-PLTXT ASSIGNING <fs_key1>.
- <fs>-PLTXT = <fs_key1>-FOUND.
- else.
- <fs>-PLTXT = <fs_key1>-FOUND.
- ENDIF.
- clear: ls_key1.
- READ TABLE ls_r-eqktx ASSIGNING <fs_key1> WITH TABLE KEY KEY1 = <FS>-equnr.
- IF sy-subrc ne 0.
- SELECT SINGLE eqktx as found equnr as key1
- from eqkt
- into CORRESPONDING FIELDS OF ls_key1
- WHERE
- equnr = <FS>-equnr AND
- spras = 'R'.
- IF sy-subrc ne 0.
- ls_key1-KEY1 = <FS>-equnr.
- ENDIF.
- INSERT ls_key1 INTO TABLE ls_r-eqktx ASSIGNING <fs_key1>.
- <fs>-eqktx = <fs_key1>-FOUND.
- else.
- <fs>-eqktx = <fs_key1>-FOUND.
- ENDIF.
- clear: ls_key1.
- READ TABLE ls_r-point ASSIGNING <fs_key1> WITH TABLE KEY KEY1 = <FS>-WARPL.
- IF sy-subrc ne 0.
- SELECT SINGLE point as found WARPL as key1
- from mmpt
- into CORRESPONDING FIELDS OF ls_key1
- WHERE
- WARPL = <FS>-WARPL.
- IF sy-subrc ne 0.
- ls_key1-KEY1 = <FS>-WARPL.
- ENDIF.
- INSERT ls_key1 INTO TABLE ls_r-point ASSIGNING <fs_key1>.
- <fs>-point = <fs_key1>-FOUND.
- else.
- <fs>-point = <fs_key1>-FOUND.
- ENDIF.
- * clear: ls_key3.
- * READ TABLE ls_r-abnum ASSIGNING <fs_key3> WITH TABLE KEY KEY1 = <FS>-WARPL KEY2 = <FS>-WPPOS KEY3 = <fs>-AUFNR.
- * IF sy-subrc ne 0.
- * SELECT SINGLE abnum as found WARPL as key1 WPPOS as KEY2 AUFNR as KEY3
- * from mhio
- * into CORRESPONDING FIELDS OF ls_key3
- * WHERE
- * WARPL = <FS>-WARPL AND
- * WPPOS = <FS>-WPPOS AND
- * AUFNR = <FS>-AUFNR .
- * IF sy-subrc ne 0.
- * ls_key3-KEY1 = <FS>-WARPL.
- * ENDIF.
- * INSERT ls_key3 INTO TABLE ls_r-abnum ASSIGNING <fs_key3>.
- * <fs>-abnum = <fs_key3>-FOUND.
- * else.
- * <fs>-abnum = <fs_key3>-FOUND.
- * ENDIF.
- clear: ls_key2.
- READ TABLE ls_r-MZAEHL ASSIGNING <fs_key2> WITH TABLE KEY KEY1 = <FS>-WARPL KEY2 = <FS>-ABNUM.
- IF sy-subrc ne 0.
- clear lv_ZAEHL.
- SELECT SINGLE ZAEHL
- from mhis
- into lv_ZAEHL
- WHERE
- WARPL = <FS>-WARPL AND ABNUM = <FS>-ABNUM.
- IF sy-subrc ne 0.
- ls_key2-KEY1 = <FS>-WARPL.
- ls_key2-KEY2 = <FS>-ABNUM.
- ENDIF.
- ls_key2-FOUND = lv_ZAEHL.
- INSERT ls_key2 INTO TABLE ls_r-MZAEHL ASSIGNING <fs_key2>.
- <fs>-MZAEHL = <fs_key2>-FOUND.
- else.
- <fs>-MZAEHL = <fs_key2>-FOUND.
- ENDIF.
- * clear: ls_key2.
- * READ TABLE ls_r-MZAEHL ASSIGNING <fs_key2> WITH TABLE KEY KEY1 = <FS>-WARPL KEY2 = <FS>-ABNUM.
- * IF sy-subrc ne 0.
- * SELECT SINGLE ZAEHL as found WARPL as key1
- ** ABNUM as key2
- * from mhis
- * into CORRESPONDING FIELDS OF ls_key2
- * WHERE
- * WARPL = <FS>-WARPL AND ABNUM = <FS>-ABNUM.
- * .
- * IF sy-subrc = 0.
- *
- * else.
- * ls_key2-KEY1 = <FS>-WARPL.
- * ls_key2-KEY2 = <FS>-ABNUM.
- * ENDIF.
- * INSERT ls_key2 INTO TABLE ls_r-MZAEHL ASSIGNING <fs_key2>.
- * <fs>-MZAEHL = <fs_key2>-FOUND.
- * else.
- * <fs>-MZAEHL = <fs_key2>-FOUND.
- * ENDIF.
- ENDLOOP.
- ENDMETHOD.
- METHOD hide_applog.
- IF split_container IS NOT INITIAL.
- split_container->set_row_sash(
- EXPORTING
- id = 1 " Row Splitter Bar ID
- type = split_container->type_sashvisible " Attribute
- value = 0 " Value
- EXCEPTIONS
- cntl_error = 1
- cntl_system_error = 2
- OTHERS = 3
- ).
- IF sy-subrc <> 0.
- ENDIF.
- split_container->set_row_height(
- EXPORTING
- id = 2 " Row ID
- height = 0 " Height
- EXCEPTIONS
- cntl_error = 1
- cntl_system_error = 2
- OTHERS = 3
- ).
- IF sy-subrc <> 0.
- ENDIF.
- ENDIF.
- ENDMETHOD. "hide_applog
- METHOD show_applog.
- IF split_container IS NOT INITIAL.
- split_container->set_row_sash(
- EXPORTING
- id = 1 " Row Splitter Bar ID
- type = split_container->type_sashvisible " Attribute
- value = 1 " Value
- EXCEPTIONS
- cntl_error = 1
- cntl_system_error = 2
- OTHERS = 3
- ).
- IF sy-subrc <> 0.
- ENDIF.
- split_container->get_row_height(
- EXPORTING
- id = 2 " Row ID
- IMPORTING
- result = height " Result Code
- EXCEPTIONS
- cntl_error = 1
- cntl_system_error = 2
- OTHERS = 3
- ).
- IF sy-subrc EQ 0 AND height EQ 0.
- split_container->set_row_height(
- EXPORTING
- id = 2 " Row ID
- height = 15 " Height
- IMPORTING
- result = result
- EXCEPTIONS
- cntl_error = 1
- cntl_system_error = 2
- OTHERS = 3
- ).
- IF sy-subrc <> 0.
- ENDIF.
- ENDIF.
- ENDIF.
- ENDMETHOD.
- METHOD EVF_MENU_BUTTON.
- CASE e_ucomm.
- WHEN zcl_falv_dynamic_status=>b_01.
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_1'
- TEXT = 'Рассчитать плановые даты ППР' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_2'
- TEXT = 'Создать отзывы ППР за период').
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_3'
- TEXT = 'Изменить плановые даты' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_4'
- TEXT = 'Пропуск отзыва' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_5'
- TEXT = 'Ввести дату последего КР' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_6'
- TEXT = 'Новый отсчет наработки после КР' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_7'
- TEXT = 'Добавить данные ППР' ).
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'Menu_1_8'
- TEXT = 'Открыть данные о наработке' ).
- WHEN zcl_falv_dynamic_status=>b_02.
- e_object->ADD_FUNCTION(
- exporting
- FCODE = 'MyMenuFunc2'
- TEXT = 'MyMenuFunc2'
- ).
- ENDCASE.
- ENDMETHOD.
- METHOD evf_user_command.
- * IF mr_changed is INITIAL.
- *
- ** mo_container = me->I_APPLOGPARENT.
- *
- *
- * else.
- * mr_changed->REFRESH_PROTOCOL( ).
- * mr_changed->FREE( ).
- * ENDIF.
- CASE e_ucomm.
- WHEN 'Menu_1_1'.
- me->menu_1_1( ).
- WHEN 'Menu_1_2'.
- me->menu_1_2( ).
- WHEN 'Menu_1_3'.
- me->menu_1_3( ).
- WHEN 'Menu_1_4'.
- me->menu_1_4( ).
- WHEN 'Menu_1_5'.
- me->menu_1_5( ).
- WHEN 'Menu_1_6'.
- me->menu_1_6( ).
- WHEN 'Menu_1_7'.
- me->menu_1_7( ).
- WHEN 'Menu_1_8'.
- me->menu_1_8( ).
- * LOOP AT ME->OUTTAB->* .
- *
- * ENDLOOP.
- * BREAK-POINT.
- * data: lv type i VALUE 0.
- ** BREAK-POINT.
- ** mr_changed->MP_MOD_ROWS = ME->MT_OUTTAB.
- * DO 1 TIMES.
- *
- *
- * lv = lv + 2.
- *
- *
- ** me->SET_ROW_COLOR(
- ** exporting
- ** IV_COLOR = 'C300'
- ** IV_ROW = lv
- ** ).
- ** mr_changed->MP_MOD_ROWS.
- ** BREAK-POINT.
- ** mr_changed->MODIFY_CELL(
- ** exporting
- ** I_ROW_ID = lv
- ** I_TABIX = lv
- ** I_FIELDNAME = 'IWERK'
- ** I_VALUE = 'test;'
- ** ).
- ** mr_changed->MODIFY_STYLE(
- ** exporting
- ** I_ROW_ID = lv
- ** I_FIELDNAME = 'IWERK'
- ** I_STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED
- ** ).
- * mr_changed->ADD_PROTOCOL_ENTRY(
- * exporting
- * I_MSGID = 'ZALR_BC'
- * I_MSGTY = 'E'
- * I_MSGNO = 008
- ** I_MSGV1 =
- ** I_MSGV2 =
- ** I_MSGV3 =
- ** I_MSGV4 =
- * I_FIELDNAME = 'IWERK'
- * I_ROW_ID = lv
- * I_TABIX = lv
- *).
- ** me->SET_3D_BORDER(
- ** exporting
- ** BORDER =
- *** exceptions
- *** ERROR = 1
- *** OTHERS = 2
- ** ).
- ** if sy-subrc <> 0.
- *** message id sy-msgid type sy-msgty number sy-msgno
- *** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- ** endif.
- * ENDDO.
- ** me->enable_button( me->mc_fc_print_back ).
- * me->ADD_BUTTON(
- * exporting
- * IV_FUNCTION = zcl_falv_dynamic_status=>b_27
- * iv_icon = icon_alarm
- ** IV_QUICKINFO =
- ** IV_BUTN_TYPE =
- ** IV_DISABLED =
- * IV_TEXT = 'sdfsdf'
- ** IV_CHECKED =
- * ).
- * WHEN 'MyMenuFunc2'.
- * me->disable_button( me->mc_fc_print_back ).
- * me->add_button(
- * EXPORTING
- * iv_function = zcl_falv_dynamic_status=>b_03
- * iv_icon = icon_alarm
- * IV_BUTN_TYPE = 2
- * ).
- * WHEN zcl_falv_dynamic_status=>b_03.
- * me->delete_button( zcl_falv_dynamic_status=>b_03 ).
- ENDCASE.
- me->SOFT_REFRESH( ).
- IF mr_changed->mt_protocol IS NOT INITIAL.
- mr_changed->DISPLAY_PROTOCOL(
- exporting
- I_CONTAINER = mo_container ).
- show_applog( ).
- ELSE.
- hide_applog( ).
- ENDIF.
- ENDMETHOD. "evt_user_command
- ENDCLASS. "lcl_test IMPLEMENTATION
- CLASS LCL_TEST2 IMPLEMENTATION.
- * METHOD EVF_USER_COMMAND_internal.
- * BREAK-POINT.
- * endmethod.
- * METHOD evf_user_command.
- ** en
- **METHOD EVF_AFTER_USER_COMMAND.
- ** BREAK-POINT.
- * CASE E_UCOMM.
- * WHEN 'CANCEL'.
- ** BREAK-POINT.
- ** me->DISPLAY( ).
- * me->PARENT->FREE(
- ** exceptions
- ** CNTL_ERROR = 1
- ** CNTL_SYSTEM_ERROR = 2
- ** OTHERS = 3
- * ).
- * if sy-subrc <> 0.
- ** message id sy-msgid type sy-msgty number sy-msgno
- ** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- * endif.
- * falv->DISPLAY( ).
- * LEAVE TO SCREEN 0.
- *
- *
- ** CALL METHOD me->grid->free.
- ** .
- ** CALL METHOD g_dialogbox_container->free.
- ** CLEAR g_dialogbox_container.
- ** set screen 100. leave screen. "----> ADDED BY KDSCHERER
- *
- ** BREAK-POINT.
- ** LO_FALV->cl
- **set SCREEN 0.
- **LEAVE SCREEN.
- **falv->REFRESH_TABLE_DISPLAY(
- *** exporting
- *** IS_STABLE =
- *** I_SOFT_REFRESH =
- *** exceptions
- *** FINISHED = 1
- *** OTHERS = 2
- **).
- **if sy-subrc <> 0.
- *** message id sy-msgid type sy-msgty number sy-msgno
- *** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- **endif.
- ** me->FREE(
- *** exceptions
- *** CNTL_ERROR = 1
- *** CNTL_SYSTEM_ERROR = 2
- *** OTHERS = 3
- ** ).
- ** if sy-subrc <> 0.
- *** message id sy-msgid type sy-msgty number sy-msgno
- *** with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- ** endif.
- ** falv->DISPLAY(
- ** exporting
- ** IV_FORCE_GRID = SPACE
- ** IV_START_ROW =
- ** IV_START_COLUMN =
- ** IV_END_ROW =
- ** IV_END_COLUMN =
- ** ).
- **
- ** LEAVE to SCREEN 0.
- ** set SCREEN 100.
- ** LEAVE SCREEN.
- * WHEN OTHERS.
- * ENDCASE.
- * ENDMETHOD.
- ENDCLASS.
- START-OF-SELECTION.
- lcl_test=>create( exporting i_subclass = cl_abap_classdescr=>describe_by_name( p_name = 'LCL_TEST' )
- i_applog_embedded = 'X'
- CHANGING ct_table = gt_data rv_falv = lo_falv ) .
- falv ?= lo_falv.
- falv->title_v1 = 'ZDEMO_FALV05'.
- * "Set Gui status to fully dynamic (no standard buttons of ALV Grid)
- falv->gui_status->fully_dynamic = abap_true .
- falv->GET_DATA( ).
- falv->prepare_layout( ).
- falv->display( ).
- *DATA: sflight TYPE STANDARD TABLE OF sflight.
- * SELECT * UP TO 100 ROWS
- **Begin SMD
- ** INTO CORRESPONDING FIELDS OF TABLE @sflight
- * INTO CORRESPONDING FIELDS OF TABLE sflight
- **End SMD
- *
- * FROM sflight.
- *
- *
- * "FALV creation with only table passed
- **Begin SMD
- *
- * DATA: falv2 TYPE REF TO zcl_falv.
- *
- ** data(falv) = zcl_falv=>create( changing ct_table = sflight ).
- * zcl_falv=>create( EXPORTING I_POPUP = 'X' CHANGING ct_table = sflight rv_falv = falv2 ).
- **End SMD
- *
- * "Add title variable
- *
- *
- * "Display full screen grid
- * falv2->display( ).
- *
- * falv->display( ).
- * BREAK-POINT.
- *falv->
- *falv->layout->SET_EDIT( 'X' ).
- * falv->add_button_menu_grid_1( ).
- * falv->SET_ROW_COLOR(
- * exporting
- * IV_COLOR = 'C300'
- * IV_ROW = 1
- * ).
- *falv->GET_SELECTED_ROWS(
- * importing
- * ET_INDEX_ROWS =
- * ET_ROW_NO =
- *).
- * falv->SET_EDITABLE( ).
- * falv->COLUMN( 'SWERK' )->SET_NO_OUT( abap_true ).
- * "Add button into GUI status at for function F01 (in partial dynamic GUI Status we can have up to 19 buttons)
- * falv->gui_status->add_button(
- * EXPORTING
- * iv_button = zcl_falv_dynamic_status=>b_01
- * iv_text = 'Enable Print'
- * iv_icon = icon_activate
- *
- ** iv_qinfo =
- ** iv_allowed = ABAP_TRUE
- * EXCEPTIONS
- * button_already_filled = 1
- * button_does_not_exists = 2
- * icon_and_text_empty = 3
- * OTHERS = 4
- * ).
- * IF sy-subrc <> 0.
- * ENDIF.
- * "Add button into GUI status at for function F02
- * falv->gui_status->add_button(
- * EXPORTING
- * iv_button = zcl_falv_dynamic_status=>b_02
- * iv_text = 'Disable Print'
- * iv_icon = icon_active_inactive
- ** iv_qinfo =
- ** iv_allowed = ABAP_TRUE
- * EXCEPTIONS
- * button_already_filled = 1
- * button_does_not_exists = 2
- * icon_and_text_empty = 3
- * OTHERS = 4
- * ).
- * IF sy-subrc <> 0.
- *
- * ENDIF.
- *
- * "remove button "Details" & "Info" from standard Grid functions
- * falv->delete_button( falv->mc_fc_detail ).
- * falv->delete_button( falv->mc_fc_info ).
- "Display full screen grid
- * BREAK-POINT.
Add Comment
Please, Sign In to add comment