cancel
Showing results for 
Search instead for 
Did you mean: 

Copying to "Custom BO" from "Standard BO"

Former Member
0 Kudos

Dear Experts

I'd like to copy all data from Standard BO.

For example, I'd like to copy to my custom bo from "TradeReceivablesPayablesRegister" BO

But, I don't know how to implement...

Please tell me some advice.

Best regards,

Ryota Ichida


Accepted Solutions (1)

Accepted Solutions (1)

sunil1101
Advisor
Advisor
0 Kudos

Hi Ryota,

there are different way to do this

1. Internal service integration, apply the logic the way you want to transfer

2. Use XML file input, in this case you have to download data from your standard BO (either from OWL or from available reports)

you can get more details about how to implement these two way in SDK document at page 471(studio_od_1402).

third way via ABSL coding, you can write an action in your custom BO and query the Standard BO, using query selection parameter fetch those data what you want to copy in your custom BO.

inside the loop you can use Create method to create all instance of std bo in custom bo.

here is the sample code

I want to copy ServiceRequest data in my custom BO,

Only those open ticket I want to copy

1. create you custom BO with required elements with an action


import AP.Common.GDT as apCommonGDT; businessobject Test_RecieverBO {         [AlternativeKey]element TicketID:BusinessTransactionDocumentID;
element ServiceStatus:ServiceRequestLifeCycleStatusCode;
element CreationDateTime:BASIS.Global:GLOBAL_DateTime;
element LastChnageDateTime:BASIS.Global:GLOBAL_DateTime;


action CopySRdata;
}

  ABSL code for copy the data in custom BO(Test_Reciever)


import ABSL;
import AP.CRM.Global;
var NodeElement:elementsof Test_RecieverBO;
var qrysr = ServiceRequest.ServiceRequestOverview.QueryByElements;
var qrySel = qrysr.CreateSelectionParams();
qrySel.Add(qrysr.Status.ServiceRequestLifeCycleStatusCode, "I", "EQ", "1");
var qryRes = qrysr.Execute(qrySel);
if (qryRes.Count()>0){
foreach( var ins in qryRes){
NodeElement.TicketID = ins.ID;
NodeElement.ServiceStatus = ins.Status.ServiceRequestLifeCycleStatusCode;
NodeElement.CreationDateTime = ins.ToRoot.SystemAdministrativeData.CreationDateTime;
NodeElement.LastChnageDateTime = ins.ToRoot.SystemAdministrativeData.LastChangeDateTime;
Test_RecieverBO.Create(NodeElement);

}
}

you can call this action in owl, if data will be huge then it will take time
Hope this help

Regards
Sunil

Former Member
0 Kudos

Dear Sunil

I appreciate your kindness.

I tried the way of ABSL coding. But, I have a problem.

I can get the copy data. But, the search criteria are displayed in OWL.(like a below screen)

Could you tell me how to solve it?

Best regards,

Ryota Ichida

sunil1101
Advisor
Advisor
0 Kudos

Hi Ryota,

My Apologies, I did not understand your problem with search criteria.

What exactly you want to solve here?

Regard

Sunil

Former Member
0 Kudos

Dear Sunil

Sorry for not explaining enough.

I run the following step using your coding

1. Click a Action button (Finished copy action)

2. Click a "Close" in QAF

3. Click a "Yes" in "Confirmation Dialog" screen

4. The blank data is registered

I would not like to register it. Please tell me some advice.

For example, is it possible to close directly without "Confirmation Dialog"?

Best regards,

Ryota Ichida

sunil1101
Advisor
Advisor
0 Kudos

Hi Ryota,

Yes you can do

Go to UI designer, Controler->EventHandler open your BO action and check the checkbox

"Save After Execution"

or you can add one more windowAction after the BO action and use action type save.

hope this help

Sunil

Former Member
0 Kudos

Dear Sunile

Thank you so much

The problem was solved by your advice

Finally, there is one question.

Is it possible to close directly without "Confirmation Dialog"?

Best regards,

Ryota Ichida

sunil1101
Advisor
Advisor
0 Kudos

No

When your task keep unsave then this notification is needed, it can not be ignored

Only thing is that your current data must be saved

Thanks

Sunil

Former Member
0 Kudos

Dear Sunil

Noted with thanks.

Thank you for your cooperation.

Best regards,

Ryota Ichida

Answers (0)