Read SAP HR Infotype text from cluster PCL1


original: http://www.erki.net/node/29
Retrieve long text from Infotype 2002 (Attendance) in HR

Infotype 2002 (Attendances) has maintain text area (F9) lines that can be used to store comments regarding the attendance types assigned to employee. This text is not directly stored in the database table PA2002. This data is stored in the ‘PCL1′ cluster with Cluster ID ‘TX’.

Since this text is stored in PCL1 cluster, READ_TEXT function module cannot be used to retrieve it. Instead, make use of one of the 2 ways mentioned below to retrieve this text.

1. Make use of IMPORT ptext FROM DATABASE pcl1(tx) command
2. Use RP-IMP-C1-TX macro stored in TRMAC table.

Sample program Using IMPORT statement

REPORT ZHR_READ_CLUSTER.
TYPES:
BEGIN OF t_pa2002,
pernr TYPE persno,
*subty TYPE subty,
objps TYPE objps,
sprps TYPE sprps,
endda TYPE endda,
begda TYPE begda,
seqnr TYPE seqnr,
itxex TYPE itxex,
END OF t_pa2002,

BEGIN OF t_text,
line(72),
END OF t_text.

DATA:
gt_pa2002 TYPE STANDARD TABLE OF t_pa2002,
gw_pa2002 TYPE t_pa2002,
ptext TYPE STANDARD TABLE OF t_text INITIAL SIZE 10,
gw_text TYPE t_text,
gw_key TYPE pskey.

SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME TITLE text-001.
PARAMETERS:
p_pernr LIKE pernr-pernr,
subty like pa2002-subty,
Start like pa2002-begda,
End like pa2002-endda.
SELECTION-SCREEN END OF BLOCK abc.

START-OF-SELECTION.
SELECT pernr objps sprps endda begda seqnr itxex
FROM pa2002
INTO TABLE gt_pa2002
WHERE pernr EQ p_pernr and
subty EQ subty and
begda GE Start and
endda LE End .

LOOP AT gt_pa2002 INTO gw_pa2002 WHERE itxex EQ ‘X’.
MOVE-CORRESPONDING gw_pa2002 TO gw_key.
gw_key-infty = ‘2002’.
gw_key-subty = subty.
IMPORT ptext FROM DATABASE pcl1(tx) ID gw_key.
LOOP AT ptext INTO gw_text.
write : p_pernr ,’-‘, subty.
Write / gw_text-line .
ENDLOOP.
ENDLOOP.

Hope it will be helpfull In Shaa’ Allah

Done!

Advertisements

Overtime Approval through IT2007


I was facing a problem in overtime approval , after i’ve created attendance quota in table V_T556P for Approved Overtime and set time type determination in table V_T555Z , when i was entering approved quota in IT2007 nothing was generated ,

Solution :
the problem was that in activity of “Time Type Determination” i was set time type M in the field “Processing Type for Pair Type = 1 (At Work)”

It’s required to leave the field blank , so function GOT TO20 01
can process the time pair .

Done!