Skip to Content
0

How to create follow up document(also Service Request) for Service Request by ABSL

Sep 06, 2017 at 07:41 AM

314

avatar image
Former Member

My friends,

I want to create a follow up document for a Service ticket using ABSL script language,the follow up document also is a Service ticket,but not the same process type.

I write the logic in the BeforeSave event of Service Request's root node, when I save one Service ticket, it trigger the breakpoint I have set in the ABSL before,but there is a dump.

I don't know which issue cause the dump.The following is the detail step.

The following picture is the Dump Analysis, but I don't know what's mean, My friend, please help me with this problem, Thank you very much.

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


//ServiceRequest: Root node
var elTaskRoot : elementsof ServiceRequest;


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);
	}
1.jpg (82.3 kB)
2.png (55.3 kB)
3.png (24.7 kB)
4.png (68.5 kB)
5.png (23.0 kB)
6.png (74.6 kB)
7.png (21.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Horst Schaude
Sep 08, 2017 at 12:07 PM
0

Hello Chiangjian,

Based on the documentation from the Repository Explorer the action CreateWithReference of the BO ServiceRequest does not support any parameters.

HTH,
. Horst

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Horst,

Thank you very much! I want to create a sub-tickets for the current tickets as following up by ABSL, do you have any good idea? I've been confused about this problem for several days, thanks again.

Changjian

Best Regard

0

Hello Changjian,

Did you had a look into the documentation of this action?

Bye,
. Horst

0
Former Member

Hi Horst,

Thanks for you reply!

I review the BO "ServiceRequest"'s information in the Repository Explorer,I can not see any documentation for the action "CreateWithReference",see the following picture.

I'm trying another way to create the follow up, Although not dump,but the docu flow of the two tickets is not created.

The code as following:

    import ABSL;
    import AP.CRM.Global;

    //Assign the Document to the BTD Reference node
    var BTDReference: elementsof ServiceRequest.BusinessTransactionDocumentReference;
    BTDReference.BusinessTransactionDocumentReference.ID.content = this.ZTicketID2.content;
    BTDReference.BusinessTransactionDocumentReference.TypeCode = "118"; //Ticket Type
    BTDReference.BusinessTransactionDocumentRelationshipRoleCode = "2"; 
    this.BusinessTransactionDocumentReference.Create(BTDReference);

Sir, please help me check the above code,thanks very much.

Changjian

Best Regard

0

Hello Changjian,

Sorry, this needs internal knowledge about the ServiceRequest BO which I am missing. :-(

Sorry,
. Horst

0
Former Member

Thank you Sir! Do you have any similar example for create follow up for Transaction?

Changjian

Best Regard

0

Hello Changjian,

I've asked some previous contacts on my side and they believe that the ID is wrong / not existing.
Does the "this.ZTicketID2.content" already exist in the system?

Second: It looks like they plan to provide some documentation :-)

HTH,
. Horst

0
Former Member
Horst Schaude

Hi Horst,

Thank you Sir! The "this.ZTicketID2.content" already exist in the system, I want to create Relationship between the two ServiceRequest,but not success. When I debug into the absl code ,the document flow has been created in the session when read the reference document of one of the ServiceRequest again,but not save to the DB,It seems not commit work. Sir,do you known what's wrong? Thank you very much!

Changjian

Best Regard

0
Former Member

Sir,

I try to use call the webservice to create follow up for ServiceRequest, the method was a SAP Colleague give to me.

And it works, Thank you very much,Sir.

Changjian

Best Regard

0
Benny Huang Sep 13, 2017 at 02:07 AM
0

Hi Changjian,

In new PDI tools, the "this" is not instance.

Try using the instance as:

var elTaskRoot : elementsof ServiceRequest;
var instTask;

foreach(var ins_this in this)
{
instTask = ServiceRequest.CreateWithReference(ins_this);
}

Best Regards,

Benny


instance.png (30.3 kB)
Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Benny,

Thanks for you reply! I try it as your code,but still have dump.Please review my steps as flowing:

Changjian

Best Regard

followup00.jpg (55.4 kB)
followup01.jpg (144.6 kB)
followup02.jpg (201.0 kB)
followup04.jpg (397.0 kB)
followup03.jpg (82.3 kB)
0
Former Member

Hi Benny,

I want to known your C4C system's version,my C4C system version as flowing,Thank you.

Changjian

Best Regard

version.png (24.9 kB)
0

Hi Changjian,

I use the system of your version, it is the same issue, maybe you need the script as:

The instTask's id, you need back to created id, in the picture it is changed by the assignment.

Best Regards,

Benny

copy-error.png (94.5 kB)
0
Former Member

Hi Benny,

I try to use call the webservice to create follow up for ServiceRequest, the method was a SAP Colleague give to me.

And it works, Thank you very much, Benny.

Changjian

Best Regard

0
Former Member

As I too need to create a copy of present Service Request on basis of Status. Could you please share the steps with screenshots preferred or code. For me too the dump is coming while using CreateWithReference(this).

Thanks in advance.

Regards,

Rupesh

0
var elTaskRoot : elementsof ServiceRequest;
var instTask;

foreach(var ins_this in this)
{
 instTask = ServiceRequest.CreateWithReference(ins_this);
}
0