Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member200925
Active Participant

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

19 Comments
Labels in this area