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: 

Behavior of GET PERNR based on Selection

former_member202818
Active Contributor
0 Kudos

In selection screen i have input company code as 4000, but GET PERNR gave me PERNRs not only belongs to the company code 4000.

What is the exact behavior of PNP Logical data base.

pls help..

15 REPLIES 15

former_member187748
Active Contributor
0 Kudos

Hi Sreekanth,

please paste your query , you have written to get PERNR values.

0 Kudos

hi Sanjeev,

thanks for ur reply.


GET pernr.


   CHECK p0002-natio IN so_natio.                 "Check For Nationality

   PERFORM getdata.                                   "Collecting data into final IT


END-OF-SELECTION.


Plz help,,

0 Kudos

Hi Shreekanth,

p0002 is not a table its an structure, so how you are matching it with your selection screen fields


Please use PA0002 instead to p0002




0 Kudos

hi Sanjeev,

Ya it is a structure and y can't i do so..

and my question is not that..

Plz refer the attachment.


input..

Output

0 Kudos

Hi Sreekanth,

first check your entries, you are fetching data from, are they correct mentioned.

If yes, please check your code.

gouravkumar64
Active Contributor
0 Kudos

Hi Sreekanth,

Check in your program BUKRS -company code field selection & 4000 value working properly or not.

If you are using ABAP HR programming you have to go with GET PERNR with that P* structure only.

There is not field BUKRS in P0002 also.

but there is field BUKRS in P0001 .

So check all structure.

Check your code with filter part.

Thanks

Gourav.

0 Kudos

Hi kumar,

Thanks for reply.

Actually my code is,

I input compny code as 4000. but why GET PERNR loops for other company codes(4500,3000).

plz refr above post.

And what is the use of PNP selection screen?

pls help.. reply pls

former_member199214
Participant
0 Kudos

Hi Sreekanth,

    

GET PERNR:

This event is executed for all personnel numbers that were selected on the basis of selection screen entries .

Data is retrieved at the GET PERNR time point.

fills the internal tables of infotypes that are declared for each employee using the INFOTYPES statement.

Kindly try this,

Report XXXXXX.

Data declaration

START_OF_SELECTION.

GET PERNR.

retrieve the data from internal tables to output internal tables

END_OF_SELECTION.

Display the data retrieved above.

From GET PERNR to  END_OF_SELECTION ; it will loop with the employee numbers selected from the selection screen.

And one more thing what's the period ur providing?

Regards,

Sindhuja

0 Kudos

hi Sindhuja,

i m new in HR ABAP.

I havn't provide any period.

My code is ...

Selection Screen input...

My output...

How it happends?

plz explain me..

0 Kudos

Hi,

In my system am getting correctly,

According to me it might be because of the Nationality selection

Check the following.

REPORT ZVC_PROGRM035.

TABLES:     PERNR,PA0002.

INFOTYPES: 0000,0001,0002.

SELECT-OPTIONS: SO_NATIO FOR PA0002-NATIO NO INTERVALS.

START-OF-SELECTION.

GET PERNR.

*CHECK p0002-natio IN so_natio.

  IF P0002-NATIO IN SO_NATIO.

    WRITE : / PERNR-PERNR , PERNR-BUKRS.

  ENDIF.

END-OF-SELECTION.

Regards,

Sindhuja.

subbu4sap
Explorer
0 Kudos

Hi Sreekanth,

Logical database PNP uses default selection screen. In this selection screen if we give any PERNR's , GET PERNR event will fetch the corresponding PERNR's details otherwise it will fetch all the employee details which are existing in the system.

The other selection screen details will just act as parameter/selection-option entries only( as like selection screeen entries we define normally in standard ABAP programs ) .

Try to Debug the program at your check condition  , it will help you to understand the flow of LDB & ABAP HR programming.

Hope this helps.

Thanks & Regards,

Subbu

Former Member
0 Kudos

Hello Sreejanth,

Check choise the period as actual.

0 Kudos

hi all...

thanks i got it..

I think this is why GET PERNR Consider the PERNR 70125 & other 2.

0 Kudos

Hi,

If you need the last entry, you need to use rp_provide_from_last after get pernr.

RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.

0 Kudos

Hi i have already told you to check your data for consistency