cancel
Showing results for 
Search instead for 
Did you mean: 

Capture BPC username in BADI

Former Member
0 Kudos

Hi,

I am using UJ_CUSTOM_LOGIC Badi to change the status of work status.

Currently i have hardcoded username of bpc for testing purpose.

In real time how can i capture BPC username from where script will invoke my Badi?

Please help.

Accepted Solutions (0)

Answers (3)

Answers (3)

bishwajit_das
Active Contributor
0 Kudos

Hi Riya, Please find the following link bellow, which covers all your queries.

http://scn.sap.com/community/epm/planning-and-consolidation-for-netweaver/blog/2013/10/28/how-to-cha...



Thanks & Regards,

Bishwajit

former_member186338
Active Contributor
0 Kudos

Hi Bishwajit,

In the link you mention the user was hardcoded!

Extract from the code in the link mentioned:

******** I hardcoded my user id just for testing purposes.

******** You can use an ABAP method that can get you the currently logged-on user. In fact this is what you should do!

    user_id = 'RIZKJ'.

    gs_user-USER_ID = user_id.

former_member186338
Active Contributor
0 Kudos

Hi Riya,

You are running custom logic badi with the help of script. And this badi will receive the IT_PARAM:

READ TABLE it_param WITH KEY hashkey = 'USER_ID' INTO ls_param.

Vadim

bishwajit_das
Active Contributor
0 Kudos

If you are trying to change the work-status inside a BADI , it will require the admin ID who has the complete authorization to change work-status.

So to get your admin user ID dynamically, you can use the following method - read_sysadmin_id

where the IMPORTING parameter e_sysadmin_id is the ADMIN ID.

Thanks & Regards,

Bishwajit

Former Member
0 Kudos

Hi,

I have tried using above method, but i am getting userid as blank.

We have created users on the basis of planner.

So basically planner - userid who has planned should be passed to BADI.

Say if ROHITT is planner than userid = ROHITT should pass to the BADI.

Can you give me sample code how this  can be achieved?

bishwajit_das
Active Contributor
0 Kudos

I think if you want the userid of the planner running the BADI, you can get it from the ENTITY dimension where you have probably maintained the Owner Property.

Or Else, you can try sy-uname as we generally do in ABAP coding

Former Member
0 Kudos

First option of Owner Property will not work in case if we have 2 planners for same site.

If i use sy-uname will it contain BPC logged in users?