How to add the fields into combo ?
Hi,
I want to add the table fields into combo box. Now I am able to getting the columns from table but I don�t know how to add that columns in combo box.
My jsp getting the columns from table.
function metadata(){
try {
Connection con = null;
Class.forName("oracle.jdbc.driver.OracleDriver") ;
con = DriverManager.getConnection("jdbc:oracle:thin:@10.60.4.25:1521:clopaydb","scott","tiger");
String query = "SELECT * FROM emp";
DatabaseMetaData dma = con.getMetaData ();
Statement stmt = con.createStatement ();
ResultSet rs = stmt.executeQuery (query);
ResultSetMetaData rsmd = rs.getMetaData ();
int i;
int numCols = rsmd.getColumnCount ();
for (i=1; i<=numCols; i++) {
if (i > 1) System.out.print(",");
System.out.print("\nThe Table Column list "+rsmd.getColumnLabel(i));
rs.close();
stmt.close();
con.close();
catch (Exception ex) {
ex.printStackTrace ();
}Please give me a sample code for add these items into combo. (I need JSP sample code )
Thanks & Regards,
Merlin Roshina
function metadata(){
try {??
Are you sure on this ? Dont mix javascript function with a java method.
Make a java bean and your method may return an ArrayList.
In your JSP ..
<select name="yourComboBox">
<%
// Make a For Loop for the arraylist
String columnLabel = (String ) arrayList.get(i);
<option value="<%=columnLabel%>"><%=columnLabel%></option>
<%
} // end bracing of for loop
%>
</select>
Post your code based on the directions above then we can help you more on this if reqd.
Probably you should look up into sample JSP ..JDBC sample codes on google.
-Rohit
Similar Messages
-
How to add new field into dynamic internal table
Hello Expert.
how to add new field into dynamic internal table.
PARAMETERS: P_TABLE(30). "table name
DATA: I_TAB TYPE REF TO DATA.
FIELD-SYMBOLS: <TAB> TYPE standard TABLE.
*Create dynamic FS
create DATA I_TAB TYPE TABLE OF (p_table).
ASSIGN I_TAB->* TO <TAB>.
SELECT * FROM (p_table) INTO TABLE <TAB>.
here i want to add one more field into <TAB> at LAST position and my
Field name = field_stype and
Field type = 'LVC_T_STYL'
could you please helpme out .Hi,
Please find the code below.You can add the field acc to your requirement.
Creating Dynamic internal table
TYPE-POOLS: slis.
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE, u201C Dynamic internal table name
<fs_dyntable>, u201C Field symbol to create work area
<fs_fldval> type any. u201C Field symbol to assign values
PARAMETERS: p_cols(5) TYPE c. u201C Input number of columns
DATA: t_newtable TYPE REF TO data,
t_newline TYPE REF TO data,
t_fldcat TYPE slis_t_fldcat_alv,
t_fldcat TYPE lvc_t_fcat,
wa_it_fldcat TYPE lvc_s_fcat,
wa_colno(2) TYPE n,
wa_flname(5) TYPE c.
Create fields .
DO p_cols TIMES.
CLEAR wa_it_fldcat.
move sy-index to wa_colno.
concatenate 'COL'
wa_colno
into wa_flname.
wa_it_fldcat-fieldname = wa_flname.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 10.
APPEND wa_it_fldcat TO t_fldcat.
ENDDO.
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO <t_dyntable>.
Create dynamic work area and assign to FS
CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
ASSIGN t_newline->* TO <fs_dyntable>.
Populating Dynamic internal table
DATA: fieldname(20) TYPE c.
DATA: fieldvalue(10) TYPE c.
DATA: index(3) TYPE c.
DO p_cols TIMES.
index = sy-index.
MOVE sy-index TO wa_colno.
CONCATENATE 'COL'
wa_colno
INTO wa_flname.
Set up fieldvalue
CONCATENATE 'VALUE' index INTO
fieldvalue.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
ENDDO.
Append to the dynamic internal table
APPEND <fs_dyntable> TO <t_dyntable>.
Displaying dynamic internal table using Grid.
DATA: wa_cat LIKE LINE OF fs_fldcat.
DO p_cols TIMES.
CLEAR wa_cat.
MOVE sy-index TO wa_colno.
CONCATENATE 'COL'
wa_colno
INTO wa_flname.
wa_cat-fieldname = wa_flname.
wa_cat-seltext_s = wa_flname.
wa_cat-outputlen = '10'.
APPEND wa_cat TO fs_fldcat.
ENDDO.
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = fs_fldcat
TABLES
t_outtab = <t_dyntable>. -
Hi Experts,
How to add additional field into output table VENDORS/WH TAX TYPES AND CODES in RFIDYYWT(Generic Withholding Tax Reporting).
I have no idea how to start with, please give some advice.
Thanks!
IceDear Ice,
Use Append structure, see given link:
https://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm
Regards,
Abbas. -
How to add the field sapcomponent in fast entry screen
Hi ,
This is reg the support message which is created using crmd_order.
I have a requirement in which the field sapcomponent in the transaction tab which
has to be placed in the fast entry tab also.On populating this in the fast entry screen the same value
should also be populated in the transaction tab.
Guide on how to create the field in the fast entry screen and how to link it with the transaction tab.
Step by step procudure to achieve this is appreciated.
Regards,
srikanth.Hi Ana,
Greetings and Good Morning.
We are currently going through the implementation of electronic nota fiscal in R/3 and have already implemented the old data sources and BCT for the same. Do you have any idea for enhancing the new data structures. Looks like you have gone through this recently.
Do you have a new BCT available for the same.
Kindly send me some info.
Thanks
regards
MS -
How to add the reports into INTRANET PORTAl SITE ?
Hi everybody,
We developed reports in character mode Reports 2.5 , i wants to add all the reports into INTRANET PORTAL SITE ( OUR COMPANY PORTAL SITE ) , Can you please anyone tell me what are all the procedure to followup.
Thanks in advance.Please see chapter 5, chapter 8 and appendix C of following document on how to publish reports to Oracle Portal,
http://otn.oracle.com/docs/products/reports/htdocs/doc_library/getstart/docs/a92102_01.pdf
-Jeff -
How to enhance the fields into xml schema?
Hi Expert,
We are at SRM-MDM Catalog 3.0 SP02, we enhanced two fields in the contract data which were transfered from the SRM via xml. But when the MDM import manage do the mapping between the xml file and MDM catalog items automatically, it will bring a exception with the mapping error. The error message is "Logon Error: Source file dose not conform to XML schema. Element <field name> not found in the xml schema."
How could I add these fields to xml schema?
The problem is resolved.
Edited by: Wendrin Duan on Nov 5, 2009 5:01 AMHi
Did changing the Name of the Schema in the console to be the same as the Name of the Schema file solve the problem.
I take it you used the output file with the custime fields to create the Schema file so as to have a consistent structure.
REegards,
Iggy -
How to add the fields to the transaction 'Z10SD25' using ABAP Query
Hello,
I want to add the new fields like 'From' and 'To' depending on some conditiions. But i have to do this using ABAP Query.
Can any one help me with this as I am not much aware of ABAP Query .
Regards,
DarshanaHi,
ABAP/4 query can be designed in four steps
1. Creation of a user group
2. Creation of Infoset
3. Assignment of user group to Infoset
4. Creation of the query based on Infoset
By executing the transaction codes mentioned below
u2022 SQ01 ABAP/4 Query
u2022 SQ02 Infosets
u2022 SQ03 User group
Step 1: To create an Infoset without a logical database
One of the following can be selected
u2022 Based on a single table
u2022 Using an ABAP/4 program
u2022 Using Table Joins
u2022 Using Sequential Dataset
NOTE: The tables to be used in the join should have at least one field in common i.e. it should have the same name, domain or data element.
Step 2: Here you specify the users who should be authorized to run the query. A user group is always associated with a Infoset.
Step 3: In Query Definition you can define the Selections Screen. Here you can check against the fields(fields from the tables specified in the infoset above) that you require to be shown on the selection screen.
Now we Finally need to specify the output type for the query as Basic List, Statistics or Ranked List. Choose the option Basic List and also select the fields to be displayed in the output list(in your case from and to fields...)
After providing all the above options you can save the query and execute it by clicking the Execute button twice.
Hope this helps
Regards
Shiva
Edited by: Shiva Kumar Tirumalasetty on Sep 15, 2009 12:44 PM -
How to add additional field " SEGMENT" in the FBL5N Report
Hello ,
The Requirement is we need add the field " Segment" in the Report FBL5N.
Could you please advice How to add the field " Segment" to the FBL5N Report.
Thanx & Regards
RameshHi,
try SAPNET note 373268.
Best regards, Christian -
How to add new field XREF3 in FB50
Hi,
I have a problem with adding the new field XREF3 in FB50 transaction in Items window. I configured field status group in OBC4 and OB41 transaction for XREF3 as optional entry. XREF3 is available in FB01 transaction but not in FB50. I checked table settings for Item window in FB50 using Administrator button. Field XREF3 is not displayed in current settings window. I checked also that structure ACGL_ITEM include the field XREF3. Can you give me any advice how to add the field XREF3 in this enjoy transaction FB50 ?
Thanks in advance.
Zbigniew Debowskihi,
start FB50!
at the upper right corner of the items, there is a small coloured box (blue, yellow and white), click on it
click Administrator in the popup
search for XREF3 in the list, the field Invisible (last coloum) should be ticked, untick it!
click Activate, than Close, than Close again
hope this helps
ec -
How to sort the fields in ABAP query.
Hi all
I am not able to drag the fields in Sort tool box.
Please help me how to add the fields in Sort tool bar.
Regards
GangiIn SQ01, when we are creating a query, we can define the default sort sequence & Totals also.
This can be done when defining the basic list. -
HT4913 How to add My Mac into my I Tunes account.
Hi, I want to download an App which I purchased through my iPad into my Mac Pro.
So, I noticed that my Mac is not yet registered to my device list, even though it is already authorised.
How to add the Mac into the device List? I can only see how to remove a device but not adding one.
Please help to give step by step guidance, since I tried to follow the Apple Support article and I followed it but could find the "add device".Not sure what you mean.
Just sign into your account on your computer. Go to Quick Links>Purchased in the iTunes store to download past purchases or connect your iPad and click File>Device Transfer Purchases
iphone/ipod/ipad apps do not work on a computer at all. -
How can i add Custom fields into the
Dear Experts
We have Ecc6.0 system,
How can i add Custom fields into the Infotype Screen(PA30),i heard that we do it by PM01 Tcode.
But in PM01 i am unable to find the enhance infotype tab.
How can i do it ....pls help.....
Regards
SajidHi,
Do it thru the third tab : Single Screen.
There write down the infotype number (e.g. 0022) and say generate objects.
Regards,
Dilek -
How to add a field in the view not in context node
Hi All,
I want to add a new field in one of my views. The problem is that the field does not exist in the context node. I have checked in the BOL model there it comes under another root object. I would like to know whether it is possible to add the field from another root object.
can you please help to me to solve this issue.
Advance Thanks & Regards
SujithHi Ashish,
I will give a detailed explanation of my requirement. I am working in ICWEB client for utility services, In this case for a particular view in the bsp application CRM_IUFCS_IC/View1.htm i want to add a field but the field is not the context nodes, or any of the related entities in the BOl Model. But its in another root object in the BOL Model. So i would like to know how can i add this field into my layout.
e.g.:let context node in view to be modified is buag and the field to be added is under BuilHeader object. This is the scenario.
Advance Thanks,
Sujith -
My question is that How to add a report into the SAP-SCRIPT .
by using PERFORM ......ENDPERFORM
I don't know how to used it .Hi Sandeep,
Please check this link
http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
http://www.allinterview.com/showanswers/37425.html
Calling ABAP Subroutines: PERFORM
You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = u2018|u2019. "First page
ELSE.
OUT_PAR-VALUE = u2018||u2019. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Best regards,
raam -
How to add custoim fields on the additiondata b tab of va01 and va02
Hi All,
i want to add the field on the Additional data B tab of the VA01 and VA02 at header level.
Already one field is there now i want to add one more field.How to proceed.
I think i have to go with screen exits.Can you help me in proceeding further and where should i write the code.
It is urgetn.Please help meI have to move the updated fields to the vbak table
The code is like this
If VBAK-ZZGrswgh less than ZTRKLMT-ZZweight OR
VBAK-ZZCubTot less than ZTRKLMT-ZZCube OR
VBAK-ZZPaltot less than ZTRKLMT-ZZPallet
CLEAR VBAK_ZZTRKLMT.
Else
MOVE X TO VBAK_ZZTRKLMT.
End if
should i write this code in the USEREXIT_MOVE_FIELD_TO_VBAK of program MV45AFZZ ?
This user exit should trigger when
VBAK-AUART Equals 'ZWH' OR
VBAK-AUART Equals 'ZFV'
Reply soon
Maybe you are looking for
-
In India, which LED monitor works best with the Macbook air 11". I am looking at Samsung/LG/Viewsonic 27" models. My concern is related to the device drivers. They all have drivers for Windows but not for Apple. Is that a problem?
-
Negative Planned Values in CJ40
Dear Guru's, i am getting negative planned values in CJ40 against Order/Network column. I am unable to find the root of this value. Here i am using the network costing, BOM's and MRP run process. So can any one tell me how to find the root of that ne
-
Create batch for existing GR materials
Hi, how can we create the batches for the materials whose GR is already done w/o Batch management active? imean i want to put a new batch no for the existing GR materials?
-
If I plug in my new itouch i will be receiving in a few days and sync it, will it take all of the music from itunes even if i had another older itouch attached to my account?..I dont care about the old itouch and will not be using it anymore and I do
-
Why is Creative Cloud hanging in Home, Files and Fonts?
The Creative Cloud desktop app (Version 1.1.1.220, released on 8/20/2013), running on OS X v10.8.4, hangs completely in its Home, Files, and Fonts sections. The Apps tab works fine, and I'm able to update existing and install new apps ; Behance works