Friday, December 31, 2010

REPORT ztest_notepad.
DATA:it_nfal     TYPE STANDARD TABLE OF nfal WITH HEADER LINE.
DATA:c1          TYPE cursor.
DATA:flag        TYPE c.
DATA:no_of_lines TYPE i VALUE '1000'.

START-OF-SELECTION.
  OPEN CURSOR:c1 FOR SELECT * FROM nfal.
  DO.
    IF flag NE 'X'.
      FETCH NEXT CURSOR c1 APPENDING TABLE it_nfal PACKAGE SIZE no_of_lines.
      IF sy-subrc <> 0.
        CLOSE CURSOR c1.
        flag = 'X'.
      ENDIF.
    ENDIF.
    IF flag = 'X'.
      EXIT.
    ENDIF.
  ENDDO.

Coming Soon...

Note:Right now Links won't work


Coming Soon...

Note:Right now Links won't work


Coming Soon...

Note:Right now Links won't work


Coming Soon...

Note:Right now Links won't work



Contributor

  • Sajith Kumar Dara, SAP HR Consultant

  • Create Daily work schedule.
    Path > IMG > Time Management > Work schedules > Daily Work Schedules > Define Daily Work Schedules
  • Off Day Work Schedule.
    Path > IMG > Time Management > Work schedules > Daily Work Schedules > Define Daily Work Schedules

  • Create Period Work Schedule.  Path > IMG > Time Management > Work schedules >  Define Period Work Schedules
  • Create Work Schedule Rule.
    Path > IMG > Time Management > Work schedules > Work Schedule rules and Work schedules > Set Work Schedule rules and Work Schedules
  • Generate Work Schedule Rule. Path > IMG > Time Management > Work schedules > Work Schedule rules and Work schedules > Generate Work Schedules Manualy
  • Generated Work Schedule Rule.
    Note: Screen Shot shown below for a month only.
  • Copy related model and create custom wage type.
    PATH: IMG > Personnel Management > Personnel Administration > Personnel Data > Additional Payments > Wagetypes > Create Wagetype catalog (TCode: OH11). 


    PATH: IMG > Personnel Management > Personnel Administration > Personnel Data > Additional Payments > Wagetypes > Wage Type Catalog >Check entry Permissibility for Additional Payments.
  • Maintain Permissibility.
    PATH: IMG > Personnel Management > Personnel Administration > Personnel Data > Additional Payments > Wagetypes > Wage Type Catalog > Define Wage Type Permissibilities for PS and ESG
  • Maintain Wage type characteristics.
    PATH: IMG > Personnel Management > Personnel Administration > Personnel Data > Additional Payments > Wagetypes > Wage Type Catalog > Check Wage Type Characteristics. 
  • Goto Tcode: SM30  Table : V_T512W_O  Maintain Processing Classes , Cumulations , Evaluation Classes.
  • GO TO TCode SM30  Table : V_T512W_B  MaintainValuation Basis for Wagetype.
  • GoTo Tcode: PE01, select respective Schema.
  • GoTo Sub Schema ZRT0 in Tcode: PE01.
  • GoTo Personal calculation Rule Z100 (Tcode: PE02) .
  • Goto TCODE: PE02 > Rule Z010, this code works for Day Calculation.
  • For PCR: ZS11 details GoTo Tcode: PE02 , This code works for Hours calculation.
  • GoTo Tcode: PE02 enter rule ZS11 hours calculation for part time employees.
  • Go To PA30 > Enter Part Time employee then goto Infotype 0007.
  • Maintain Infotype 0008 .
  • Maintain Infotype 2010 with 4 hours .

  • Payroll Driver.
    PATH: SAP EASY ACCESS > SAP MENU > Human Resourse > Payroll > Asia/Pacific > Singapore > Payroll Accounting > Simulation.  
  • Payroll log details.
  • In Detail.
    Payslip Layout
REPORT ztest_notepad.
DATA:it_nfal       TYPE STANDARD TABLE OF nfal WITH HEADER LINE.
DATA:total_records TYPE i.
DATA: c1           TYPE cursor,
c2           TYPE cursor,
c3           TYPE cursor.
DATA:cgh_flag      TYPE c,
kkh_flag      TYPE c,
sgh_flag      TYPE c.

START-OF-SELECTION.
SELECT COUNT( * ) FROM nfal INTO total_records.
OPEN CURSOR:c1 FOR SELECT * FROM nfal WHERE einri = 'CGH',
c2 FOR SELECT * FROM nfal WHERE einri = 'KKH',
c3 FOR SELECT * FROM nfal WHERE einri = 'SGH'.
DO.
IF cgh_flag NE 'X'.
FETCH NEXT CURSOR c1 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c1.
cgh_flag = 'X'.
ENDIF.
ENDIF.
IF kkh_flag NE 'X'.
FETCH NEXT CURSOR c2 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c2.
kkh_flag = 'X'.
ENDIF.
ENDIF.
IF sgh_flag NE 'X'.
FETCH NEXT CURSOR c3 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c3.
sgh_flag = 'X'.
ENDIF.
ENDIF.
IF cgh_flag = 'X' AND
kkh_flag = 'X' AND
sgh_flag = 'X'.
EXIT.
ENDIF.
ENDDO. 
? to request help or information about the FTP commands
ascii to set the mode of file transfer to ASCII
(this is the default and transmits seven bits per character)
binary to set the mode of file transfer to binary
(the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files)
bye to exit the FTP environment (same as quit)
cd to change directory on the remote machine
close to terminate a connection with another computer

