cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HR

Former Member
0 Kudos
90

I have to generate a report that has personnel number,employee name,position and position text.The first three fields are being retrieved from one table ,that is,PA0001 and the last is to be retrived from another table namely HRP1000.Is there any common field in both the tables on which the validation can be applied and data can be retrieved?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

can somebody please look into this.

waqas_rashid
Contributor
0 Kudos

Hi,

Fields in table PA0001 (Organizational Assignment):

PERNR Personnel Number

ENAME Employee Name

PLANS Position

Fields in table T528T (Positions)

PLANS Position

PLSTX Text

So PLANS is the key which can be used to link these 2 tables. You will also have to specify the language code in SPRSL field.

Regards,

Waqas Rashid

Answers (4)

Answers (4)

former_member184119
Active Contributor
0 Kudos

Just pass


perform GET_JOB_WORKKEY_TEXT using job_workey_text 
value ( here pass p0001-plans) value date ( Pn-begda).

FORM GET_JOB_WORKKEY_TEXT USING JOB_WORKKEY_TEXT

VALUE(JOB_WORKKEY)

VALUE(DATE) TYPE D.

DATA: L_OBJECT_TEXT LIKE P1000-STEXT,

L_SHORT_TEXT LIKE P1000-SHORT.

CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'

EXPORTING

OTYPE = 'S'

OBJID = JOB_WORKKEY

STATUS = '1'

BEGDA = DATE

ENDDA = DATE

LANGU = SY-LANGU

IMPORTING

SHORT_TEXT = L_SHORT_TEXT

OBJECT_TEXT = L_OBJECT_TEXT

EXCEPTIONS

NOTHING_FOUND = 1

WRONG_OBJECTTYPE = 2

MISSING_COSTCENTER_DATA = 3

MISSING_OBJECT_ID = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

CLEAR JOB_WORKKEY_TEXT.

ELSE.

IF NOT L_OBJECT_TEXT IS INITIAL.

JOB_WORKKEY_TEXT = L_OBJECT_TEXT.

ELSE.

JOB_WORKKEY_TEXT = L_SHORT_TEXT.

ENDIF.

ENDIF.

ENDFORM. 

Former Member
0 Kudos

HI

As told by myself and Rajesh earlier, please Try Ad hoc Query using t.code: S_PH0_48000513.

No need to go for any validation or program for such a small report.

Regards

Vikas K Sharma

Former Member
0 Kudos

You can achive this throug Ad-Hoc Query. No need to go for any Z reports. Try Ad hoc Query using t.code: S_PH0_48000513.

Former Member
0 Kudos

Dear Geetu

have you tried AD-Hoc Query.

Just go to Ad-Hoc Query and select "Personnel Number" from Key fields and "Position" from Organisation assignment.

In the Output just select Value & text and it will display, employee no. name, position and position text.

Regards

Vikas K Sharma

Former Member
0 Kudos

HI..

PA0001 will have PLANS - position

then HRP1000 where object type = S and Object ID = PA0001-plans.

You can use PA0001-ENAME for employee name.

cheers

Ajay