cancel
Showing results for 
Search instead for 
Did you mean: 

Query infotype and RT table

Former Member
0 Kudos

Hi experts!!

Is possible to do queries and get information from Infotypes and RT table in the same time.

We would like to do a query with information from infotypes an RT table, we don't want do a query for the data from infotypes and another one to get data from de rt table (PC00_M99_CWTR).

How is possible to do this kind os queries?

Kind regards,

Julian

Accepted Solutions (1)

Accepted Solutions (1)

antoine_foucault
Active Contributor
0 Kudos

Hi.

Yes it is possible to query payroll result by activating payroll infotype.

Please review:

Evaluting the payroll results using infotype or the logical database document: - page 9 onwards.

[http://help.sap.com/printdocu/core/print46c/en/data/pdf/PYINT/PYINT_REPORTING.pdf]

Beware, this can be time and resources consuming since payroll evaluation will create (INSERT) PA entries for corresponding results.

Hope it helps.

Regards.

Former Member
0 Kudos

Thank you very much!!

Do you know if is possible create a logical database with data from RT table and PA infotypes, without saving entries for payroll results in PA infotypes.

What do you think about it?

Kind regards,

Julian

antoine_foucault
Active Contributor
0 Kudos

Hi,

This option will lead you to programming. Please review standard example program: EXAMPLE_PNP_GET_PAYROLL It uses both GET PERNR and GET PAYROLL statement so to retrieve PA and PY data. But this is as good as using cl_hr_pay_result (or any ways to access PY data) at the GET PERNR event of a normal PNP report class.

Regards.

Former Member
0 Kudos

Thank you very much one more time,

Where is possible find out more information about using cl_hr_pay_result (or any ways to access PY data) at the GET PERNR event of a normal PNP report class?

Kind regards,

Julian

antoine_foucault
Active Contributor
0 Kudos

To check on how to use cl_hr_pay_access class, I would first try google and then the where used list button while reviewing said class in se24 tcode - example of use: RPCGR1K0

DATA: pay_access TYPE REF TO cl_hr_pay_access.  "access of payroll result   
  CREATE OBJECT pay_access.                                                 
  CALL METHOD pay_access->read_cluster_dir                                  
    EXPORTING                                                               
      pernr       = pernr                                                   
    IMPORTING                                                               
      cluster_dir = rgdir[]                                                 
    EXCEPTIONS                                                              
      OTHERS      = 4.                                                      
  CALL METHOD pay_access->read_pa_result                                    
    EXPORTING                                                               
      pernr                         = p_pernr                               
      period                        = p_rgdir                               
      molga                         = '07'                                  
    IMPORTING                                                               
      payroll_result                = pay_result                            
    EXCEPTIONS                                                              
      no_authorization              = 1                                     
      read_error                    = 2                                     
      country_version_not_available = 3                                     
      OTHERS                        = 4.                                    
      CALL METHOD pay_access->read_pe_result                                
        EXPORTING                                                           
          pernr                         = p_pernr                           
          period                        = p_rgdir                           
          molga                         = '07'                              
        IMPORTING                                                           
          payroll_result                = pay_result_person                 
        EXCEPTIONS                                                          
          no_authorization              = 1                                 
          read_error                    = 2                                 
          country_version_not_available = 3                                 
          no_person_data                = 4                                 
          OTHERS                        = 5.

result will be held in pay_result_person->inter deep structure

RT is inter-rt

BT is inter-bt

Or you can use function PYXX_READ_PAYROLL_RESULT - again - google or where used in se37 tcode. standard use in RPCDCI00

* -------------------------------------------------------------------- *
* FORM GET_PAYRESULT                                                   *
* -------------------------------------------------------------------- *
* read the internationl part of the payroll result from sequential     *
* number I_SEQNR.                                                      *
* -------------------------------------------------------------------- *
form get_payresult using i_seqnr         like pc261-seqnr
                changing cs_payxx_result type pay99_international.

field-symbols: <payxx_result> type pay99_international.

  call function 'PYXX_READ_PAYROLL_RESULT'
    exporting
      employeenumber                     = pernr-pernr
      sequencenumber                     = i_seqnr
    changing
      payroll_result                     = <pay_result>
    exceptions
      illegal_isocode_or_clusterid       = 1
      error_generating_import            = 2
      import_mismatch_error              = 3
      subpool_dir_full                   = 4
      no_read_authority                  = 5
      no_record_found                    = 6
      versions_do_not_match              = 7
      error_reading_archive              = 8
      error_reading_relid                = 9
      others                             = 10.
  if sy-subrc <> 0.
    case sy-subrc.
      when 5.
        perform error using c_er_payauth i_seqnr space
                            space space c_yes.
      when others.
        perform error using c_er_readpay i_seqnr sy-subrc
                            space space c_yes.
    endcase.
  endif.

  assign component 'INTER' of structure <pay_result>
                           to <payxx_result>.
  cs_payxx_result = <payxx_result>.

endform.     " GET_PAYRESULT

Good luck.

Former Member
0 Kudos

Thank you very much!!

Kind regards,

Julian

Answers (0)