Skip to Content
0

SAP C4C - Use KUT field in ABSL query

Nov 23, 2017 at 01:35 PM

208

avatar image

Hello experts,

I'm looking for a way to use a custom field defined via KUT in an ABSL query in the Cloud Application Studio.

I've read the following posts, but they don't give a definitive answer:

https://archive.sap.com/discussions/thread/3871694 https://answers.sap.com/questions/215431/sap-c4c-extend-kut-field-to-query-and-using-on-sdk.html

The field is an extension field on the Customer Business Object and is already made available via a .ref file in the Cloud Application Studio.

query2 = Customer.QueryByIdentification;
param2 = query2.CreateSelectionParams();
param2.Add(query2.HeaderExtSubChannel.content, "I", "EQ", this.AccountType.content);
result2 = query2.Execute(param2);

Above code is what I'm trying.

Where "HeaderExtSubChannel" is the extension field defined via KUT.
But... It's not working.

Any suggestions are more than welcome!

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Abdul Rasheed Mohammed Nov 25, 2017 at 09:26 AM
1

Hi Glenn,

Add the KUT field to the QueryCustomerIn Service by going into KUT field definition -> Services tab. Once field is added to the query, you can check the same in Code completion in SDK as well

Regards,

AbdulRasheed

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you Abdul!

I will try it out and let you know if it worked!

0

Abdul,

This is the correct answer! Thank you very much!

Kind Regards,

Glenn

0
Johannes Schneider Nov 24, 2017 at 08:04 AM
0

Hello Glenn,

You have to implement a reference to Customer-Specific Fields. This is an object addable in the add new item Pop-Up.

There you have to select the Key User Tool created fields.

Now you should be able to select them.

Kind Regards,

Johannes

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hello Johannes,

First of all, thank you very much for the reply.

However, like I said I already made a reference to Customer-Specific Field. And I've checked the "HeaderExtSubChannel" field there.

"The field is an extension field on the Customer Business Object and is already made available via a .ref file in the Cloud Application Studio."


And I can access the field in ABSL code in general.

E.g. works:

var subChannel = Customer.HeaderExtSubChannel

But I can't use it in a query!


When you define an extension field via the Cloud Application Studio (instead of via KUT), you can annotate the field with an extension scenario. In that extension scenario you can check the options to enable the extension field for query.

So I need some way to achieve the same for the KUT field.

0

Hello Glenn,

did you try to debug your coding?

Try to test with an InternalID of a customer first and check if the system repsonds at all.

If the query with the KUT field does not run into errors, it might doesnt find any customer with a filled field.

Kind Regards,

Johannes

0

Johannes,

No that's not the problem...

In code below when I type "query2." and use code completion, the field isn't even showing up.
While all other extension fields are showing up. That's because they are made with the Studio and are included in the Extension Scenairo.

param2.Add(query2.HeaderExtSubChannel.content, "I", "EQ", this.AccountType.content); 
0