Skip to Content
author's profile photo Former Member
Former Member

Not able to modify the data for infotype 0008 using FM

Hi All ,

I have got a requirement for updating the infotype 0008 data using FM : HR_MAINTAIN_MASTER_DATA.

While trying to modify the wagetypes data which is of blank ..unable to upload the amount for that partcular field ..

For this am herewith the link of o/p :

http://i55.tinypic.com/28jfw2c.jpg for this am also posting the code...

Please suggest me furthur in what way i can upload..

SELECT * FROM pa0008 INTO TABLE itab_pa0008

  • FOR ALL ENTRIES IN itab

WHERE pernr = wa_data-pernr

AND begda = wa_data-begda_out

AND endda = wa_data-endda_out.

DESCRIBE TABLE itab_pa0008 LINES lin.

IF lin EQ 0.

c_action = 'INS'.

ELSE.

c_action = 'MOD'.

ENDIF.

*

**************************************************************************************************************

LOOP AT itab INTO wa_itab WHERE pernr = wa_data-pernr.

CLEAR: wa_bapireturn, wa_bapireturn1, wa_hr_return.

REFRESH: it_pprop[],it_modified_keys[].

********************************************************************************************************************

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-TRFAR'. "1

it_pprop-fval = wa_itab-trfar.

APPEND it_pprop.

CLEAR it_pprop.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-TRFGB'. "2

it_pprop-fval = wa_itab-trfgb.

APPEND it_pprop.

CLEAR it_pprop.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-TRFGR'. "3

it_pprop-fval = wa_itab-trfgr.

APPEND it_pprop.

CLEAR it_pprop.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-TRFST'. "4

it_pprop-fval = wa_itab-trfst.

APPEND it_pprop.

CLEAR it_pprop.

flag = flag + 1.

*****************************************************************************************************5

BREAK-POINT.

IF NOT wa_itab-lga1 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA01'.

it_pprop-fval = wa_itab-lga1.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet1.

ENDIF.

IF NOT wa_itab-bet1 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET01'.

it_pprop-fval = wa_itab-bet1.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************6

  • IF NOT wa_itab-lga2 IS INITIAL.

*********

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-LGA02'.

  • it_pprop-fval = wa_itab-lga2.

  • APPEND it_pprop.

  • CLEAR it_pprop.

  • bet1 = wa_itab-bet2.

  • ENDIF.

IF NOT wa_itab-bet2 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET02'.

it_pprop-fval = wa_itab-bet2.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************7

IF NOT wa_itab-lga3 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA03'.

it_pprop-fval = wa_itab-lga3.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet3 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET03'.

it_pprop-fval = wa_itab-bet3.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************8

IF NOT wa_itab-lga4 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA04'.

it_pprop-fval = wa_itab-lga4.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet4 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET04'.

it_pprop-fval = wa_itab-bet4.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************9

IF NOT wa_itab-lga5 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA05'.

it_pprop-fval = wa_itab-lga5.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet5 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET05'.

it_pprop-fval = wa_itab-bet5.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************10

IF NOT wa_itab-lga6 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA06'.

it_pprop-fval = wa_itab-lga6.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet6 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET06'.

it_pprop-fval = wa_itab-bet6.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************11

IF NOT wa_itab-lga7 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA07'.

it_pprop-fval = wa_itab-lga7.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet7 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET07'.

it_pprop-fval = wa_itab-bet7.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************12

IF NOT wa_itab-lga8 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA08'.

it_pprop-fval = wa_itab-lga8.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet8 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET08'.

it_pprop-fval = wa_itab-bet8.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************13

IF NOT wa_itab-lga9 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA09'.

it_pprop-fval = wa_itab-lga9.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet9 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET09'.

it_pprop-fval = wa_itab-bet9.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************14

IF NOT wa_itab-lga10 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-LGA010'.

it_pprop-fval = wa_itab-lga10.

APPEND it_pprop.

CLEAR it_pprop.

bet1 = wa_itab-bet2.

ENDIF.

IF NOT wa_itab-bet10 IS INITIAL.

it_pprop-infty = '0008'.

it_pprop-fname = 'P0008-BET010'.

it_pprop-fval = wa_itab-bet10.

APPEND it_pprop.

CLEAR it_pprop.

ENDIF.

*******************************************************************************************************15

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-LGA11'.

  • it_pprop-fval = wa_itab-lga11.

  • APPEND it_pprop.

  • CLEAR it_pprop.

  • bet1 = wa_itab-bet2.

*

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-BET11'.

  • it_pprop-fval = wa_itab-bet11.

  • APPEND it_pprop.

  • CLEAR it_pprop.

*

********************************************************************************************************16

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-LGA12'.

  • it_pprop-fval = wa_itab-lga12.

  • APPEND it_pprop.

  • CLEAR it_pprop.

  • bet1 = wa_itab-bet2.

*

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-BET12'.

  • it_pprop-fval = wa_itab-bet12.

  • APPEND it_pprop.

  • CLEAR it_pprop.

*

********************************************************************************************************17

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-LGA13'.

  • it_pprop-fval = wa_itab-lga13.

  • APPEND it_pprop.

  • CLEAR it_pprop.

  • bet1 = wa_itab-bet2.

*

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-BET13'.

  • it_pprop-fval = wa_itab-bet13.

  • APPEND it_pprop.

  • CLEAR it_pprop.

*

********************************************************************************************************18

