Sort table according to input field.
hii,
i have a strange requirement in it there is a input fiefld and below it is table . wat i have to do is when user enter a albhabet in the
input field then the grid should sort according to his entry for eg (if he enters a all records in table should sort by a and after a if he enters b then record should sort with ab an similsrily.) Only by writing alphabet without any user action.
is it possible .
Regards,
Gaurav.
Hello Gaurav,
In webdynpro for ABAP, it is not possible.
In Web Dynpro for ABAP, you have to use button i.e. event triggering
But you can achive this thing into Web Dynpro for JAVA or in BSP's.
Regards,
Narendra
Similar Messages
-
Add data to table view from input fields in a page
Hi
I am developing a BSP page which will be called from SRM shop transaction. After user enters the line item data, data will be passed back to shop transaction using OCI interface and the page attributes (URL).
(1) How can I add data from input fields to table view on a page on a button click? I am able to add first line but I could not retain first line data when I try to add the second line.
I am able to add multiple lines to table view if I use view and controller by adding to the line data to static attribute of the controller. I cant use the controller and view because I can not set the attribute to Controller automatically.
(2) Is there a way to pass an attribute (URL) to controller from SPRO? Like we pass an attribute to page automatically (Automatic page attribute).
(3) How can I call a controller and view and pass the page attribute to the controller on a button click from a page with out controller?
Thanks
SreenivasI'm trying to test the merge with the following data in a test.txt file:
ZZZZZ114923000004
1234Z400660000001
ZZZZZ114923000010
Getting an error:
SQL> @C:\dataformats\sql\pc12seriesMerge.sql
Directory created.
SP2-0552: Bind variable "17" not declared.
SQL>
here it the pc12seriesMerge.sql file
set serveroutput on
create or replace directory user_dir as 'c:\dataformats\incoming\';
DECLARE
v_filename VARCHAR2(100); -- Data filename
v_file_exists boolean;
v_file_length number;
v_block_size number;
f utl_file.file_type;
s varchar2(200);
lineString varchar(200);
v_account varchar(5);
v_IDN varchar(6);
v_quantity varchar(6);
BEGIN
v_filename := 'TEST.TXT';
DBMS_OUTPUT.PUT_LINE(v_filename); --shows filename
utl_file.fgetattr('USER_DIR', v_filename, v_file_exists, v_file_length ,v_block_size );
IF v_file_exists THEN
dbms_output.put_line('File Exists');
create table ext_table (
account varchar2(5),
idn number(6),
quantity varchar2(6)
organization external (
type oracle_loader
default directory user_dir
access parameters (
records delimited by newline
fields (
account position(1:5) char(5),
idn position(6:11) char(6),
quantity position(12:17) char(6)
location ('test.txt')
reject limit unlimited;
MERGE INTO id_req_stg t
USING (
SELECT account,
idn,
decode(quantity, '-', 0, to_number(quantity)) as quantity
FROM ext_table
) v
ON ( t.account = v.account AND t.idn = v.idn )
WHEN MATCHED THEN
UPDATE SET t.quantity = v.quantity
DELETE WHERE t.quantity = 0
WHEN NOT MATCHED THEN
INSERT (account, idn, quantity)
VALUES (v.account, v.idn, v.quantity);
ELSE
dbms_output.put_line('File Does Not Exist');
END IF; -- file exists
EXCEPTION
WHEN UTL_FILE.ACCESS_DENIED THEN
DBMS_OUTPUT.PUT_LINE('No Access!!!');
WHEN UTL_FILE.INVALID_PATH THEN
DBMS_OUTPUT.PUT_LINE('PATH DOES NOT EXIST');
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);
END;
/ -
How to populate dynamic internal table according to the field names
Hi ,
Iam having a dynamic internal table <DYN_TABLE> , it has fields like
MATNR MAKTX MEINS BISMT MTART ...
Now my requirement is i need to fill them according to the fieldname from another internal table (static) .
The order of internal table (static) and dynamic internal are not same.
kindly help me.Hi,
Here is the code. Please reward points if helpful.
REPORT z_dynamic.
TYPE-POOLS : abap.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>.
DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
xfc TYPE lvc_s_fcat,
ifc TYPE lvc_t_fcat.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_table(30) TYPE c DEFAULT 'T001'.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_structure.
PERFORM create_dynamic_itab.
PERFORM get_data.
PERFORM write_out.
*& Form get_structure
text
FORM get_structure.
DATA : idetails TYPE abap_compdescr_tab,
xdetails TYPE abap_compdescr.
DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
LOOP AT idetails INTO xdetails.
CLEAR xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
APPEND xfc TO ifc.
ENDLOOP.
ENDFORM. "get_structure
*& Form create_dynamic_itab
text
FORM create_dynamic_itab.
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
Create dynamic work area and assign to FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
ENDFORM. "create_dynamic_itab
*& Form get_data
text
FORM get_data.
Select Data from table.
SELECT * INTO TABLE <dyn_table>
FROM (p_table).
ENDFORM. "get_data
*& Form write_out
text
FORM write_out.
Write out data from table.
LOOP AT <dyn_table> INTO <dyn_wa>.
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE <dyn_wa> TO <dyn_field>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-index = 1.
WRITE:/ <dyn_field>.
ELSE.
WRITE: <dyn_field>.
ENDIF.
ENDDO.
ENDLOOP.
ENDFORM. "write_out -
Sorting table according 2 columns
Hello,
I am using the TableSorter object in order to sort Dynpro tables.
Suppose I have requirement to sort according 2 columns,
I mean one primary and second secondary.
The situation now is every click on another column cancel the first sort.
I'll appreciate any suggestion.
Thanks,
Maya.Hi Maya,
Check this links.
/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s
Re: table column sorting
Re: execute tableSorter
Regards,
Mithu -
Dynamic filling of input fields in a table
Hi,
There are input fields in a two tables these are to be filled parallely at run time. the no of entries depend on the entires in internal table.
If internal table has more entries, then a certain entries is filled up; say 9 times the control should be given to a new tables and the remaining entries should be filled in the input fields of other table .
I appreciate help.Hi,
Actually there is two HTML tables, each table has nine rows. if the no of entries in the internal table exceeds nine then the second table should be filled after the first HTML table has filled with all the nine entries.
Both tables contains same input fields. How to fill both tables dynamically. I think now it makes sense. -
Hi ,i want provide a input help for a Selection input field
Hi Experts,
I want to provide a input help for field in selection-screen ,
this field is non primary key Custom Table(Z) selection input field .
how we can get ,f4 help for this field.
how to get f4 help Suppose field Link s_mtart-low,s_mtart-high,
What are the function moduled available for this >
Thanks in Advance.
Regards,
Hitu.Hi,
refer to below code.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_usnam-low.
**//To provide F4 help to S_USNAM-LOW
PERFORM f_f4help_usnam USING 'S_USNAM-LOW'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_usnam-high.
**//To provide F4 help to S_USNAM-HIGH
PERFORM f_f4help_usnam USING 'S_USNAM-HIGH'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_wbs-low.
**//To provide F4 help to S_WBS-LOW
PERFORM f_f4help_wbs USING 'S_WBS-LOW'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_wbs-high.
**//To provide F4 help to S_WBS-HIGH
PERFORM f_f4help_wbs USING 'S_WBS-HIGH'.
*& Form f_f4help_usnam
To provide F4 help to username
-->P_0019 text
*FORM f_f4help_usnam USING value(p_0019) TYPE any.
**// To retrieve username from mkpf.
SELECT bname
FROM usr01
INTO TABLE it_usnam.
SORT: it_usnam BY usnam.
DELETE ADJACENT DUPLICATES FROM it_usnam COMPARING usnam.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = c_retusnam
PVALKEY = ' '
dynpprog = c_dynpprog
dynpnr = c_dynpnr
dynprofield = p_0019
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = c_s
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = it_usnam
field_tab = it_usnam.
return_tab = l_it_ret
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
*ENDFORM. " f_f4help_usnam
*& Form f_f4help_wbs
To create F4 help for wbs element
-->P_0039 text
*FORM f_f4help_wbs USING value(p_0039) TYPE any.
**// To retrive wbs element from mseg
SELECT pspel
FROM pspl
INTO TABLE it_wbs.
SORT:it_wbs BY wbs.
DELETE ADJACENT DUPLICATES FROM it_wbs COMPARING wbs.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = c_retwbs
PVALKEY = ' '
dynpprog = c_dynpprog
dynpnr = c_dynpnr
dynprofield = p_0039
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = c_s
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = it_wbs
FIELD_TAB =
return_tab = l_it_ret1
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
*ENDFORM. " f_f4help_wbs -
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 -
Highlighting input field and table cell column in red colour
Hi,
I have 4 input fields and a table in my screen. All the input fields are read only.
I have a functionality where I have to highlight a input field with the red colour. In the sense, I have to put a thin Red border over the input field without thowing any errors or messages.
Also, i have to highlight a particular cell in the table. i.e, i have to put Red colour border over the cell of the table for some rows only. Right now i have changed the background colour of the cell for required rows, but i need Red thin border rather than changing the entire background colour.
Please guide me on achieving these functionalities..
Thanks and Regards,
-Shabir Rahim.Hi,
The red thin lines border you are talking about comes from the framework during the exceptions. If this is the case then refer the following links, hope this will help you.
[Re: Automatic message for inputfields with state=required]
[Re: Validation of InputField]
Well without exceptions, i dont think it will come.
thanks & regards,
Manoj
Edited by: Manoj Kumar on Feb 7, 2008 12:09 PM -
Input field in a table view control
Hi,
I have a table view control, with input field in one of the columns.
That is meant for entering some values.
My problem is when i am entering a 3 input field with value and then by using mouse control i enter say 20th input field with value. After that when i use the directional keys to enter the 21st field, the cursor is not in 21st field, it is somewhere else.
How to correct this problem.
Regards,
VijayalakshmiHi,
Try to use the TABINDEX property of <input>.
Best regards,
Guillaume -
How to get the value from the Input field of the Table view.
Hi Experts,
I have created a table view with 10 rows and each rows contains input fields in it.Can you please help me getting the values that are entered in all 10 rows.
Currently I am using the below code,but using the below I am able to get only the first row details of the table.
lo_el_table->get_static_attributes(
IMPORTING
static_attributes = ls_table).
Please let me know you suggestions on this.Thanks in advance.
Regards,
ArunHi Arun,
You should use this method:
lo_nd_table->get_static_attributes_table(
IMPORTING
table = lt_table).
Cheers,
Roelof
http://www.nl4b.com -
Input field validation in a Table based on the value of other column
Hi all
I have a table with 2 columns. column1 is of text view and column2 is Input field.
The user should not be allowed to enter a value in the column2 ( input field) greater than the value populated in column1(textview).
So for Eg; if the column1 is populated with value 100, The user should not be able to enter a number greater than 100 in the column2 input field.
Please let me how this can be achieved.
I appreciate the help.
ThanksHi,
Let me make sure u r working with table control.
First u have to create a event(VALIDATE) to do the validation.
Inside the event,
1. First get the current index where user has pointed the curson
2. Once u get the index read the internal table with index value.
3. Now u can compare the col1 and col2 values and populate the error message.
1. DATA : lo_elt TYPE REF TO if_wd_context_element,
l_index type i.
lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
CALL METHOD LO_ELT->GET_INDEX( RECEIVING MY_INDEX = l_index.
above code should be written inside the event.
Thanks, -
Issue with input field in table control
Hi,
I have an issue with field acgl_item-rstgr in the table control.
I have created a screen program with a table control.
In the control i have added a dictionary field as acgl_item-rstgr.
When i execute, do f4 on the input field, select a value and press enter, then it is showing me
error as 'Entry 'val' does not exist in T053R (check entry). Its really weird to understand this. I have selected the value
from f4 and even then it says this. Its working for all other columns, but not working only for RSTGR.
Plz help me on this regard.
Code is like this.
TYPES : BEGIN OF ty_rstgr,
rstgr TYPE RSTGR,
END OF ty_rstgr.
TABLES : ACGL_ITEM.
DATA : it_rstgr TYPE TABLE OF ty_rstgr.
DATA : wa_rstgr TYPE ty_rstgr.
CONTROLS : table TYPE TABLEVIEW USING SCREEN 100.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT it_rstgr INTO wa_rstgr WITH CONTROL TABLE.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
LOOP AT it_rstgr.
ENDLOOP.
Thanks,Hi Navitha,
Its Check Table concepts for the error u stated. Please check wht the Search help ur using...Because for this field there is no search help at value table level...Use search help that hold all master data or create a custom search field in SE11 level or in program level.
Cheers,
Naveen -
How to set focus on a input field in a selected row of a table?
In a previous discussion (http://scn.sap.com/thread/3564789) I asked how to access an input (sap.m.Input) field of a selected row in a table. In the answer that was supplied I was shown how to get the items of the table. Then using the selected index to get the selected item get the cells. Then I could set editable on the proper cell(s). This worked fine.
Now I need to set the focus on one of the fields. I tried something like this:
var oNewLink = table.getSelectedItem();
var oNewLinkName = oNewLink.getCells()[1];
oNewLinkName.focus();
But this doesn't seem to work.
I have searched through other discussions and have seen this technique for putting focus on a field if you have its ID:
sap.ui.getCore().byId(id_of_the_input_field).$().focus();
In my case though I do not have an ID since the row and its cells are generated. How can I set focus on the cell of a certain row in a table?Hello Venkatesh. Yes that code does work. First I tried it on a table cell that was already rendered and it did work. The next time I tried it on a table row that was being added and it did not work there. So I added an on after rendering function for the table and added that code there. That did not work until I added a delay (timeout) to do a context switch before calling the focus and that worked.
Once last thing though sometimes when I call focus on an input field (actually in a table row cell) if the field has text in it already the flashing cursor is at the beginning of the text and other times it is at the end of the text (which is the desired way). It depends on where I click in the row. Is there anyway to make sure the flashing cursor is at the end of the text when the focus is applied to a field that contains text? -
Hi All,
I am facing a problem now where table row height is too big , as in 1 row size is actually a merged of 2 rows, the input field is shifted to the bottom of the cell. And when you select the row, an asterik is visible at the bottom row, and the input field is shifted up to the top of the cell. I am using customized iterator and cl_crm_ic_inputfield to render the cell. Anyone have this problem before?
Thanks!
Cheers,
cadyHi Guys,
Some additional info i found on this issue. I am using design2003. I realized that the * added meant that its required field. However, upon further checking, when calling method RENDER_DESIGN2003 in class cl_crm_ic_inputfield, it checkes for me->required is not initial, which is kind of odd since the required field has the initial value of 'FALSE'. So , either required = 'TRUE' or 'FALSE', it will always be required field. Anyone encountered such problem before?
Cheers,
cady -
Error in validation an input field in a table ui and high lighting the cell
Hello All,
I have a table ui in one of my application. This table has, say 6 columns; out of these 6 columns 4 columns are shown as input fields. User needs to put in some numbers in two of the fields. I need to capture these two number fields data and subtract one from the other. If number is negative , I need to let the user know by error message that the number is negative and they need to fix their input to make the answer positive. I am able to do all this, but I am not able to high light the corresponding field which needs to be fixed. Is there anyway I can do that...I mean high light the particular field as one gets it when we use the "report attribute error message" method of message manager class.
Secondly I can not halt the application, I need to do some work around for that using some flags. Is there a simple way to halt the application, other than using flags and if condition? I searched this forum, but could not find any definite answer....
Thanks very much!
Any help would greatly be appreicated.Hi....
First you should have the table values in an internal table.... for that yo need to get the values from the context like this....
*DECLARE INTERNAL TABLE AND WORKAREA.
data ls_nd_stru type wd_this->element_<node name>
data lt_nd_table type wd_this->elements_<node name>
get all declared attributes
lo_nd_<your context node>->get_static_attributes_table(
importing
table = lt_nd_table ).
*now your lt_nd_table will have the values.....what ever you have in the table.
*then
loop at lt_nd_table into ls_nd_stru.
<.....your logic.....>
<ie., read the current line of the field like
ls_nd_stru-<field name1> = ls_nd_stru-<field name2> - ls_nd_stru-<field name3>
then check error msg... based on your postive or negative values
endloop.
Hope this will help you....
Thanks & regards
Raja
Maybe you are looking for
-
No receiver found in Receiver Determination
Hello Experts, Sub: Calling integration process (which in software component1) from sender service interface_Out (which is in another software component2) in Receiver Determination Fails. There are two software components, S/W C1, S/W C2,
-
HOW TO MAKE A HIGH DEFINITION AUDIO DVD WITH PREMIERE CS2
I have been working with my CS2 Premiere to create some auto play high definition, audio-only DVDs that are autoplay. To clear the air, yes I know that CS4 will permit 24bit-96 kHz. For the time being 16 bit-48 kHz, is still better (marginally) tha
-
How do I keep it an "n-only" network?
I want to keep a network accessible to n-devices only. I have g-devices at the location, and don't want them slowing down my n-devices. What settings on the Airport Extreme Base Station are required to keep the network as "n-only" network? Thank you.
-
Is there any way to avoid having to rerender files each time I open a PE8 project? Yes, I save the file, but for some reason certain files have to be rerendered. All files are AVHCD. And there doesn't seem to be any reason why some files need to be r
-
Not able to use Sql Server 2012 Intellisenese
I am not able to use Sql Server Intellisence . I refer following links http://blog.sqlauthority.com/2009/03/31/sql-server-2008-intellisense-does-not-work-enable-intellisense/ http://www.mssqltips.com/sqlservertip/2591/troubleshooting-intellisense-in-