How to Store Simulation Payroll Result for any Reconciliation

...Previous

Create Enhancement implementation.

A spot will be created to write our custom code.  

Create a table to store the data.

The below code is to take the data form RT table from final result of the simulation payroll and store the data in the table at runtime for the wage types that maintained in the Set or wage type maintenance table.

We have the condition here this will run for the T.Code PC00_M13_CALC_SIMU' and the data in the table will be store and modify for next time run.  

Note : Data will store for one month only ie. Let say we run the simulation payroll for the month of Aug 09 all the related amount will be store in the ztable that are maintained in SET. If we run for AUG the data will be over write the existing one. Then if we run the simulation payroll for the Sep 09 the all the data store for the Aug be cleared and only sep 09 will be available.  

*----------------------------------------------------------------------*
DATA : it_final TYPE TABLE OF zhrtr_aus_wt_du ,
       wa_final 
TYPE zhrtr_aus_wt_du.
DATA : r_wages TYPE hrpayjp_range_lgart,
       w_wages 
TYPE pjpsk_range_lgart.
DATA :it_ab_wage TYPE TABLE OF rgsb4,
       wa_ab_wage 
TYPE  rgsb4.
DATA : lv_check TYPE i.
DATA : wa_rt TYPE pc207 .
IF tst_on = 'X' and sy-tcode = 'PC00_M13_CALC_SIMU' .
   
SELECT SINGLE * FROM zhrtr_aus_wt_du INTO wa_final WHERE begda = PNPDISBD  .
    
if sy-subrc ne 0.
      
DELETE FROM zhrtr_aus_wt_du.
    
endif.

  
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
    
EXPORTING
      
client          = sy-mandt
      setnr           = 
'ZAUS_WAGE'
      
class           = '0000'
      no_descriptions = 
' '
      no_rw_info      = 
' '
    
TABLES
      set_values      = it_ab_wage
    
EXCEPTIONS
      set_not_found   = 
1
      
OTHERS          = 2.
  
IF it_ab_wage IS NOT INITIAL.
    
LOOP AT it_ab_wage INTO wa_ab_wage.
      w_wages-
sign   = 'I'.
      w_wages-option = 
'EQ'.
      w_wages-low    =  wa_ab_wage-
from.
      
append w_wages to r_wages.
    
ENDLOOP.
    
CLEAR it_final.
    
LOOP AT rt INTO wa_rt WHERE lgart IN r_wages.
      wa_final-pernr = p0000-pernr.
      wa_final-begda = PNPDISBD.
      wa_final-lgart = wa_rt-lgart.
      wa_final-betrg = wa_rt-betrg.
      
APPEND wa_final TO it_final.
    
ENDLOOP.
    
IF it_final IS NOT INITIAL.
      
MODIFY zhrtr_aus_wt_du FROM TABLE it_final.
      
IF sy-subrc = 0.
        
COMMIT WORK.
      
ENDIF.
    
ENDIF.
  
ENDIF.
ENDIF.

endform.
ENDENHANCEMENT.
*$*$-End:   (1 )------------------------------------------------------$*$*

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image