Skip to Content

Infotype 0002 BADI change HRPAD00INFTY

Hi Experts,

I am using a BADI "HRPAD00INFTY". when user change the marital status e.g; from single to married. I have to implement a logic there, with a change status.

i have used the following code at "AFTER INPUT" to get a new entered value in the "new_marital" varible. But cannot get an entered value "e.g; married".

Can any expert give me a hint about the reason?

CLASS CL_HR_PNNNN_TYPE_CAST DEFINITION LOAD.

CASE new_innnn-infty.
WHEN '0002'.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
EXPORTING
PRELP = new_INNNN
IMPORTING
PNNNN = new_pa0002.
ENDCASE.
new_marital = new_pa0002-famst.


Thanks and Regards,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Nov 20, 2014 at 01:25 PM

    You can do this in the IN_UPDATE method, try something like this:

    data ls_old_image type psoper.
    data ls_prelp_new type prelp.
    data ls_prelp_old type prelp.
    data ls_p0002_new type p0002.
    data ls_p0002_old type p0002.
    field-symbols <ls_new_image> type psoper.
    field-symbols <ls_prelp> type prelp.

    loop at new_image assigning <ls_new_image>.

    if <ls_new_image>-infty = '0002'.

    case ipspar-actio.

    * when 'INS' or 'MOD' or 'COP'. " For Action Insert
    * get new record IT0002
    move-corresponding <ls_new_image> to ls_prelp_new.
    call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
    exporting
    prelp = ls_prelp_new
    importing
    pnnnn = ls_p0002_new.

    ls_p0002_new-famst = new_marital.

    call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
    exporting
    pnnnn = ls_p0002_new
    importing
    prelp = ls_prelp_new.
    move-corresponding ls_prelp_new to <ls_new_image> .
    endif.

    endcase.
    endif.
    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2014 at 12:35 PM

    Hi,

    In HRPAD00INFTY there is no exporting parameters, only we have the importing parameters with this we can do the validations, modification of data is not possible in BADI.

    Better to go for user exit ZXPADU02 in this exit you are able to modify the data and use the same coding get the infotype data in INNN structure and modify the data as per requirement.

    Regards,

    Rajesh K

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2014 at 12:41 PM

    Find below coding

    if INNNN-INFTY = '0002'.

    call method CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

    exporting

    PRELP = INNNN

    importing

    PNNNN = I0002. "here you have record which is being changed

    "now do necessary changes in I0002 structure

    "and cast it back like this

    call method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

    exporting

    PNNNN = I0002

    importing

    PRELP = INNNN.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2014 at 05:13 PM

    Hi Muhammad,

    Your program working now?

    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.