close brubeck closes the current FTP connection with brubeck,
but still leaves you within the FTP environment.
delete to delete (remove) a file in the current remote directory (same as rm in UNIX)
get to copy one file from the remote machine to the local machine

get ABC DEF copies file ABC in the current remote directory to (or on top of) a file named DEF in your current local directory.

get ABC copies file ABC in the current remote directory to (or on top of) a file with the same name, ABC, in your current local directory.
help to request a list of all available FTP commands
lcd to change directory on your local machine (same as UNIX cd)
ls to list the names of the files in the current remote directory
mkdir to make a new directory within the current remote directory
mget to copy multiple files from the remote machine to the local machine;
you are prompted for a y/n answer before transferring each file

mget * copies all the files in the current remote directory to your current local directory, using the same filenames. Notice the use of the wild card character, *.
mput to copy multiple files from the local machine to the remote machine;
you are prompted for a y/n answer before transferring each file
open to open a connection with another computer

open brubeck opens a new FTP connection with brubeck;
you must enter a username and password for a brubeck account
(unless it is to be an anonymous connection).
put to copy one file from the local machine to the remote machine
pwd to find out the pathname of the current directory on the remote machine
quit to exit the FTP environment (same as bye)
rmdir to to remove (delete) a directory in the current remote directory
File needs to be uploaded
=========================
CGH;6703000002;1
CGH;6707100006;1
=========================
REPORT ztest_notepad.
TYPE-POOLS:truxs.
DATA: raw_data TYPE truxs_t_text_data.
DATA: BEGIN OF it_nfal OCCURS 0,
      einri TYPE nfal-einri,
      falnr TYPE nfal-falnr,
      falar TYPE nfal-falar,
    END OF it_nfal.

START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename = 'C:\Documents and Settings\Administrator\Desktop\nfal.txt'
    filetype = 'ASC'
  TABLES
    data_tab = raw_data.

CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
  EXPORTING
    i_field_seperator    = ';'
    i_tab_raw_data       = raw_data
  TABLES
    i_tab_converted_data = it_nfal.

LOOP AT it_nfal.
  WRITE:/ it_nfal.
ENDLOOP.
REPORT ztest_program .
DATA: it_data TYPE TABLE OF t001.
DATA:check    TYPE char3.
DATA:sy_index TYPE char2.
DEFINE checkbox.
  parameters:&1 as checkbox.
END-OF-DEFINITION.
checkbox:c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,
c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,
c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,
c31,c32,c33,c34,c35,c36,c37,c38,c39,c40.

AT SELECTION-SCREEN OUTPUT.
  DESCRIBE TABLE it_data LINES sy-tfill.
  sy-tfill = 39. "This will be changed based on the itab records. I just hardcoded the value
  sy_index = 1.
  LOOP AT SCREEN.
    CONCATENATE 'C' sy_index INTO check.
    IF screen-name = check.
      IF sy_index GT sy-tfill.
        screen-active = '0'.
        MODIFY SCREEN.
        sy_index = sy_index + 1.
        CONTINUE.
      ENDIF.
      sy_index = sy_index + 1.
    ENDIF.
  ENDLOOP.

Introduction

What is Payroll Cluster?

Payroll cluster enables you to view all the payroll related information for an employee at a single place. The information like, in which payroll cycle the employee lies, what is the run date and run time for a particular payroll, which is the active payroll, is quite easy to retrieve using payroll cluster.

What are Payroll Cluster Tables?

Payroll Cluster tables combine the data from several tables with same Keys into one record on the database.

  • Data is written to a database in compressed form.
  • Retrieval of data is very fast with the help of Primary Key.
  • Payroll Cluster tables are defined in the data dictionary as transparent tables.
  • External programs can NOT interpret the data in a cluster table.
  • Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETEFROM DATABASE are used to process data in the cluster tables.

Payroll Cluster Tables in SAP are:

PCL1 - Database for HR work area; (long text, etc)
PCL2 - Accounting Results (time, travel expense and payroll); (payroll results)
PCL3 - Applicant tracking data;
PCL4 - Documents, Payroll year-end Tax data (change logs, etc)

Management of PCLn Database Tables

  • PCLn database tables are divided into subareas known as data clusters.
  • Data Clusters are identified by a two-character code. E.g. RU for US payroll result, B2 fortime evaluation result, LA for change logs.
  • Each HR subarea has its own cluster.
  • Each subarea has its own key.

Data Clusters in PCL1 Tables.

  • B1 time events/PDC
  • G1 group incentive wages
  • D1 Interfaces to devises
  • L1 individual incentive wages
  • LL individual incentive wages
  • NS N Shift heavy work.
  • PC personal calendar
  • TE travel expenses/payroll results
  • TS travel expenses/master data
  • TX info type texts
  • TA General Data for Travel Expense
  • TC Credit card data

    Figure 1

