Skip to Content
0
May 03, 2018 at 12:05 PM

C4C PDI Create opportunity with reference - How to?

1182 Views

Dear gurus,

I am currently trying to create a new opportunity with reference to an existing opportunity. I am doing this in the after modify event. But I seem to be doing something wrong. Every time the coding line is reached the C4C runs into this short dump:

500 SAP Internal Server Error
ERROR: The current application triggered a termination with a short dump. (termination: RABAX_STATE)
    at new a (https://c4cstatic.hana.ondemand.com/resourcesvc/1805.1.6.0.1525232720021/SAP_UI/HTML5/resources/sap/client/lib-0.js:309:378)
    at constructor._fireErrorOnDispatch (https://c4cstatic.hana.ondemand.com/resourcesvc/1805.1.6.0.1525232720021/SAP_UI/HTML5/resources/sap/client/lib-0.js:605:7449)
    at constructor. (https://c4cstatic.hana.ondemand.com/resourcesvc/1805.1.6.0.1525232720021/SAP_UI/HTML5/resources/sap/client/lib-0.js:605:4333)
UI components and application support components of current request:
object
Description:
ClassName:
sap.client.evt.BaseOperation
Type:
Error
Function_name:
sap.client.evt.BaseOperation.prototype._digestResponse

I have tried all of the following commands (each on its own of course) but somehow I seem to be calling them wrong. They all cause the shortdump above:

foreach ( var oppi in this ){ 
//create follow-up oppi, I tried all of these lines - none of them works
var child = Opportunity.CreateChildOpportunity( oppi ); //try create child 

Opportunity.CreateChildOpportunity( oppi ); //maybe without return parameter?

var child = Opportunity.CreateWithReference( oppi ); //try create with ref.

var child = Opportunity.CreateWithReference( Opportunity.Retrieve(oppi.ID) ); //maybe try to cast it again?

var child = Opportunity.Copy( oppi ); 
}

As I can find no documentation on these methods or their interfaces, maybe someone here can throw some light on this?