cancel
Showing results for 
Search instead for 
Did you mean: 

Reset of DropdownbyIndex

former_member210563
Participant
0 Kudos

Hi.,

I have programmed a view with 3 dropdownbyindex fields below each other. They represent categories in HCM and looks almost like this:

Level1 dropdown

Level2 dropdown

Level3 dropdown

The 3 levels are related and it Works fine until the user makes a new choice at level1.

In that case Level2 and level3 should be shown with the values for the new choice but the values from the first selection remains in level2 and level3.

How can I either make them blank at new selection or read the related level2 and level3 for the new selection at level1 ?

BR

Peter

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Peter,

            i created a document for your issue please check this link if possible.

former_member210563
Participant
0 Kudos

Hi,

Would you be kind enough to send me the parameter definitions for your methods as they are not visible in the document ?

Thanks.

Peter

0 Kudos

supply_levels(cc):

 

       node ref to if_wd_context_node.

       parent_element ref to if_wd_context_element

ONACTIONON_LEVEL_SELECT(view):

  

WDEVENTCL_WD_CUSTOM_EVENT
CONTEXT_ELEMENTIF_WD_CONTEXT_ELEMENT
ID

STRING

former_member210563
Participant
0 Kudos

Hi,

I mean those in your class. ZCL_LEVELS for each method as below.

0 Kudos

GET_ALL_COMPANY_CODES_DROP:


LT_CCODEExportingType

ANY

GET_PLANT_BY_COMP_CODE_DROP:

C_CODEImportingTypeBUKRS
LT_WERKSExportingTypeANY

GET_STORGAE_BY_PLANT_DROP:

C_WERKSImportingTypeWERKS_D
LT_LGORTExportingTypeANY

GET_ALL_COMPANY_CODES:

LT_CCODEExportingTypeANY

GET_PLANT_BY_COMAPANY_CODE:

C_CODEImportingTypeBUKRS
LT_WERKSExportingTypeANY

GET_STORGAE_LOCATION_BY_PLANT:

C_WERKSImportingTypeWERKS_D
LT_LGORTExportingTypeANY
former_member210563
Participant
0 Kudos

Hi,

Thank you very much. Just one last problem. There seems to a Unicode problem. Has this since been solved ?

0 Kudos

how you declared lv_key if you just copied my program then the problem may be the way you declared the LGORT in context why because if you get this error then you should get this error in BUKRS level only

former_member210563
Participant
0 Kudos

Hi,

I have changed it accordingly and I also had to change lv_key to type LGORT_D.

However at runtime it looks like this:

ramakrishnappa
Active Contributor
0 Kudos

Hi Peter,

The error is because the selected value '0006' is not found in the drop down list of LEVEL 2. This could arise when there is conversion happening or data formatting was not correct.

Check out the drop down list values populated for LEVEL 2 and make sure that you have the same value in the KEY.

Regards,

Rama

0 Kudos

Hi peter i think it's my fault the problem is the values for the level1 0006 in level2 are

0006,DC01,DC02,DC03,PL01 but it is just showing the privious values but when you select any one not relavant to these then you are getting this error and next time when you click on the same drop down on the same LEVEL2 then you are getting the correct values i might written code of LEVEL2 in LEVEL1 ,LEVEL3 at LEVEL2  for the drop down any way i will check and change it

Answers (4)

Answers (4)

0 Kudos

HI Peter,

   

Model1:

step1 :   create a node level1(cardinality 1:n) and create an attribute BUKRS ,create a subnode        level2(cardinality 0:n , singleton ) . assign supply_levels as supply function

step2:expand the node level2 and create the attribute WERKS,create a subnode level3(cardinality 1:n, singleton ).  assign supply_levels as supply function.

step3; expand the node level3 and create attribute LGORT.

MODEL2:

  

  create recursive node with level1,level2 ,level3 anyway i will create a document and share to you if possible

former_member184578
Active Contributor
0 Kudos

Hi,

Use onSelect Event of Drop Down. read the selected value and then populate the other drop downs based on the selected value.

Check this threads for more details:

hope this helps,

Regards,

Kiran

ramakrishnappa
Active Contributor
0 Kudos

Hi Peter,

You can achieve your requirement as below

  • Go to the event OnSelect of level1 dropdown ui element
  • Set the level2 & level3 drop down value to blank
  • Also, you need to prepare the drop down list for level2 ddbi by reading the value selected in the Level1 ddbi and bind to the context node of level2 ddbi
  • Similarly, OnSelect event of level2 ddbi prepare the list for level3 ddbi based on selected value of level2 ddbi and also clear the value of level3 ddbi

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

You can use the event OnSelect of your Dropdown field Level1 to set the values to the other fields.

AbstractDropDownByIndex Events - Web Dynpro for ABAP - SAP Library

Regards,

Felipe