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

Get employee’s country from company code PA0001-BUKRS

Hi Experts,

I have created a Ztable which contain fields like Country, Company Code and ZField. My requirement is to get the employee's country from company code PA0001-BUKRS and if that country has value in ZField, then I need to handle my logics.

But how can I get the country from PA0001. Also how can I take care of PERNR?

Please guide me over this. Expecting your valuable ideas.

Thanks and Regards,

Ramakrishnan M.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2013 at 06:13 AM

    Hi,

    You can use table CSKS to get the company code for the employee's cost center. Use the Company code in table T001 to get the corresponding country key.

    Hope this helps,

    ~Athreya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2013 at 05:44 AM

    Usually the nationality of an employee is available in the infotype PA0002 , field NATIO ( nationality).

    If you need the country,pass the value from PA0002-NATIO to table T005 to get the field LAND1 which is the country

    Fetch the latest record for the employee number by passing BEGDA <= sy-datum and ENDDA >= sy-datum in PA0002 Table...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 29, 2013 at 06:14 AM

    Hi,

    As mentioned by Byju, the personal details of employee are in infotype 0002.

    To get the country data, fetch the valid record from PA0002. You can get the country of birth from GBLND and Nationality from NATIO. But for this you will need the pernr. Hope you have that information.

    The employee and company code are linked in infotype 0001.

    So you need to fetch the valid record from PA0001-bukrs to get his company code.

    Now having these two fields - company code and country, you can fetch the value for ZFIELD from your ZTABLE.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 29, 2013 at 03:14 AM

    Ramakrishnan Murugan wrote:

    ...then I need to handle my logics.

    What exactly is the logic you want to handle?

    But how can I get the country from PA0001.

    You could call function BAPI_COMPANYCODE_GETDETAIL


    Also how can I take care of PERNR?

    How do you mean want to "take care" of the PERNR? What do you want to do?

    Sougata.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2013 at 07:13 AM

    Thanks for all of your appreciable responses.

    With regards,

    Ramakrishnan M

    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.