Application Development 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: 

Get pernr statement

Former Member
0 Kudos

Hi,

I just want to know how to debug the get pernr statement or to know what is happening by this statement in the program.

Thing is that, I have a scenario where, for a particular employee ID the get pernr statement gets executed with sy-subrc value 0 which idealy should not be. And except this ID rest all IDs have sy-subrc as 4 after the get pernr statement execution.

Please reply.

Regards,

Binay.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

What I understood from the statement is that you want this statement should only get executed when sy-subrc not equal to 0.

So just write one statement before it

IF sy-subrc NE 0.

GET prnr

endif.

Your work will be done.

Reward some points.

Bye,

Anomitro

14 REPLIES 14

Former Member
0 Kudos

Hi,

What I understood from the statement is that you want this statement should only get executed when sy-subrc not equal to 0.

So just write one statement before it

IF sy-subrc NE 0.

GET prnr

endif.

Your work will be done.

Reward some points.

Bye,

Anomitro

0 Kudos

Hi,

I am rectifying my query.

The Get pernr statement gets the details for only one employee ID but not for the other ones. Ideally speaking this statement should not fetch any data for any of the employees as per the program's logic. The same variant is used for all employees while execution but still then why does the Get pernr statement fetches data for only one employee ID.

I just wanted to know how to track the get pernr statement results and from where is it getting that which I dont know how to get.

Thanx for your reply.

Binay.

0 Kudos

check if the pernr's are in table .. HRPY_RGDIR

also check pernrs in infotypes which U declared with

infotypes statement ...

Former Member
0 Kudos

If U R using LDB PNP .. then put a break point in program

SAPDBPNP and execute your program ...

Former Member
0 Kudos

Hi PERNR belongs to Logical Database PNP.

So you can use SAPDBPNP program to debug.

Please assign points

Former Member
0 Kudos

FIRST UNDERSTAND WHAT IS THE USE OF THE STATEMENT

IN HR REPORTING WHEN WE WRITE

GET PERNR (USING LDB PNP AND PROGRAM SAPDBPNP)

THIS STATEMENT WILL RETRIVE ONE EMPLOYEE DATA OR RECORDS FROM DATABASE TABLE (PA0000 TO PA0999)

BY USING THE LDB PROGRAMME AND PASS TTHE DATA INTO

INFOTYPE INTERNAL TABLE WHICH DECLARE IN THE PROGRAM

LIKE INFOTYPE: 0001,0002.

WHAT THIS STATEMENT DOES IS CREATES AN INFOTYPE INTERNAL TABLE

SO U CAN CHECK U R CONDITION AFTER GETTING THE EMPLOYEE RECORD

Former Member
0 Kudos

Hi,

the program which gets executed is :'sapdbpnp' and the

your information gets selected in the include 'DBPNPF01' :

'SELECT DISTINCT pernr FROM pa0001 INTO TABLE index

WHERE pernr IN pnppernr'

select and copy the above statement ...... search the program

for it and put a breakpoint there. Hope this will solve your problem.

Former Member
0 Kudos

hi check one thing..

get pernr is like a loop through the pernrs that r selected and it process a single pernr only...like parameter....it will allow the single parameter at a time ..this can be ckecked with the debugging..

regards,

venkat.

Former Member
0 Kudos

Hi Binay,

If you wanted to debug and find the cause, try to find the Perform "putpern" in program "SAPDBPNP" (Actually you will find 2, but one wil only trigger as it is written for IF-ELSE condition). For your info, inside this Perform, they use another perform "fill_infotype_tables_and_put" which contains the Statement "PUT PERNR' which is the corresponding statement trigerring "GET PERNR" in your code....

Also i will suggest you to write down all your selection conditions inside GET PERNR and End-of-selection loop.. something like WRITE: p0000-massn, p0000-burks, p0000-begda, etc... This writes in the screen for your testing, for which data the Get Pernr statement gets triggered, upon which you can analyze whether it matches your program selections/changed pnp fields inside the code..

Also you can put your code here, so that I can exactly figure out what is happening...

0 Kudos

Hi,

First of all thanx for your reply.

The variant used in the program execution should consider all the company codes except 0121. But its strange that this company code is too chosen and that too for only one employee. I tried to test with other employees belonging to this company code but they are not chosen.

Actually this program is meant for the job to run Payroll for Semimonthly employees and this employee should not be chosen as the variant is only meant for company codes other than 0121 and this employee belongs to 0121.

Just before the Get pernr statement, in the code while debugging, there are some Badis being called. I did not find anything by checking them too.

Please suggest.

Regards,

Binay.

0 Kudos

see the problem is surely in the data or the selection criteria what u can do is run the program without any variant just put company code 0121 and the employee number which is apperaing and run if this appears then put a check that company code ne 0121 and run if this employee still runs this means that u need to check the employee data.

0 Kudos

Hi,

I gete the data in both the cases. One thing I noticed that if I change the period, I am not getting any data. The program shows data only in that period.

Earlier I was running for the period 08,2008 and I was getting data but now when I ran for period 09,2008 no data is found.

I even checked the table pa0001 but found no such inconsistencies in data for the employee.

I am really stuck in this matter.

Please suggest.

Binay.

0 Kudos

check in the table HRPY_RGDIR for the given period ..

09 2008 ...

0 Kudos

Hi Binay,

Can you please write below the Infty0001 records for that pernr (specifically for this period (01/01/2008 - 12/31/2008)....

Infty0000 records would also be helpful (as you can have p0000-stat2 as inactive for this month)....