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

Problem with HR_MAINTAIN_MASTERDATA

Former Member
0 Likes
877

I am trying to change an infotype field with the following FM .

The problem is that doesn't work .

REPORT YDP_TEST.

TYPE-POOLS: TRUXS.

TABLES : PA0001 , PA0002.

DATA : FS_HR_RETURN LIKE HRHRMM_MSG.

DATA: BEGIN OF PROPOSED_VALUES OCCURS 5.

INCLUDE STRUCTURE PPROP.

DATA: END OF PROPOSED_VALUES.

REFRESH PROPOSED_VALUES.

PROPOSED_VALUES-INFTY = '0002'.

PROPOSED_VALUES-FNAME = 'P0002-BEIDN1'.

PROPOSED_VALUES-FVAL = 'LALAKIS'.

APPEND PROPOSED_VALUES.

CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'

EXPORTING

PERNR = '00231034'

ACTIO = 'MOD'

TCLAS = 'A'

BEGDA = '20070701'

ENDDA = '99991231'

DIALOG_MODE = '0'

LUW_MODE = '1'

NO_ENQUEUE = 'X'

IMPORTING

HR_RETURN = FS_HR_RETURN

TABLES

PROPOSED_VALUES = PROPOSED_VALUES.

points will be rewarded

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
727

Better to use FM :

HR_INFOTYPE_OPERATION

5 REPLIES 5
Read only

Former Member
0 Likes
728

Better to use FM :

HR_INFOTYPE_OPERATION

Read only

b_deterd2
Active Contributor
0 Likes
727

Hi,

A FM which i use myself is HR_INFOTYPE_OPERATION. Maybe this one will work. Give it a try.

Regards,

Bert

Read only

Former Member
0 Likes
727

Yia sou,

Have you tried to execute the following just after CALL FUNCTION 'HR_INITIALIZE_BUFFER'. ?

Regards

Read only

Former Member
0 Likes
727

Use the Function 'HR_INFOTYPE_OPERATION'

You need to Lock it first.

PERFORM ENQUEUE_PERNR(SAPFP50G)
                       USING wa_pa0022-pernr ' '.

      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          INFTY         = '0022'
          NUMBER        = wa_pa0022-pernr
          SUBTYPE       = wa_pa0022-subty
          LOCKINDICATOR = ''
          VALIDITYEND   = wa_pa0022-endda
          VALIDITYBEGIN = wa_pa0022-begda
          RECORD        = wa_pa0022
          OPERATION     = 'MOD'
        IMPORTING
          RETURN        = e_return
          KEY           = e_key.

**If the updation is single record then we will send the
**Return message
      PERFORM DEQUEUE_PERNR(SAPFP50G)
                       USING wa_pa0022-PERNR.

Then after that Unlock it.

it will work . just use locking before calling, and unlocking after call.

Read only

Former Member
0 Likes
727

Hi,

U can use the following code .

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '00XX'

NUMBER = WA_00XX-PERNR

SUBTYPE = WA_00XX-SUBTY

OBJECTID = OBJPS

VALIDITYEND = END

VALIDITYBEGIN = BEGIN

RECORDNUMBER = SEQ

DIALOG_MODE = '0'

RECORD = WA_0014

OPERATION = 'MOD'

IMPORTING

RETURN = WS_RETURN.

It will work fine.

If it is usefull reward pts.

Regards

Srimanta