cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic drop down list in Adobe forms

Former Member
0 Kudos

I have created a drop down list using enumerated drop down list from webdynpro native tab and binded in the object palette by giving $record.sap-vhlist.DESCR\.DATA\.FIELD.item[]* in the list items dynamically.DESCR is the field in the internal table into which i fetched data from the database table .I have written this code in a BADI.I dont know whether my form's display type is activex or native? I am not getting any values in the drop down list.can anybody please tell me what might be missing and how should i know whether my form is ActiveX or Native?

My form is called from portal so i have used BADI to connect portal to form

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naga,

If the layout type is ZCI then you form is Native otherwise its Activex and based on this you have to use the Dropdown UI element from corresponding WDP Activex/WDP Native library.

Hope this helps!!

Regards,

Arafat

Former Member
0 Kudos

Hi ,

Can you send me that BAdi code in which you have created the drop down menu ... because my requirement is that only ..

I have to pass the internal table in which i have the value which

i want to display in the output of the drop down menu in the adobe forms ..

and save the value into the internal table or a variable the value selected from the drop down in the adobe forms..

Thanks ,

Om

Answers (4)

Answers (4)

phanir_mullapudi
Active Participant
0 Kudos

Hi,

Is there a way we can close the Enumerated DropDown list other than by selecting a value. rightnow it only closes when a value is selected. It doesn't have close option like on normal searchHelp(pop-up).

Sarang_Akhare
Explorer
0 Kudos

Hi Naga,

I am facing with the similar problem.The dropdown values are getting populated in the ADDITIONAL DATA internal table but I cant find them on dropdown list on form.

Please let me know if u have overcome with the problem.....

and is there any scripting required in this case?

Thanks in advance,

Sarang Akhare.

Former Member
0 Kudos

Hi sarang,

I have done a dynamic drop down list in which DESCR field comes from database table and pops into the drop down dynamically. I was working for a PCR scenario so the adobe form was called from portal.I will tell u all the required steps.It might work for u as it is working for me:

1.In the form:

I used two elements from library first is a "ENUMERATED DROP DOWN LIST NO SELECT" from web-dynpro native tab and second is "ISR_TEXT DISPLAY INVISIBLE ON EDIT MODE" from ISR controls tab.Place them one on other inthe form.

For drop down list the setting are:

In object, field tab click on list items there in ITEMS put :$record.sap-vhlist.DESCR\.DATA\.FIELD.item[*].in ITEMS TEXT write text in ITEMS KEY write key.

In binding,in default binding put $record.DESCR.DATA[*].FIELD.

For text element the settings are:

In binding,default binding put Normal.

when we select ISR_TEXT DISPLAY INVISIBLE ON EDIT MODE it automatically comes with calculated read only int he value tab.so open script editor and place the below code:

$record.DESCR.DATA.FIELD (in calculate).

2.Now the code in BADI is as follows:

In BADI we have to write the code for drop down list in the METHOD "SCENARIO_SET_ADDITIONAL_VALUES"

As i didnt change the standard BADI i added an enhancement spot in which i wrote a function module which fills ADDITIONAL_DATA. and the below code fills the ADDITIONAL_DATA .

DATA: t_t572b TYPE STANDARD TABLE OF t572b WITH HEADER LINE,

t_t554t TYPE STANDARD TABLE OF t554t WITH HEADER LINE.

SELECT * FROM t572b INTO TABLE t_t572b WHERE sprsl EQ 'E'.

CLEAR ls_additional_data-fieldindex.

LOOP AT t_t572b.

ADD 1 TO ls_additional_data-fieldindex.

ls_additional_data-fieldname ='DESCR_KEY'.

ls_additional_data-fieldvalue = t_t572b-descd.

APPEND ls_additional_data TO additional_data.

ls_additional_data-fieldname ='DESCR_LABEL'.

ls_additional_data-fieldvalue = t_t572b-descr.

APPEND ls_additional_data TO additional_data.

CLEAR t_t572b.

ENDLOOP.

For DESCR field the we have to declare DESCR_KEY and DESCR_LABEL in the place holders for key values and palce holders for default values in characteristics tab(where all the fields for the form are defined) of ur respective scenario.(where ur pcr scenario is defined)

Hope ur problem got resolved.

Please let me know if any doubts.

If ur form is not called from portal and u want a dynamic drop down list the difference is put a data drop down list and in object, field tab click on list items there in ITEMS select the field into which u populated the data from the database table (this code shud be written in code Initialization in the respective interface) and in ITEMS TEXT put $ in ITEMS KEY put $.and in binding as we normally do bind it to the respective field in which the data is populated from database table.

It should work.

Sarang_Akhare
Explorer
0 Kudos

Hi Divya,

Thanks for the reply. Now drop down lists in my case are working very fine.Actually I was missing the entries to be made in QISRSCENARIO in characteristics in"Settings for value help" i.e

<fieldname>_KEY and <field_LABEL" entries.

Thanks once again Divya

Sarang_Akhare
Explorer
0 Kudos

Hi Divya,

I need your help this time again.In this case I have a drop dpwn field having various values.According to those values the remaining fields in the form should get visible or invisible accordingly. Can you please help me out in scripting required in this case.

I have tried scripting as given below but it is not working. I request you to please tell me whats the problem in this and what needs to be done to achieve this.

For Example in case if i select "03 - Transfer" in the dropdown field named OPTION then I want to make New Personal Sub area field as editable else it should not get displayed on the form.Fot this the scripting i wrote in javascript in the event calculate for this field is as follows.

if($record.OPTION.DATA.FIELD == "03 - Transfer")

then

this.access == "open"

else

this.presence = "invisible"

endif

But this is not working when I check the form on portal.Please let me know what I need to do inorder to achieve this functionality.

Former Member
0 Kudos

i think try as "this.presence = visible."

i have an example where if u select value in drop down list another drop down list appears for that i wrote following code in the script editor of the second drop down list.:pay_reason is first drop down list,amount and amount enterable are 2 drop down list which are visible after selecting the first drop down list.

if($record.PAY_REASON.DATA.FIELD == null)

then

this.presence = "invisible"

else

if($record.AMOUNT.DATA.FIELD == null &

$record.AMT_ENTERABLE.DATA.FIELD == null)

then

this.presence = "invisible"

else

this.presence="visible"

if( $record.CONTROL_PARAM.ISR_MODE == "DISPLAY" |

$record.CONTROL_PARAM.ISR_FORM_VIEW == "ISR_APPROVE" | $record.AMT_ENTERABLE.DATA.FIELD == null)

then

this.access = "readOnly"

else

if($record.CONTROL_PARAM.ISR_REVIEW == "false")

then this.access = ""

endif

endif

endif

endif

Former Member
0 Kudos

Can you please help - Iadded the additional data, but when you click on the drop-down in the separation request it only displays 19 entries of possible 30. Does it have anything to do with filters or the form script calculate on the adobe form?

chintan_virani
Active Contributor
0 Kudos

Naga,

I suggest please close the thread if your question has been answered.

Chintan

chintan_virani
Active Contributor
0 Kudos

Naga,

Check the displayType property in WD or else if yopu created the form using SFP transaction then do this.:-

1. Enter the name of the form in SFP and click Change.

2. Goto Properties and check the Layout Type. If you want Native choose ZCI Layout and if forms are ACF enabled then it should be xACF layout.

Chintan