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

Accessing Infotype data in dialog program

Former Member
0 Likes
473

Hi All

In Dialog programs attributes I didn't see any logical database field. How can I access Infotype data into dialog program without specifying the Logical database(i.e. PNP).

Thanks,

Vivek.

2 REPLIES 2
Read only

Former Member
0 Likes
428

Can we access PA0001 PA0002 using normal SQL statements?

Lat me try and get back for more help.

Thanks

Vivek.

Read only

0 Likes
428

Hi Vivek, <li>You can access HR infotype tables data without LDB mentioned in Program attributes or in module or dialog program. <li>Method - 1

DATA  it_p0001 LIKE p0001 OCCURS 100 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        tclas     = 'A'        " Master Data and Time Data
        pernr     = '00001001' " Employee Number
        infty     = '0001'     " Infotype number
        begda     = '18000101' " It gets all the records existed for employee in the table PA0001
        endda     = '99991231' " It gets all the records existed for employee in the table PA0001
      TABLES
        infty_tab = it_p0001.
    "Loop your internal table and get the required information
<li>Method - 2

    INFOTYPES:0001.
    INCLUDE dbpnpmac.
    rp_read_infotype '00001001' '0001' p0001 '18000101' '99991231'.
    "Loop your internal table and get the required information

    " rp_read_infotype a b c d e.
    "----------------------------
    " a        Requested Personalnumber
    " b        Requested Infotypnumber
    " c        Output Table Like PNNNN
    " d        Requested Interval-Begin
    " e        Requested Interval-End
<li>Method - 3
DATA  it_p0001 LIKE p0001 OCCURS 100 WITH HEADER LINE.
    SELECT *
      FROM pa0001
      INTO TABLE it_p0001
     WHERE  pernr = '00001001'
      AND   begda GE s_date-low  "date given on selection-screen
      AND   endda LE s_date-high."date given on selection-screen
    "Loop your internal table and get the required information
I hope that it helps you. Thanks Venkat.O