06-05-2009 5:32 PM
Hello !
I got a question about optimizing data fetching from LDB.
Nowdays i do something like :
INFOTYPES: 0657.
GET pernr.
LOOP AT P0657 WHERE somefield IN criteria.
"do stuff here
ENDLOOP.
Problem with this approach is Preformance - i only want to process records that have IT0657 entry - but since no select options are given on screen GET pernr fetches every personal number - is there any way to restrict that ?
i know i could do SELECT to db and then insert its results as LDB params to loop only on the relevant records - problem with that is that my Selection Options regarding PERNR in LDB get lost that way - is there something more accurate ?
06-05-2009 11:32 PM
Thanks.
My task is actually to create report of reciepts for a given agreements and i use PN-BEGDA and PN-ENDDA to filter on a infotype level - i need to clarify whenever has to be active whenever the reciept is payed off (actually i use PAYMN field so its a payment date) .
and last question - why do you query PA0657 table ? i tought P0657 is LDB and PA0657 is physical - do I miss something ?
06-05-2009 9:52 PM
Hi Jacek,
Some tips which can improve performance a litte bit here:
1) define infotype table like this:
INFOTYPES: 0657 MODE N.
It will not fill the table with data once GET pernr event is raised. Instead you can write a query checking if relevant record for EE exists and transport it only when condition fulfilled.
2) transport only certain fields in GET pernr event
GET PERNR fields PERNR. "list fields of LDB which you are interested in
Anyhow, for skipping EE fetch I am afraid you will have to use standard funtionalities..
Regards
Marcin
06-05-2009 9:57 PM
Can you please give some example of such query - it's my 1st approach to LDBs and i dont know how to deal with it exactly. Can P0657 be queried with OpenSQL as usual ?
i guess with mode N the only diffrence between LDB and physical DB is that LDB results are filtered by provided selection screen ?
Does declaring mode N override the selections somehow ?
Does PNP have any other nodes than PERNR ? how do i know what nodes i can use ?
Edited by: Jacek Zebrowski on Jun 5, 2009 10:57 PM
06-05-2009 10:35 PM
Can P0657 be queried with OpenSQL as usual ?
Yes.
i guess with mode N the only diffrence between LDB and physical DB is that LDB results are filtered by provided selection screen ?
Correct
Does PNP have any other nodes than PERNR ? how do i know what nodes i can use ?
Go to SE36-> type in PNP -> here you have all nodes available in PNP -> select PERNR and choose table icon
or
Go to SE11-> structure PERNR
All these fields are transported during GET PERNR event, so always try to restrict them to those which you really need
Can you please give some example of such query - it's my 1st approach to LDBs and i dont know how to deal with it exactly.
SELECT-OPTIONS so FOR field.
INFOTYPES: 0657 mode n. "table empty at GET pernr event.
...
GET PERNR FIELDS pernr ....
SELECT field field2 field3 FROM PA0657 into corresponding fields of table PA0657
where pernr = pernr-pernr
and field in so.
if sy-dbcnt = 0.
"entry exists
else.
"no entry
REJECT. "reject EE and proceed to next node -> here next PERNR
endif.
This could help a litte bit with performamance but I think the best would be filtering at LDB level, so using select options for payrol area, company code, org unit, cost center etc (all Emoplyees processing should really never been performed, because it is time intensive) . Also giving dates PNPBEGDS and PNPENDDS restricts picking EEs to those who are at least one day active (PA0000-stat2 = 3) within this date range. On the other hand, PNPBEGDA and PNPENDDA only restrict fetching infotype table, so here it is of no relevance as we instructed it not to do it (mode N).
Regards
Marcin
11-18-2009 6:51 AM
Hi,
this is srinivas , i am new to HR ABAP, i have doubt in GET PERNR? i dont want to mention PNP LDB in se38 ->attribute, LDB screen is cmg while executing, im going generate flat text file. i want to pass 15 infotypes (physical DB) thru get pernr and by using HR_READ_INFOTYPE i will get the data? is it possible? Pl any one give ur valuable input.
Thanks in advance.
Srinivasan.r
06-05-2009 11:32 PM
Thanks.
My task is actually to create report of reciepts for a given agreements and i use PN-BEGDA and PN-ENDDA to filter on a infotype level - i need to clarify whenever has to be active whenever the reciept is payed off (actually i use PAYMN field so its a payment date) .
and last question - why do you query PA0657 table ? i tought P0657 is LDB and PA0657 is physical - do I miss something ?
06-06-2009 6:06 AM
why do you query PA0657 table ? i tought P0657 is LDB and PA0657 is physical - do I miss something ?
Well When using the Logical database we really do not explicitly query the Infotype tables.
Logical databse driver program does it for us in optimized way.
You just need to use the PNP logical databse in Report attributes then it automatically takes
the Selection screen to your program.
You define INFOTYPES: 0001 , 0002 and so on.
And when GET PERNR occurs all the infotypes defined with INFOTYPES statement will get
populated according to your selection criteria.
Hope this clarifies.
06-06-2009 9:35 AM
and last question - why do you query PA0657 table ? i tought P0657 is LDB and PA0657 is physical - do I miss something ?
Sorry in query destination table should be P0657. But here, you are right. PA0657 is phisycal DB table, whereas P0657 is defined by means of INFOTYPE statement and is used for LDB purpose. Still you can use it, however, for your internal queries like in the one given above.
Please don't forget to close the thread once resolved.
Regards
Marcin
06-06-2009 6:14 PM
11-18-2009 6:45 AM
Hi,
this is srinivas , i am new to HR ABAP, i have doubt in GET PERNR? i dont want to mention PNP LDB in se38 ->attribute, LDB screen is cmg while executing, im going generate flat text file. i want to pass 15 infotypes (physical DB) thru get pernr and by using HR_READ_INFOTYPE i will get the data? is it possible? Pl any one give ur valuable input.
Thanks in advance.
Srinivasan.r
11-18-2009 6:45 AM
Hi,
this is srinivas , i am new to HR ABAP, i have doubt in GET PERNR? i dont want to mention PNP LDB in se38 ->attribute, LDB screen is cmg while executing, im going generate flat text file. i want to pass 15 infotypes (physical DB) thru get pernr and by using HR_READ_INFOTYPE i will get the data? is it possible? Pl any one give ur valuable input.
Thanks in advance.
Srinivasan.r
11-18-2009 6:45 AM
Hi,
this is srinivas , i am new to HR ABAP, i have doubt in GET PERNR? i dont want to mention PNP LDB in se38 ->attribute, LDB screen is cmg while executing, im going generate flat text file. i want to pass 15 infotypes (physical DB) thru get pernr and by using HR_READ_INFOTYPE i will get the data? is it possible? Pl any one give ur valuable input.
Thanks in advance.
Srinivasan.r
11-18-2009 9:39 PM
If the report is ONLY for those people with the Infotype you specify you can edit your selection. Before you execute your GET PERNR statement do a select of all PERNRS with PA0657 qualified however you need to and put those PERNR numbers into PNPPERNR. This way when it does the GET PERNR statment it will be using these PERNR numbers only.
11-26-2009 6:18 AM
Thanks Yaar... I have an query , PROVIDE .. ENDPROVIDE IS now OBSOLETE , which one alternate for this provide..endprovide. and in HR_READ_INFOTYPE FM i want to pass pernr range values like pnpperner-low - pnppernr-high. is it possible..
thanks & regards,
Srinivas.r