cancel
Showing results for 
Search instead for 
Did you mean: 

Linking drop down boxes

Former Member
0 Kudos

Hi all,

I would like to add multiple drop down boxes to my model, say f.e.:

- division

- country

- sales manager

- customer

These drop down boxes should be linked, such that when I select a value for division, the second drop down box only contains values that are applicable for division A. In our example, division A only sells products in Germany and Spain. When I select Germany, I would like the third drop down box to only show the names of sales manager from division A that sold products in Germany.

How to build this?

Best regards,

Ralph

Accepted Solutions (1)

Accepted Solutions (1)

former_member193545
Active Participant
0 Kudos

Hi

You can create dynamic entry lists each list takes the previous one as an input and returns only the relevant data, you may have to create bapis, rfc's or stored procedures to do this.

Jarrod Williams

Former Member
0 Kudos

I agree with Jarrod. You have to use dynamic entry lists. You can use as data service a RFC, BAPI, stored procedure and a BI Query as well. If you let me know where the data from (e.g. BI infoobject), I can give you a hint for a solution.

Best Regards,

Marcel

Former Member
0 Kudos

Hello Marcel,

I am using BI info objects:

- ZDIVISION (values = A, B, C, D)

- ZPRODUCT (values = AA, AB, AC, BA, BB, BC, CA, DA, DB)

Division A only sells products beginning with A (thus, AA, AB and AC), etc.

In my VC model I would like the value insert in dropdown box ZDIVISION to determine which values can be chosen in dropdown box ZPRODUCT.

I took a look at dynamic entry list. I saw that I can fill in a formula for the assigned input values. Ís it possible to solve this problem over here?

Thanks in advance,

Ralph

Former Member
0 Kudos

Hi Ralph,

therefore you can write a simple ABAP RFC. Start the transaction SE80 and create a RFC function module.

If you use text in your infoobject ZDIVISION you can use a simple ABAP:


FUNCTION ZZ_GET_MD_ZDIVISION .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      T_TABLE_VIEW STRUCTURE  /BIC/TZDVISION OPTIONAL

* For reading the data from the textable
SELECT * FROM /BIC/TZDVISION INTO CORRESPONDING FIELDS OF TABLE T_TABLE_VIEW.

ENDFUNCTION.

Then you can use a dynamic entry list and choose for the key F_BIC_DIVISION and TXTSH or TXTMD for your text.

Then you have to create your RFC function module for ZPRODUCT, this could look like:


FUNCTION ZZ_GET_MD_PRODUCT .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(I_SEARCH) TYPE  STRING OPTIONAL
*"  TABLES
*"      T_TABLE_VIEW STRUCTURE  /BIC/TZPROCUDT OPTIONAL

data: l_condition type string.

* Preparing String for SQL Statement e.g. A% for Division A
CONCATENATE '''' I_SEARCH '%' '''' INTO I_SEARCH.

CONCATENATE 'ZPRODUCT LIKE' I_SEARCH INTO l_condition SEPARATED BY SPACE.

* For reading the data from the textable
SELECT * FROM /BIC/TZPROCUDT INTO CORRESPONDING FIELDS OF TABLE T_TABLE_VIEW WHERE (l_condition).

ENDFUNCTION.

Then you create a dynamic entry list for ZPRODUCT and choose for input (I_SEARCH) the value of the divsion and for output again ZPRODUCT for the key and if you use text TXTMD or TXTSH for the texts.

Hope that helps,

Best Regards,

Marcel

Former Member
0 Kudos

I took the liberty to transfer our great example to the WIKI:

https://wiki.sdn.sap.com/wiki/display/VC/LinkingDrop-DownLists

Answers (0)