cancel
Showing results for 
Search instead for 
Did you mean: 

Populating 2nd DropDown Box according to value selected in first DD box ??

Former Member
0 Kudos

Hi,

In our PCR Adobe forms we have two dropdown boxes, and our requirement is that if user selects a value in first dropdown box, second dropdown box should be populated according to the selected value.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Amit,

You can do this by placing script code in the "exit" event of the first drop down list.

For example, the following script code will set the selection of the second drop down list to match the first.

TargetList.rawValue = SrcList.rawValue;

Assuming "SrcList" is the name of the drop down list containing the data and "TargetList" is the name of the drop down list that you want to copy

If you want to populate the second list with a new set

of items, you can either fetch new XML data at this point

or update the binding of the drop down list.

From your question, I am not sure if this is helpful. Please let me know regardless.

Regards,

Blair

Former Member
0 Kudos

Hi Blair/ All,

writing on behalf of Amit.

The second drop down must have a list of values depending upon the single value selected in the first drop down. <this needs to be implemented in ISR Scenarios - MSS PCR>

A scenario -

the value types in both drop-down lists are different. say, the first drop down contains the company name and the second list contains list of cost centres in the company.

The method tried is <unsuccesful> -

1. call an event on the selection of a value at the first drop down.< through scripting>

2. define the event in the user command method of the BAdi definition -QISR1. <the event fills the additional_data values for the corresponding field i.e the second drop down list.

on debuging, the control is going fine as desired. even though the values are getting filled. the same are not getting reflected at the portal side.

it seems the additional values are not getting updated in the user_command method of the BAdi definition QISR1 other than Add_values method.

Any points/ solutions on this issue is higly appreciated.

Kindly help.

Rgds,

anto for amit.

Former Member
0 Kudos

Hi,

I had a similar requirement in my previous client site like based on the Personnel Area selected, I used to get the list of Personnel Sub Area.

For this, I had triggered an EVENT say PERSG on Exit Event of Personnel Sub Area field in Adobe form.

This event is handled in QISR1 BADI - SCENARIO_PROCESS_USER_COMMAND as...

<i> if user_command = 'PERSG'.

READ TABLE SPECIAL_DATA INTO LS_SPECIAL_DATA WITH KEY FIELDNAME = 'EG_NEW'.

IF SY-SUBRC = 0.

MOVE LS_SPECIAL_DATA-FIELDVALUE TO W_PERSG.

SELECT * FROM T503 INTO CORRESPONDING FIELDS OF TABLE ESG_TAB

WHERE PERSG = W_PERSG.

CLEAR INDEX.

LOOP AT ESG_TAB INTO WA_ESG_TAB.

CLEAR W_PTEXT.

SELECT SINGLE PTEXT INTO W_PTEXT FROM T503T

WHERE PERSK = WA_ESG_TAB-PERSK.

ADD 1 TO INDEX.

CLEAR LS_ADDITIONAL_DATA.

LS_ADDITIONAL_DATA-FIELDINDEX = INDEX.

LS_ADDITIONAL_DATA-FIELDNAME = 'ESG_NEW_KEY'.

LS_ADDITIONAL_DATA-FIELDVALUE = WA_ESG_TAB-PERSK.

APPEND LS_ADDITIONAL_DATA TO ADDITIONAL_DATA.

CLEAR LS_ADDITIONAL_DATA.

LS_ADDITIONAL_DATA-FIELDINDEX = INDEX.

LS_ADDITIONAL_DATA-FIELDNAME = 'ESG_NEW_LABEL'.

CONCATENATE W_PTEXT '(' WA_ESG_TAB-PERSK ')'

INTO LS_ADDITIONAL_DATA-FIELDVALUE.

APPEND LS_ADDITIONAL_DATA TO ADDITIONAL_DATA.

ENDLOOP.

ENDIF.

ENDIF.</i>

I hope this clears your problem.

Regards,

<i><b>Raja Sekhar</b></i>

Former Member
0 Kudos

Hi Shekar,

We have implemented the same as said in the previous mail.. but the data in the additional_values were not getting reflected in the portal accordingly..

both the drop downs are working fine.. when they are checked seperately thru add _values method.

but the changes in add_vaues (on debugging the values are getting filled up) at the user_commm method is not getting reflected in the portal side.

is there any note relating to it.. (though i couldn't find any)..

Shekar, it would be great if you cud send me your contact no: or mail id.

Kindly help.. any suggestions are highly appreciated. (i will surely recheck the codes we have impolemented)

Thank you,

Rgds,

Anto.

Former Member
0 Kudos

Hi,

Do you really think that this PERSG(say) Event is getting triggered at appropiate time say EXIT Event. Check those scripts and also make sure that this event is getting triggered.

Regards,

<i><b>Raja Sekhar</b></i>

Message was edited by: Raja Sekhar

Message was edited by: Raja Sekhar

Former Member
0 Kudos

Hi Anto,

Is your problem closed?

Please update us.

Regards,

<i><b>Raja Sekhar</b></i>

Former Member
0 Kudos

Hi,

Updating this thread as I have recieved many offline queries regarding this.

On triggering the event, the flow of BADi methods called are different. Please put a breakpoint in the metthods and check.

Sorry, i forgot about this thread to update.

Regards,

Antony.

Answers (0)