07-09-2008 6:15 AM
Hi,
In HR ABAP , How many ways to fetch the data.
ex: select, Provide endprovide
In which scenario select and provide to be used.
Thanks
07-09-2008 11:29 AM
Hi,
We can fetch data both by Select and Provide statement. If you are using logical DB then after get event you can process the data using PROVIDE-ENDPROVIDE block. The main difference is without using LDB you can not use PROVIDE-ENDPROVIDE but with LDB you can use both PROVIDE-ENDPROVIDE and SELECT statement. Inside provide and end provide the data in Pnnnn is processed as a loop statement for internal table.
Regards,
Chandu
07-09-2008 11:32 AM
Hi
We use SELECT statements very rarely in HR ABAP programs either we LDB's or by using macros we read the data from the DB when we talk about macros we have so many and one of them is PROVIDE....ENDPROVIDE
we can use this macro
E;g
GET pernr
PROVIDE
END PROVIDE
Further Reference
http://help.sap.com/saphelp_45b/helpdata/en/8c/38e0343734cf72e10000009b38f83b/frameset.htm
Regards
pavan
07-09-2008 11:33 AM
U can also get data from FM ..
HR_READ_INFOTYPE ...
If UR using LDB's no need to fetch data .. Its enough if U
declare infotypes : ... data will be filled in the GET PERNR
event ..
07-09-2008 11:42 AM
Hi Asha.
The most vital role is played in HR ABAP by the Logical Databases, Macros and Clusters.
Provide and Endprovide acts a loop statement which we give in Normal cases of displaying records.
But, In case of LDB's We can also use IF statement in the provide and endprovide statement.
Get statement indicates use of LDBs and it is usefull in replacing the SELECT query.
Sample Code:
start-of-selection.
get pernr.
provide *
from p0000
between pn-begda
and pn-endda.
if p0000-valid = 'X'.
write:/5 p0000-pernr,
p0000-subty,
p0000-objps,
p0000-begda.
endif.
endprovide.
end-of-selection
Good Luck.
Harsh
Edited by: Harsh Dave on Jul 9, 2008 4:13 PM
07-09-2008 11:51 AM
Hi Asha,
If you are going with LDB you go for
GET pernr
provide
....
endprovide.
else also u can make use of FM like
hr_read_infotype in PA
rh_read_infty_1000 in OM
rh_read_infty_1001 in OM
and also Select statemnt if required.
Regards,
Pritam.
07-09-2008 11:58 AM
Hi Asha,
In abap Hr we can retrieve data using
Select,
macros
Function Modules
Provide -- endprovide
In ABAP HR we generally go with LDB's and we go with reading data using macros and provide and endprovide
if you are not using LDB's you can go with select and Function modules... (Preferably Function Modules)
regards
padma
07-09-2008 11:59 AM
Hi Asha,
We can use both the statements SELECT and PROVIDE-ENDPROVIDE in HR ABAP.
But generally we use only Provide-Endprovide.
When the amount of data to be fetched is less we go for Select else we go for Provide - endprovide.
But using Select does not check for the autorizations and it directly fetches the data. So, we generally do not use Select. Instead we go for PROVIDE-ENDPROVIDE in HR ABAP.
Hope this helps you.
Regards,
Chandra Sekhar
07-31-2008 4:29 PM