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

HR Table Update

Hi SAP Gurus,

Should we update PA00.. tables directly using 'Update table...' directly..or we need to use Logical database for it.

Is there any harm in updating dirctly....?

Thanks in advance,

Gaurav

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Dec 29, 2004 at 08:33 PM

    Hi Gaurav

    As Malgorzata stated, you should use the FM 'HR_INFOTYPE_OPERATION' to do personnel (PA) infotype operations. For organization part (PD), you can use 'RH_INSERT_INFTY' and other relevant FMs for deleting and updating.

    Here is an example and some information that I wrote before about the subject:

    DATA ls_data LIKE p0015 .
    DATA ls_return LIKE bapireturn1 .
    
    *--Fill "ls_data" as required here
    *- Be careful about the checks that will be done during 
    * execution of the function module. The checks it will 
    *do, will be more or less like when you insert the
    *record using the tcode "PA30". e.g. you must fill
    *obligatory fields
    CALL FUNCTION 'ENQUEUE_EPPRELE'
      EXPORTING mode_prel = 'E'
                mandt = sy-mandt
                pernr = ls_data-pernr
                infty = '0015'
                subty = '1650'
                endda = ls_data-endda
                begda = ls_data-begda
                _scope = '1'
      EXCEPTIONS
                foreign_lock = 1
                system_failure = 2
                OTHERS = 3.
    IF sy-subrc NE 0 .
    *...
    EXIT.
    ENDIF.
    
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING infty = '0015'
                number = ls_data-pernr
                subtype = ls_data-subty
                validityend = ls_data-endda
                validitybegin = ls_data-begda
                record = ls_data
                operation = 'INS'
                tclas = 'A'
                nocommit = space
      IMPORTING
                return = ls_return .
    
    CALL FUNCTION 'DEQUEUE_EPPRELE'
      EXPORTING mode_prel = 'E'
                mandt = sy-mandt
                pernr = ls_data-pernr
                infty = '0015'
                subty = '1650'
                endda = ls_data-endda
                begda = ls_data-begda.
    

    <u><b>Some Basics:</b></u>

    i. You may wonder why I locked the personel but as far as I remember, there is a problem in the FM "HR_INFOTYPE_OPERATION" about this. Locking the personel overcomes the problem. But it may have been solved. So, if you want first try without locking explicitly.

    ii. The FM calls the dialog module for the program MPXXXX00 (XXXX: Infotype number, here MP001500) of the infotype.

    iii. "ls_data" which is passed to the parameter "record" should be type "PXXXX" (here P0015).

    iv. If the infotype has subtypes, pass the subtype you want ( in our case 1650) to the parameter "subtype" .

    v. You must give the validity period to the parameters "validityend" and "validitybegin".

    vi. The operation type you need is "INS" if you want to insert an infotype record. You can see other values from the fixed values of the domain of the parameter "operation".

    vii. Since some infotypes are common for both employee an applicants data, you should pass 'A' to the parameter "tclas". This way the record is inserted to the table PAXXXX. In case of 'B', it behaves your record as to be an applicant data.

    viii. You have the option to force the FM not to commit at the end.

    ix. The exporting parameter "return" of the FM is of type "BAPIRETURN1". That is, it can be used like other BAPI returns. You can analyze the result of the execution from this table.

    Best Regards...

    *--Serdar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2004 at 01:36 PM

    Hi,

    you can use function module HR_INFOTYPE_OPERATION to update HR tables.Using direct UPADTE ... is not recommended because no checks are caried.

    Best regards,

    Malgorzata

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2004 at 12:32 PM

    Hi Serdar Simsekler & Malgorzata Jaworek ,

    Your Replies have been quite helpfull.Full points to U both.

    I feel this forum is like a heaven to ABAPers like me..

    Thnaks for all the inputs.

    Happy New Year .

    Gaurav

    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.