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

handling authorization error while updating infotype

I am calling function module to add the record in info type, i want to set a returncode if user is not authorized to access infotype

but nothing has come in wa_return even the infotype is not getting updated

data: wa_return type bapiret1.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '9077'

number = wa_p9077-pernr

validityend = wa_p9077-endda

validitybegin = wa_p9077-begda

record = wa_p9077

operation = 'INS'

IMPORTING

return = wa_return.

please guide

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2010 at 09:54 AM

    Try this code

    constants: insert type pspar-actio value 'INS'.

    "This code is requred and locks the record ready for modification

    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

    EXPORTING

    number = p_pernr.

    validitybegin = p_record-begda.

    validityend = p_record-endda.

    p_record-pernr = p_pernr.

    p_record-begda = pn-begda.

    p_record-endda = validityend.

    p_record-subty = p_subty. "subtype of new entry

    p_record-scref = p_subty. "subtype of new entry

    "plus populate any other fields you need to update

    CALL FUNCTION 'HR_INFOTYPE_OPERATION'

    EXPORTING

    infty = '0071'

    subtype = p_record-subty

    number = p_record-pernr "employeenumber

    validityend = validityend

    validitybegin = validitybegin

    record = p_record

    operation = insert

    nocommit = nocommit

    dialog_mode = '0'

    IMPORTING

    return = return_struct

    key = personaldatakey

    EXCEPTIONS

    OTHERS = 0.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2010 at 07:04 AM

    Resolved

    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.