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

HR_MAINTAIN_MASTERDATA

Former Member
0 Likes
4,931

Hi All,

I am using the above FM to create a new pernr in SAP. It is supposed to replicate the PA40 tcode meaning that the hiring process is being automated. The only problem I ran into so far is while creating the USER ID and EMAIL entries on infotype 0105. In PA40, the 1015 screen pops up first with subty '0010' for email and then the next screen is subty '9000' for used id.

The parameters I am passing to the FM is as below.

CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'

EXPORTING

PERNR = '00000000'

MASSN = IT_CREATE-ACTION

ACTIO = 'INS'

TCLAS = 'A'

BEGDA = EFF_DATE " MM/DD/YYYY

ENDDA = '99991231'

  • OBJPS =

  • SEQNR =

  • SPRPS =

  • SUBTY =

WERKS = IT_CREATE-WERKS

PERSG = IT_CREATE-PERSG

PERSK = IT_CREATE-PERSK

PLANS = OPEN_POS

DIALOG_MODE = '1'

LUW_MODE = '1'

NO_EXISTENCE_CHECK = 'X'

NO_ENQUEUE = ' '

IMPORTING

RETURN = RETURN

RETURN1 = RETURN1

HR_RETURN = HR_RETURN

TABLES

PROPOSED_VALUES = PROPOSED_VALUES

MODIFIED_KEYS = MODIFIED_KEYS .

the table PROPOSED_VALUES has the entries below (the infotypes that need to be created)

INFTY FIELD VALUE

0008 P0008-BET01 2500.00

0008 P0008-LGA01 0100

0008 P0008-TRFGR M07

0077 P0077-RACKY VN

0077 P0077-ETHEN E2

0022 P0022-AUSBI 9

0007 P0007-SCHKZ SN 20+

0014 P0014-LGART 0051

0014 P0014-BETRG 100

0019 P0019-TMART S1

0019 P0019-TERMN 20080601

0094 P0094-RESIS 10

0105 P0105-USRID_LONG

0105 P0105-USRID JACK

0171 P0171-BAREA 01

0171 P0171-BENGR SNHS

and so on...

Now, even when I have the required entries listed in the table for Infotype 0105, the infotype is not created with the specified values.

The FM always returns a message saying 'required fields missing'. I later used dialog mode '1' and found that the fields do not get populated only for infotype 0105. They appear blank when control goes to IT 0105. I am unable to figure out why this is happening. The rest of the infotypes are fine.

My only guess is that since IT 0105 has two screen pop up one after the other for different subtypes, the function module is unable to interpret it correctly.

Can someone please suggest a solution/work around for this problem?

All your inputs/suggestiona are greatly appreciated.

Thanks!

Sandeep

7 REPLIES 7
Read only

Former Member
0 Likes
1,722

Hi Sandeep,

User ID is stored in subtype 0001 not in 9000.

Try with 0001.

Regards,

Atish

Read only

venkat_o
Active Contributor
1,722

Hi Sandeep, Check the following program and do fill ur proposed values table accordingly for the infotype 0105. just execute and check the result.

REPORT  zvenkat_notepad3.
TABLES:pernr.
DATA:
      proposed_values   LIKE pprop OCCURS 0 WITH HEADER LINE,
      wa_fval           LIKE pprop-fval,
      rc                LIKE bapireturn,
      rc1               LIKE bapireturn1.


START-OF-SELECTION.

GET pernr.
  PERFORM fill TABLES proposed_values USING '0105'           "Infotype
                                            'P0105-BEGDA'    "Begin date field
                                            '20080528'       "date
                                            '01'.            "First record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'           "Infotype
                                            'P0105-ENDDA'    "End date field
                                            '99991231'       "date
                                            '01'.           "First record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'           "Infotype
                                            'P0105-USRTY'    "Subtype field
                                            '0001'           "Subtype
                                            '01'.            "First record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'           "Infotype
                                            'P0105-USRID'    "User ID field
                                            'VENKAT'         " User Id
                                            '01'.           "First record for the infotype

  PERFORM fill TABLES proposed_values USING '0105'
                                            'P0105-BEGDA'
                                            '20080528'
                                            '02'.           "2nd record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'
                                            'P0105-ENDDA'
                                            '99991231'
                                            '02'.           "2nd record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'
                                            'P0105-USRTY'
                                            '0010'
                                            '02'.           "2nd record for the infotype
  PERFORM fill TABLES proposed_values USING '0105'
                                            'P0105-USRID'
                                            'venkat.xyz at xyz.com'
                                            '02'.           "2nd record for the infotype
  CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
    EXPORTING
      pernr           = pernr-pernr
      actio           = 'INS'
      tclas           = 'A'
      begda           = sy-datum
    IMPORTING
      return          = rc
      return1         = rc1
    TABLES
      proposed_values = proposed_values.
  IF rc-type <> 'E'.
    WRITE / 'success'.
  ENDIF.
*&---------------------------------------------------------------------*
*&      Form  fill
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->LOC_PROPOSED_VALUES  text
*      -->INFTY                text
*      -->FNAME                text
*      -->FVAL                 text
*      -->SEQNR                text
*----------------------------------------------------------------------*
FORM fill TABLES loc_proposed_values STRUCTURE pprop
        USING  infty LIKE pprop-infty
               fname LIKE pprop-fname
               fval  LIKE pprop-fval
               seqnr LIKE pprop-seqnr.

  DATA: wa_values LIKE pprop.

  wa_values-infty = infty.
  wa_values-fname = fname.
  wa_values-fval  = fval.
  wa_values-seqnr = seqnr.
  APPEND wa_values TO loc_proposed_values.

ENDFORM.                    "fill
I hope that it solves ur problem. Regards, Venkat.O

Read only

Former Member
0 Likes
1,722

Hi Venkat,

Thanks for your reply. I will make those changes and let you know if it works.

Sandeep

Read only

Former Member
0 Likes
1,722

I'll add records to PA40. Coming field empty. Could you help please!!!

Read only

Former Member
0 Likes
1,722

Hi Venkat,

I executed your code and it works fine if an IT 0105 record needs to be created for an EXISTING pernr.

But, in my case where a NEW pernr has to be created, it is not working.

Since IT0105 has been included in the infogroup, the USRID and EMAIL ID screens pop-up when creating a pernr through PA40.

When i run it in dialog mode 1, the control still stops at IT0105 screen and asks for the user to input the values manually, eventhough I have the proposed_values table populated with IT 0105 values.

I am unable to figure out what else can be done to overcome this situation.

Any suggestions are greatly appreciated.

Thanks!

Sandeep

Read only

Former Member
0 Likes
1,722

Thank you for all the inputs.

Read only

0 Likes
1,722

This message was moderated.