Skip to Content
author's profile photo Former Member
Former Member

Reading RT results in ABAP

I need to read RT results in the payroll simulation run. I understand that in the simulation run RT table doesn't get updated, but still all the calculations and processing is done. I need to read these values in my ABAP program. Any suggestions on how to read these values in the simulation run?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 12:04 PM

    Hi,

    Get the payroll result by using th function module

    PYXX_READ_PAYROLL_RESULT

    CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

    • EXPORTING

    • EMPLOYEENUMBER = w_pernr-pernr SEQUENCENUMBER = NUMBER

    • CHANGING

    • PAYROLL_RESULT = 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.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

  • *

    The deep structure is stored in Result table.

    now move the Result table to another table.

    move result -inter-rt[ ] to it_rt.

    Then, loop IT_RT table and get the values.

    Regards,

    Vani

Add a comment
10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 12:21 PM

    Hi Nikhil,

    Once you got the SEQNR(Sequence Number), RELID( Cluster ID), you have to pass these fields along with the PERNR to the Function module PYXX_READ_PAYROLL_RESULT, it will give the payroll result is the deep structure, does contains 3 structures(EVP,INTER,NAT), but our interest is on the sturcture INTER, which contains the payroll results.

    So u have to loop on this perticulat INTER structure as follows,

    LOOP AT i_pay_result-inter-rt INTO wa_rt where lgart = wagetype(selection-screen input).

    wa_final-amount = wa_rt-betrg.

    ENDLOOP.

    DATA : i_result_dir LIKE TABLE OF pc261,

    i_pay_result TYPE pay99_result,

    Regards,

    Narendra

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Narendra /Vani,

      PYXX_READ_PAYROLL_RESULT helped me in resolving my problem. Now I am reading the payroll simulation results using this function and storing it in a custom table for reporting purposes. I am flushing the table once the report is generated. Sample code for others reference:

      &----


      *& Include ZINCLUDE

      &----


      FORM ZFUZDRT.

      data: result type pay99_result.

      data: my_rt like pc207 occurs 0 WITH HEADER LINE.

      data: amount TYPE i.

      DATA: ZZRTDUMP TYPE ZZRTDUMP OCCURS 0 WITH HEADER LINE.

      DATA: ZZRTDUMP1 TYPE ZZRTDUMP.

      call function 'PYXX_READ_PAYROLL_RESULT'

      exporting

      clusterid = 'RX'

      employeenumber = PERNR-PERNR

      sequencenumber = '00003'

      READ_ONLY_BUFFER = 'X'

      READ_ONLY_INTERNATIONAL = 'X'

      • IMPORTING

      • VERSION_NUMBER_PAYVN =

      • VERSION_NUMBER_PCL2 =

      changing

      payroll_result = result

      EXCEPTIONS

      OTHERS = 1.

      IF SY-SUBRC <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      my_rt[] = result-inter-rt[].

      LOOP AT my_rt."where lgart = wagetype(selection-screen input).

      ZZRTDUMP1-PERNR = PERNR-pernr.

      ZZRTDUMP1-LGART = my_rt-LGART.

      ZZRTDUMP1-BETRG = my_rt-BETRG.

      ZZRTDUMP1-AMT_CURR = my_rt-AMT_CURR.

      ZZRTDUMP1-ANZHL = my_rt-ANZHL.

      ZZRTDUMP1-BETPE = my_rt-BETPE.

      INSERT INTO ZZRTDUMP VALUES ZZRTDUMP1.

      ENDLOOP.

  • Before answering

    You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
    You must be Logged in to submit an answer.

    Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.