Data Clusters in PCL2 Tables.

  • B2 time accounting results
  • CD cluster directory of the CD manager
  • PS generated schemas
  • PT texts for generated schemas
  • RX payroll accounting results/international
  • Rn payroll accounting results/country-specific ( n = HR country indicator RU for US payroll result)
  • ZL personal work schedule

    Figure 2

Data Clusters in PCL3 Tables.

  • AP action log / time schedule
  • TY texts for applicant data info types
  • AN Notepad for Actions
  • AL Letters for Actions

    Figure 3

Data Clusters in PCL4 Tables.

  • LA change logs (long term documents)
  • LB change logs for Application Master
  • P1 Layout for log
  • PR Logging of report
  • QT Simulations of Info types 0000,0014,0015,0416.
  • SA Short-Term Documents for HR Master Data
  • SB Short-Term Documents for Applicant Master

    Figure 4

Display Payroll Results Screen.

The transaction PC00_M08_CLSTR is used to navigate to the payroll cluster or Display payroll results screen.

The Display payroll results screen is divided into split task pane windows.

Left Pane:

The selected personnel numbers will be displayed in the left pane

Right Pane:

Employee's name and the records for different payroll period results will be displayed in the right pane. The most current payroll period will be highlighted.


Figure 5

To view the results for an employee, double click on the desired personnel number. The green indicator in front of each name indicates results exist for the employee. If you have a red indicator it means no results exist for the employee. Diamond indicates that you have no authorization to display that personnel number details.

In the right task pane, you can view all payrolls existing for the employee selected. The status indicates the type of payroll result:

Other items that can be viewed from this screen include the payment date, for-period and in-period, start and end date of the payroll, etc.

When you click on a particular record in the right pane for the selected employee, you will get the below shown screen.


Figure 6

It displays the data clusters related to particular employee.

WPBP Table (Work Center/Basic Pay)

On Double Click it will navigate to Basic Pay Payroll Results for a particular employee.


Figure 7

RT Table (Result Table)

The wage types listed in the RT reflect gross, net calculations, benefit transactions, garnishment transactions, etc.

There are two types of View

  • Expanded View
  • Collapsed View

On Double Click on RT It will navigate to the expanded View


Figure 8

RT_ Table

On Double Click on RT It will navigate to the collapsed View


Figure 9

CRT Table

The Next table is the Cumulative Results Table (CRT) which contains Table CRT contains the cumulations of wage types in table RT over a certain time period.


Figure 10

BT Table

On Double Click on BT It will navigate to the Bank Transactions

Every entry in the Bank Transactions table (BT) of an employee, corresponds to a payment that was created in a payroll period for this employee. However, the employee is not necessarily the payment recipient of all payments.


Figure 11

VERSION Table

On Double Click on Version it will navigate to version Tables

Table VERSION contains creation data for the payroll result, for example the Release and payroll program.

Version table is a field string of information related to the creation of the payroll result. It identifies who created the payroll results, when the payroll results were created, and which schema and release was used.


Figure 12

PCL2 Table

On Double Click on PCL2 It will navigate to change access of payroll result

Table PCL2 contains information about the last change access to a payroll result.


Figure 13

This table stores key information about the payroll status. It tells you the payroll run date, payroll run time, check date, off-cycle reason if applicable, voided check or reversal indicator if applicable, etc.

VERC Table

The Next table is the TAX (Employee Tax details table).

Table VERSC contains organizational information about the payroll result.


Figure 14

Function Module for Retrieving data from Payroll Cluster Tables

Call Function Module PYXX_GET_RELID_FROM_PERNR to get the area identifier for cluster in tables PCLx .

CALL FUNCTION 'PYXX_GET_RELID_FROM_PERNR'

EXPORTING

employee = pernr

IMPORTING

relid = relid

molga = molga

where relid is Area Cluster Identifier

molga is Country Grouping

Call Function Module CU_READ_RGDIR Passing the Values of molga(Country Grouping from previos Function module)

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = pernr

IMPORTING

molga = molga

TABLES

in_rgdir = in_rgdir

where in_rgdir contains cluster Directory (For Export and Import of Payroll Results)

Call Function Module CD_READ_LAST for Reading the RGDIR directory with latest valid record

CALL FUNCTION 'CD_READ_LAST'

EXPORTING

begin_date = pnpbegda

end_date = pnpendda

IMPORTING

out_seqnr = out_seqnr

TABLES

rgdir = rgdir

where pnpbegda is the Latest Begin date

pnpendda is the Latest End date

out_seqnr is the sequence number

* *rgdir contains Cluster Directory

Call Function Module to retrieve Payroll Results PYXX_READ_PAYROLL_RESULT

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = g_relid "'RM'

employeenumber = pernr-pernr

sequencenumber = g_seqnr

CHANGING

payroll_result = it_result

The Payroll Results are collected in Internal Table It_Result.

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.