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: 

HR Report

Former Member
0 Kudos

Hi All,

Am newly learning HR Programing .

Am using 5 version and actually i have written one Report but it is showing some error please anyone can help me out from this ( Always am getting the same error plz......)

ERROR :

PERNR is not defined for the current logical database

Here i given the Report Also

REPORT ZBAR_SELECTION.

*-- Declaration

TABLES: pernr.

INFOTYPES: 0002.

"Personal Data

SELECT-OPTIONS: language FOR p0002-sprsl.

*-- Selection screen

INITIALIZATION.

pnptimed = 'D'.

*-- Processing

GET pernr.

PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda.

CHECK language.

WRITE: / p0002-pernr,

sy-vline,

pernr-ename,

sy-vline,

p0002-sprsl,

sy-vline,

p0002-gbdat.

ENDPROVIDE.

Thanks in Advance.

Sheethal.

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

In the Report attributes, verify if the report is tied to PNPCE & change it to PNP.

~Suresh

14 REPLIES 14

suresh_datti
Active Contributor
0 Kudos

In the Report attributes, verify if the report is tied to PNPCE & change it to PNP.

~Suresh

0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

Former Member
0 Kudos

While creating the program , have you specified the Logical database name

in menu goto>attributes logical database

0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

former_member181962
Active Contributor
0 Kudos

What si the LDB that you are using in your program attributes?

It should be PNP.

Regards,

Ravi

0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

amit_khare
Active Contributor
0 Kudos

Hi,

Please pass PNP in Logical Database tab of Attributes in Report.

Regards,

Amit

Reward all helpful replies.

0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

former_member635028
Active Participant
0 Kudos

Hi,

Check out with this program,

&----


*& Report ZMSV1_HR *

*& *

&----


*& *

*& *

&----


REPORT ZMSV1_HR

line-count 20

line-size 420.

tables: pernr.

infotypes: 0000,

0001,

0002,

0006,

0021.

data: begin of itab occurs 0,

pernr type p0000-pernr,

stat2 type p0000-stat2,

bukrs type p0001-bukrs,

plans type p0001-plans,

stell type p0001-stell,

vorna type p0002-vorna,

nachn type p0002-nachn,

anzkd type p0002-anzkd,

name2 type p0006-name2,

stras type p0006-stras,

ort01 type p0006-ort01,

pstlz type p0006-pstlz,

name21 type p0006-name2,

stras1 type p0006-stras,

ort011 type p0006-ort01,

pstlz1 type p0006-pstlz,

favor type p0021-favor,

fanam type p0021-fanam,

fgbdt type p0021-fgbdt,

end of itab.

start-of-selection.

get pernr.

rp_provide_from_last p0006 '2' pn-begda pn-endda.

if pnp-sw-found = 1.

move p0006-name2 to itab-name2 .

move p0006-stras to itab-stras .

move p0006-ort01 to itab-ort01 .

move p0006-pstlz to itab-pstlz.

endif.

rp_provide_from_frst p0006 '1' pn-begda pn-endda.

if pnp-sw-found = 1.

move p0006-name2 to itab-name21 .

move p0006-stras to itab-stras1 .

move p0006-ort01 to itab-ort011 .

move p0006-pstlz to itab-pstlz1.

endif.

provide * from p0000

  • from p0001

  • from p0002

  • from p0021 between pn-begda and pn-endda

where p0000-stat2 = '2' or

p0000-stat2 = '3' and

p0021-subty = '2'.

move p0000-pernr to itab-pernr.

move p0000-stat2 to itab-stat2.

move p0001-bukrs to itab-bukrs.

move p0001-plans to itab-plans.

move p0001-stell to itab-stell.

move p0002-vorna to itab-vorna.

move p0002-nachn to itab-nachn.

move p0002-anzkd to itab-anzkd.

  • move p0006-name2 to itab-name2.

  • move p0006-stras to itab-stras.

  • move p0006-ort01 to itab-ort01.

  • move p0006-pstlz to itab-pstlz.

*

if p0002-anzkd > 0.

move p0021-favor to itab-favor.

move p0021-fanam to itab-fanam.

move p0021-fgbdt to itab-fgbdt.

endif.

append itab.

clear itab.

endprovide.

*uline.

end-of-selection.

write:/1(420) sy-uline.

write:/1 sy-vline, 'pernr',

20 sy-vline, 'stat2',

40 sy-vline, 'bukrs',

60 sy-vline, 'plans',

80 sy-vline, 'stell',

100 sy-vline, 'vorna',

120 sy-vline, 'nachn',

140 sy-vline, 'anzkd',

160 sy-vline, 'name2',

180 sy-vline, 'stras',

200 sy-vline, 'ort01',

220 sy-vline, 'pstlz',

240 sy-vline, 'favor',

250 sy-vline, 'fanam',

285 sy-vline, 'fgbdt',

310 sy-vline, 'name21',

350 sy-vline, 'stras1',

370 sy-vline, 'ort011',

400 sy-vline, 'pstlz1',

420 sy-vline.

write:/1(420) sy-uline.

loop at itab.

  • write:/300 sy-uline.

*

  • uline.

write:/1 sy-vline, itab-pernr color 1,

20 sy-vline, itab-stat2 color 1,

40 sy-vline, itab-bukrs color 3,

60 sy-vline, itab-plans color 3,

80 sy-vline, itab-stell color 3,

100 sy-vline, itab-vorna color 4,

120 sy-vline, itab-nachn color 4,

140 sy-vline, itab-anzkd color 4,

160 sy-vline, itab-name2 color 5,

180 sy-vline, itab-stras color 5,

200 sy-vline, itab-ort01 color 5,

220 sy-vline, itab-pstlz color 5,

240 sy-vline, itab-favor color 6,

250 sy-vline, itab-fanam color 6,

285 sy-vline, itab-fgbdt color 6,

310 sy-vline, itab-name21 color 7,

350 sy-vline, itab-stras1 color 7,

370 sy-vline, itab-ort011 color 7,

400 sy-vline, itab-pstlz1 color 7,

420 sy-vline.

*

  • else.

  • write:/ 'The employee has no children'.

  • write:/ itab-pernr,

  • / itab-stat2,

  • / itab-bukrs,

  • / itab-plans,

  • / itab-stell,

  • / itab-vorna,

  • / itab-nachn,

  • / itab-anzkd,

  • / itab-name2,

  • / itab-stras,

  • / itab-ort01,

  • / itab-pstlz.

*

  • endif.

*uline.

endloop.

write:/1(420) sy-uline.

Regards,

Sreevani

0 Kudos

Hi ,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal

Former Member
0 Kudos

Hi,

PERNR is a structure, it's not a Table. So u shouldn't use

Tables: pernr.

Comment it & see.

If helps awrd points.

Thanks.

messier31
Active Contributor
0 Kudos

Hi Sheethal,

Code looks absolutely fine and there is no error. can u re-test this. hope ypu assigned PNP logical database attribute of program.

Let us know ur findings.

Enjoy SAP.

Pankaj Singh

Former Member
0 Kudos

Hi Sir,

Thanks A lot i given the points to u.

have a nice time.

Regards,

Sheethal