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

Memory ID Problem

Hello All,

We have developed a bdc for hiring action. In bdc we are capturing internally generated personnel no.s using import/export statements.

i have exported personnel no from badi and importing it into bdc program for display.

please find code below inside badi.

IF new_innnn-infty EQ '0001'.

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn

EXPORTING

prelp = new_innnn

IMPORTING

pnnnn = i0001.

EXPORT i0001 = i0001 TO MEMORY ID 'PAR'.

ENDIF.

Please find syntax in report.

IMPORT i0001 FROM MEMORY ID 'PAR'.

The problem is when i'm executing tcode for first time pernr's are not loaded into memory id and hence displaying blank in report.

And when i'm executing second time it's working perfectly fine.

Please guide on how to resolve this error.....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jun 04, 2014 at 08:22 AM

    Hello Tushar

    Set a break-point and check. May be the code b/w if endif is not getting exeucted for first time

    IF new_innnn-infty EQ '0001'.

    break-point. " execute for first and second time .

    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn

    EXPORTING

    prelp = new_innnn

    IMPORTING

    pnnnn = i0001.

    EXPORT i0001 = i0001 TO MEMORY ID 'PAR'.

    ENDIF.

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 04, 2014 at 08:26 AM

    If you want the personnel number, export the personnel number to its memory ID.

    EXPORT i0001-pernr TO MEMORY ID 'PER'.

    IMPORT lv_pernr FROM MEMORY ID 'PER'.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 04, 2014 at 08:40 AM

    Instead of BDC, why dont you use HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA or HR_PAD_HIRE_EMPLOYEE to create/hire an employee?


    Once employee is hired using the above FM, you could then use BDC on PA30 or HR_INFOTYPE_OPERATION for other infotypes.


    For HR_MAINTAIN_MASTERDATA to create/hire a new employee, pass NO_EXISTENCE_CHECK as 'X' for internally generated employee number.

    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.