on 02-26-2009 2:34 PM
Hi guys ....
i'm trying to create a project using 'BAPI' function.
I have two new question:
(1)
In the template that i use to create the new project, i defined three types of roles (let's say ROLE_A,ROLE_B, ROLE_C). I wold like to use one of theese role as "responsible role" for a selected phase of my project (without implement this setting in the template). the right bapi to use ( i think) should be the 'BAPI_BUS2173_CHANGE' but i do notknow where to find the roles GUID to put into the input parameter 'IS_PHASE-RESPONSIBLE_ROLE_GUID' .
(2)
The other problem is how to change the status to a phase or a task or to the whole project. The right bapi should be 'BAPI_BUS2172_SET_STATUS' but i cannot find the right value to insert in the input parameter 'IV_STATUS_PROFILE' (for example to set the status of the whole project to "released" ).
Can anyone help me ?
thanks a lot again,
Fabrizio Gemma
Hello Fabrizio,
Some suggestions:
'BAPI_BUS2173_CHANGE' is the right FM to make changes in a Phase.
You may find the role GUIDs in table DPR_PART
I think you can pass the template GUID to 'BAPI_BUS2173_CHANGE' and get role details of the same.
Regarding status change, the parameter 'IV_STATUS_PROFILE' is used for populating the status profile. Have you configured any status profile for including custom status management?
You can get the status values in the table TJ02T.
Let me know if this helps.
Regards,
Vivek Pandey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek...
(1)
In the table DPR_PART there are the resposible_role_guid associated to all the projects, tasks, phases ever created. This means that when you assign the role ROLE_A to be the responsible-role to a selected phase, some a transaction generate a guid and create a new entry in the table DPR_PART: this guid can be found using Function BAPI_BUS2173_GET_DETAIL.
But my problem is different: i have a phase of my project without a responsible_role_guid. This means tha there is no responsible_role_guid in the table DPR_PART associated to such a phase, and that if i pass the phase guid to the function BAPI_BUS2173_GET_DETAIL it returns the corresponding field RESPONSIBLE_ROLE_GUID as a void field.
Now the question is : how can i associate a responsible role to my phase using the bapi BAPI_BUS2173_GET_CHANGE ? How can i know the right responsible_role_guid to use as input parameter?
(2)
I've only default status (TJ02T has got 241 entries).
The problem is:
The field IV_STATUS_PROFILE required by the function BAPI_BUS2173_SET_STATUS is a char of lenght 8, that does not match any field of the table TJ02T.
When i try to use this function it returns me back the following error message: Status profile 'REL.' cannot be used for the current object. (message number 051 of message class DPR_BAPI ).
Thanks again
fabri
Hi Fabrizio,
I am trying to understand some points here.
1. How are you providing inputs to your program that is creating the project?
2. If there is an external file/input that provides this data, then you may provide the Role ID ( of the role within the template) there.
Call function DPR_GET_GUID_BY_ID_FROM_DB and input the Role ID there. You will get the Role GUID as the output.
You can assign this GUID as responsible to the phase.
3. From your reply, it seems that no status profiles have been configured. Dont specify the status value in IV_STATUS_PROFILE. You can keep it blank.
Input values in IS_BUSINESS_TRANSACTION.
(1)
i've got the role id ....... but i've not got the function DPR_GET_GUID_BY_ID_FROM_DB.
(2)
If i want to change the status of a phase from "Created" to "Released".... What should i put inside IS_BUSINESS_TRANSACTION-BUSINESS_TRANSACTION and IS_BUSINESS_TRANSACTION-USER_STATUS?
regards
FG
Edited by: fabrizio gemma on Feb 26, 2009 5:12 PM
sorry vivek .... but i haven't still benn able to change the status of neither a project or a task , a phase .... using the function BAPI_BUS21xx_SET_STATUS ......
i set IV_STATUS_PROFILE blank , and i tryed a numerous set of values for IS_BUSINESS_TRANSACTION .
if someone has been able to change a project/phase/task status (any transition between different sates) .... please describe step-by-step the whole procedure.
thanks to all,
Fabrizio Gemma
Dear Fabizio,
You can use FM BAPI_BUS2172_GET_SUBOBJECT. Pass the project GUID and in the ET_SUBOBJECT structure that is returned, OBJ type MTG are the roles defined in the project along with their GUIDs. After that you can use BAPI_BUS2173_CHANGE to add the role to the phase.
To set the status of a project, phase or task use the following BAPIs
BAPI_BUS2172_SET_STATUS - To set the status of the project
BAPI_BUS2173_SET_STATUS - To set the status of the phase
BAPI_BUS2175_SET_STATUS - To set th status of a task
In each of the BAPIs pass the relevant GUIDs of the project, phase or the task as applicable and in structure IS_BUSINESS_TRANSACTION in field BUSINESS_TRANSACTION pass the relevant value -
RELEASE Release
COMPLETE Complete
REVOKE_COMPLETE Reset Complete
CANCEL Cancel
REVOKE_CANCEL Reset Cancel
SET_IN_PROCESS Set in Process
SET_USER_STATUS Set User Status
REVOKE_USER_STATUS Reset User Status Without Status Number
You can read the FM documentation for the same. As you are using only standard statuses, this will enable you to set the status.
Edited by: Debaranjan Hazarika on Feb 27, 2009 5:09 AM
Dear Debaranjan Hazarika,
Ok for the roles ..... thanks!
The 'Set Status' process continues to give me some troubles:
When i try to release a project as you suggested me (BAPI_BUS2172_SET_STATUS with ongli GUID and BUSINESS_TRANSACTION input fields filled as required), th FM returns me back these log messages:
STATUS || ID || TEXT
I || DPR_BAPI || No active status profile - deletion is not necessary
And when i call BAPI COMMIT WORK to save the eventually changes:
STATUS || ID || TEXT
S || DPR_CORE || No changes were made. Data is not saved
Thanks
Update of the still unsolved problem:
The question is: how can i change the status of a project/task/phase (example: change the status of a selected phase from "created" to "released" ) using BAPI fuction (via internet is a dummy procedure and so there must be a way to do it even via FM!!) ?
as suggested the right FM to do it should be : BAPI_BUS21XX_SET_STATUS.
Probelem: it does't work!!!
The problem is that i've not defined a custm status-scheme (from SPRO transaction), because of i use the standard one : a project can be "cerated", "released", .... (see the chapter 'status management' of the cprojects guide http://help.sap.com/saphelp_cproject300/helpdata/en/home.htm for a detailed view about it ).
I suppose This is the reason why the function BAPI_BUS2172_SET_STATUS gives me back the log message: "I || DPR_BAPI || No active status profile - deletion is not necessary".
I do not want to define a new status-scheme ( i don't need) and i still don't know how to change the project satus using BAPI function ....... but i'm preatty sure the there should be a method to do it !!
Thanks to all,
best regards,
Fabrizio Gemma
Edited by: fabrizio gemma on Feb 27, 2009 11:21 AM
Dear Fabrizio,
Try this. It worked for me -
DATA stat TYPE bapi_ts_business_transaction.
CLEAR stat.
stat-business_transaction = 'RELEASE'.
CALL FUNCTION 'BAPI_BUS2172_SET_STATUS'
EXPORTING
project_definition_guid = project_guid
is_business_transaction = stat
TABLES
return = it_return.
Call COMMIT_WORK after this.
problem solved!!!
The problem was the right commit function to call : BAPI_TRANSACTION_COMMIT.
only last question: where can i find the possible values for the admitted transaction ?
is there any table where i can find the right business_transaction text like 'RELEASE' , 'CLOSE' .... ?
Thanks very much to all!
Fabrizio
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.