‎2007 Mar 28 8:51 AM
Hallow experts,
I use pnpce and the runtime of program is to much
Here Is my code what I doing wrong and if I can something to improve time because is to much
regards
START-OF-SELECTION.
GET peras.
PERFORM get_new_data.
END-OF-SELECTION.
wa_person_tab-pernr = pernr-pernr.
rp_provide_from_last t_0001 ' ' sy-datum sy-datum. "pa0001
pn-begda pn-endda.
wa_person_tab-stell = t_0001-stell.
wa_person_tab-werks = t_0001-werks.
wa_person_tab-persg = t_0001-persg.
wa_person_tab-persk = t_0001-persk.
wa_person_tab-orgeh = t_0001-orgeh.
rp_provide_from_last t_0002 ' ' sy-datum sy-datum. "pa0002
wa_person_tab-lastname = t_0002-nachn.
wa_person_tab-firstname = t_0002-vorna.
wa_person_tab-perid = t_0002-perid.
rp_provide_from_last t_0315 ' ' sy-datum sy-datum. "pa0315
wa_person_tab-lifnr = t_0315-lifnr.
wa_person_tab-kostl = t_0315-kostl.
wa_person_tab-yytariff_code = t_0315-yytariff_code.
wa_person_tab-yytariff_total = t_0315-yytariff_total.
wa_person_tab-yywaers = t_0315-yywaers.
APPEND wa_person_tab TO person_tab.
CLEAR wa_person_tab.
IF person_tab[] IS NOT INITIAL.
SELECT pernr stdaz begda plans " Employee Numbers & Hours
FROM pa2010
INTO (wa_person_tab-pernr, wa_person_tab-stdaz,
wa_person_tab-begda, wa_person_tab-orgeh)
FOR ALL ENTRIES IN person_tab
WHERE pernr = person_tab-pernr
AND lgart = '9EXT' " Wage Type (salary)
AND begda GE pn-begda
AND begda LE pn-endda
GROUP BY pernr stdaz begda plans.
IF sy-subrc = 0.
APPEND wa_person_tab TO person_tab.
CLEAR wa_person_tab.
ENDIF.
ENDSELECT.
ELSE.
MESSAGE i023.
EXIT.
ENDIF.
‎2007 Mar 28 10:14 AM
‎2007 Mar 28 9:43 AM
Hi
1.as the select doesnt hv all the keys in the where condition, try to create an index with the keys mentioned in ur where clause.
2.Avoid the Select-endselect.
3.delete the duplicate entries comparing perner from the internal table person_tab
4.Avoid Group by caluse in ur select statement
regards,
madhumitha
‎2007 Mar 28 9:51 AM
Hi Antonio,
I think first you process the data with in the Get pernr loop and after that
collect your data to person_tab. After end-of-selection you write select for
Infty 2010 for all the pernrs. Dont use select and end select use for all entries
in table.
Hope this will save some time.
Thanks & regards,
Siri.
‎2007 Mar 28 9:52 AM
Why r u using select end select.
SELECT pernr stdaz begda plans " Employee Numbers & Hours
FROM pa2010
INTO table person_tab
FOR ALL ENTRIES IN person_tab
WHERE pernr = person_tab-pernr
AND lgart = '9EXT' " Wage Type (salary)
AND begda GE pn-begda
AND begda LE pn-endda
GROUP BY pernr stdaz begda plans
appending lines of person_tab.
Coding between select and endselect puts a lot of load on DB.
Inthis way, ur select query doest not overwrite the contents of person_tab but appends it.
‎2007 Mar 28 10:14 AM
‎2007 Mar 28 10:36 AM
‎2007 Mar 28 10:54 AM
hi santosh
maybe u now how i can add <b>where</b> to
rp_provide_from_last t_0001 ' ' sy-datum sy-datum.
like where persg <> 6.
regards
‎2007 Mar 28 11:04 AM
hi ,
You cannot give where condition to that
refer
http://help.sap.com/saphelp_45b/helpdata/en/60/d8bc17576311d189270000e8322f96/content.htm
Regards,
Santosh
Message was edited by:
Santosh Kumar Patha
‎2007 Mar 28 11:07 AM
hi
you cannot write where condition here. to restrict entries do it in the loop provide-endprovide .
regards,
madhu