‎2007 Feb 26 9:31 AM
I need to select all the active employee where stat2 = 3 in ifotype 0000, can you please check is correct.
PROVIDE * FROM p0000
ename from p0001
BETWEEN pn-begda AND pn-endda
where p0000-stat2 = '3'. .
Write: / p0001-ename,
endif.
ENDPROVIDE.
‎2007 Feb 26 9:41 AM
Thats right...
perform get_infotype tables p0000
using pernr-pernr
'0000'
dt_current
dt_current.
read table p0000 index 1.
if p0000-stat2 ne '3'.
inactemp = 'X'.
it_qtocre-message = 'Info: Inactive Employee'.
endif.
Rgds,
Jothi.P
‎2007 Feb 26 9:41 AM
Thats right...
perform get_infotype tables p0000
using pernr-pernr
'0000'
dt_current
dt_current.
read table p0000 index 1.
if p0000-stat2 ne '3'.
inactemp = 'X'.
it_qtocre-message = 'Info: Inactive Employee'.
endif.
Rgds,
Jothi.P
‎2007 Feb 26 9:43 AM
Hi,
REPORT HRREP.
TABLES: PERNR.
INFOTYPES: 000, 0001.
GET PERNR.
PROVIDE * FROM P0000
FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA
where p0000-stat2 = '3'..
Write: / p0001-ename.
ENDPROVIDE.
Regards,
Anji
‎2007 Feb 26 9:55 AM
when I use GET PERNR. event and try to run the report I get this as an output
" Don't use GET PERNR event ".
‎2007 Feb 26 10:17 AM
If u use LDB the u can Use GET statements, otherwise u cant use GET.
‎2007 Feb 26 9:43 AM
Refer this sample code
Example
The entries in the table SE, PR and SH contain time ranges and are filled as follows:
DATA: BEGIN OF SE OCCURS 3,
FROM TYPE D,
TO TYPE D,
NAME(15) TYPE C,
AGE TYPE I,
END OF SE,
BEGIN OF PR OCCURS 4,
START TYPE D,
END TYPE D,
PRICE TYPE I,
NAME(10) TYPE C,
END OF PR,
BEGIN OF SH OCCURS 2,
CLOSED TYPE D,
STR(20) TYPE C,
OPENED TYPE D,
END OF SH VALID BETWEEN OPENED AND CLOSED,
BEGIN TYPE D VALUE '19910701',
END TYPE D VALUE '19921001'.
SE-FROM = '19910801'. SE-TO = '19910930'.
SE-NAME = 'Shorty'. SE-AGE = 19. APPEND SE.
SE-FROM = '19911005'. SE-TO = '19920315'.
SE-NAME = 'Snowman'. SE-AGE = 35. APPEND SE.
SE-FROM = '19920318'. SE-TO = '19921231'.
SE-NAME = 'Tom'. SE-AGE = 25. APPEND SE.
PR-START = '19910901'. PR-END = '19911130'.
PR-NAME = 'Car'. PR-PRICE = 30000. APPEND PR.
PR-START = '19911201'. PR-END = '19920315'.
PR-NAME = 'Wood'. PR-PRICE = 10. APPEND PR.
PR-START = '19920318'. PR-END = '19920801'.
PR-NAME = 'TV'. PR-PRICE = 1000. APPEND PR.
PR-START = '19920802'. PR-END = '19921031'.
PR-NAME = 'Medal'. PR-PRICE = 5000. APPEND PR.
SH-CLOSED = '19920315'. SH-STR = 'Gold Avenue'.
SH-OPENED = '19910801'. APPEND SH.
SH-CLOSED = '19921031'. SH-STR = 'Wall Street'.
SH-OPENED = '19920318'. APPEND SH.
PROVIDE NAME AGE FROM SE
NAME FROM PR
* FROM SH
BETWEEN BEGIN AND END.
...
ENDPROVIDE.
‎2007 Feb 26 11:30 AM
Check the following fragment of the code:
Write: / p0001-ename,
endif.Have you defined variable <b>endif</b>?
Put dates pn-begda = pn-endda when executing your report. Otherwise you may find one employee multiple times on your list. This is because they may have more than one record of infotype 0000 in the period from pn-begda to pn-endda when they are active (p0000-stat2=3).
Regards,
Renata