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

runtime problem in pnpce

Former Member
0 Likes
812

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

hi

the rp_provide use is o.k.?

regards

8 REPLIES 8
Read only

Former Member
0 Likes
778

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

Read only

Former Member
0 Likes
778

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.

Read only

Former Member
0 Likes
778

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.

Read only

Former Member
0 Likes
780

hi

the rp_provide use is o.k.?

regards

Read only

0 Likes
778

hi,

That is okie ...

Regards,

santosh

Read only

0 Likes
778

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

Read only

0 Likes
778

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

Read only

0 Likes
778

hi

you cannot write where condition here. to restrict entries do it in the loop provide-endprovide .

regards,

madhu