cancel
Showing results for 
Search instead for 
Did you mean: 

bapi to set user status of a task

Former Member
0 Kudos

Hi,

I am looking for a bapi or method to set the user status of a task.

We have created a status profile for user status and need to set the user status of the task in the dpr_attributes badi based on some conditions.

I tried bapi BAPI_BUS2175_SET_STATUS but it either says status profile not found or if i assign the status profile to the task it says status profile already active but never changes the user status.

I checked method SET_DATA_EXT of class CL_DPR_TASK_O but it does not have user status field for modifying whereas GET_DATA_EXT method has the user status but it wouldn't help to change the user status.

If anyone has any idea on this it will be extremely helpful.

Regards,

Simmi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi again,

We used this BAPI (and several other ones) in DPR_ATTRIBUTES as well, so it should work.

Try to have a look at the Return table in debug mode, to check what is wrong.

Matthias

Former Member
0 Kudos

Hi Matthias

Thanks,

I am getting the message "business transaction, SET_USER_STATUS is not allowed" from the bapi. I guess this is related to note 954975.

But i wonder why it works fine in a program and not in the badi.

Also my connection gets timed out and the badi seems to go on in an infinite loop when i save the project. Any idea why this is happening.

Thanks,

Simmi

Edited by: Simmi Balakrishnan on Jul 23, 2008 10:00 PM

Former Member
0 Kudos

You can check what is wrong in the following class/method: CL_DPR_BAPI_BUS_TRANSACTION / IS_BUS_TRANSACTION_ALLOWED. You can set a breakpoint there around line 40 (Create business transaction string for user status action) to check what happens.

Following what you say, you should apply the note to correct this.

Matthias

Former Member
0 Kudos

Hello!

Please try the following code, it works for us (let's say the status profile is already active, otherwise you have to add the corresponding export parameter):

DATA: BUS TYPE BAPI_TS_BUSINESS_TRANSACTION,

RETURN TYPE STANDARD TABLE OF BAPIRET2,

BUS-BUSINESS_TRANSACTION = 'SET_USER_STATUS'.

BUS-USER_STATUS = your_user_status.

CALL FUNCTION 'BAPI_BUS2175_SET_STATUS'

EXPORTING

TASK_GUID = task_guid

IS_BUSINESS_TRANSACTION = BUS

TABLES

RETURN = RETURN.

If still not working, you can have a look to the following SAP Note: 954975

Matthias

Former Member
0 Kudos

Hi,

I had tried to use this bapi, but the problem i have is i am coding this inside the badi dpr_attributes and this BAPI does not work there.

The bapi does work if i use it in a program.

I am looking for some solution to update user status of a task inside a badi.

Regards,

Simmi