Simples

Embed Size (px)

DESCRIPTION

rqrwer

Citation preview

*&---------------------------------------------------------------------**& NOME DO PROGRAMA : ZF_ZPARNR_QM*& TTULO DO PROGRAMA : REPORT DE PERFORMANCE*& PROGRAMADOR : BRUNO SANTOS (USURIO SAP)*& DATA : 16/08/2013*& LTIMA ATUALIZAO : 16/08/2013*&*& DESCRIO*&---------------------------------------------------------------------**& LISTA DE MODIFICAES: **& DATA AUTOR REQUEST # DESCRIO **& 16/08/2013 USUARIO SAP SPDK900013 CODIFICAO INICIAL **&---------------------------------------------------------------------*FUNCTION zf_zparnr_qm.*"----------------------------------------------------------------------*"*"Interface local:*" TABLES*" SHLP_TAB TYPE SHLP_DESCT*" RECORD_TAB STRUCTURE SEAHLPRES*" CHANGING*" VALUE(SHLP) TYPE SHLP_DESCR*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL*"----------------------------------------------------------------------* EXIT immediately, if you do not want to handle this step IF callcontrol-step 'SELONE' AND callcontrol-step 'SELECT' AND callcontrol-step 'DISP'. EXIT. ENDIF.*"----------------------------------------------------------------------* STEP SELONE (Select one of the elementary searchhelps)*"----------------------------------------------------------------------* This step is only called for collective searchhelps. It may be used* to reduce the amount of elementary searchhelps given in SHLP_TAB.* The compound searchhelp is given in SHLP.* If you do not change CALLCONTROL-STEP, the next step is the* dialog, to select one of the elementary searchhelps.* If you want to skip this dialog, you have to return the selected* elementary searchhelp in SHLP and to change CALLCONTROL-STEP to* either to 'PRESEL' or to 'SELECT'. IF callcontrol-step = 'SELONE'.* PERFORM SELONE ......... EXIT. ENDIF.*"----------------------------------------------------------------------* STEP PRESEL (Enter selection conditions)*"----------------------------------------------------------------------* This step allows you, to influence the selection conditions either* before they are displayed or in order to skip the dialog completely.* If you want to skip the dialog, you should change CALLCONTROL-STEP* to 'SELECT'.* Normaly only SHLP-SELOPT should be changed in this step. IF callcontrol-step = 'PRESEL'.* PERFORM PRESEL .......... EXIT. ENDIF.*"----------------------------------------------------------------------* STEP SELECT (Select values)*"----------------------------------------------------------------------* This step may be used to overtake the data selection completely.* To skip the standard seletion, you should return 'DISP' as following* step in CALLCONTROL-STEP.* Normally RECORD_TAB should be filled after this step.* Standard function module F4UT_RESULTS_MAP may be very helpfull in this* step.*&---------------------------------------------------------------------**& NOME DO PROGRAMA : ZF_ZPARNR_QM*& TTULO DO PROGRAMA : FUNO PARA O MATCH CODE Z_SH_ZPARNR*& PROGRAMADOR : BRUNO SANTOS (USURIO SAP)*& DATA : 16/08/2013*& LTIMA ATUALIZAO : 16/08/2013*&*& DESCRIO*&---------------------------------------------------------------------**& LISTA DE MODIFICAES: **& DATA AUTOR REQUEST # DESCRIO **& 16/08/2013 USUARIO SAP SPDK900013 CODIFICAO INICIAL **&---------------------------------------------------------------------*FUNCTION zf_zparnr_qm.*"----------------------------------------------------------------------*"*"Interface local:*" TABLES*" SHLP_TAB TYPE SHLP_DESCT*" RECORD_TAB STRUCTURE SEAHLPRES*" CHANGING*" VALUE(SHLP) TYPE SHLP_DESCR*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL*"----------------------------------------------------------------------* EXIT immediately, if you do not want to handle this step IF callcontrol-step 'SELONE' AND callcontrol-step 'SELECT' AND callcontrol-step 'DISP'. EXIT. ENDIF.*"----------------------------------------------------------------------* STEP SELONE (Select one of the elementary searchhelps)*"----------------------------------------------------------------------* This step is only called for collective searchhelps. It may be used* to reduce the amount of elementary searchhelps given in SHLP_TAB.* The compound searchhelp is given in SHLP.* If you do not change CALLCONTROL-STEP, the next step is the* dialog, to select one of the elementary searchhelps.* If you want to skip this dialog, you have to return the selected* elementary searchhelp in SHLP and to change CALLCONTROL-STEP to* either to 'PRESEL' or to 'SELECT'. IF callcontrol-step = 'SELONE'.* PERFORM SELONE ......... EXIT. ENDIF.*"----------------------------------------------------------------------* STEP PRESEL (Enter selection conditions)*"----------------------------------------------------------------------* This step allows you, to influence the selection conditions either* before they are displayed or in order to skip the dialog completely.* If you want to skip the dialog, you should change CALLCONTROL-STEP* to 'SELECT'.* Normaly only SHLP-SELOPT should be changed in this step. IF callcontrol-step = 'PRESEL'.* PERFORM PRESEL .......... EXIT. ENDIF.*"----------------------------------------------------------------------* STEP SELECT (Select values)*"----------------------------------------------------------------------* This step may be used to overtake the data selection completely.* To skip the standard seletion, you should return 'DISP' as following* step in CALLCONTROL-STEP.* Normally RECORD_TAB should be filled after this step.* Standard function module F4UT_RESULTS_MAP may be very helpfull in this* step.* Seleciona os valores para a montagem da tabela de exibio do match code IF callcontrol-step = 'SELECT'.* Busca primeiramente os valores do Grupo de Responsveis SELECT parnr name_qmsm INTO TABLE ti_responsav FROM zqm_t_responsav WHERE parnr LIKE 'PRT%'.* Ordena a tabela interna SORT ti_responsav BY parnr.* Exclui os registros duplicados DELETE ADJACENT DUPLICATES FROM ti_responsav COMPARING parnr.* Monta a tabela com os valores do Grupo de Responsveis LOOP AT ti_responsav INTO wa_responsav. wa_value-zparnr = wa_responsav-parnr. wa_value-descr = wa_responsav-name_qmsm. APPEND wa_value TO ti_value. ENDLOOP.* Busca o restante dos valores SELECT stext mc_short INTO TABLE ti_hrp1000 FROM hrp1000 WHERE plvar = '01' AND otype = 'O' AND istat = '1' AND begda = sy-datum AND langu = sy-langu.* Ordena a tabela interna SORT ti_hrp1000 BY mc_short.* Exclui os registros duplicados DELETE ADJACENT DUPLICATES FROM ti_hrp1000 COMPARING mc_short.* Monta a tabela com os demais valores que sero exibidos no match code LOOP AT ti_hrp1000 INTO wa_hrp1000. wa_value-zparnr = wa_hrp1000-mc_short. wa_value-descr = wa_hrp1000-stext. APPEND wa_value TO ti_value. ENDLOOP. ENDIF.*"----------------------------------------------------------------------* STEP DISP (Display values)*"----------------------------------------------------------------------* This step is called, before the selected data is displayed.* You can e.g. modify or reduce the data in RECORD_TAB* according to the users authority.* If you want to get the standard display dialog afterwards, you* should not change CALLCONTROL-STEP.* If you want to overtake the dialog on you own, you must return* the following values in CALLCONTROL-STEP:* - "RETURN" if one line was selected. The selected line must be* the only record left in RECORD_TAB. The corresponding fields of* this line are entered into the screen.* - "EXIT" if the values request should be aborted* - "PRESEL" if you want to return to the selection dialog* Standard function modules F4UT_PARAMETER_VALUE_GET and* F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step.* Monta o display de exibio IF callcontrol-step = 'DISP'.* Varre a tabela com os dados da seleo LOOP AT ti_value INTO wa_value.* Concatena os valores dos campos que sero exibidos no match code CONCATENATE wa_value-zparnr wa_value-descr INTO record_tab-string RESPECTING BLANKS.* Grava na tabela standard APPEND record_tab. ENDLOOP.* Flag, nenhuma ordenao desejada ( no permite que o standard ordene os dados exibidos) callcontrol-sortoff = 'X'. ENDIF.ENDFUNCTION._____________________________________________________________________________________________________________________________*&---------------------------------------------------------------------**& NOME DO PROGRAMA : ZF_ZPARNR_QM*& TTULO DO PROGRAMA : FUNO PARA O MATCH CODE Z_SH_ZPARNR*& PROGRAMADOR : BRUNO SANTOS (USURIO SAP)*& DATA : 16/08/2013*& LTIMA ATUALIZAO : 16/08/2013*&*& DESCRIO*&---------------------------------------------------------------------**& LISTA DE MODIFICAES: **& DATA AUTOR REQUEST # DESCRIO **& 16/08/2013 USUARIO SAP SPDK900013 CODIFICAO INICIAL **&---------------------------------------------------------------------*FUNCTION-POOL zgf_ext_zparnr. "MESSAGE-ID ..TYPE-POOLS: shlp.* EstruturasTYPES: BEGIN OF ty_hrp1000, stext TYPE hrp1000-stext, mc_short TYPE hrp1000-mc_short, END OF ty_hrp1000, BEGIN OF ty_values, zparnr TYPE zzde_zparnr, descr TYPE zzde_descricao_qm, END OF ty_values, BEGIN OF ty_zqm_t_responsav, parnr TYPE zqm_t_responsav-parnr, name_qmsm TYPE zqm_t_responsav-name_qmsm, END OF ty_zqm_t_responsav, BEGIN OF ty_swhactor. INCLUDE TYPE swhactor.TYPES: pernr TYPE pa0105-pernr, END OF ty_swhactor.* Tabelas InternasDATA: ti_value TYPE STANDARD TABLE OF ty_values, ti_responsav TYPE STANDARD TABLE OF ty_zqm_t_responsav, ti_hrp1000 TYPE STANDARD TABLE OF ty_hrp1000.* Work AreasDATA: wa_value TYPE ty_values, wa_responsav TYPE ty_zqm_t_responsav, wa_hrp1000 TYPE ty_hrp1000.