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

IT 2002 & IT 2003

Former Member
0 Likes
1,233

Hi All,

I am in serious need of help, I am currently working on performance tuning a piece of legacy code, the thing is I have done everything that I can: but the report still runs for like 12hours and counting, it was 14hours. The client is currently using infotypes 2002 aand 2003 to capture actual working times this gets done on a weekly basis, the report is an interface program that reads a text file, then updates the above mentioned infotypes.

The major problem at the moment is that it uses the HR_INFOTYPE_OPERATION function to update the infotypes. This is how I have it now:

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '2003'

number = s_empdata-pernr

validityend = s_empdata-endda

validitybegin = s_empdata-begda

record = s_empdata

operation = 'INS'

dialog_mode = '0'

nocommit = 'X'

IMPORTING

return = return

key = personaldatakey.

Some code here...

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '2002'

number = s_infotype2002-pernr

subtype = '2700'

validityend = s_infotype2002-endda

validitybegin = s_infotype2002-begda

record = s_infotype2002

operation = 'INS'

dialog_mode = '0'

nocommit = 'X'

IMPORTING

return = return

key = personaldatakey.

Is there any other way that I can update these infotypes without using the HR_INFOTYPE_OPERATION function?

Please please help...

Hi All,

I am in serious need of help, I am currently working on performance tuning a piece of legacy code, the thing is I have done everything that I can: but the report still runs for like 12hours and counting, it was 14hours. The client is currently using infotypes 2002 aand 2003 to capture actual working times this gets done on a weekly basis, the report is an interface program that reads a text file, then updates the above mentioned infotypes.

The major problem at the moment is that it uses the HR_INFOTYPE_OPERATION function to update the infotypes. This is how I have it now:

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '2003'

number = s_empdata-pernr

validityend = s_empdata-endda

validitybegin = s_empdata-begda

record = s_empdata

operation = 'INS'

dialog_mode = '0'

nocommit = 'X'

IMPORTING

return = return

key = personaldatakey.

Some code here...

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '2002'

number = s_infotype2002-pernr

subtype = '2700'

validityend = s_infotype2002-endda

validitybegin = s_infotype2002-begda

record = s_infotype2002

operation = 'INS'

dialog_mode = '0'

nocommit = 'X'

IMPORTING

return = return

key = personaldatakey.

Is there any other way that I can update these infotypes without using the HR_INFOTYPE_OPERATION function?

Please please help...

5 REPLIES 5
Read only

MarcinPciak
Active Contributor
0 Likes
1,139

Hi Carlos,

You can feed up infotype tables directly with provided data. Anyhow it is not recommended as you would have to be highly sure about data consistency which is almost impossible. Other way is to create a BDC session without processing it in the program. Instead you can create a session seen in SM35 and later someone can manually run it.

You can also use LSMW for this, especialy when data file is a flat file. Of course if the requirement is doing it with a report you can't do too much on it, except for my first suggestion.

Regards

Marcin

Read only

Former Member
0 Likes
1,139

Is this code in a loop? How many records are being updated at a time?

Rob

Read only

Former Member
0 Likes
1,139

Yes it is inside a loop, and it creates +- 80000 records of either 2002/2003 records.

Read only

0 Likes
1,139

HI,

Use this FM..you can update all the record at once

CALL FUNCTION 'RH_INSERT_INFTY'
      EXPORTING
        fcode               = 'INSE'
        vtask               = 'D' 
        commit_flg          = l_commit_flg
      TABLES
        innnn               = p_innnn
      EXCEPTIONS
        no_authorization    = 1
        error_during_insert = 2
        repid_form_initial  = 3
        corr_exit           = 4
        begda_greater_endda = 5
        OTHERS              = 6.

CALL FUNCTION 'RH_UPDATE_DATABASE'
        EXPORTING
          vtask     = 'D'
        EXCEPTIONS
          corr_exit = 1
          OTHERS    = 2.
      IF sy-subrc = 0.
        COMMIT WORK.
      ENDIF.

Read only

Former Member
0 Likes
1,139

Hi everyone,

I think I found the problem, it was pointed out to me by Mubeen who is also a member of this forum, since I am new to ABAP development I forgot to initialize the buffer every time I updated the infotypes, I implemented this initialization and it cut my run time down by 80 percent, then another guy Shafiq, told me that there are classes that implement the infotypes and this cuts out all the dynamic-ness of the FM HR_INOFOTYPE_OPERATION. Oh yes and as for the classes that implement infotypes they can only be used as from ECC 6.0.

Thanks for all the suggestions.