ABAP - Saving data to a table after pressing 'TAB' on a specific field?
In ABAP programming for a custom SAP program, I was wondering if it is possible to trigger a SAVE action to occur when pressing the TAB key instead of the ENTER key.
For example, I have 3 input fields -- Material, Serial Number, and Quantity. I enter a Material, press TAB to get to the next field, enter a Serial Number, press TAB to get to the Quantity field, then I enter a Quantity and I must press ENTER in order for the input Material, Serial Number and Quantity to be written to the custom table.
What I need is to be able to press a "TAB" on the Quantity field instead of an "ENTER", and therefore override the normal TAB behavior only on that 'Quantity' field so that I get an "ENTER" behavior, and my record is saved. Is this possible in ABAP?
The reason I need that TAB to behave like and ENTER on the Quantity field is because we have barcode scanners with a keypad. These barcode scanners have a design flaw in that sending a specific command after keypad entry is extremely limited. For my company's specific requirements, the scanner will only allow the TAB command to be sent from the scanner after entering a Quantity. Since only a TAB can be sent, I need the TAB command to be able to write the record to the table, and return me to then next "Material" input field.
Thanks all. I appreciate your replies. The reply from Prasoon Sahay gave me an idea. Ideally, I would like the TAB on the last Quantity field to be able to save the record and return back to the first Material input field. But instead, I will have to keep the TAB on the Quantity field, and then scan an extra code that sends a Control S, and that will save the record. It is not the most elegant solution, but it will work.
Similar Messages
-
Fatch data from a table after a given time interval
Hello
I want to fetch date from a table after a fixed time interval is there any
way to do it.
thanksNot sure what you want. But maybe this helps.
SELECT date+interval FROM atable;
Also if you tell us more about the business case the answers could be more to the point. -
How would you order an internal table e.g. itab according a specific field
Hello
How would you order an internal table e.g. itab according a specific field?
Would you be so kind and let me see an mini example
Thank you in advanceHi Tina,
You can sort the table as already mentioned, or if you want it always kept in a key sequence you could define it as a sorted table something like this:
types:
begin of itabline,
field1 type c,
field2 type n,
field3 ....
end of itabline.
DATA itab TYPE sorted table of itabline WITH UNIQUE key field1.
You can then insert and read entries by the key fields.
Hope that helps as an option!
Robin -
Reg: Getting the latest or last saved data from the table
Hi,
I'm having a table, which is getting updated whenever something is saved.
Now i want to get the latest or last saved details to be displayed or the details of the row with greatest Id.( i.e, the Id. will be greatest for the last saved)
please help me out with code to do this...
Thanks & Regards,
SureshHi Suresh,
This could be done either through the webdynpro or the back end function module itself.
If another field of type date/time is present in the table, u can save the current date and time along with the data in the table, and sort it in descending order of time. so that whenever u refresh the page the latest record is always in the first row,
if u want to do it through webdynpro, u can also sort the table based on the date so that u get the latest record that was saved.
Another solution is that u can maintain a serial number sort of thing the table which helps u identify the latest record
Hope this helps u.
Regards,
Poojith M V -
Removal of data from 1 table after comparing with other table
Hi,
I have 2 table. Both have same primary key i.e. WO_ID. 1st table wrk_ord have no redundant data and the 2nd table wo_audit have few redundant data. Both table are related with WO_ID. Now I want to remove the redundant data from table wo_audit so that the uniq WO would be same in both the table. both the table are very huge. WO_ID table have 31million of record. I ran query
delete from wo_audit where wo_id not in (select wo_id from wrk_ord);
this query throw an error ora-01555. I just want to know the how can optimize this query.
Thanks.Hi,
delete from wo_audit where wo_id not in (select wo_id from wrk_ord);AFAIk, you not removing redundant data, but you are removing the data which does not exists in wrk_ord. Try to check things from business perspective.
Tune the value of the UNDO_RETENTION parameter, check the the below one
select max(maxquerylen) from v$undostat;
- Pavan Kumar N
Edited by: Pavan Kumar on Apr 8, 2011 1:36 PM -
How to set current row in table after use tab key on inputText
Hello all,
My first post .., I'm newbie in ADF and I will try to explain my problem.
For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
So far, everything works fine.
When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
My question : how can I change the current row after tab key pressed in this case ?
I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
Thanks in advance.Frank Nimphius wrote:
Hi,
My question : how can I change the current row after tab key pressed in this case ?
Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
to learn about how to use the client listener and server listener
FrankHi,
Thanks a lot for your advices, I used the client and server listener
I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("START changeSelectedRow");
RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
if (oldRowKeySet == null) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("oldRowKeySet is null");
return;
RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
bindingIterator.setRangeSize(-1);
// set the new index of the current row.
int index = bindingIterator.getCurrentRowIndexInRange();
if (index < bindingIterator.getAllRowsInRange().length - 1) {
index++;
bindingIterator.setCurrentRowIndexInRange(index);
// get the current row after changed the index
Row currentRow = bindingIterator.getCurrentRow();
if (currentRow != null) {
ArrayList nextLst = new ArrayList(1);
nextLst.add(currentRow.getKey());
newRowKeySet.add(nextLst);
// set the new selectedRow
myTable.setSelectedRowKeys(newRowKeySet);
SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
selectionEvent.queue();
AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("END changeSelectedRow");
Best Regards
Benjamin -
After pressing the apply button, all fields become readonly in page
hello friends,
i have a requirement that when i click the apply button , all the records should save into database then all the fields should become readonly in page.
vary urgent....
Thanks
krishna.Krishna,
To make bold use the CSS OraDataText on fields.
cant we disable add another row button when we press apply button. why because after pressing apply button add another row can add new row and that row also becoming readonly. so how to control that addanother row button after pressing apply button.Yes you can disable the add another row button by using SPEL.
Thanks
--Anil -
Saving data into two tables "in one transaction"
Hello everybody!
My scenario is the following: SAP PI receives message containing some data (header and MULTIPLE details data in one message) and has to transfere this data to a database.
In the database there are two tables for storing the data contained in the message: one for HEADER data and one for DETAILS data. I need to save all the data (header and MULTIPLE details data) into these two tables "in one transaction" and roll back saving of HEADER data and DETAILS data if saving of some DETAILS data has failed.
I am going to use receiver JDBC adapter for this purpose.
My questions are:
1. How can I save all the data "in one transaction"? Will it work if I transform the source message into the target message which looks something like this?
<root>
<StatementName1>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>HEADER_table</table>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName1>
<StatementName2>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>DETAILS_table</table>
<access>
<col1>val1</col1>
<col2>val3</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName2>
<StatementName3>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>DETAILS_table</table>
<access>
<col1>val1</col1>
<col2>val4</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName3>
</root>
2. How to roll back saving of HEADER data in the case of saving of DETAILS data has failed?
3. What will be the response structure returned by database look like in the case of success?
Thanks,
VikaI guess the response in my case will be something as following?
<response>
<Statement1_response>
<row>
<update_count>1</update_count>
<insert_count>0</insert_count>
</row>
</Statement1_response>
<Statement2_response>
<row>
<update_count>0</update_count>
<insert_count>1</insert_count>
</row>
<row>
<update_count>0</update_count>
<insert_count>1</insert_count>
</row>
</Statement2_response>
</response>
Vika -
Need help with saving data and keeping table history for one BP
Hi all
I need help with this one ,
Scenario:
When adding a new vendor on the system the vendor is suppose to have a tax clearance certificate and it has an expiry date, so after the certificate has expired a new one is submitted by the vendor.
So i need to know how to have SBO fullfil this requirement ?
Hope it's clear .
Thanks
BonganiHi
I don't have a problem with the query that I know I've got to write , the problem is saving the tax clearance certificate and along side it , its the expiry date.
I'm using South African localization.
Thanks -
How to maintain data of a table after I created the structure of it?
If I does not create a maintain view in SM30, can I also be able to input data without writing a programme.
Best regards,Check the check box of
Table Maintainence allowed in Attributes tab of table
and then go to
utilities->table contents->create Entries.
Reward if useful.
Devi -
Using abap code data from internal table to XML file create
Hi ALL,
i am using methods
L_VALUE = GS_DOCUMENT-U_MITARBEITER.
L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'U_Mitarbeiter' VALUE = L_VALUE ).
CLEAR: L_VALUE,
L_RC.
L_VALUE = GS_DOCUMENT-VORNAME .
L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'Vorname' VALUE = L_VALUE ).
ENDLOOP.
LOOP AT GS_DOCUMENT-GI_TIMETABLE INTO GS_TIMETABLE.
L_ELEMENT_AIRLINE = L_DOCUMENT->CREATE_SIMPLE_ELEMENT(
NAME = 'Timetable'
PARENT = L_ELEMENT_FLIGHTS ).
Create attribute 'code' of node 'airline'
L_VALUE = GS_TIMETABLE-BEGINNUHRZEIT.
L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Beginnuhrzeit' VALUE = L_VALUE ).
L_VALUE = GS_TIMETABLE-BEMERKUNGEN.
L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Bemerkungen' VALUE = L_VALUE ).
L_VALUE = GS_TIMETABLE-ENDEUHRZEIT .
L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Endeuhrzeit' VALUE = L_VALUE ).
L_VALUE = GS_TIMETABLE-BUCHUNGSDATUM.
L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Buchungsdatum' VALUE = L_VALUE ).
ENDLOOP.
Creating a stream factory
L_STREAMFACTORY = L_IXML->CREATE_STREAM_FACTORY( ).
Connect internal XML table to stream factory
L_OSTREAM = L_STREAMFACTORY->CREATE_OSTREAM_ITABLE( TABLE = L_XML_TABLE ).
Rendering the document
L_RENDERER = L_IXML->CREATE_RENDERER( OSTREAM = L_OSTREAM
DOCUMENT = L_DOCUMENT ).
L_RC = L_RENDERER->RENDER( ).
Saving the XML document
L_XML_SIZE = L_OSTREAM->GET_NUM_WRITTEN_RAW( ).
i am geting the output,
line1
<?xml version="1.0"?><Head Document="002_TMA1_KW1_SAP.XML" Innenauftragsnummer="008004000800" Kalenderwoche="17" MonatJahr="04/2008" Name="" Personalnummer="91003139" Projektnummer="1400000700" Regionalstelle="B" U_Entleiher="1" U_Mitarbeiter="1" Vorname=
line 2
Ricky"><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="21.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="22.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrz
line 3
it="16:30" Buchungsdatum="23.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="24.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="25.04.2008"/></Head>
but i want this type line by line
<?xml version="1.0" encoding="ISO-8859-1"?>
<Document Dokumentnummer="001_TMA7_KW2_MAN" Dokumenttyp="TN_HE" Innenauftragsnummer="8004750104" Kalenderwoche="15" MonatJahr="04/2008" Name="Banana" Personalnummer="166326" Projektnummer="1400000203" Regionalstelle="RV1" U_Entleiher="1" U_Mitarbeiter="1" Vorname="Sepp">
<TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="07.04.2008" Endeuhrzeit="16:00"/>
<TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="08.04.2008" Endeuhrzeit="16:00"/>
<TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="09.04.2008" Endeuhrzeit="16:30"/>
<TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="10.04.2008" Endeuhrzeit="16:30"/>
<TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="11.04.2008" Endeuhrzeit=""/>
</Document>
for line breaking, please give me solution
Regards,
SanthaHi,
Please give me more inforamtion, how to use this
CLASS cl_abap_char_utilities DEFINITION LOAD.
cl_abap_char_utilities=>newline
Regards,
Santha -
ABAP HCM : Data from 2 tables
Hi.
I want to retrieve 5 fields from table pa0169.
The problem is I also need to check if the Company Code field (pa0001-bukrs) for the employee is one of the specified values.
The company code values are maintained in range r_division with low values.
The Plan_ID values are maintained in range r_plan_id with low values.
Initially I was getting multiple entries for a pernr in the resulting table. Hence I have added the SORT and DELETE DUPLICATES commands.
The Function spec snippet :
Select all employee's where Benefit Plan (P0169-BPLAN) equals Custom Parameter 'Plan ID' Low
Value as of the Parameter 1 date and where Company Code (P0001-BURSK) equals Custom Parameter 'Division
Name' Low Value,
Please tell me if this will work? Also tell me the performance of this query.
SELECT A~pernr
A~bplan
A~begda
A~endda
A~aedtm
FROM pa0169 as A
INNER JOIN pa0001 as B
ON Apernr = Bpernr
AND Abegda >= Bbegda
AND Aendda <= Bendda
INTO TABLE oi_0169
WHERE A~pernr IN r_pernr
AND A~bplan IN r_bplan
AND B~bukrs IN r_division
AND A~begda <= v_parm1date
AND A~endda >= v_parm1date.
SORT oi_0169 BY pernr ASCENDING begda DESCENDING.
DELETE ADJACENT DUPLICATES FROM oi_0169 COMPARING pernr.
Thanks & Regards
Edited by: SUD239492 on Feb 11, 2011 5:17 AMHi,
Split the join and write as :
select pernr endda begda into table it_pa0001
where pernr in r_pernr
AND endda >= v_parm1date
AND begda <= v_parm1date
AND bukrs IN r_division .
if sy-subrc = 0.
sort it_pa0001 by pernr begda descending.
delete adjacent duplicates from it_pa0001 comparing pernr.
SELECT pernr
bplan
begda
endda
aedtm
FROM pa0169
INTO TABLE oi_0169
for all entries in it_pa0001
WHERE pernr = it_pa0001-pernr
AND begda <= v_parm1date
AND endda >= v_parm1date
AND bplan IN r_bplan .
SORT oi_0169 BY pernr ASCENDING begda DESCENDING.
DELETE ADJACENT DUPLICATES FROM oi_0169 COMPARING pernr.
endif.
Regards,
Srini. -
Saving data in different Tables
Hi,
How to save/fetch data by using single click (save,View) from different table using Table Control. Example...DB1 and DB2 to be updated by using single click on SAVE Button.
What should be the code? and how to frame that? Can anybody give me any standard
program or zprogram?Hi,
Please check these ALV documents.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIDOCK/BCCIDOCK.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIGOF/BCCIGOF.pdf
Regards,
Ferry Lianto
Please reward points if helpful. -
Saving data in same table simultaneously
Hi All
I have a question and here it goes. Suppose I have two users who are updating the same table through forms and Saving or commiting at the same time, exactly same time. What will happen in this kind of situation. Both of them will get error or one will get and the other will be able to commit or both will commit. Though i am quite sure that both cant commit at the same time. So my question to all is what will happen in this kind of a situation and what can i do to avoid this kind of situation. I have heard something about On-Lock trigger. Does this comes into picture during this situation.
Any kind of suggestion is appreciated. Thanks in advance.Thanks Francois
<<<You can delay this locking process to the commit time.>>>
1. I am sorry but i couldnt figure out what you mean by this.
2. Also if suppose i overload the ON-LOCK trigger, i will writing a code to throw an error msg to both the users and ask them to try later.
3. By the way, is there a way by which i can just randomly select one of the user to have commit first and then process commit for the second one.
Please advise. Thanks for the help. -
Hi Expert team
please give me solution as soon as possibleThank you for your reply, Paul. Unfortunately this suggestion didn't solve the issue.
After experimenting with it for a bit, it seemed that it might be related to widow/orphan control, but it occurs even with widow/orphan control turned off.
Does anyone out there have any suggestions?
Thanks,
Jason
Maybe you are looking for
-
How do I set up a static IP on Airport Express so I can activate and use the Connect My Mac app from outside my home network?
-
i am writing a program in jQuery to type Assamese language. I have made a function which is executed on each keyup. The function take the keycode and then display the Assamese alphabet based on Unicode decimal number assigned against the keycode in a
-
Tiger 10.4.11 to SL...What am I up against?
I'm a bit confused. I have a MacBook running 10.4.11. Can I even do an "upgrade" install from Tiger 10.4.11 to SL or do I need to do a "clean" install? If so, how does one go about a clean install? How do I backup my Mail if I need to do a clean inst
-
Unable to describe the table as system user
Hi, I'm able to describe the below table as sys user but not able to do so as system user. SQL> desc IA_MBR_ID_D; Name Null? Type MBR_ID_EDW_SK NOT NULL NUMBER MBR_ID NOT NULL CHAR(3) MBR_SBSCR_ALTN_ID NOT NULL VARCHAR2(13) MBR_LST_NM VARCHAR2 MBR_FR
-
I want to learn abt datasources.. pl tel some datasources in sd, mm, pp
Pl tel some datasources for sd, mm, pp ... and tel me where to find the datasource... with example...