Program Cluster

download Program Cluster

If you can't read please download the document

description

cluster

Transcript of Program Cluster

REPORT ZEXEMPLO_CLUSTER.* Declaraes ----------------------------------------------------------TABLES: PCL1, "Cluster 1 HRPCL2, "Cluster 2 HRITCPP,PERNR. "Funcionrios*- Includes ------------------------------------------------------------INCLUDE PCTYPBR0.INCLUDE PCCLSBR1. "HRMS BR cluster dataINCLUDE PCCLSBR0. "HRMS BR cluster readingINCLUDE PCTYPBR0. "Type pools for declaring payroll dataINCLUDE PCXRXBR0. "Macros para recuperao do ClusterDATA:SUBRC LIKE SY-SUBRC,FBEG LIKE SY-DATUM, "Incio perodoFEND LIKE SY-DATUM. "Fim perodo*- Parmetros Seleo --------------------------------------------------PARAMETERS PMES LIKE QPPNP-PABRP.PARAMETERS PANO LIKE QPPNP-PABRJ.*- Eventos -------------------------------------------------------------START-OF-SELECTION."Move o 1o. dia e o ltimo do ms informado no parmetro para FBEG e"FENDCONCATENATE PANO PMES '01' INTO FBEG.CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'EXPORTINGDAY_IN = FBEGIMPORTINGLAST_DAY_OF_MONTH = FEND."Executa para cada funcionrio. Banco de dados lgico PNPGET PERNR.PERFORM READ_BRAZILIAN_CLUSTER TABLES RGDIR "Tab.de diretoriosUSING PERNR-PERNR "Chave do empregadoPN-BEGDA "Data de inicioPN-ENDDA "Data fim do periodoSUBRC. "Flag de retorno"A tabela RGDIR contm todos os processamentos de folha realizados"para o funcionrio.LOOP AT RGDIR."Verifica se existe processamento de folha para o ms"solicitado no parmetro de execuo nesse funcionrioCHECK FBEG LE RGDIR-FPEND.CHECK FEND GE RGDIR-FPBEG."Se existir efetua a carga das tabelasPERFORM READ_SPECIFIC_RESULT USING PERNR-PERNR "Chave do empRGDIR-SEQNR "Seq. do ProceSUBRC. "Flag de retoEXIT.ENDLOOP."Neste ponto temos todas as tabelas carregadas (RT,VERSC,CRT,BT,etc.)LOOP AT RT.WRITE: / RT-LGART,RT-BETRG.ENDLOOP.END-OF-SELECTION.