Trap string output from resultset and pass the value to getSchema.
I want to get the string ldb output frm the resultset and pass it to getSchemas(ldb).kindly let me know how to do it,right now it is throwing error like variable ldb might not have been initialised.
public boolean Err_getSchemas() {
boolean ret = true;
try {
System.out.println("**** Testing getSchemas Tests : - ");
if(login()) {
Statement stmt = con.createStatement();
ResultSet rs;
String ldb;
rs = stmt.executeQuery("SELECT identifier FROM ldb_catalog");
while(rs.next())
ldb = rs.getString(1);
//String ldb = rs.getString(1);
//System.out.println("lll"+ldb);
try{
System.out.println("1.Testing DatabaseMetaData.getSchemas() with string ldb");
ordbjava.jdbc.ordbMetaData dbmd = ( ordbjava.jdbc.ordbMetaData)con.getMetaData();
ResultSet dbmdrst = dbmd.getSchemas(ldb);
System.out.println(" Exception not thrown: TEST Pass ");
dbmdrst.close();
}catch(Exception ex){
System.out.println("***JDBCMetaData.getSchemas() with string ldb failure***");
System.out.println(" Catch Exception"+ex );
catch (SQLException e) {
printExceptionStack(e);
System.out.println("***ordbCollection Preparation Error Caught SQLException: " + e.getMessage());
return false;
finally {
try {
con.close();
catch (SQLException e) {}
return ret;
}
I want to get the string ldb output frm the resultset and pass it to getSchemas(ldb).kindly let me know how to do it,right now it is throwing error like variable ldb might not have been initialised.
public boolean Err_getSchemas() {
boolean ret = true;
try {
System.out.println("**** Testing getSchemas Tests : - ");
if(login()) {
Statement stmt = con.createStatement();
ResultSet rs;
String ldb;
rs = stmt.executeQuery("SELECT identifier FROM ldb_catalog");
while(rs.next())
ldb = rs.getString(1);
//String ldb = rs.getString(1);
//System.out.println("lll"+ldb);
try{
System.out.println("1.Testing DatabaseMetaData.getSchemas() with string ldb");
ordbjava.jdbc.ordbMetaData dbmd = ( ordbjava.jdbc.ordbMetaData)con.getMetaData();
ResultSet dbmdrst = dbmd.getSchemas(ldb);
System.out.println(" Exception not thrown: TEST Pass ");
dbmdrst.close();
}catch(Exception ex){
System.out.println("***JDBCMetaData.getSchemas() with string ldb failure***");
System.out.println(" Catch Exception"+ex );
catch (SQLException e) {
printExceptionStack(e);
System.out.println("***ordbCollection Preparation Error Caught SQLException: " + e.getMessage());
return false;
finally {
try {
con.close();
catch (SQLException e) {}
return ret;
}
Similar Messages
-
Call RFC from ECC and display the values in AET
Hi ALL,
I had an RFC in ECC ( Z_CRM_SPEC_DATA) this should be called into my AET Fields in getter method.
In getter method of tat AET field what code should i write?
Plz help me on this.HI,
1) Call the RFC(Z_CRM_SPEC_DATA) from ECC and display the values as mentioned in below AET fields.
AET FIELDS : zzfld00000M zzfld00000N
Description : Budget Quan Forecast Quan
values : (--5.0)(6.0--
2) (Fetch Budget and Forecast data from ECC ),you would need to pass Material Number(MATNR) as well as Ship to party info to fetch the budget and forecast data as one material may be assigned to 2 or more SH with specific budget and forecast data for each.
Edited by: venkatabharathv on May 23, 2011 2:44 PM
Edited by: venkatabharathv on May 23, 2011 2:49 PM -
How to retrieve the procedure value and pass the value to a form field
How to retrieve the procedure value and pass the value to a form field?
Set property for the field and the value is the actual procedure/function.
Cheers -
Is the raw output from JSP and XSQLServlet the same?
Hi
Is there is difference between the raw output from XSQLServlet and JSP? For example, assuming the same content is being generated, is there some additional header information emitted by XSQLServlet that is not done by JSP?
I am using software that successfully consumes generated content from a JSP OK, but the same content (using the same XML/XSL) generated from XSQLServlet is being rejected. I am puzzled by this. Maybe this is due to some differences in servlet output or an encoding issue? The content is not HTML but XML-like with an "application" contentType, like Steve's SVG example.
It seems that XSQLServlet is showing some data prior to emitting the actual content, i.e. HTTP version, responding server version, content type and date, e.g.
HTTP/1.0 200 OK^M
Server: Resin/2.0.5^M
Content-type: application/x-sky; charset=UTF-8^M
Date: Thu, 28 Mar 2002 06:45:34 GMT^M
^M
(then the generated content)
Is this preamble usually generated by a JSP also?
If not, can this information be turned off, or put another way, can XSQLServlet's raw output be set to be exactly like JSP? If not, is there a workaround?
I have tried setting the following XSQLConfig.xml
<suppress-mime-charset> for the mime-type &
<character-set-conversion>
<none/>
</character-set-conversion>
also, but to no avail.
Please help! I really want to use XSQLServlet!
Thanks.
Michael.Yes, just less fine control over the process but the same engine.
Regards
TD -
RFC to read the attachment from PR05 and pass the doc to the PHP front end
Hi Team,
Our requirement : We are designing a new front end using PHP portal and pull the data from SAP-backend for travel expense/request.
We are able to upload the document to PR05 using frontend portal.
If employee/manger wants to read the attachment in the portal,how to get the documents attached in PR05 to the front end..
I would like to know the RFC which help me in reading the attachemnts.Regards,
MadhuI dont want use all the values in my second program I need to pass empno and job only.Since your cursor gets all the columns (using the * is not a good way to code the cursor), that is what your other program will get when it calls pr_test procedure. You will have to FETCH all the columns in that other procedure and discard the ones you do not need.
Alternatively, change the code of cursor to select only the columns you would actually need. -
Need help parsing a long and passing the value.
I'm doing Cattle Drve 4b on javaranch.com (http://www.javaranch.com/say.jsp) and I need a bit of help.
I want to pass the reference of my num value to several small methods to work out the value printed. Here's the original code I did from 4a:
public class Say{
public static void main(String[]args){
int num = Integer.parseInt(args[0]); // parse argument from command line
String array[] ={"Zero", "One", "Two", "Three", "four", "five", "six","seven","eight",
"nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen",
"seventeen","eighteen","nineteen","twenty","thirty","fourty","fifty",
"sixty","seventy","eighty","ninety"}; //initialize the array
//start check for value
if(num<21)
System.out.println("\n" + array[num]);
// \n is added before
else if(num<30) // each result for a
System.out.println("\n" + array[20]+ "-" + array[(num-20)]); // cleaner output
else if(num<40)
System.out.println("\n" + array[21]+ "-" + array[(num-30)]);
else if(num<50)
System.out.println("\n" + array[22]+ "-" + array[(num-40)]);
else if(num<60)
System.out.println("\n" + array[23]+ "-" + array[(num-50)]);
else if(num<70)
System.out.println("\n" + array[24]+ "-" + array[(num-60)]);
else if(num<80)
System.out.println("\n" + array[25]+ "-" + array[(num-70)]);
else if(num<90)
System.out.println("\n" + array[26]+ "-" + array[(num-80)]);
else if(num<100)
System.out.println("\n" + array[27]+ "-" + array[(num-90)]);
//endFor 4b I need to be able to print out values in the billions, so I was going to create a few methods to keep it clean like so:
public class billion (long (int num)
{ if( num<9 billion)
num-= 8 billion
System.out.print("eight billion ");
else if(num<8 billion){
num-= 7 billion
System.out.print("seven billion ");
....etc
return num;
public class million...
public class thousand...
etc.And the current main section will be moved into a new "tens" class.
I'm running into two problems though.
1. How do you parse a long? I know integers are like so:
int num = Integer.parseInt(args[0]); are longs the same?
like:
long num = Long.parseLong(args[0L])if not, how can I do it?
2. how do I properly pass num to all the methods? I'm going to make num a public int and make the methods public because that seems simplest, but can I pass num to the method and then return the new value of num back to main?
BTW, I'll be removing the carriage return from the beginning of the "tens" class when all is said and done so the results don't end up printing on multiple lines.
Thanks in advance everyone.The L suffix is used to identify a Long literal.
The index of the args[] array does not need to be specified as a Long.
Solong num = Long.parseLong(args[0]);will suffice. You might want to put that in a try/catch block to catch the NumberFormatException that will be thrown if args[0] cannot be parsed to a long value.
Various ways to update the value of num in the methods of the same class:
Simplest of all: declare num as an instance variable. The methods simply access and assign its value.
Other ways:
-- pass num as a parameter to the method.
-- return the value of num from the method (provided the method doesn't have to return any other value)
-- Have a getNum() method return the value of num
-- Have setNum() method to update the value of num
db
What's that line? public class billion (long (int num)edit Typos, typos...
Also, the set/get approach with public access is the preferred method when used in the methods of another class.
Don't forget that the other class has to know whose set/get methods to call.
Message was edited by:
Darryl.Burke -
Call view of another WDA Component and pass the value to it
Dear Experts,
I have a wda component1 with window1 and view1
wda1 has a node1 with one attribute carrid (no default value).
view1 also has the same structure and is mapped with it.
(here i have one input field of type carrid)
This view will be shown in wda2.
now i have wda2 with window2 and view2 with the same structure & names as above (node & attribute)
But here the carrid has a default value of 'AA'(so that when view1 is displayed in wda2,data is passed from here wda2).
in wda property->used components i have used wda component1
in view property->used components i have used wda component1
view2 has a viewcontainer.
In window2, in the view container i have embedded the view1 of the wda1.
In the component2 context node, the default value of carrid is AA.
when i have executed the application of wda2, it was showing the input field of view1 of wda1.
but it was empty ie., had no value (AA).
Now My problem is if i have the value AA in wda2 for the attribute, how does it get passsed to wda1.
Regards
SajidHi Sajid,
Let me first try to say as to what I thought you were trying to achieve.
You have 2 components say SUB & MAIN. Now in both the components you are trying to display an input field on your layout. This input field is bound to an context attribute CARRID & you have given it an initial value in only 1 component. (MAIN component) Now within your component MAIN you have an VIEWCONTAINERUIELEMENT & you are trying to display the view from SUB within it. But you end up with the input field from your MAIN view displaying the default value as AA whereas the view from SUB displays a blank input field. You now want to be able to have this input field fetch the value from your MAIN component and get initialized. So if this is your requirement then you can continue reading below:
1) When you create your context at component controller level in component MAIN you have a property for the node which says as: "Interface Node" Just checkmark this checkbox. When you do this you would be able to share the data within your context nodes across other components.
2) Specify a default value of AA in the "Default Value" property of the attribute in component MAIN
3) Now go to your other component SUB which you would like to also get initialised. Define a usage of your component MAIN within this component.
4) Go to your component controller & create your context node & attribute with exactly the same names as how you had created in your MAIN component.
5) Do a mapping between the interface controller of your MAIN component & the component controller of your SUB component
6) You would be able to see that the appearance of the node has changed to an interface node. This means that your SUB component now has an exact replica of your MAIN components context data.
Test your application after following all these steps & you should be fine.
Regards,
Uday -
How to delete formula from cells and keep the values in Excel VBA
Hi,
In my Excel I have 15 columns. In column F which has a formula (INDEX MATCH), it has contains "RECEIVED" and "INTRANSIT". I need to filter the column F for all "RECEIVED" and then remove the formula from cells and
retain or keep the values that are already in the cells. something tricky and i'm not sure on how to work on this in Excel VBA.
Below is my initla VBA code:
I already have the codes on how to filter. kindly please help me on how to do this. thank you in advance.
Sub test_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long
Set wb = ThisWorkbook
Set ws = wb.Sheets("Intransit_")
Application.ScreenUpdating = False
ws.AutoFilterMode = False
With ws
lrow = .Range("F" & Rows.Count).End(xlUp).Row
Set rng = .Range("A1:R" & lrow)
Debug.Print rng.Address
rng.AutoFilter Field:=6, Criteria1:="RECEIVED"
End With
Application.creenUpdting = True
End SubSolved.
Sub test_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long
Dim rRec As Range
Dim btField As Byte
Set wb = ThisWorkbook
Set ws = wb.Sheets("Intransit_")
btField = 6
Application.ScreenUpdating = False
ws.AutoFilterMode = False
With ws
lrow = .Range("F" & Rows.Count).End(xlUp).Row
Set rng = .Range("A1:R" & lrow)
With rng
.AutoFilter Field:=btField, Criteria1:="RECEIVED"
On Error Resume Next
Set rRec = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
End With
.AutoFilterMode = False
If Not rRec Is Nothing Then
With rRec
.Columns(btField).Value = .Columns(6).Value
End With
End If
End With
Application.ScreenUpdating = True
End Sub -
Read integer values from spreadsheet and display the values in a table
Hi all,
I have integer values to read from a spreadsheet and display them in a table. I am using 'Read from spreadsheet file' in 'integer' mode. I would like to display these values in a table. The problem is that the table takes only 2d-array of string as input but not integer.
It works fine if I change the mode of 'Read from spreadsheet file' from 'integer' to 'string' but I want to read integers and have to use the integer values for further calculations. Please give any suggestions on displaying integers to a table.
Thank you.
Solved!
Go to Solution.No don't take element by element just convert as a whole. See the attached example
Good luck
The best solution is the one you find it by yourself -
How to calculate the value from prompt and use the value as filter
Hi everyone,
I am designing a OBI query. I want to write a query and one of it filters comes from the dashboard prompt. Say I want to make a query to pull out the record for 3 consective years and user wants to enter the last year # and omit entering the first 2-year code#.Thanks!Hi,
if i understand your question
you have a prompt for year.. and it's assigned with presentation variable, say: var_year
And you are just entering value for only one year, say 2000.
Then, the request (which is using that prompt value as filter) should display year values 2000, 2000-1 (i.e. 1999), 2000-2 (i.e. 1998).
Is this your requirement?
If then,
Hope you are using edit box as control for year prompt and assign a presentation variable for that prompt.
Now, in report go to filter of year prompt, click on advance > Convert this filter to SQL.
write here... *Times.Year between @{var_year} and @{var_year}-2*
And make sure that your var_year is integer, if not cast it to integer -
Reading data from table and print the value based condition
hi
my table like this
slno | value1 | value2 |
1 0 5
2 5 10
3 10 15
assume n= 8 ( where n is user define)
i want output like
number 8 between value 5 and 10
plz helpHi,
Try:
Select 'Number '+ U_Value3 + ' Between '+ U_Value1'and 'U_Value2
From [dbo\].[@UDT T0\]
Where T0.U_Value3=[%0\] and T0.U_Value3 BETWEEN U_Value1 AND U_Value2
Thanks,
Gordon -
Open a crystal report from WAD with passing the variables values
Hi,
I need to know is there any way to link SAP WAD to crystal reports (open a crystal report from WAD)and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
Maybe we need to pass parameter by WAD URL but this is just my assumption and have no idea how to do this with passing variable values.
right now I know the method of how Bex queries which are used as data source for crystal reports but in my current scenario we have the structure like this that bex queries link with WAD and then WAD is linked with crystal reports.
No doubt that Crystal report is target option in RRI but there the source is Bex Query only but in current scenario we are looking WAD (web template) as a source to crystal report or crystal report called in WAD.
Please suggest something on same.
Thanks
Take care
Vishal sharmaHello Vishal.
Did you find a solution for this problem?
I'm facing right now the same problem, I need a way to link SAP WAD to crystal reports (open a crystal report from WAD) and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
Have found an answer to this issue? If yes, please kindly inform how have you solved this.
Best Regars
Armando Santos -
How to import values from txt and pass values to variables
I need to export some variables from Indesign and import them in Illustrator. I can export a txt file from InDesign but I don't know how to import and pass the values to variables in Illustrator.
Can someone help?Well from you ID script Im presuming that you are simply writing a few lines of info to a plain text file like so…
writeFile('SomeData');
writeFile('AnotherData');
writeFile('LastData');
function writeFile(info) {
try {
var log = File('~/Desktop/ID_Data.txt');
log.open('a');
log.write(info + '\r');
log.close()
catch (e) {
alert(e);
So you would just read this back where or when ever you need to use it in your Illustrator script…
var log = File('~/Desktop/ID_Data.txt');
log.open('r');
var a = log.readln();
var b = log.readln();
var c = log.readln();
log.close();
alert(a); -
Passing the values in Recipe PLM WEBUI
Created a new tab for Recipe via customization in PLM Web UI. But I am not able to create new fields in the screen and pass the values.
Please let me know the configuration steps and how to pass the values to PLM Web UIHi Shailesh
You will have to create 'New Selection' in either Row/Columns (wherever you wish to display the Key Figures) or you could also create a 'Restricted Key figure'.
In the First Selection / RKF.. select the ey Figure for 'No of Employee' and then select the Characteristic for the From/To Period (0I_FPER).
In the second Selection / RKF..select the Key Figure for the Amount and then select the Char for the From/To Period (0I_FPER).
If there is any other characteristic which is used for identifying the Employees that have resigned, (say for Eg. Employee Status could be 0 for resigned employee, a hypothetical case), select the char. for Employee status with the value '0' and include it in both the selections / RKFs and you will get the desired results.
Pl remember, if you select a period variable with a range (i.e. from and to values within the same variable) , then you will get only one column for 'Amount' and the value in this column will be for value for the period.
If you want Amount for From and To values to appear in two different columns , the do not select variable with a 'range'. Instead select two variables with single value , one each from From and To. (However, I am not sure if you requirement wants From and To in two different columns, although, you are saying so !!!). If you select two variable (say for eg. ZPERIOD1 and ZPERIOD2 then in your selections you will not use 0I_FPER instead the new variables).
Hope you find the answer useful.
Regards
Umesh -
To pass the values through variable in JDBC adapter
Hello,
We are working in JDBC adapter. Currently we have written the select statement in JDBC sender adapter to select all the values from the table in SQL SERVER.
Instead of this, Can we use a variable and pass the values in there from XI in order to select the records from the table based on values in the variable?
Expecting Advice!
Thanks,
Lakshmi.Hi krishnan,
You can use the JDBC receiver adapter to acheive a select using variables. Here you create a canonical XML format(your XSD) based on which the JDBC receiver adapter issues a select and returns you the response. chk this url in help site http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm for the canonical format.
However u lose the flexibility of polling the table at regular tables available with sender adapter. Also you need an event(a message) to trigger this select query execution, since it is a receiver CC config.
-Saravana
Maybe you are looking for
-
Why will itunes not install on my macbook pro
Why will I-tunes not work on my brand new macbook pro?
-
I have 2 iphones 4s's, ones my wife and one is mine. we have different apple IDs, can we share one itunes account?? if so, how??
-
Is there a way to actually sync music from my iPhone 3G to my computer?
Recently, I had to get a new laptop. The music on my iPhone won't trasfer to my new laptop. I have put new, different music on my laptop. When I try to sync the two, laptop & iPhone, all it wants to do is to wipe out the music on my iPhone and repl
-
Hi, I have this code: // define an array of acceptable property types $propTypes = array('Houses', 'Flats/Apartments', 'Bungalows','Commercial'); // if submitted value is in the array of acceptable types, use it // otherwise, use a wildcard character
-
How Can I Change Default Mail Account in Mail Application?
I have 2 Gmail accounts. Gmail1 and Gmail2. When I changed the password of my Gmail1 account - which used to be my default mail account - it changed in the Mail application so that now Gmail2 is my default mail account. I know that usually you can go