Capture return key from a field
Hi,
I have developed an application with a GUI interface from which the user has to input various values to the Jtext, radio buttons, and combo boxes. The values will then be written to the database.
My problem is I cannot go from the 1st field to the 2nd field using the 'Enter' key. It is stuck there. But I can navigate using the tab key. I need the enter key because I want to check whether the user has input any characters other than letters in the 1st field. Can anybody please help me with a sample code?
A JTextField interprets the "Enter" key as the ActionCommand. Any other type of GUI element needs to have a custom KeyListener added to it to make the "Enter" key do what you want.
Similar Messages
-
Returned data from database field having data type CLOB
hi..
i hv table having CLOB field type ... having 12000 char length ... data is present in the field... but when i do select on that field it only returns the limited data from that field for any given row...
pls let me know wuts may b the problem...
cheeerrss..Are you running the select from SQL*Plus? If so check out the [SET LONG|http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#sthref2800] parameter.
HTH! -
Create a foreign key from a field that is part of a mulitple primary key
Hi,
i had a table named T_A, with a double primary key : (A,B)
Then i created a table named T_B with a field : C.
I want this field T_B.C to take only values that already exist in field T_A.A.
So i tried to create a foreign key on my field T_B.C, pointing on the field T_A.A : an error message appeared "not possible to create a foreign key on a field that is not a primary key".
How can i solve this....? If U have any idea, please mail me !!
THANX very much.Add column A as foreign key into the table T_BHow?
(was the question from the original poster. Adding a column to table T_B that happen to have same name as the corresponding column in table T_A would not allow you to add the foreign key).
SQL> create table t_a (a number, b number, primary key(a, b)) ;
Table created.
SQL> create table t_b(a number, c number, constraint foreign key references t_a(a)) ;
create table t_b(a number, c number, constraint foreign key references t_a(a))
ERROR at line 1:
ORA-02270: no matching unique or primary key for this column-list
SQL> -
Capture Return Value from Contextual Events Subscriber Method
Hi
I was wondering if anyone knew whether you could capture the return value from a method exposed as a subscriber for a contextual event?
Requirement: We have 2 bounded task flows (parent-child) with the child task flow embedded as a region in a view activity in the parent task flow. Based on an action in the parent task flow we raise a contextual event which calls an application module method exposed as a data control within the child task flow. We need to be able to capture the return value from the method on the managed bean.
Example method within child task flow application module:
public String contextualEventSub(){
Return "Y";
So here we would like to capture String value when the event is raised by the event producer (parent task flow action).
Within the Event Map on the page definition of the parent task flow view activity it is possible to set parameters to pass to the subscriber but it’s not obvious where you can capture the return value.
Many thanks!
Technology:
ADF 11.1.1.7 – ADFbc with ADF task flows and page fragmentsCheck this URL it may help you
One size doesn't fit all: JDev 11g: Programmatic Contextual Events -
Capture return code from system command?
Can someone please tell me what is the easiest way to capture the return code when executing a system command?
In other words I wish to execute a say a perl script and capture the return code from it.
Any help is appreciated.Process p = Runtime.getRuntime().exec("blah.exe");
p.waitFor();
System.out.println("Return code from blah.exe"+ p.exitValue()); -
How to capture return value from stored procedure?
Hi All,
I want to capture the retun values from this procedure to a table - CALL SYS.GET_OBJECT_DEFINITION('SCHEMA_NAME', 'TABLE_NAME').
The below approach is not working -
Insert into STG.STG_DDL
Call SYS.GET_OBJECT_DEFINITION('DWG', 'DWG_SITE')
Could you please have a look on the same?
Thank you,
VijeeshThanks a lot Everyone.
Considering the discussed options, and an approach explained in this thread - -http://scn.sap.com/thread/3291461 , I have written an SQL to build the Alter statements to add the columns & Constrains to table.
The below Query will provide the scripts to build a table in another environment.
select * from (
select TABLE_name,'tbl_Create' column_name, 1 as position, 'CREATE TABLE '|| schema_name ||'.'|| table_name ||' ( DUMMY_CLMN INTEGER);' as SQLCMD
from tableS
where schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
-- MASS change of NOT NULL COLUMNS
-- set to NOT NULL - character data type, double, decimal fixed - need the length but not the scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('VARCHAR', 'NVARCHAR', 'DOUBLE')
and scale is NULL
UNION ALL
-- MASS change of NOT NULL COLUMNS
-- set to NOT NULL - character data type, double, decimal fixed - need the length but not the scale
select TABLE_name,column_name, position + 100,'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') );' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('VARCHAR', 'NVARCHAR', 'DOUBLE')
and scale is NULL
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||','|| scale ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is not null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||','|| scale ||') ) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is not null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and null scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and null scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is null
UNION ALL
-- set to NOT NULL - DATE | TIME | SECONDDATE | TIMESTAMP | TINYINT | SMALLINT | INTEGER - don't need length or scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DATE', 'LONGDATE', 'TIME', 'SECONDDATE', 'TIMESTAMP', 'TINYINT', 'SMALLINT', 'INTEGER' )
-- and scale is not null
UNION ALL
-- set to NOT NULL - DATE | TIME | SECONDDATE | TIMESTAMP | TINYINT | SMALLINT | INTEGER - don't need length or scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' ) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DATE', 'LONGDATE', 'TIME', 'SECONDDATE', 'TIMESTAMP', 'TINYINT', 'SMALLINT', 'INTEGER' )
-- and scale is not null
UNION ALL
select table_name, 'PK' AS column_name, 9990, 'ALTER TABLE '||table_name||' ADD CONSTRAINT Primary_key PRIMARY KEY ('||PK_COLUMN_NAME1||
case when PK_COLUMN_NAME2 is null then ' ' else ','|| PK_COLUMN_NAME2 end ||
case when PK_COLUMN_NAME3 is null then ' ' else ','|| PK_COLUMN_NAME3 end ||
case when PK_COLUMN_NAME4 is null then ' ' else ','|| PK_COLUMN_NAME4 end ||');'
from
(SELECT DISTINCT C1.table_name , C1.COLUMN_NAME AS PK_COLUMN_NAME1, C2.COLUMN_NAME AS PK_COLUMN_NAME2, C3.COLUMN_NAME AS PK_COLUMN_NAME3, C4.COLUMN_NAME AS PK_COLUMN_NAME4
FROM (SELECT * FROM CONSTRAINTS WHERE POSITION=1 AND IS_PRIMARY_KEY = 'TRUE') C1
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=2 AND IS_PRIMARY_KEY = 'TRUE') C2
ON C1.table_name = C2.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=3 AND IS_PRIMARY_KEY = 'TRUE') C3
ON C2.table_name = C3.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=4 AND IS_PRIMARY_KEY = 'TRUE') C4
ON C3.table_name = C4.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=5 AND IS_PRIMARY_KEY = 'TRUE') C5
ON C4.table_name = C5.table_name
) PK
where table_name = 'DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
select table_name, 'UK' AS column_name, 9991, 'ALTER TABLE '||table_name||' ADD CONSTRAINT UNIQUE ('||UK_COLUMN_NAME1||
case when UK_COLUMN_NAME2 is null then ' ' else ','|| UK_COLUMN_NAME2 end ||
case when UK_COLUMN_NAME3 is null then ' ' else ','|| UK_COLUMN_NAME3 end ||
case when UK_COLUMN_NAME4 is null then ' ' else ','|| UK_COLUMN_NAME4 end ||');'
FROM
(SELECT DISTINCT C1.table_name , C1.COLUMN_NAME AS UK_COLUMN_NAME1, C2.COLUMN_NAME AS UK_COLUMN_NAME2, C3.COLUMN_NAME AS UK_COLUMN_NAME3, C4.COLUMN_NAME AS UK_COLUMN_NAME4
FROM (SELECT * FROM CONSTRAINTS WHERE POSITION=1 AND IS_PRIMARY_KEY = 'FALSE') C1
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=2 AND IS_PRIMARY_KEY = 'FALSE') C2
ON C1.table_name = C2.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=3 AND IS_PRIMARY_KEY = 'FALSE') C3
ON C2.table_name = C3.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=4 AND IS_PRIMARY_KEY = 'FALSE') C4
ON C3.table_name = C4.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=5 AND IS_PRIMARY_KEY = 'FALSE') C5
ON C4.table_name = C5.table_name
) UK
where table_name = 'DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
SELECT REFERENCED_TABLE_NAME AS table_name,'FK' AS column_name, 9992,
'ALTER TABLE DWG.'||TABLE_NAME||' ADD FOREIGN KEY ( '||COLUMN_NAME||' ) REFERENCES '|| REFERENCED_TABLE_NAME||'('||COLUMN_NAME||' ) ON UPDATE CASCADE ON DELETE RESTRICT;'
FROM REFERENTIAL_CONSTRAINTS
WHERE REFERENCED_TABLE_NAME = 'DWG_SITE'
UNION ALL
select TABLE_name,'tbl_ClmnDrop' column_name, 9995 as position, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' DROP ( DUMMY_CLMN );' as SQLCMD
from tableS
where schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
order by position; -
How to return text from Text Field?
I'm an experienced VB programmer, but new to Dreamweaver, and
web programming. I need to put the text just entered by the user in
a form text field into a field farther down in the form- like when
your mailing address automatically populates into a shipping
address field. How to do?
Thanks
Bill SpencerHI,
If i understand for you purpose you need to use a select list with redirect.
Then you have to put in the text field the code for displaying the corrisponding cities related to the code you choosed from the select list.
However that depends a lot about data and your app itself: If i understand you assume the postalcode is unique for a given city?
hope it helps
Message was edited by:
Marcello Nocito
Message was edited by:
Marcello Nocito -
Capturing return status from a call to STARTRFC from a shell script.
Hi All
I am trying to use startrfc to integrate a Unix (Solaris) batch process with SAP. I want to determine whether an SAP user exists.
Here is the command as run in the Unix shell: -
startrfc -t -3 -h ourHost -s 01 -c 550 -l EN -u SAPuser -p secret -F BAPI_USER_EXISTENCE_CHECK -E USERNAME=testSAPuser
This command always exits with a status of zero, whether or not the user exists. (With the -t flag) It creates a file, dev_rfc and a second file of the form CPICTRCnnnnn. However there is no output to stdout, irrespective of whether testSAPuser exists.
Can I force this utility program to write its output to stdout instesd of writing it to a file? How?
Alternatively can I force the utility to write its output to a specific (named) file instead of writing to dev_rfc?
Thank you for your attention
Stephen BroadbridgeHi,
You could create an RFC in SAP and put your BAPI function, an the result into a table parameters:
- use -T parameter to get the table
- use w to set your file
<b>Example:</b>
startrfc -E PEBELP=00010 -t -d AR1 -h S01AZ03A01 -s 10 -g S01AZ03A01 -x sapgw10 -u LOLA -p flores -c 130 -l EN -F Y_RFC_EXAMPLE2 <b>-T RESULTADO,250,w=outputname.txt</b>
<b>Explanation of parameters:</b>
-T <table name>,<width>,[r=<file>][,w=<file>]
Where <file> is a path name to read from (r) or write to (w) the internal table. If <file> is -, stdin or stdout is used.
<b>Example of Y_RFC_EXAMPLE2</b>
FUNCTION Y_RFC_EXAMPLE2.
""Local interface:
*" IMPORTING
*" VALUE(PEBELP) TYPE EBELP
*" TABLES
*" RESULTADO STRUCTURE TAB512
DATA fecha(10).
DATA wa TYPE string.
WRITE sy-datum TO fecha.
CONCATENATE pebelp fecha INTO wa SEPARATED BY '/'.
ds_rec 'sample' wa.
append wa to resultado.
ENDFUNCTION. -
Handling Return Codes from SQL Stored Procedures
Hi,
Please can you let me know how to take care of system return codes from Stored Procedure in JDBC program. Is there any way it can be handled using Callabale Statement.
Regards.not sure what you mean by "system" return codes, but to capture return values from stored procedures you can use CallableStatement.registerOutParameter(), just like with output parameters. see http://www.j-netdirect.com/GenStoredProcedures.htm#ReturnStatus.
-
How to fetch old and new value from of a field(non-key) from LOGDATA
Hello SDNers,
i m fecthing LOgdata from dbtlog table[in our case the log is not getting Updated in CDHDR and CDPOS table]
i m using the same logic as it is used in RSVTPROT
but the problem is
" IT is fetching OLD and NEW VALUE after Update from same field LOGDATA of dbtlog table BUT when i used same logic it is FEtching only OLD VALUEs,
CAN U GUYS PLS TELL ME HOW TO FECTH OLD VALUE and NEW VALUE of a PArticular field(non-key field, fecthing key field is not an issue) From LOGDATA field of DBTLOG.
thx a lot in advance
Regards
KuldeepHi,
May be this link is useful to you.
a® -
Remove carriage returns from a field in an oracle table
I have a field that is defined as a LONG in my oracle table; the data contained in this field has carriage returns/line feeds (it's free form text); as i'm selecting data from this field, i need the carriage returns removed so that the data from this field all appears on one line.
I tried using the TRANSLATE function to convert the carriage returns to something else, but that doesn't work.
Example:
Select comment from Notes:
COMMENT
the applicant called for an appointment;
an exam was scheduled for 4/1/05 at 9am;
called applicant to confirm app
this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant to confirm app"
How can i do this? Can the decode function be used to remove the carriage returns in this field?when i used translate its giving correctly,
SQL> ed
Wrote file afiedt.buf
1 select translate('the applicant called for an appointment;
2 an exam was scheduled for 4/1/05 at 9am;
3 called applicant to confirm app
4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
5 How can i do this? Can the decode function be used to remove the carriage returns in this field
6* ',' ') from dual
SQL> /
TRANSLATE('THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONF
the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant t
SQL> ed
Wrote file afiedt.buf
1 select 'the applicant called for an appointment;
2 an exam was scheduled for 4/1/05 at 9am;
3 called applicant to confirm app
4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
5* How can i do this? Can the decode function be used to remove the carriage returns in this field
SQL> /
'THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONFIRMAPPTHIS
the applicant called for an appointment;
an exam was scheduled for 4/1/05 at 9am;
called applicant to confirm app
this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4
How can i do this? Can the decode function be used to remove the carriage returns in this field?
SQL> -
Need return key to advance through fields
Hi,
I have a user that prefers to use the return key to advance to each field. Is there a way to substitute the tab action with return or do I need to add a listener to each field?modifying the code here should do what you want
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=565916 -
Problem while capturing keys from keyboard .
hello abapers,
i am trying to catch my enter key from keyboard coz i want run some code when user will press enter.
i think sy-ucomm will capture the key pressed, if i am wrong then plz correct me.
(1) with this assumption i tried running bdc for my screen and tried to get the bdc_okcode value which is /00
i passed this value to sy-ucomm in my abap prog but it didnt worked
(2) i tried writting /h in command window it oppend the debugging window but the value for sy-ucomm was blank
if any one of you is able to correct me it would be of great help to me plz its .....
Thank you.
Edited by: Dakshaini A Subramaniam on May 15, 2011 8:36 AM
Edited by: Rob Burbank on May 15, 2011 4:21 PMHi ,
Double click your ,
SET PF-STATUS 'STATUS'.
code. At Standard Toolbar part of the pf-status , set OK CODE for first item (green) to 'ENTER'.
When user hits enter , sy-ucomm will be ENTER.
This is for screen processing . -
How to remove carraige return from the field while loading external table
I am facing an issue of not getting rid of carraige returns present in the fileds of the source .csv file while loading the records into external table.
I had tried using LRTRIM, but it does not help.
The error I am getting is:
KUP-04021: field formatting error for field POPULATION_DESCRIPTION
KUP-04037: terminator not found
I am pasting one record out of the .csv file which is causing this error as below:
"Business Card Accounts
",123,7 BizCard - Gamers,Control,"Business Card Accounts
",75270,75271
You can see the carraige return in the 1st field as well as 5th field. Filed are separated by commas & eclosed by double quotes.
Could anybody help on this please?Can you copy the file to an external table only version, and then dos2unix it?
Alternatively, you can use the ACCESS PARAMETERS area in your external table definition to set that your RECORDS DELIMITED BY carriage returns, instead of the default.
Check out the example here http://www.psoug.org/reference/externaltab.html -
Capture keyboard characters without hitting return key
Is it possible to get a keyboard key typed character without requiring the user to enter the RETURN key?
For example, the user press a key and the screen will echo the key pressed in console mode, not in GUI mode.Is it possible to get a keyboard key typed character
without requiring the user to enter the RETURN key?The shell that's running in your console window will not give the kay strokes to the rpogram until the human hits enter/return. This is so the shell can do all the editing (EG backspace, etc).
In unix you can put the console in 'raw' mode which lets every key stroke through. See the 'stty' command
Maybe you are looking for
-
I got an error while updating my phone
I was updating my iphone 4 software when I got an error, now my phone has the apple with a progress bar on it.
-
Load balancing on a Redundant Bridging
Hi to all, i need to configure a wireless link using two bridge on a single side of the link(4 bridge total),i want to aggregate wireless link with Redundant Bridging but i don't know if the bandwidth is 54mbit or is double?!? There is a hint or a me
-
French accents display as question marks as do spaces?
I run a website listing French châteaux and all the accents show up as ? all the time. Spaces also show up as question marks. I'm on mac 10.4 and using Firefox 3.6.3 == This happened == Every time Firefox opened == i'm not sure but it happens all the
-
I've been trying to run the "Verify Disk" utility on Disk utility on my main 500GB hard drive that contains the OS among other things. When ever I run either verify or repair disk utility it runs for a little bit then ultimately comes back with the e
-
Any selection input for posting date in Confirmation Report CN48n
Hi All, Is there any way to select some date based on posting date in CN48n report, because if i have run by Plant / co.code it takes so long. Plz advice. Cheers, Nies