Skip to Content
0
Feb 16, 2017 at 10:52 AM

unable to pass Text Data from Data work bench to Text Collection of Custom BO. Resulting with Error

269 Views

Hi Experts,

I'm unable to pass Text Data from Data work bench to Text Collection of Custom BO. Result Ending with Error no Record getting created for Custom BO.

Let me explain the Scenario I need to create records via Data Work Bench. I'll be passing complete record with notes(The Text Data).

To pass Text Data receiving from Data Work Bench to Text Collection I'm using ABSL code

Business Object Details

businessobject transaction{

[Label(" Transaction ID")] [AlternativeKey] element Activity_ID_Number : ID;

[Label("Transaction Type")] element Transaction_Type : CodeList_InspectionTypeCode;

[Label(" Status")] element Status : CodeList_InspectionStatusCode;

[Label(" Planned Start Date")] element Start_Date : Date;

[Label(" Planned End Date")] element End_Date : Date;

[Label("Account ID")] element AccountNumber : BusinessPartnerInternalID;

[Label("New Notes")] element NewNotes : LANGUAGEINDEPENDENT_Text; // Since in Custom BO Data in Business Object can max be 255 Characters therefore it’ll be use to pass data to Text Collection

association ToCustomer to Customer;

[DependentObject(AttachmentFolder)] node Attachment;

[DependentObject(TextCollection)] node Text;

}

ABSL Code Details

Logic: Since there is a Restriction that Custom BO Fields can Max hold 255 Character if more than that while saving it'll get truncated . To hold more than 255 Character need to use Text Collection (please refer this link for reference . https://archive.sap.com/discussions/thread/3404546)

Therefore Logic I've used if New Notes field is holding data then it should create instance of Text Collection Node & also its Child node and then pass the data to Text Collection-->Text -->TextContent-->Text-->Content

Then clear New Notes Field.

Event Before Save

import ABSL;

if(!this.NewNotes.IsInitial())

{

if(!this.Text.IsSet())

{ var textnode = this.Text.Create();

if(textnode.IsSet())

{

var textassociation = textnode.Text.Create();

if(!textassociation.TextContent.IsSet())

{

var textfield = textassociation.TextContent.Create();

if(textfield.Text.content.IsInitial())

{

texttfield.Text.content = this.NewNotes;

}

}

}

}

this.NewNotes.Clear();

}

ABSL Code is executing without error(checked in debugger) but when seeing in Data workbench--> Monitor. It is showing Error. When trying to open error a Blank Page is showing. Not getting clue what went wrong

Please help me in this.

Regards

Nabarun Barua