on 2013 Jan 31 12:36 PM
Hi ByD studio forum,
recently one of the ByD solution partner raised an interesting questing regarding context dependant codelists. I create this thread to share the question and the answers (provided by Thomas Schneider) to it with the community.
Most of the ByD codelists are context independant and contain a list of unique values. Some of the codelists (i.e. WorkAgreementAdministrativeCategoryCode) are context dependant and the code value is only unique within a certain context, i.e. country, region.
Example - WorkAgreementAdministrativeCategoryCode:
List ID | Code Value | Description |
---|---|---|
AT | 1 | Hourly |
AT | 2 | Salaried Employee |
AT | 3 | Manager |
AU | 1 | Hourly |
AU | 2 | Salaried Employee |
AU | 3 | Manager |
BE | 1 | Hourly |
BE | 2 | Salaried Employee |
BE | 3 | Manager |
BR | 1 | Salaried Employee |
In a custom BO a element typed with an context dependant codelist is defined and should be placed on a custom UI.
import AP.Common.GDT as apCommonGDT;
businessobject CodeListMapping_Test {
element CustomerWorkAgreementAdministrativeCategoryCode : WorkAgreementAdministrativeCategoryCode;
}
In UI-Designer however is the required ListID not available by default:
So how can a ByD studio developer deal with context dependant codelist?
Best regards,
Ralf
Request clarification before answering.
Hi Ralf,
you need the contxt of the GDT in the BO:
import AP.Common.GDT as apCommonGDT;
businessobject CodeListMapping_Test {
element CountryCode : CountryCode;
element CustomerWorkAgreementAdministrativeCategoryCode :
WorkAgreementAdministrativeCategoryCode;
}
As a next step, go to the UI designer, select the data element CustomerWorkAgreementAdministrativeCategoryCode.content, and select "Codelist Context Mapping" from the context menu. You can maintain the context of the structured code as shown in the following figure:
Save and activate the UI model. The result is as follows:
If you set the CountryCode field (via UI or via coding) the Customer....Code code list is filterted by the country code. You can also set the Customer....Code.listID in ABSL code if the element is filled via code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ralf,
We are trying to implement the similar scenario in this thread.
But System says Key is not unique. Specify a unique combination of key field values.
Comparing with the same example if we give the combination of AT 1 and AU 1 it is not accepting them as two different keys unfortunately. But AT 1 and AT 2 works fine.
Here the field taking AT/AU is defined as an attribute and the field taking 1/2 is the Key within BCO.
All are custom fields. Nothing standard is involved here. Any idea why system is behaving this way ? Our tenant is on 1311.
Regards
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
I am not able to see the context property in the Data Model for the Code list as shown below:
Thanks & Regards,
Malkit Singh
Hi Horst,
I want to use Context Mapping for CashDiscountTermsCode for Supplier and Customer.
Here is the Model Codelist Context Mapping of content.
I tried some data types and binding. Still cannot get the required result.
Which Mapping Parameter should I used to get a dependent code list regarding Supplier and Customer.
Best Regards
Fred
Hello Fred,
This context structure is like a search structure of a query:
As the BusinessPartnerRoleCode (which is used to differentiate between a Supplier and a Customer and other BuPa roles) is not part of this context structure, you can not restrict the value help on that kind of parameter.
Sorry,
Horst
Hi Horst,
In Accounts and Suppliers, CashDiscountTermsCode (Payment Terms) is restricted automatically.
I am trying to get the similar behavior for my custom field with data type CashDiscountTermsCode.
As you said, there is no Mapping Parameter for my case.
So, I want to know how the system restrict the Payment Terms.
And whether I can follow the same or not.
Best Regards
Fred
In the ABSL you could assign number range: http://scn.sap.com/message/16571836
User | Count |
---|---|
89 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.