cancel
Showing results for 
Search instead for 
Did you mean: 

How to Query by KUT Field in an Stand. BO.

pablo_daniel
Participant
0 Kudos

Hi experts,

I have the following situation,

I am extending a Customer Quote and Referencing Field from KUT.  The problem is with a Field what is necessary to check for duplicity.

The Field was defined like Text and not like ID, i am trying by ABSL code to query by this field but is not shown.

There is a way to check by a KUT field for duplicity ?

Thx!!!.

Regards Pablo.

Accepted Solutions (0)

Answers (3)

Answers (3)

pablo_daniel
Participant
0 Kudos

Hi Guys,

Finally i tried with this way,

var queryCustomers = this.QueryByBusinessObjectCustomer.Execute().CurrentCommon.Where(w=>w.NumerodeDocumento1==numeroDoc).Count();

But i have a problem, This sentence delays 10 seconds to execute.!!

There is another way to execute the same sentence with better performance?

Thx.

former_member200567
Active Contributor
0 Kudos

Hi Pablo,

There is no way afaik.

Have you tried with making Alternative Key as I suggested before?

Still, not sure if you can make a reference field Alternative Key.

Best Regards,

Fred

Former Member
0 Kudos

Hi Pablo,

Take a look at this. http://scn.sap.com/community/business-bydesign/studio/blog/2015/08/27/sap- cloud-application-studio-performance-best-practices. Specifically the bit about using query.ExecuteDataOnly()

Additionally if your tenant is on 1602 you can right click on the ABSL file and click "Performance Tips", it will analyse the ABSL and give you the results on how to improve performance and stop dumps.

pablo_daniel
Participant
0 Kudos

Hi Fred,

This is not possible.

Best Regards.

Pablo.

pablo_daniel
Participant
0 Kudos

Hi Will,

The problem is that i cannot to acces to the field using ExecuteDataOnly. Using only Execute i can access.

Best Regards.

Pablo.

pablo_daniel
Participant
0 Kudos

I tried to see this option, i have the studio Version 1602, but is not visible .

Thxs.

Former Member
0 Kudos

The initial release didn't include the performance tips for some reason, if you go to the service marketplace you can get the latest version.

pablo_daniel
Participant
0 Kudos

Hi Guys,

I am facign the same problem trying to use the Standar query of the customer BO and filtering for the KUT field (using by .ref file). Using Selection params. (I cannot see this KUT Field)

I am trying to filter by iteration. (I know this is not for good performance)

In validation-Onsave.absl i tried by this way.

var nroDoc = this.CurrentCommon.NumerodeDocumento ;

var customers = Customer.QueryByBusinessObjectCustomer.ExecuteFromDB();

foreach (var entry in customers){

  if(nroDoc = entry.CurrentCommon.NumerodeDocumento1)

     {

          return false;

     }

}

but is not working .

former_member200567
Active Contributor
0 Kudos

Hi Pablo,

How about making that ref field AlternativeKey?

ExecuteFromDB has some problem. You can search some threads related to that issue in the forum.

Best Regards,

Fred

pablo_daniel
Participant
0 Kudos

Hi Fred, yes is true,

This was for Testing porpouses,

Can i make  AlternativeKey a Ref Field created from KUT ?

Can you help me?

Thx for the help!!!

former_member200567
Active Contributor
0 Kudos

Hi Pablo,

To be honest, I have never set ref field as alternative key.

Just suggesting an option.

If you are going to create one by one (saving one instance after another), then you can just use Execute method.

Cheers,

Fred

former_member200567
Active Contributor
0 Kudos

Hi Pablo,

Have you checked this out?

Best regards,

Fred

former_member186648
Active Contributor
0 Kudos

Hi Pablo,

What i understand is you have created a KUT extension field and have created .ref file to access it in
SDK.
You want to check for duplicate entries for this field, for that you want to query and see if the value for
this field already exists.

Have you also enhanced the KUT field to the Query in KUT?

Thanks, Pradeep.

pablo_daniel
Participant
0 Kudos

Hi Pradeep, i don´t know how to make this steep. Can you Help me?

Thx,

Pablo

pablo_daniel
Participant
0 Kudos

I tried in KUT Configuration and adaptation to enhace this field to the query, but i cannot see the option.

Thx for the help.