Display record once i click alv o/p
hi friends
once i click or double click the output of alv record..it must be added in itab.
finally i want all the records.. whatever item i already clicked in the internal table..(without using screen painter concept)
thankz in advance
gowrishankar
may be u can develop BDC on ALV double click
Form user_command .....
case 'XXXX'.
when 'VA02'.
write ur BDC code here
endcase.
Similar Messages
-
Getting present display records or Row Id's information in ALV grid?
Hi,
I am using REUSE_ALV_GRID_DISPLAY for ALV display.
I need to get the row id's when user filter the records with any conditions - or any other ways if he selected particular records - I need to process my logic only for those present displaying records in ALV grid.
So How do I can get preset display records in ALV grid or Present display records row id's ?
Please let me know .
And also I am using
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_repid = i_repid
e_grid = lt_grid
In lt_grid there is a table MT_ROID this table is having selected row id's information but I could not read this table. I think this will work only OO ABAP and also method - get_selected_rows is also not working.
I highly appreciate your answers.
Thanks
KevinHallo,
Any ideas?
Thanks. -
Update all alv (grid) displayed records to internal table
Hi all,
i want to update the records into the internal table which are changed by the user in the edit field.
after he select save button.
i have to save the ALV grid displayed records in the internal table.
hw can i do this ?ALV with EDIT and SAVE functionality
Code:REPORT z_demo_alv_jg.*******************************************************************
TYPE-POOLS *
TYPE-POOLS: slis. *******************************************************************
INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.*******************************************************************
FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.*******************************************************************
SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c,
lines(5) TYPE n.*******************************************************************
START-OF-SELECTION *
START-OF-SELECTION.* Storing table name
p_table = tabname.* Create internal table dynamically with the stucture of table name
entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'. LEAVE TO LIST-PROCESSING.
ENDIF.
Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.* Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>. SORT i_fieldcat BY col_pos.* Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS. REFRESH <dyn_tab_temp>.* Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2. IF sy-subrc <> 0. ENDIF.&----
*& Form SET_PF_STATUS
Setting custom PF-Status
-->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab. SET PF-STATUS 'Z_STANDARD'.ENDFORM. "SET_PF_STATUS&----
*& Form user_command
Handling custom function codes
-->R_UCOMM Function code value
-->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.* Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.* Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.* Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.* Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>. CASE r_ucomm.* When a record is selected
WHEN '&IC1'.* Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex. IF sy-subrc = 0.* Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.* Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'Z_DEMO_PDF_JG'
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.* Make all the fields input enabled except key fields
w_field-input = 'X'. MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL. ENDIF.* Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2. IF sy-subrc = 0.* Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.* If the record is changed then track its index no.
and populate it in an internal table for future
action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF. ENDIF.* When save button is pressed
WHEN 'SAVE'.* Sort the index table
SORT i_index.* Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index. LOOP AT i_index.* Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF. ENDLOOP.* Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3. IF sy-subrc = 0.* Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>. REFRESH <dyn_tab_temp>.* Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table. ENDIF.
ENDCASE. rs_selfield-refresh = 'X'.ENDFORM. "user_command -
Need to display records only once for that particular group
Hi,
I have a requirement like displaying repeated records only once for that particular group.
For eg, in the emp table, I need to display repeated deptno only once for the particular group of job.
And for the above requirement I have used the below query,
SELECT empno, DECODE (LAG (job, 1) OVER (ORDER BY job), job, NULL, job),
DECODE (LAG (deptno, 1) OVER (ORDER BY deptno), deptno, NULL, deptno)
FROM emp;
Output:
EMPNO JOB DEPTNO
7782 10
7934 CLERK
7839 PRESIDENT
7876 20
7788
7902 ANALYST
7566 MANAGER
7844 30
7900
7654 SALESMAN
7698
But in the above output you can find that, say deptno 10 is getting displayed only once, whereas I want that deptno 10 to be checked whether it is getting repeated within the group of JOB and than hide the deptno 10 only if it is repeated within that job group. If not, deptno 10 should be displayed again.
Please help me in this.
Regards,
ShivaHi,
Hope the below helps.
SELECT emp_id, job, deptno,
CASE WHEN LAG(deptno, 1) OVER (partition by job order by deptno) = deptno THEN null else deptno end
FROM empRegards
Ameya -
Click on J button to display record set
How to write a code to click o j button to display record set of MS Access database
http://java.sun.com/docs/books/tutorial/jdbc/index.html
Create a class to perform DB related stuff and call in when the button is clicked. Your question is too generic. It would be better if ou asked a specific query. -
How to display records with radio buttons
Well,
<b>This is what I have right now:</b>
When I execute the Sales Orders report, it takes me to a selection screen with fields (VBELN, AUDAT, UNAME,....). I have Display, Create and Edit buttons below the selection criteria. The database table will have a DELETE FLAG.
<b>This is what I need to do:</b>
When I click on Edit button, it should take me to a new screen (this screen will have 3 buttons: Change, Delete, Undelete) with records based on the selection criteria. Also each record should have radio button.
So if I select a record and <u>click on CHANGE</u> button it should take me to a new screen with only that record and the fields should be editable. Upon changing the fields, the records should be updated in the database.
If I <u>click on DELETE</u> button it should set the DELETE FLAG in the database, so that when I click on Display button in main screen it shouldn't show me this record next time.
If I <u>click on UNDELETE</u> button it should reset the DELETE FLAG.
<b>This is what you get:</b>
Reward points if helpfulYou can use AT SELECTION-SCREEN OUTPUT event to capture the dynamic screen changes like selecting the radio buttons, once you captured the user action then you can call the other screen and you can work on that.
regards,
Dj
reward, if its useful -
How can we assign different colours to different records(line items) in alv
how can we assign different colours to different records(line items) in alv reporting?
Hi Friend,
Please see this SDN Wiki for setting the color in ALV :[http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP-DevelopingInteractiveALVReportusing+OOABAP]
There are so many SDN Wiki's on this just try with search Alv Color display in SDN,
Regards, -
How do i display text information below an ALV grid.??
Hi.
I need to display my output in an ALV GRID.
also i need to display summary details below the ALV grid. the smmary values keep changing dynamically depending upon selection screen inputs!!chk this report..write your code in the footer
*& Report ZRJR02 *
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
* INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT A~ZEMPNO A~ZEMPNAME A~ZDEPTCD B~ZDEPTNAME A~ZDESGCD C~ZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON A~ZDEPTCD EQ B~ZDEPTCD
INNER JOIN ZDESG_MST AS C
ON A~ZDESGCD EQ C~ZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*& Form LAYOUT
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
* PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
* PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
* MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
* IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*& Form LSORT
*FORM LSORT USING P_FIELD P_TABLE P_UP.
* ADD 1 TO L_POS.
* IT_SORT-SPOS = L_POS.
* IT_SORT-FIELDNAME = P_FIELD.
* IT_SORT-TABNAME = P_TABLE.
* IT_SORT-UP = P_UP.
* APPEND IT_SORT.
*ENDFORM. " LSORT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
ENDFORM.
*& Form F_WRITE_SUMMARY
* Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM. -
How can I display records quickly in order, using set_block_property
Hi all,
I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
I have written the following code in when-button-pressed trigger:
begin
if get_block_property('block_name',default_where) = 'column_name ASC' then
set_block_property('block_name', default_where,'column_name DESC');
else
set_block_property('block_name',default_where, 'column_name ASC');
end if;
end;
How can I get the result quickly can anyone please give me an idea to solve this.
Thanks in advance.Hi user;
I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
I have written the following code in when-button-pressed trigger:
begin
if get_block_property('block_name',default_where) = 'column_name ASC' then
set_block_property('block_name', default_where,'column_name DESC');
else
set_block_property('block_name',default_where, 'column_name ASC');
end if;
end;
How can I get the result quickly can anyone please give me an idea to solve this.Did you try to use index for related column? Also did you try to use order_by instead of default_where
If its not help, I also suggest post your issue on :Forum Home » Developer Tools » Forms
Hope it helps
Regard
Helios -
Displaying the selected rows in ALV Grid output
Hi Experts,
I am developing one interactive ALV Grid report where user can process the selected records/rows from the ALV Grid output.
for displaying the ALV Grid, I have used the class CL_GUI_ALV_GRID class. I am working on ECC 6.0 system.
when I select any records/rows from output and then press any Application Toolbar button, PAI and then PBO modules of the screen gets executed as per the normal flow.
however After PBO, when same ALV output comes, all the selected/highlighted rows appear as unselected, that means I want to retain the ALV
rows selection during the round trip.
please advise.
Regards,
JageshHi,
Feiyun Wu is correct.
Get_selected_rows and set_selected_rows are the methods to be used .
Some code:
Note the sequence of code:
FORM set_gui_alv_grid_1 .
DATA: wa_layout TYPE lvc_s_layo ,
wa_print TYPE lvc_s_prnt .
DATA: it_sort TYPE lvc_t_sort ,
wa_sort TYPE LINE OF lvc_t_sort .
DATA: it_fieldcatalog TYPE lvc_t_fcat.
IF gui_custom_container_1 IS INITIAL .
CREATE OBJECT gui_custom_container_1
EXPORTING
container_name = 'GUI_CUSTOM_CONTAINER_1'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6 .
IF sy-subrc <> 0.
ENDIF.
PERFORM get_field_catalog
USING gc_log_group_1
CHANGING it_fieldcatalog .
CREATE OBJECT gui_alv_grid_1
EXPORTING i_parent = gui_custom_container_1.
CREATE OBJECT ob_event_receiver_1
EXPORTING log_group = gc_log_group_1 .
* registers the event handlers
SET HANDLER ob_event_receiver_1->handle_toolbar FOR gui_alv_grid_1 .
SET HANDLER ob_event_receiver_1->handle_user_command FOR gui_alv_grid_1 .
SET HANDLER ob_event_receiver_1->print_top_of_page FOR gui_alv_grid_1 .
SET HANDLER ob_event_receiver_1->hotspot_click FOR gui_alv_grid_1 .
wa_layout-cwidth_opt = abap_true .
* wa_layout-excp_fname = gc_excp_fname .
* wa_layout-ctab_fname = gc_ctab_fname.
* wa_layout-excp_led = abap_true .
CALL METHOD gui_alv_grid_1->set_table_for_first_display
EXPORTING
is_layout = wa_layout
is_print = wa_print
i_save = 'A'
is_variant = gs_disvariant_1
CHANGING
it_sort = it_sort
it_fieldcatalog = it_fieldcatalog
it_outtab = it_alv_grid_1.
ELSE .
CALL METHOD gui_alv_grid_1->refresh_table_display.
* Restore selections
CALL METHOD gui_alv_grid_1->set_selected_rows
EXPORTING
it_index_rows = ob_event_receiver_1->it_rows.
* Restore position
CALL METHOD gui_alv_grid_1->set_scroll_info_via_id
EXPORTING
is_col_info = ob_event_receiver_1->wa_col
is_row_no = ob_event_receiver_1->wa_roid.
ENDIF.
ENDFORM . "set_gui_alv_grid_1
Regards. -
Display seletion screen values in alv grid output
Hi,
I am changing from alv list to alv grid. In ALV list after displaying output, in application tool bar one button is there that is "Display selections", when i click it, is giving all selection screen values in a popup. i want same funtionality in ALV grid.
By
jaganHi,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
FORM top_of_page .
PERFORM populate_top_of_page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = ig_header.
ENDFORM. " top_of_page
*& Form populate_top_of_page
FORM populate_top_of_page .
REFRESH ig_header.
CLEAR wg_header .
wg_header-typ = c_h.
wg_header-info = 'Selection Criteria:'(004).
APPEND wg_header TO ig_header.
CLEAR: wg_header.
IF NOT s_lgort IS INITIAL.
CONCATENATE s_lgort-low '-'(111) s_lgort-high
INTO g_text1 SEPARATED BY space .
ENDIF.
wg_header-typ = c_s.
wg_header-key = 'Storage Location :'(005).
wg_header-info = g_text1 .
APPEND wg_header TO ig_header.
CLEAR: wg_header.
CLEAR g_text1.
IF NOT s_ekgrp IS INITIAL.
CONCATENATE s_ekgrp-low '-'(111) s_ekgrp-high
INTO g_text1 SEPARATED BY space .
ENDIF.
wg_header-typ = c_s.
wg_header-key = 'Purchasing Group :'(006).
wg_header-info = g_text1 .
APPEND wg_header TO ig_header.
CLEAR: wg_header.
CLEAR g_text1.
IF NOT s_werks IS INITIAL.
CONCATENATE s_werks-low '-'(111) s_werks-high
INTO g_text1 SEPARATED BY space .
ENDIF.
wg_header-typ = c_s.
wg_header-key = 'Plant :'(007).
wg_header-info = g_text1 .
APPEND wg_header TO ig_header.
CLEAR: wg_header.
CLEAR g_text1.
ENDFORM. " populate_top_of_page
Hope this is helpful...
Regards
Milan -
I am completely stuck at this point and need urgent help.
here is what i have done till now:
i have one jsp page called first.jsp which displays records in RowsetBrowser from View Object A.
The attributes are ID,name,Location.
in View Object A i have added a transient attribute to which i have given an expression
as: ''| |ID| |'', i want to make the id as a link to the edit page,
i do not want an additional column to show up as link,hence i am not using addTextUrlColumn method.
now on clicking on this id,edit.jsp page is called and the parameter p which is the id is passed to
edit.jsp page.
The edit.jsp page is based on another View Object B.
the code is as follows:
String param=request.getParameter("p");
oracle.jbo.html.databeans.RowsetNavigator rsn;
rsn=(oracle.jbo.html.databeans.RowsetNavigator) new oracle.jbo.html.databeans.RowsetNavigator();
rsn.initialize(application,session,request,response,out,"NTS_NTS_NTSModule.LogPanelView");
rsn.getRowSet().getViewObject().setWhereClause("ncc_log_id="+param);
rsn.getRowSet().getViewObject().executeQuery();
The results of above query is only one record,which is right.
my job is now to display all the attributes of the above record,in text fields or
combo boxes.Hi Monali,
If I understand your attribute Number1 (and Number 2) is one string value (varchar2 type, long type etc. in Entity) which include in self more different values (other strings or numbers). Right? You can do this if you parse string with an method which analyse that string and give you all the values in an array. Then you can display all the values just like you display other attributes. Off course between the values within attributes value must exist an sign (;, |, ^ etc.) which separate one value from another.
Format is:
SignValue(1)SignValue(2)SignValue(3)SignSignValue(maxData)Sign
(e. g.)
Format 1:
|Ad45gt63e4|34f5t55B4|3d563H6a2|5G67sE3h7||d45fgh5|
First sign (|) in the string is separator between the values
Format 2:
;Friday;September 07;2001;Baker Street 21b;LONDON;Europe;;JSP;12345678;EJB;
First sign (;) in the string is separator between the values
I write one demo application (Parse) which you can see in listing 1: Parse.java (see below). Maybe isnt the best solution for this problem but working :-)(compile and run from java console)
In your case code maybe look like in listing 2: BrowserBean.java (see below)
I hope this help you...
Veso
Note: Sample code in listing 2 I write from my head (without testing), so maybe has errors.
Parse.java
public class Parse {
public static String CheckValue(String strValue){
int strEnd;
char strSign = strValue.charAt(0);
strEnd = strValue.indexOf(strSign,1);
strValue = strValue.substring(1, strEnd);
return strValue;
public static void main(String[] args) {
final int maxData = 100;
int sAllValues;
String sEmpty = "";
String[] sAllValuesNumber1 = new String[maxData];
String sValueNumber1 = ";Friday;September 07;2001;Baker Street 21b;LONDON;Europe;";
try {
sAllValues = 0;
while (sValueNumber1 != null && !sValueNumber1.equalsIgnoreCase(sEmpty) && !sValueNumber1.equalsIgnoreCase(sValueNumber1.substring(0,1))) {
sAllValues++;
sAllValuesNumber1[sAllValues-1] = CheckValue(sValueNumber1);
System.out.println(sAllValuesNumber1[sAllValues-1] + "\n");
sValueNumber1 = sValueNumber1.substring(sAllValuesNumber1[sAllValues-1].length() + 1);
} catch(Exception ex) {
throw new RuntimeException(ex.getMessage());
BrowserBean.java
package demobeans;
import java.io.PrintWriter;
import java.io.OutputStream;
import oracle.jbo.*;
import oracle.jbo.html.databeans.*;
public class BrowserBean extends oracle.jdeveloper.html.DataWebBeanImpl {
public static String CheckValue(String strValue){
int strEnd;
char strSign = strValue.charAt(0);
strEnd = strValue.indexOf(strSign,1);
strValue = strValue.substring(1, strEnd);
return strValue;
public void render() throws Exception {
final int maxData = 100; // number of values for attributes (Number1 or Number2)
int sAllValues1;
int sAllValues2;
String sData = null;
String sEmpty = "";
String sQuery = request.getParameter("id");
String sValueID = null; // if is ID column1 in ViewObject
String sValueName = null; // if is name column2 in ViewObject
String sValueNumber1 = null; // if is name column3 in ViewObject
String sValueNumber2 = null; // if is name column4 in ViewObject
String[] sAllValuesNumber1 = new String[maxValues];
String[] sAllValuesNumber2 = new String[maxValues];
Row[] drows = qView.getAllRowsInRange();
AttributeDef[] dattrs = getDisplayAttributeDefs();
for (int rowno = 0; rowno < drows.length; rowno++) {
for (int j = 0; j < dattrs.length; j++) {
if (!shouldDisplayAttribute(dattrs[j]))
continue;
if (drows[rowno] != null) {
Object attrObj = drows[rowno].getAttribute(dattrs[j].getIndex());
if (attrObj != null) {
sValue = attrObj.toString();
switch (dattrs[j].getIndex()) {
case 0 : sValueID = sValue; break;
case 1 : sValueName = sValue; break;
case 2 : sValueNumber1 = sValue; break;
case 3 : sValueNumber2 = sValue; break;
sAllValues1 = 0;
while (sValueNumber1 != null && !sValueNumber1.equalsIgnoreCase(sEmpty) && !sValueNumb er1.equalsIgnoreCase(sValueNumber1.substring(0,1))) {
sAllValues1++;
sAllValuesNumber1[sAllValues1-1] = CheckValue(sValueNumber1); // put values from Number1 in an array
sValueNumber1 = sValueNumber1.substring(sAllValuesNumber1[sAllValues1-1].length() + 1);
sAllValues2 = 0;
while (sValueNumber2 != null && !sValueNumber2.equalsIgnoreCase(sEmpty) && !sValueNumber2.equalsIgnoreCase(sValueNumber2.substring(0,1))) {
sAllValues2++;
sAllValuesNumber2[sAllValues2-1] = CheckValue(sValueNumber2);
sValueNumber2 = sValueNumber2.substring(sAllValuesNumber2[sAllValues2-1].length() + 1);
sData = "<!-- html -->Name:" + sValueName + "<!-- html code (table tags or other) -->";
sData += "<!-- html -->Number1[1]:" + sAllValuesNumber1[0] + " Number1[2]:" + sAllValuesNumber1[1] + ... + " Number2[sAllValues1]:" + sAllValuesNumber1[sAllValues1-1] + "<!-- html code (table tags or other) -->";
sData += "<!-- html -->Number2[1]:" + sAllValuesNumber2[0] + " Number2[2]:" + sAllValuesNumber2[1] + ... + " Number2[sAllValues2]:" + sAllValuesNumber2[sAllValues2-1] + "<!-- html code (table tags or other) -->";
out.print("Other HTML code...") // other elements for your look and feel
out.print(sData);
out.print("Other HTML code...") // other elements for your look and feel
releaseApplicationResources();
null -
i have 100 records can anybody tell me how i display records 10 at atime in jsp & by clicking the next button another 10 records displays in the same jsp. How i can do that thing.
You have to implement a page breake yourself.
Simple scenario would be to store a page number into a session:
session.setAttribute("page", selectedPage)
every time user clicks on a next page link
When displaying the record read the page and display only those which should be on the page
Integer selectedPage = session.getAttribute("page")
if (selectedPage == null) selectedPage = 1;
//display code goes here -
Firefox 4 will not let me keep my bookmarks listed on the side bar. I can open them there but once I click somewhere else they go away. On previous Firefox versions I could display my bookmark folders down the left side of my screen and just leave them there, accessing saved bookmarks when I needed to. Now with FF4 I can open a vertical column of my bookmark folders by clicking on bookmarks in the navigation bar but this won't stay there; if I click elsewhere they disappear. I could put a bookmark toolbar on my screen but this takes up more vertical space. I have lots of horizontal space that's unused. How can I go back to the display of bookmarks in previous versions?
You can fix that by going to View -> Sidebar and click on Bookmarks.
Or you could simply use a shortcut
''control + B'' -
How to display record in hyperlink in JSP?
Does any knows how to display the records in hyperlink? That's mean when I retrieve data from one database....two records...let's say peter and thomas....then i want the two records display in hyperlink....that's mean two records can be clicked by the user....and after the user clicked on either one of the record.....the record's value will be able to pass to the other page for use...
Can anyone pls help me of this?Thank in advanced....This will pass the Value from the DB as Query Parameters to the Target JSP.
Peter
Thomas
Maybe you are looking for
-
Difference between Null and null?
What is the difference between null and NULL? When is each used? Thanks,
-
How come, and how do I add the missing field to that defiling list? Thanks for any insight Jef
-
firefox bookmark toolbar not allowing me to drag & drop website icons. I've gone into view and click on " bookmark toolbar". bookmark toolbar appears but its but its not allowing me to drag and drop the icon on the toolbar. i've tried everything that
-
Not able to create DIR from PR line Item
Dear Friends, I have Cretaed Doc Type "CON" and entered "EBAN - Purchase Req. Item" in the object link and in Create Document I have mentioned " 1 - Create simple document". When I try to create a DIR from PR Line Item, there is no option or a logo i
-
I'm encountering a rather perplexing issue when using the getAttribute method of the Row interface. I have a view object defined and it returns 13 columns worth of data. Once I have executed the query and attempt to read the results using the getAttr