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

Replace a query with a function module

Former Member
0 Likes
520

Hi Genius;

Please let me know how to replace a statement in HR abap as shown below

select single plans into lv_plans from pa0001 where

pernr = obj_tab-objid and

begda <= sy-datum and

endda >= sy-datum.

with a function module.

I will rewrds good points, please respond.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
451

data : itab like table lines of pa0001 .

call function module HR_READ_INFOTYPE,

give

import parameters

pernr ,

begda ,

endda , infotype as 0001, etc .

output will in table format , so

give here in infty_tab = itab .

so that the itab will consist of all fields data from the infotype 0001 you can use your data from the itab.

Regards,

Girish

3 REPLIES 3
Read only

Former Member
0 Likes
451

Hi Rahul,

HR_READ_INFOTYPE suits your requirement.

Regards,

Younus.

Reward Helpful Answers!!!!!

Read only

Former Member
0 Likes
452

data : itab like table lines of pa0001 .

call function module HR_READ_INFOTYPE,

give

import parameters

pernr ,

begda ,

endda , infotype as 0001, etc .

output will in table format , so

give here in infty_tab = itab .

so that the itab will consist of all fields data from the infotype 0001 you can use your data from the itab.

Regards,

Girish

Read only

Former Member
0 Likes
451

Hi Rahul

Goto function builder and call function module HR_READ_INFOTYPE,

which has,

report name =' '

import parameters

fieldname = ' '

begin date = ' '

end date = ' '.

execute the query,it wil surely help you out.

REWARD IT PLEASE...!!