07-16-2008 8:55 AM
Dear Experts,
I am developing a utility program to change the status of multiple projects at once.
I am changing the status of Phase, task, check list,check list item and Project status from
Create to Release, release to Complete and to Work Effor Complete.With respective status change BAPIS.
when ever the projects is not able to change the status success fully due to validations
such as person respondsble not mainted or any other basic data is missing,
We are not committing the changes if every thing goes fine we are commiting with BAPI: BAPI_CPROJECTS_COMMIT_WORK
but when we commit with this it still retaining the previous project status in LUW and trying to commit previous project too.
and commit is getting failed.
I am not able to roll back or free the project with BAPI:BAPI_CPROJECTS_ROLLBACK_WORK and BAPI_BUS2172_FREE
BAPI_CPROJECTS_ROLLBACK_WORK: when iam trying to use this BAPI it is going to short dump
BAPI_BUS2172_FREE: It is returing error saying unable to free the project.
Could you please tell how to roll back the changes to the project or how to commit only success full projects (Project with out any errors in status change.)
Kindly do the needful
Thanking you.
-ravi
07-16-2008 1:16 PM
Hi ravi,
use
BAPI_TRANSACTION_ROLLBACK Execute external Rollback when using BAPIs
n see this links
http://wiki.open-esb.java.net/Wiki.jsp?page=SAPRequirementsAndUseCases
http://abap.wikiprog.com/wiki/BAPI_BUS2001_DELETE
thanks
karthik
07-16-2008 3:41 PM
Hi Karthik,
Thank you very much for quick response!
We are addressing this issue in CRM and we cant use this BAPI 'BAPI_TRANSACTION_ROLLBACK'.
Could you please provide me the info how to handle this issue in CRM 4.0.
Thanking you.
-ravi.
07-16-2008 4:47 PM
Program flow
Loop at It_Project
*Status Change for Check List
CALL FUNCTION 'BAPI_BUS2176_SET_STATUS'
EXPORTING
checklist_guid = p_guid
IV_STATUS_PROFILE =
is_business_transaction = lv_bus_trans
TABLES
return = t_return.
*Status Change for task
CALL FUNCTION 'BAPI_BUS2175_SET_STATUS'
EXPORTING
task_guid = p_guid
is_business_transaction = lv_bus_trans
TABLES
return = t_return.
;
;
*Status Change for project
CALL FUNCTION 'BAPI_BUS2172_SET_STATUS'
EXPORTING
project_definition_guid = p_guid
is_business_transaction = lv_bus_trans
TABLES
return = t_return.
If there is a sucess in changing the status.
CALL FUNCTION 'BAPI_CPROJECTS_COMMIT_WORK'
TABLES
return = t_creturn.
Else.
CALL FUNCTION 'BAPI_CPROJECTS_ROLLBACK_WORK'
TABLES
return = t_rreturn.
Endif.
Endloop.
In the above code when we are executing BAPI_CPROJECTS_ROLLBACK_WORK is going for dump.
If we simply commit with BAPI_CPROJECTS_COMMIT_WORK for all the projects then if any project
commits with error same error is re produced for all the following projectsid (unable to destroy the LUW).
and in CRM we can't use 'BAPI_TRANSACTION_ROLLBACK'.