on 2024 Sep 25 7:06 AM
Hello community !
In one of my SAP MDK Projects, I have a page with 3 list pickers, Plants, Projects and Department. I am trying to filter the Department list based on the value chosen for Plant. However this dynamic filtering is not working.
Please suggest what can be done here !
This is my page.
This is my filtering: $filter=werks eq '{{#Control:FCSetPlant/#SelectedValue}}'
Request clarification before answering.
This is a case of cascading list picker where you want to display value in a picker based on the selection from previous picker.
You will set a rule to the OnValueChange event of the Plant List picker. Based on the selected value from the Plant List picker, this rule will set the query option and update the Target Specifier of the Department List Picker.
See this example:
export default function PlantTypeChange(context) {
let pageProxy = context.getPageProxy();
let plantPicker = pageProxy.getControl('SectionedTable0').getSection('SectionFormCell0').getControl('PlantLP');
let plantTypeValue = plantPicker.getValue()[0].ReturnValue;
let DepartmentPicker = pageProxy.getControl('SectionedTable0').getSection('SectionFormCell0').getControl('DepartmentLP');
let specifier = DepartmentPicker.getTargetSpecifier();
let qo = `$filter=werks eq '${plantTypeValue}'`;
specifier.setQueryOptions(qo);
DepartmentPicker.setTargetSpecifier(specifier);
}
You may additionally set the Department Picker to disable until a Plant is selected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.