HR Abap - Using select query

Hello expert,

I've tried provide statement and macro both work fine. Now i want to do a select statement using bedga and endda entered on screen.

"getting all employee personal number & normal hours employee only

   SELECT pernr

     FROM pa0007

     INTO TABLE gt_007

     WHERE begda <= p_begda AND endda > p_endda.


Is this the right way? Because here we are dealing with with period interval not just comparing date, please let me know if this is correct

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 18, 2014 at 07:28 AM

    Hi hassim,

                     Your code is correct if your are not using LDB, Just a little change for endda

    SELECT pernr

         FROM pa0007

         INTO TABLE gt_007

         WHERE begda <= p_begda AND endda >= p_endda.


    cheers

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 18, 2014 at 07:02 AM

    Hi,

    try with:


    DATA: GT_007 LIKE PA0007 OCCURS 0 WITH HEADER LINE.


    SELECT * FROM PA0007 INTO TABLE GT_007

         WHERE ( PERNR = PERNR-PERNR AND BEGDA <=  PN-BEGDA

                        AND   ENDDA >=  PN-ENDDA.

    Add comment
    10|10000 characters needed characters exceeded

    • @Hassim,

      select PNP in Logical database on attributes of screen,

      and put:

      DATA: GT_007 LIKE PA0007 OCCURS 0 WITH HEADER LINE.

      SELECT PERNR

            FROM PA0007

            INTO TABLE GT_007

            WHERE BEGDA <= PN-BEGDA AND ENDDA >= PN-ENDDA.


      A+

  • Sep 19, 2014 at 08:35 AM

    Hi Hassim,

    Did you manage to resolve the issue? If so please post the code here so that others can also learn. Thank u.

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content