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

Validating the PERNR

Former Member
0 Likes
1,964

Hi,

I will describe the requirement in detail. On the selection screen, there are 4 parameters like 'Personnel Number', 'Action Date', 'Start Date', 'End Date'. Now the requirement from the user is that, he needs to validate the personnel number. When he enters the personnel number, the employee name corresponding to that personnel number has to be displayed like what it happens in PA30/PA40. Please help me to solve this at the earliest.

Best Regards

Renjan

1 ACCEPTED SOLUTION
Read only

sathish_perumal
Active Participant
0 Likes
1,201

Hi Renjan,

You can display the name in a label or input/out field in the selection screen. Only thing always it should be in display mode and when the pernr itself is not entered it should be in invisible mode.

So when the user enters the pernr in At Selection-screen on Pernr event you can get the name from the table pa0001 and make the label or text field visible and display the value.

Regards,

Sathish

Note : Reward helpful answers.

6 REPLIES 6
Read only

Former Member
0 Likes
1,201

Hi renjan,

1. employee name corresponding to that personnel number has to be displayed

Simple

2. Take take PA0001

and fetch ENAME field from it.

(that will be the name )

regards,

amit m.

Read only

anversha_s
Active Contributor
0 Likes
1,201

hi,

go to PA0001

take ENAME field .

rgds

anver

pls mark hlpful answers

Read only

0 Likes
1,201

I am not an experienced guy in ABAP HR... I know the field... But I dont know how to display it on the selection screen once the user enter the PERNR like how it happens in PA30/PA40. I have just copied a part of the source code so that you people can help me out very easily i believe.

-


Code----


report ZRR_HR_LEV_WITH_ADV1 no standard page heading line-size 255.

include zrrbdcrecx1.

TABLES: PA0001.

DATA: CALCDATE LIKE SY-DATUM,

POS LIKE PA0001-PLANS,

ACTDT1(10), LSTDT1(10), LEDDT1(10).

selection-screen begin of block blk1 with frame title text-001.

parameters: pernr like pa0001-pernr,

Actdt like sy-datum,

lstdt like sy-datum,

leddt like sy-datum.

selection-screen end of block blk1.

at selection-screen output.

loop at screen.

if screen-name = 'PERNR' OR SCREEN-NAME = 'ACTDT' OR

SCREEN-NAME = 'LSTDT' OR SCREEN-NAME = 'LEDDT' OR

screen-name = '%_PERNR_%_APP_%-TEXT' OR

SCREEN-NAME = '%_ACTDT_%_APP_%-TEXT' OR

SCREEN-NAME = '%_LSTDT_%_APP_%-TEXT' OR

SCREEN-NAME = '%_LEDDT_%_APP_%-TEXT' or

SCREEN-NAME = '%B001058_BLOCK_1000'.

ELSE.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

endloop.

Best Regards

Renjan

Read only

sathish_perumal
Active Participant
0 Likes
1,202

Hi Renjan,

You can display the name in a label or input/out field in the selection screen. Only thing always it should be in display mode and when the pernr itself is not entered it should be in invisible mode.

So when the user enters the pernr in At Selection-screen on Pernr event you can get the name from the table pa0001 and make the label or text field visible and display the value.

Regards,

Sathish

Note : Reward helpful answers.

Read only

0 Likes
1,201

Hi,

My doubt is how can I display a label field... See, if we give PARAMETERS, a text field will be displayed on the selection screen. Like that, how will I give a label field. It will be helpful, if you can explain with an example.

Best Regards

Renjan

Read only

0 Likes
1,201

Hi again,

1. just copy paste to get a taste of it.

2. it will display employee name (just like pa30)

in greyed field.

(just press ENTER after keying in the pernr)

3. report abc.

PARAMETERS : PERNR LIKE P0001-PERNR.

PARAMETERS : ENAME LIKE P0001-ENAME MODIF ID DIS.

*----


AT SELECTION-SCREEN OUTPUT.

SELECT SINGLE ENAME INTO ENAME

FROM PA0001 WHERE PERNR = PERNR.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'DIS'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.