‎2009 Jun 12 10:27 PM
We have Project Structre that looks like this:
Proj1
bwbs1 prctr1
wbs1 prctr1
bwbs2 prctr2
wbs2 prctr2...
( Tcode: CJ02 or CJ20 )
I try to use PS substitution to accomplish the above. When SAP loops to the line
bwbs1, I use 'BAPI_PROFITCENTER_CREATE' to create the profit center( prctr1 ) and
substituted into prps-prctr for bwbs1.
When it looped to the next line( wbs1 ), since it is a wbs, i find its parent( bwbs1 ) and
copy the profit center( prctr1 ) into the profit center field( prps-prctr ) of wbs1.
Repeat the same for bwbs2.
Problem: If i do not use 'BAPI_TRANSACTION_COMMIT' at the end of each 'BAPI_PROFITCENTER_CREATE', in the end, SAP will return a message saying
profit center does not exist. Therefore, it cannot be substituted. If I do use
'BAPI_TRANSACTION_COMMIT', it will create prctr1 in CEPC when it is looping to the line for bwbs1. However, it will also immediately create all the bwbs1, wbs1, bwbs2, wbs2 all into prps. This means that
none of the profit center can further be substituted by the custom profit center. Is there any way we can commit to database only the profit center created but not the list of BWBS/WBS that need further substitution?
‎2009 Jun 18 4:27 AM
‎2009 Jun 18 1:57 PM
I can not see your program design entirely but check this:
Why dont you create all Profit centers first then COMMIT and then create related Projects/WBSs.