*

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-LGA14'.

  • it_pprop-fval = wa_itab-lga14.

  • APPEND it_pprop.

  • CLEAR it_pprop.

  • bet1 = wa_itab-bet2.

*

  • it_pprop-infty = '0008'.

  • it_pprop-fname = 'P0008-BET14'.

  • it_pprop-fval = wa_itab-bet14.

  • APPEND it_pprop.

  • CLEAR it_pprop.

*******************************************************************************************************

  • BREAK-POINT.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = wa_itab-pernr

IMPORTING

return = wa_bapireturn1.

BREAK-POINT.

  • IF c_action = 'INS'.

  • CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'

  • EXPORTING

  • pernr = wa_itab-pernr

  • actio = 'INS'

  • tclas = 'A'

  • begda = wa_data-begda_out "'20110401'

  • endda = wa_data-endda_out "'99991231'

  • dialog_mode = '2'

    • luw_mode = '1'

  • IMPORTING

  • return = wa_bapireturn

  • return1 = wa_bapireturn1

  • hr_return = wa_hr_return

  • TABLES

  • proposed_values = it_pprop

  • modified_keys = it_modified_keys.

  • *

    • IF NOT wa_bapireturn IS INITIAL.

    *

    • WRITE : / wa_bapireturn.

    • CLEAR : wa_itab , wa_bapireturn.

    • ENDIF.

    ********************************************************************************************

    • ELSEIF c_action = 'MOD'.

    CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'

    EXPORTING

    • infty = '0008'

    pernr = wa_itab-pernr

    actio = 'MOD'

    begda = wa_data-begda_out "'20110401'

    endda = wa_data-endda_out "'99991231'

    • record = p_record

    • recordnumber = wa_itab-SEQNR

    • operation = change

    • nocommit = nocommit

    dialog_mode = '0'

    IMPORTING

    return = wa_bapireturn

    return1 = wa_bapireturn1

    hr_return = wa_hr_return

    TABLES

    proposed_values = it_pprop

    modified_keys = it_modified_keys.

    .

    IF NOT wa_bapireturn IS INITIAL.

    WRITE : / wa_bapireturn.

    CLEAR : wa_itab , wa_bapireturn.

    ENDIF.

    **

    • ENDIF.

    **

    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

    EXPORTING

    number = wa_itab-pernr

    IMPORTING

    return = wa_bapireturn1.

    ******************************************************************************************************************

    ENDLOOP.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

    Assigned Tags

    Related questions

    5 Answers

    • Posted on Jul 21, 2011 at 01:06 PM

      Nocommit = nocommit >> TRY WITH 'X' or space >> or abap_true or abap_fale

      TABLES

      proposed_values = it_pprop modified

      does it_pprop_modified has all the fields with the values?

      check pa0008 table, try to push all the values of the record in it_pprop_mod ..ofcourse with the values you want to change

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on Jul 21, 2011 at 01:12 PM

      Hi,

      Check if you are missing any data that you are passing to the HR_MAINTAIN_INFOTYPE FM.

      Also try passing 'MOD' instead of 'INS'.

      Thanks

      guru.

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on Jul 21, 2011 at 01:34 PM

      Tnk Guys , Its still d same . Not able to upload..any oder way ......

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on Jul 21, 2011 at 02:20 PM

      Have not used the FM that u have mentioned ...if possible can i have a brief functionality behind that or could you please send me the code which so that i can go through it and do the needful changes as per my requirement...

      Thanks ,

      Dheeraj

      Add a comment
      10|10000 characters needed characters exceeded

      • Here is a sampe, and the logic you are using for wages goes in the internal table for wages (you already have the enqueue & dequeue so you don't have to worry about that, so you only have to add the BAPI_TRANSACTION_COMMIT):

        CALL FUNCTION 'BAPI_BASICPAY_CHANGE'
          EXPORTING
            employeenumber             = pa0008-pernr
            subtype                    = pa0008-subty
            objectid                   = pa0008-objps
            lockindicator              = pa0008-sprps
            validitybegin              = pa0008-begda
            validityend                = pa0008-endda
            recordnumber               = pa0008-seqnr
            payscaletype               = pa0008-trfar
            payscalearea               = pa0008-trfgb
            payscalegroup              = pa0008-trfgr
            payscalelevel              = pa0008-trfst
        *   NEXTINCREASE               =
        *   LOCALALLOWLEVEL            =
        *   PARTNERSHIP                =
        *   CURRENCY                   =
        *   COMPARISONPAYSCLTYPE       =
        *   COMPARISONPAYSCLAREA       =
        *   COMPARISONPAYSCLGRP        =
        *   COMPARISONPAYSCLLVL        =
        *   COMPNEXTINCREASE           =
        *   CAPACITYUTILLEVEL          =
        *   HOURSWORKEDPERPERIOD       =
        *   ANNUALSALARY               =
        *   CASEGROUPCATALOG           =
        *   CASEGROUP                  =
        *   CURRENCYANNUALSALARY       =
        *   REASON                     =
        *   NOCOMMIT                   =
        * importing
        *   return                     =
         TABLES
           wagetypes                  = wages.
        

        Regards,

        Ryan Crosby

    • author's profile photo Former Member
      Former Member
      Posted on Jul 21, 2011 at 02:56 PM

      Thanks Ryan , Will try in using that FM nd make an update ..

      Add a comment
      10|10000 characters needed characters exceeded

    Before answering

    You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
    You must be Logged in to submit an answer.

    Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.