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

check please.

Former Member
0 Likes
949

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
921

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

6 REPLIES 6
Read only

Former Member
0 Likes
922

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

Read only

Former Member
0 Likes
921

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

Read only

0 Likes
921

when I use GET PERNR. event and try to run the report I get this as an output

" Don't use GET PERNR event ".

Read only

0 Likes
921

If u use LDB the u can Use GET statements, otherwise u cant use GET.

Read only

Former Member
0 Likes
921

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. 

Read only

Former Member
0 Likes
921

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