Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dump during payroll execution in badi using function Module for salary

Former Member
0 Likes
919

Hi Gurus,

I have come across a strange dump I have used the badi "HR_INDVAL" in which I have been using Indirect valuation for calculating the overtime and gratuity. The badi is working fine when I m using PA30 for storing data in infotype 15 but when I am running payroll that badi gives me dump on the Function Module for Gross salary.

Dump:

" At a LOOP over an internal table, it is not allowed to be changed."

Error Analysis.

Error analysis

At a LOOP over an internal table, the table is not allowed to be changed

in the loop tail as a whole.

SORT, MOVE, REFRESH, CLEAR are, for example, not allowed.

Module Name RP_FILL_WAGE_TYPE_TABLE



CALL FUNCTION 'HR_GET_TOTAL_AMOUNT_P0008'
            EXPORTING
              pernr                     = pernr
              date                      = begda
*           P0008                     =
*           P0001                     =
*           FREQUENCY                 = '  '
*           LEAVE_HOURLY              = ' '
           IMPORTING
              amount                    = grosssal
*           AMOUNT_ORIG               =
*           FREQUENCY_ORIG            =
*           FREQUENCY_ORIG_TEXT       =
**           CURRENCY                  = 'PKR'
           EXCEPTIONS
             no_entry_in_t001p         = 1
             no_entry_in_t503          = 2
                others = 4 .

Can some body Help me out in this.

Edited by: ZAHID HAMEED on Jan 19, 2012 12:36 PM

5 REPLIES 5
Read only

Former Member
0 Likes
776

Hi,

In the method of your BADI 'HR_INDVAL' , check if you are sorting or refreshing as said in the dump.

*SORT, MOVE, REFRESH, CLEAR are, for example, not allowed.

*Might be you are trying to sort or refresh internal table 'grosssal'.

Regards,

Srini.

Read only

0 Likes
776

Hi Siri Vas.

As you can see this function Module is returning me the Gross salary in a single value it is not an internal table. My issue has resolved by calculating the salary manually mean to say using infotype 8 and allowances tables. Now it is working perfectly alright. But I wasn't been able to figure out why is it throwing the dump on function Module. I have debugged all the function module there is a function module RP_FILL_WAGE_TYPE_TABLE here it is creating the problem. it is using two internal tables one p00015[] and the other one is pp00015[].

here it is throwing dump when it comes across a statement where they are equaling both p00015[] = pp00015[]. here p00015[ ] is empty where pp00015[ ] is filled here it is creating the problem.

Thanx for everything the problem is resolved.

Edited by: ZAHID HAMEED on Jan 19, 2012 7:06 PM

Edited by: ZAHID HAMEED on Jan 19, 2012 7:08 PM

Read only

Former Member
0 Likes
776

Zahid, goto ST22 and open the dump.. it would show the exact line where it dumped. that will help you analyze what happened.

Read only

Former Member
0 Likes
776

Problem resolved.self.

Read only

Former Member
0 Likes
776

Hi,

Post all calculations you do in "HR_INDVAL", after passing the value to  valuation_output & valuation structures, should explicitly pass subrc = 0.

And at the beginning,

IF valuation_output-amount IS NOT INITIAL.

       RETURN.

     ELSE.

       subrc = 8.

       RETURN.

     ENDIF.


This will avoid dump while running the payroll. This is of no significance if the same HR_INDVAL is just for PA30 calculations.