cancel
Showing results for 
Search instead for 
Did you mean: 

Update Infotype 1001

Former Member
0 Kudos

hi all,

I have to update the SLAS of the object ID. I am using Fm " RH_UPDATE_INFty". but it is not updating the SCLAS

Code is given below

REPORT ZTEST_RH_UPDATE_INFTY.

DATA:

lt_relation TYPE TABLE OF p1001,

ls_relation TYPE p1001.

ls_relation-mandt = sy-mandt.

ls_relation-plvar = '01'.

ls_relation-otype = 'E'.

ls_relation-objid = '30000031'.

ls_relation-infty = '1001'.

ls_relation-istat = '1'.

ls_relation-rsign = 'A'.

ls_relation-relat = '025'.

ls_relation-begda = '20090709'.

ls_relation-endda = '20090711'.

ls_relation-sclas = 'P'.

ls_relation-sobid = '00123749'.

APPEND ls_relation TO lt_relation.

CALL FUNCTION 'RH_UPDATE_INFTY'

EXPORTING

vtask = 'S'

  • ORDER_FLG = 'X'

  • COMMIT_FLG = 'X'

  • AUTHY = 'X'

  • PPPAR_IMP =

  • OLD_TABNR_NEW_LANGU = ' '

  • REPID = ' '

  • FORM = ' '

  • KEEP_LUPD =

  • WORKF_ACTV = 'X'

tables

innnn = lt_relation

  • ILFCODE =

EXCEPTIONS

ERROR_DURING_UPDATE = 1

NO_AUTHORIZATION = 2

REPID_FORM_INITIAL = 3

CORR_EXIT = 4

OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

please help .

thanks

Sachin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Before RH_UPDATE_INFTY, call function RH_PM_ENQUEUE, after RH_UPDATE_INFTY, call function RH_PM_DEQUEUE.

Regards,

Dilek

Former Member
0 Kudos

hi Dilek,

thanks for ur reply.

I have added both FM but its not updating yet.

below is my code.

REPORT ZTEST_RH_UPDATE_INFTY.

DATA:

lt_relation TYPE TABLE OF p1001,

ls_relation TYPE p1001.

ls_relation-mandt = sy-mandt.

ls_relation-plvar = '01'.

ls_relation-otype = 'E'.

ls_relation-objid = '30000031'.

ls_relation-infty = '1001'.

ls_relation-istat = '1'.

ls_relation-rsign = 'A'.

ls_relation-relat = '025'.

ls_relation-begda = '20090709'.

ls_relation-endda = '20090711'.

ls_relation-sclas = 'P'.

ls_relation-sobid = '00123749'.

APPEND ls_relation TO lt_relation.

CALL FUNCTION 'RH_PM_ENQUEUE'

EXPORTING

act_plvar = '01'

act_otype = 'E'

act_objid = '30000031'

  • ERROR_TYPE = 'I'

  • EXCEPTIONS

  • ERROR_IN_ENQUEUE = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'RH_UPDATE_INFTY'

EXPORTING

vtask = 'S'

  • ORDER_FLG = 'X'

  • COMMIT_FLG = 'X'

  • AUTHY = 'X'

  • PPPAR_IMP =

  • OLD_TABNR_NEW_LANGU = ' '

  • REPID = ' '

  • FORM = ' '

  • KEEP_LUPD =

  • WORKF_ACTV = 'X'

tables

innnn = lt_relation

  • ILFCODE =

EXCEPTIONS

ERROR_DURING_UPDATE = 1

NO_AUTHORIZATION = 2

REPID_FORM_INITIAL = 3

CORR_EXIT = 4

OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'RH_PM_DEQUEUE'

EXPORTING

act_plvar = '01'

act_otype = 'E'

act_objid = '30000031'.

why this code is not updating SCLAS.

please help

thanks

Sachin

Former Member
0 Kudos

Try:

IF SY-SUBRC = 0.

CALL FUNCTION 'RH_UPDATE_DATABASE'

ENDIF.

Edited by: Dilek Ersoz Adak on Nov 24, 2009 8:52 AM

Former Member
0 Kudos

Hi Dilek,

Actually I am getting sy-subrc ne 0 out of this FM. SO what might be the reason for the same. Please help..

Thanks,

Sachin

Former Member
0 Kudos

Make sure that in HRP1001 there is an entry with the following fields - check via SE16-:

ls_relation-mandt = sy-mandt.

ls_relation-plvar = '01'.

ls_relation-otype = 'E'.

ls_relation-objid = '30000031'.

ls_relation-istat = '1'.

ls_relation-rsign = 'A'.

ls_relation-relat = '025'.

ls_relation-begda = '20090709'.

ls_relation-endda = '20090711'.

Actually if I were you, I would first select from HRP1001 into corresponding fields of ls_relation for the above key fields.

Then I would change the sclas field (in LOOP AT ls_relation ... ENDLOOP iteration )

Finally, please try to change vtask to 'B'

Hope this helps,

Dilek

Edited by: Dilek Ersoz Adak on Nov 24, 2009 12:33 PM

Former Member
0 Kudos

hi Dilek,

I hav checked the enteries. all the nteries are there in HRP1001.

what would be the problem?

thanks

Sachin

Former Member
0 Kudos

Actually if I were you, I would first select from HRP1001 into corresponding fields of ls_relation for the above key fields.

Then I would change the sclas field (in LOOP AT ls_relation ... ENDLOOP iteration )

Finally, please try to change vtask to 'B'

Dilek

Former Member
0 Kudos

hi all,

i am not able to update hrp1001. i have tried evythg but i donno whats the problem... now one exceprion is coming " ERROR DURING UPDATE"

Please give me sugestions how i ll update the table hrp1001.

i want to update SCLAS.

plz help

thanks

Sachin

Former Member
0 Kudos

Sachin,

If you are gonna change only one entry;

Goto SE16N - Table HRP1001 - enter your conditions.

In command field write &sap_edit.

Press enter.

Execute.

Select the entry, change accordingly and change.

Regards,

Dilek

Former Member
0 Kudos

dilek,

thanks for ur reply again.

i want to update lot of records.. Can u provide sample code or anythg so that i can update SCLAS in hrp1001

thanks

Sachin

Former Member
0 Kudos

hi all,

first i was doing this by using BDc.. but during BDc, the field SCLAS is in non-editable mode. so i was not able to do recording for updating SCLAS.

please tell FM to update SCLAS..

thanks

Sachin

Former Member
0 Kudos

Have you tried using tcode PP02 when doing your recording for BDC? We used PP02 for recording and had no problem except for HRPAD25 table which we really need some tweaking to force in value. So try PP02 instead of PP01.

Former Member
0 Kudos

Hi SAPUSERm

Thanks for the reply. Actually in PP02 for A025 subtype we can't edit any thing and message is coming as "can't be changed using basic transaction". So we are trying to do it with Function module.Please help

Thanks,

Sachin

Former Member
0 Kudos

Try update DB FM just after Update INFTY FM.

Former Member
0 Kudos

Hi,

Try using BAPI_BOOK_ATTENDANCE.