Skip to Content
avatar image
Former Member

CreateWithRefence - SubTicket -> Ticket

Hi SAP Experts,

We are attempting to find a solution for this scenario:

Unassociated ticket is created in C4C system. Via SDK, we would like to generate a sub-ticket from this Ticket.

We notice there is a standard method CreateWithReference in the ServiceRequest BO, after some testing, we realize that it's not so straightforward as we get a dump each time this line of code is executed.

For sake of testing, we hardcoded some values and running this off of the ServiceRequest-BeforeSave:

The dump we get is the following:

Source type \INTERFACE=IF_SERVICE_REQUEST\TYPE=TY_ROOT is not compatible, for the purposes of assignment, with target type \CLASS-POOL=BO_SERVICE_REQUEST\CLASS=ROOT\TYPE=TY_STRUCTURENamespace

Any ideas or experience with this method?

Thanks,

Jack

import ABSL;
import AP.Common.Global;
import AP.CRM.Global;

var instTask = ServiceRequest.CreateWithReference(this);

// ServiceRequest: define party node
var elTaskParty : elementsof ServiceRequest.Party;
var instParty;

instTask.Name.content = "Subject Ticket " + this.ID.content.RemoveLeadingZeros();

if (! instTask.ProcessorParty.IsSet()) {
		elTaskParty.PartyKey.PartyID.content = this.ProcessorParty.PartyKey.PartyID.content;
		instTask.ProcessorParty.Create(elTaskParty);
	}
	else
	{
		instTask.ProcessorParty.Delete();
		elTaskParty.PartyKey.PartyID.content = this.ProcessorParty.PartyKey.PartyID.content; 
		instTask.ProcessorParty.Create(elTaskParty);
	}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 08, 2017 at 11:47 AM

    Hello Jack,

    Can you use the Dump Analysis or the Debugger to locate the line in which the dump is raised?

    Bye,
    . Horst

    Add comment
    10|10000 characters needed characters exceeded