Skip to Content
0

C4C PDI Create opportunity with reference - How to?

May 03 at 12:05 PM

64

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Dominik Meier May 04 at 11:31 AM
0

Dear Anant,

Thank you very much for sending me this link https://answers.sap.com/questions/94715/ I could copy some things!

As there seems to be no better option I now went with this workaround of creating a new opportunity

foreach ( var oppi in this ){
    var child = Opportunity.Create();
/* Now copy all the data from the original oppi as described in the link and adjust what needs to be adjusted */

after maintaining all the data fields, I set the relationship between the child opportunity and the original one:

var ref : elementsof Opportunity.BusinessTransactionDocumentReference;
ref.BusinessTransactionDocumentReference.ID.content = oppi.ID.content; //ID content of parent oppi
ref.BusinessTransactionDocumentReference.TypeCode = "72"; //Oppi type code
ref.BusinessTransactionDocumentRelationshipRoleCode = "1"; //Predecessor
child.BusinessTransactionDocumentReference.Create( ref );

}

It's not nice, but for now it seems to work.

Share
10 |10000 characters needed characters left characters exceeded
Anant Acharya
May 03 at 01:29 PM
1

Dear Dominik,

Were you able to find something in View -> Dump Analysis tool ?

Also please right click on affected after modify absl and check performance tips. You might get some more insight on error message.

If still you cannot identify then, i would suggest to create an incident to SAP.

Regards

Anant

Share
10 |10000 characters needed characters left characters exceeded