Skip to Content
Author's profile photo Victor Silva

Create a dependent dropdown with context mapping

Dear community,

I see that this topic is kind of spread on some discussions inside of the community. I am creating this document in order to unify the knowledge.

The objective of this document is to present how to create a dependent Drop Down list.

See also Create a dependent dropdown without context mapping

* TODO: Check PROS and CONS on with/without context mapping.

In this example I’ll use a new BCO for Country and another for State.

1. Create BCO and BCS for your Code Lists (you can also use standard ones)

bco-country.PNG

bco-state.PNG

* Note that on State you will have to create an Attribute of Type “Code” and Subtype as your first level Code List.


bcs-state.PNG

* Note that the Key must be Unique. So if you want meaningful Keys, you’ll have to combine the first and second Keys.

2. Create the Codelist Context Mapping on UI Designer

Go on the field under the Data Model, Right Click and define the dependency.

Codelist-Context-Mapping.PNG

codelist-mapping.PNG

3. Final result

front-end.PNG

* In case you need a “live update” on your dependency, you will need to make your First level Codelist as Round Trip True.

Note that it goes against SAP Cloud Application Studio Performance Best Practices

Have fun! 🙂

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Victor Silva
      Victor Silva
      Blog Post Author

      Alessandro Iannacci,,

      Let us know what you think about doing the dependency with/without context mapping.

      I know we would not be able to run without context mapping on IPad (old app) because of the Script.

      Author's profile photo Alessandro Iannacci
      Alessandro Iannacci

      Basically there is no difference, it's just another way to do it. Maybe you can be a little more flexible with the query conditions. And yes, on iPad will be difficult to run withouth context mapping

      Author's profile photo Former Member
      Former Member

      There is a very annoying limitation in standard TI headers, where we cannot apply such feature. I wish this could be addresses at some point in time. Also, with hyperlinks, OVS, etc...

      Author's profile photo Former Member
      Former Member

      Great 🙂

      Thanks!

      Are there any differences between using this and a codelist?

      Author's profile photo Victor Silva
      Victor Silva
      Blog Post Author

      Hello Will,

      There are some...

      1. Codelist can just have a Key and one Description. No other field is allowed

      1.1. Due to this limitation, Codelist cannot be used as the secondary level of the Dropdown dependency

      2. Codelist cannot be changed via KUT

      2.1. You can create BC View based on your BCO

      Author's profile photo Former Member
      Former Member

      Thank you for sharing Victor Silva,

      Its really helpful.............. 🙂

      Regards,

      Mithun

      Author's profile photo Md Quddus
      Md Quddus

      Thanks for sharing.

      Regards,

      Quddus

      Author's profile photo Kalaiselvan S
      Kalaiselvan S

      Hi Victor Silva,

       

      Could you please help me out, how to achieve this dependent drop-down codelist mapping for XBO.

      I have using this in Goods and Activity confirmation XBO.

      Thanks,

      Kalaiselvan S.

       

       

       

      Author's profile photo Former Member
      Former Member

      Could help me achieve that plz !!

      Author's profile photo Jayant Saini
      Jayant Saini

      Hi Victor,

      I am trying to replicate the scenario however after selecting the country, I am unable to select the state as its goes it infinite loading state(three dots keep moving). Is there anything I need to check?

      Thanks,

      Jay

      Author's profile photo Former Member
      Former Member

      hello,

      I tried to replicate this work but i get empty fields in the UI