Skip to Content

Hello folks,

Hope you are doing great.

I’m blogging here because I saw no material centralizing how to create a field with dynamic dropdown being completed and determined from existing values in other fields.


So, first of all you need to create a new object

And create a “Business Configuration Object”:

Define the follow field like below:

Important: If you want to show in the screen the description you need to set in the “Field Type” the value “Description”, if you do not set this value the information was displayed is the code.

The second step is to create “Business Configuration Set” like below:

I fill with the follow values (for only example):

The data create above will be our reference field with the reference data.

So now, we need to create the second codelist. We will repeat the above step for the follow data:

Import: set the second field in as the “Code” value in “Data Type”

Create the BCC of the BCO create above

Now we need to create the extended field in the BO.

For this example we will use the Customer Extended Object like below:

import AP.Common.GDT;

import AP.FO.BusinessPartner.Global;

[Extension] businessobject AP.FO.BusinessPartner.Global:Customer {

        // You must activate this business object before you can access the extension fields

        // or messages in script files, forms, and screens.

           

             node AddressInformation {

           }

  

             node Common {

                    [Label(“Estado”)] element Estado:DEVESTADOCode;

                    [Label(“Cidade”)] element Cidade:DEVCIDADECode;

           }

  

             node CurrentEmployeeResponsible {

           }  

}

Note that element type is the codelist create from BCO.

Save and actvate all objects.

In the final step we will create a Embedded Component to insert these fields.

So, go in the Create new item and select the follow option

After create then in your Solution use the double click and open then.

First of all, you will select in the “BO Browser” and field created in the Extended Business Object like below:

Drag and drop to the screen in the Design tab

Now go to the Data model tab

Create Data structure like below

Add the field

Drag and Drop the fields from Select Elements and your Data Model will be stay like below:

Now go to the Controller tab

In the Inport folder create a new Inport like below

Add new parameter and configure then like below:

So, with the Inport selected go to the “Properties” tab

Set the “RequestFireOnInicialization” to value “True”

And create a new event in the “OnFire” events

In the event “Inicialize” configure something like that:

For your referente to create one EC follow the video:

Cloud Application Studio: Add Facet (Embedded Component) based on BO Extensions – YouTube

In the last step, back to the “Data Model” tab and click with the right button in the “Cidade” field (the field that will be used from referenced field).

Select the option “Codelist Context Mapping”

Select the field used in the BCO referenced with the field Extended Bussines Object

Click “OK”.

Now Save and Activate your EC (Embedded Component).

The process is done.

In your test the field “Cidade” will bee populate from data selected in the “Estado” field like below:

Regards

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

      1. Bin Huang

        Hi Anderson,

             After create Embedded Component, my screen is below, I can’t “select in the “BO Browser” and field created in the Extended Business Object”, and I can’t “drag and drop to the screen in the Design tab”.

             How can I do? Thanks.

        Best Regards.

            

            

        (0) 
        1. Saurabh Kabra

          Hi BIn,

          It will be on Right Hand Side of your UI Designer. And still if you are not able to see “BO Browser/Data Model” choose it from designer’s menu bar as follow:

          Pic.PNG

          Thanks

          Saurabh

          (0) 
        2. Anderson Balieiro Post author

          As suggested by Saurabh the view is need to selected in the menu “View” to display like I explained.

          Try do what Saurabh suggested and if you have more any issues, back to us

          (0) 
  1. Andres Gutierrez

    Hi Anderson,

    Quicl Question: I tried the same excersice as described here, but both codelist are always empty. Any idea what I’m doing wrong?

    kind regards,

    Andres

    (0) 
    1. Bin Huang

      Hi Andres,

      Me too, it is empty in both codelist, what is the problem?

      Have you solved it? Could you share me your experience?

      Thanks a lot.

      Benny

      (0) 
      1. Bin Huang

        Hi experts & Andres,

        I get the reason, the project need to create a bacelement, change the question for reviewed it, and deploy it.

        Thanks a lot.

        Benny

        (0) 
  2. Ashish Sharma

    Hi Experts ,

    Its not working for me as well.

    @ Anderson – Hi , If possible please provide some more screen shots or pdf docs if you have.

    or give your skype ID So that I can ping you there for checking this.

    Thanks
    Ashish Sharma
     

    (0) 
  3. Ashish Sharma

    My Requirement is , I need a drop down list ONLY without an EC and in which whenever required

    I can add the values.

    Can I do this using this ?

    Please help.

    (0) 
  4. Bin Huang

    Hi Anderson & experts,

    Now I do the code list with Embedded Component, as the picture:

    But the UI is just running when I edit the parentID record.

    The problem:

    If I add a new parentID record, before save the parentID record, it can’t add the child record.

    What can I adjust the UI?

    Thanks a lot.

    Best Regards,

    Benny

    (0) 
    1. Bin Huang

      Hi Anderson & experts,

      I using the UUID as the parameter, it is OK.

      Now I using the CustomBO as:

      If using the “shadow” BO, which step I need to do?

      Thanks a lot.

      Benny

      (0) 
      1. Bin Huang

        Hi Anderson & experts,

        I using the “shadow” BO, the list cann’t add row, but I don’t know what is the problem, could you help me? Thanks a lot.

        The result, add row is disabled

        the init eventhandler as

        the inport as

        the datamodel as

        Benny

        (0) 

Leave a Reply