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

select query (HR ABAP)

Former Member
0 Likes
1,007

Hi ..

i am writing a driver program for smartform.

I have a field DATEDEM (date of demise)

The condition is that DATEDEM = P0041-DAT01 for P0041-DAR01 .

Please help me how to write the select query to get DATEDEM from infotype 0041.

Here P0041-DAR01 = Date type &

P0041-DAT01 = Date for date type.

Please help.

Thanks & Regards,

Preeti

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
809

hi Preeti,

why do you want to write a select query on infotype ... you can get the data by using macro..

get pernr.

this will get you the data for all the infotypes that you have declared.....and then can select that record based on you condition.

if having some problem please can you make your screnario a bit more clear ....

Regards,

Jayant

hi Preeti,

why do you want to write a select query on infotype ... you can get the data by using macro..

get pernr.

this will get you the data for all the infotypes that you have declared.....and then can select that record based on you condition.

if having some problem please can you make your screnario a bit more clear ....

Regards,

Jayant

4 REPLIES 4
Read only

Former Member
0 Likes
809

can any one help me on this please.

Read only

Former Member
0 Likes
810

hi Preeti,

why do you want to write a select query on infotype ... you can get the data by using macro..

get pernr.

this will get you the data for all the infotypes that you have declared.....and then can select that record based on you condition.

if having some problem please can you make your screnario a bit more clear ....

Regards,

Jayant

Read only

dustyplanet
Active Participant
0 Likes
809

This is a raw form of the query that needs to be used, please note that some more fields may need to be qualified in the where clause if you want a consistent result.

SELECT SINGLE DAT01 from PA0041 INTO (DATEDEM) 
    WHERE PERNR = PPERNR     'Replace with the current PERNR
          AND DAR01 = 'P0'.      'P0 is Date Type for Date of Death

<i>This is just indicative of the logic to be used and does not contain important things like checking the validity of the infotype record etc., which you will need to add according to your needs to the where clause of the query.</i>

Nevertheless, hope this puts you on the right track...

Regards,

Dushyant Shetty

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
809

Hi,

You can use the function module hr_read_infotype to get the data from 41 infotype.

If logical database is used,then use rp_provide_from_last macro.