cancel
Showing results for 
Search instead for 
Did you mean: 

Please don't use terms like "urgent" and tons of exclamation marks!!!!

Former Member
0 Kudos

hiiii all,

In my application,I have a value help for selecting the different countries.For getting the list of countries we have used a function Zhr_Countryf4_Input. For each of the country, a list of states should be populated in the drop-down key.We also have a function module for the list of states called Iside_Sm_Region_Help_Get_Input. So plz suggest me the coding so that for selecting each of the country, the list of corresponding states get populated.

This is very urgent...plzz do suggest.

Thanks,

parama.

Edited by: Armin Reichert on Apr 18, 2008 2:38 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

hi,

First create a context attribute ot type Visibility.

and in the property of the Dropdown bind it to the Context Attribute of Visibility.

in the DoInit method , set the Visibilty to NONE.

i think u might have done the value help for Countries.

Once u have done the ValueHelp , get the Country name Iterate the Function Module for the Country and check the user entered country and Country in ur Function using if Condition.

once u have done based on the Conditional statement u call the corresponding statelist for the country and populate the DropDownList and here set the Visibility to VISIBLE for the drop down .

Thanks and regards

Fistae

Answers (3)

Answers (3)

nikhil_bose
Active Contributor
0 Kudos

see you got all country listed in UIElement ( I Hope so)

if you need the states form R/3 you need another model too say Iside_Sm_Region_Help_Get_Input.

after importing, binding & initializing the node ( ask if you have any doubt in this steps)

you can call the second RFC ( for states) in the onAction() of the UIElement which holds the country list.

Please let me know if you have any problem

nikhiL

Former Member
0 Kudos

Hello Parama,

You have two function modules and you have to call them in your application.

code the methods for calling country and states rfcs in Controller context.


public void executeCountryList()
{
wdContext.currentZhr_Countryf4_InputElement().modelObject().execute();
wdContext.resultCountry().invalidate();
}
public void executeStateList()
{
wdContext.currentIside_Sm_Region_Help_Get_InputElement().modelObject().execute();
wdContext.resultState().invalidate();
}

In the view put a table and bind the Country node to it and in the init() type this code


wdThis.wdGetXXXXController().executeCountryList();

In view put a Dropdownbykey/index element and bind the result node of state to it. In the leadselection action of the table type the code for calling the Bapi for state


String str = wdContext.currentContextElement().getTableCntry();
wdContext.currentIside_Sm_Region_Help_Get_InputElement().setCountry( str);
wdThis.wdGetXXXXController().executeStateList();

Regards

Vinod V

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Laha

These are the steps to implement your solutions.When at runtime you need to show both the drop downs to the end user or only contry DD first after selecting State DD.If this is the case you have to control the visibility of the State DD.

1.Create a context attr of type string and binded to selectedKey of country DD.

2.populate contry DD first in init method.

3.When user selects a country then passing country key to RFC and execute the RFC and get the States list.

You need to write in the Action assigned to country DD.

4.Populate State DD now in the same Action.

Regards

kalyan