on 03-15-2011 7:30 AM
Hi all,
I have created a field in the layout with type DROPDOWN which is a field of internal table.
I want to show that whatever data is populated in that field of intenal table,it should be shown in the form of drop down list.
Please help how to proceed in it.
Thanks in advance,
Rosalin
Hi Rosalin,
Search the forum before posting. Check whether the following blog helps you out.
[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6793] [original link is broken] [original link is broken] [original link is broken];
Thanks & Regards,
Sanoosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rosalin,
Is it something like an offline scenario and you need to fetch values from SAP while user is filling the form?
You can get this done in two ways.
1. Fetch all the values and keep it in a hidden table within the form while downloading the form
2. Use web services to fetch values at runtime
Thanks & regards,
Sanoosh
Hi Rosalin,
Loop the hidden table, get the values and populate drop down in each iteration.
DropDownList1.addItem("Text","Value");
You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
Hope this helps.
Thanks & Regards,
Sanoosh
Hi ,
Thanks for the reply.
I have created an internal table & have populated the values in it.
But please clarify how to loop the hidden table & get the values and populate drop down in each iteration,
Should I do that in code initialization or in script editor.
And also clarify how to bind the dropdown list dynamically.
Thanks
Rosalin
Edited by: Rosalin Sahu on Mar 16, 2011 5:56 AM
Hi,
I have the table with binding and hidden in the form.
Hi below is the code I do it in form ready event of the dropdown.
var reqCount = this.parent.Request_Text_Table.nodes.length;
for(var i = 0; i < reqCount-1 ; i++){
this.addItem(xfa.resolvenode("this.parent.Request_Text_Table.Data["+i+"].key").rawValue, this.parent.Request_Text_Table.Data["+i+"].Desc").rawValue);
}
hope the approach helps you,
Cheers,
Sai
Hi,
Use following script to loop table, get the values and add to dropdown list.
var hidTab = xfa.resolveNodes("mainForm.subForm.table[*].DATA[*]");
var hidTab_len = hidTab.length;
for (var i=0; i<hidTab_len; i++)
{
var text = hidTab.item(i).Field1.rawValue;
var value = hidTab.item(i).Field2.rawValue;
DropDownList1.addItem("text","value");
}
Thanks & Regards,
Sanoosh
HI Sanoosh,
I have used the binding to the internal table values for displaying the drop-down list values and I could see them in the PDF form when i execute the form through a print program but when I integrated the form in WebdynproABAP , all the internal tables usually you declare under 'Global data' were not visible in context in Webdynpro ABAP, Could you let me know how I could get these values for drop-down lists and for online interactive form , my interface type is ABAP dictionary based , is it correct or need to be changed for dipslaying the values in dropdown list box as per SAP standards ???
Thanks,
SP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roslin,
Goto SFP tcode.
1.Create Interface
In gobal Definitions->Types->Define Structure.
In gobal Definitions->gobaldata->Define Variable
Initialization->Define Outparameters
Select * into table IT_table from (Custom or standard table).
2. Create forms
Goto layout->Drag and drop the Drop-Down list
And the Bind the value IT_table
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.