How to find out if JTable's selected row is visible?
Hello there,
Given:
a JTable is inserted into a JScrollPane and the number of rows in the table is greater than the vieport size.
A random row within the table gets programmatically selected.
How to find out if the selected row is visible in a JTable visible area?
Your help will be greatly appreciated.
Tim
That will make the row visible, but not answer whether it was visible
in the first place. Try something like:
public boolean isRowVisible( JTable table, int row ) {
Rectangle rect = table.getBounds();
int rowHeight = table.getRowHeight();
int viewHeight = table.getParent().getHeight();
int max = rect.y - viewHeight + 1;
int rowPos = - rowHeight * row;
return ( rect.y >= rowPos && rowPos > max );
}assuming all rows have the same height.
: jay
Similar Messages
-
How to find out, who locked the same row
Dears,
I have a problem,
sometimes our user complain that, when he tyring to make a transaction to a specific customer's Account
its says 'Some other user access the same account, keep trying...' (like this).
and in this response I just kill that user's session. then he can make the transaction by reconnecting.
sometimes my solution(killing the session) can not slove this problem.it stayed even 5/6 hours long.
in this time,i cannot find any bloking session or such a long waiting session.
In this Scenario..
I need to find out who(SID,SERIAL#,USERNAME) locked the same ROW (not table).
There are many users who are locking different rows of the same table at the
same time. I need to find the one who locked my row.
is it possible to find out, who locked the specific customer's Account ?
I am trying to find out by the following query but failed.
SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
DBMS_ROWID.rowid_create (1,
row_wait_obj#,
row_wait_file#,
row_wait_block#,
row_wait_row#
) rowidd
FROM v$session s, dba_objects b
WHERE s.row_wait_obj# = b.object_id
SELECT *
FROM (SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
DBMS_ROWID.rowid_create (1,
row_wait_obj#,
row_wait_file#,
row_wait_block#,
row_wait_row#
) rowidd
FROM v$session s, dba_objects b
WHERE s.row_wait_obj# = b.object_id)
WHERE rowidd IN (SELECT ROWID
FROM account_mas
WHERE branch = '999' AND accout_no = '009990215454')
please help me...
My Database version- 10.2.0.4, windows
Regards
Halim
Edited by: Abdul Halim on Oct 26, 2009 2:43 AMJust check with this query, find the lock and kill the session.
select b.session_id ,a.SERIAL#, a.username "Blocker Details"
from v$session a,dba_lock b
where b.session_id = a.sid
and b.blocking_others = 'Blocking';
Regards
Asif kabir -
How to find out the current number of rows in a form without navigation
Hi.
Is there any way to count the rows in a form (block) without navigation to the last record?
I am modifying CUSTOM.pll and have to count the rows before user commits changes.
All records are new in this case. Can anyone halp me? Thanks.
Regards
TomášMagoo wrote:
no, such a block-property ^unfortunately^ does not exists.
you can just go to to the block, call the last_record build-in and find out, where the cursor is.
But with this you call restrictred procedures and their are not everywhere allowed ...
If you execute a query on a block, may not all records getting retrieved from database.
For this forms does not know, how many records are really in the block and
for this there is no build-in like get_block_property ( records_count ).It does exist indeed. GET_BLOCK_PROPERTY('BLOCK',QUERY_HITS);
Of course, this will return the number of records that would get fetched to the block (based on the where condition), but not the records with NEW status (i.e new records which are not yet committed).
-Arun -
How to find out the Batch job selection screen values
Dear Users,
One of our users has set up a Batch job by manually entering values into the Selection screen of a report instead of picking up a Variant. We would like to know the values entered on selection screen since the job has failed and the user doesn't remember the selection screen values entered.
Can anyone please advise if there is a way we can figure out the selection screen values entered?
Thanks,
VijayHi,
You can debug your failed job by going to 'SM37', type in 'JDBG' in the command line ( no '/' ), put the cursor on the job and press enter - will take you to the job in debug mode.
You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job.
So type in the transaction code 'JDBG' and place your cursor on the job after It has finished. It will take you to a SAP program in debug mode. Step through this program which is about 10 lines, after this your program will be executed in the debug mode.
Check the selection screen values. -
How to find out the difference between the row level data in 2 dump files.
Hi,
I have got the export dump files from 2 different databases(for which I dont have access).
They have got the same tables and same number of rows.
how to compare the data within the tables(in the dump files).
Cheers,
Kunwaruser9131570 wrote:
Hi,
I have got the export dump files from 2 different databases(for which I dont have access).
They have got the same tables and same number of rows.
how to compare the data within the tables(in the dump files).
Cheers,
KunwarWhy you want to do it? What's the business need? Without importing, its not possible to read the dump file * .
Aman....
* If you are using Data pump, you can make a sql file and can see the components of the dump file. -
How to find out the selected column in Table Control
Hi all,
How to find out the selected column in Table Control?
Thanks & Regards,
YJRHi,
Let your table control name in Screen painter be TC1.
READ TABLE TC1-COLS INTO WA_COLS (some wok area)
WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
CLEAR: W_DUMMY, W_COL_NAME.
SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
W_COL_NAME.
endif.
W_COL_NAME gives you the column name.
Hope it helps.
cheers
sharmistha -
How to find out the selected line in list
Hi all,
Can any one tell me how to find out the selected event in the listYour subject said 'selected <b>line</b> in list' and your description says 'selected <b>event</b> in the list'. Which one is it you want to know?
For line you will use the event AT LINE-SELECTION and for event you will use AT USER-COMMAND.
Please reward and close if answered, if not, please revert back to the forum with more details.
Thanks,
Srinivas -
How to find out selected AssignedStory or Link?
Hello to all,
can anyone pls. explain how to find out which assigned story or link is selected at the time the script is fired.
My problem is this: I would like to place an image into selected rectangle which is exported into .icml. So, for example, you have few exported rectangles and you would like to place an image into the one which is selected (through link or assignment panel). Because you can not select a rectangle in InCopy like you can in InDesign I tried to take a look through assigned stories...
For aCounter As Integer = 1 To myDocument.Assignments.Count
Dim myAssignment As InCopy.Assignment = myDocument.Assignments.Item(aCounter)
For sCounter As Integer = 1 To myAssignment.AssignedStories.Count
Dim myAssignedStory As InCopy.AssignedStory = myAssignment.AssignedStories.Item(sCounter)
Dim myStoryRef As Object = myAssignedStory.StoryReference
find out if assigned story or story reference is selected
'Rectangle
If TypeName(myStoryRef) = "Rectangle" Then
Dim myObjectRectangle As InCopy.Rectangle = myStoryRef
If myObjectRectangle.Graphics.Count = 0 And myObjectRectangle.Images.Count = 0 Then
'CheckOut if needed
'Place Media
End If
End If
Next
Next
Kind regards,
MarkoWell,
I couldn't solve this without using a placeholder image. I found that you need to check if the selection is an image and than replace that image... So something like this below:
'Check if there is a selected image for relink
If myDocument.Selection.Count = 1 Then
If TypeName(myDocument.Selection.Item(1)) = "Image" Then
myImage = myDocument.Selection.Item(1)
myImageLink = myImage.ItemLink
Dim msgRet As MsgBoxResult = MsgBox("Would you like to relink selected image?", MsgBoxStyle.YesNoCancel, "Relink seleceted image?")
If msgRet = MsgBoxResult.Yes Then
' DO some action
Dim MediaLink As String = something...
'CheckOut action
If myCheckOutMenu.AssociatedMenuAction.Enabled() Then
myCheckOutMenu.AssociatedMenuAction.Invoke()
End If
myImageLink.Relink(fileLink)
Try
myImageLink.Update()
Catch
End Try
Hope this helps.
Regards,
Marko -
How to find out the selected item in the lsit
Hi all,
How to find out the selected item in the list,can any please post some examples which easy to understand,because iam not a good programmerThis sample program uses a checkbox as selection, you could also use a HOTSPOT.
report zrich_0002 no standard page heading.
data: imara type table of mara with header line.
data: check_box(1) type c,
report_lines type i.
start-of-selection.
* Create the gui status with BACK button in standard place
* and a READ button in the application toolbar
set pf-status 'CHECK'.
select * into corresponding fields of table imara from mara up to 100 rows.
loop at imara.
write:/ check_box as checkbox, imara-matnr, imara-matkl.
hide imara-matnr.
endloop.
report_lines = sy-linno - 1.
top-of-page.
write: 'List of materials'. uline.
top-of-page during line-selection. write: 'Material.....'. uline.
at user-command.
case sy-ucomm.
when 'READ'.
check_box = space.
set pf-status 'CHECK' excluding 'READ'.
do report_lines times.
read line sy-index field value check_box.
if check_box = 'X'.
write:/ 'You have selected material',
imara-matnr.
endif.
enddo.
endcase.
Regards,
Rich Heilman -
How to find out the user-exits?
hi.
how to find out the user-exits?
regards
eswar.Hi,
*& Report ZEXITFINDER
*report zexitfinder.
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*& Tables
tables : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
*& Selection Screen Parameters
selection-screen begin of block a01 with frame title text-001.
selection-screen skip.
parameters : p_tcode like tstc-tcode obligatory.
selection-screen skip.
selection-screen end of block a01.
*& Start of main program
start-of-selection.
Validate Transaction Code
select single * from tstc
where tcode eq p_tcode.
Find Repository Objects for transaction code
if sy-subrc eq 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir
where pname = tstc-pgmna.
select single * from enlfdir
where funcname = tfdir-funcname.
select single * from tadir
where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name = enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
Find SAP Modifactions
select * from tadir
into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.
Take the user to SMOD for the Exit that was selected.
at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen.
Regards -
How to find out the Transactions used per month & the USER who used that
Hi,
1)How to find out the Transactions used per month & the USER who used that?
2)and can i get the above same for minimum 20 month?
System : SAP- Enterprise Core Component.You can use my program...
*& Report Z_ABAP_TCODE_MONITOR
*****& Program Type : Report *
*****& Title : Z_ABAP_TCODE_MONITOR *
*****& Transaction code : ZTCODE_USAGE *
*****& Developer name : Shailendra Kolakaluri *
*****& Deveopment start date : 26 th Dec 2011 *
*****& Development Package : ZDEV *
*****& Transport No : DEVK906086 *
*****& Program Description : This program is to display
*List all tcodes executed during previous day.
*& Show the number of users executing tcodes
*& Modification history
REPORT Z_ABAP_TCODE_MONITOR.
*& List all tcodes executed during previous day.
*& Show the number of users executing tcodes
TYPE-POOLS : slis.
DATA: ind TYPE i,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
layout TYPE slis_layout_alv,
variant TYPE disvariant,
events TYPE slis_t_event WITH HEADER LINE,
heading TYPE slis_t_listheader WITH HEADER LINE.
*REPORT z_report_usage.
TYPES: BEGIN OF zusertcode,
date TYPE swncdatum,
user TYPE swncuname,
mandt TYPE swncmandt,
tcode TYPE swnctcode,
report TYPE swncreportname,
count TYPE swncshcnt,
END OF zusertcode.
*data : date type n.
DATA: t_usertcode TYPE swnc_t_aggusertcode,
wa_usertcode TYPE swncaggusertcode,
wa TYPE zusertcode,
t_ut TYPE STANDARD TABLE OF zusertcode,
wa_result TYPE zusertcode,
t_result TYPE STANDARD TABLE OF zusertcode.
PARAMETER: month TYPE dats DEFAULT sy-datum.
*PARAMETER: date TYPE dats.
*select-options : username for wa_usertcode-account.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_fieldcatalog.
PERFORM set_layout.
PERFORM get_event.
PERFORM get_comment.
PERFORM display_data.
FORM get_data .
*date = sy-datum - 2 .
After start-of-selection add this line (parameter Month required 01 as day).
concatenate month+0(6) '01' into month.
CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
EXPORTING
component = 'TOTAL'
ASSIGNDSYS = 'DEV'
periodtype = 'M'
periodstrt = month
TABLES
usertcode = t_usertcode
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
wa-date = month.
*wa-date = date.
wa-mandt = sy-mandt.
wa_usertcode-account = username.
LOOP AT t_usertcode INTO wa_usertcode.
wa-user = wa_usertcode-account.
IF wa_usertcode-entry_id+72 = 'T'.
wa-tcode = wa_usertcode-entry_id.
wa-report = space.
ELSE.
wa-tcode = space.
wa-report = wa_usertcode-entry_id.
ENDIF.
COLLECT wa INTO t_ut.
ENDLOOP.
SORT t_ut BY report ASCENDING.
CLEAR: wa, wa_result.
endform.
FORM get_fieldcatalog .
fcat-tabname = 't_ut'.
fcat-fieldname = 'DATE'.
fcat-seltext_l = 'Date'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'MANDT'.
fcat-seltext_l = 'Client'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'USER'.
fcat-seltext_l = 'User Name'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'TCODE'.
fcat-seltext_l = 'Transaction Code'.
fcat-key = 'X'.
APPEND fcat.
ENDFORM.
*& Form SET_LAYOUT
text
--> p1 text
<-- p2 text
FORM set_layout .
layout-colwidth_optimize = 'X'.
ENDFORM. " SET_LAYOUT
*& Form GET_EVENT
text
--> p1 text
<-- p2 text
*FORM get_event .
events-name = slis_ev_top_of_page.
events-form = 'TOP_OF_PAGE'.
APPEND events.
*ENDFORM. " GET_EVENT
**& Form GET_COMMENT
text
--> p1 text
<-- p2 text
*FORM get_comment .
DATA: text(30).
text = 'Billing Report'.
heading-typ = 'H'.
heading-info = text.
APPEND heading.
*ENDFORM. " GET_COMMENT
**& Form top_of_page
text
--> p1 text
<-- p2 text
*FORM top_of_page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
*ENDFORM. " top_of_page
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
sort t_ut[].
DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = layout
it_fieldcat = fcat[]
i_save = 'A'
is_variant = variant
it_events = events[]
TABLES
t_outtab = t_ut
EXCEPTIONS
program_error = 1
OTHERS = 2.
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. " DISPLAY_DATA -
How to find out the person who did a transport.
How to find out the person who did a transport.
There are 3 basis admins in our Org.
so is there a way of tracing out , who did what transport.
Regards,- Goto import Overview (STMS)
- Import Queue
- Select DEV req (goto Import History)
- Edit - Display More
It will show the user who did the transport
Rgds -
How to find out when data was deleted from table in oracle and Who deleted that
HI Experts,
Help me for below query:
how to find out when data was deleted from table in oracle and Who deleted that ?
I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
TABLE_OWNER TABLE_NAME INSERTS UPDATES DELETES TIMESTAMP DROP_SEGMENTS TRU
PRODCTL F9001 1683 46 2171 11-12-13 18:23:39 0 NO
Audit is enable in my enviroment?
customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
SQL> show parameter audit
NAME TYPE VALUE
audit_file_dest string /oracle/admin/pbowe/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string DB, EXTENDED
please help
Thanks
SamLOGMiner --> Using LogMiner to Analyze Redo Log Files
AUDIT --> Configuring and Administering Auditing -
How to find out name of table for a structure.
hello all,
I want to find out name of table for a structure ADDR1_DATA. can anybody pls tell me how to find out it?
Thanks,
AshuHi Ashu,
You write the structure name in se11
after selecting the database table radio button
click on the where used list button in the application tool bar.
You will find the table name if it is used else where.
Check out the website at:
http://sap-idoc2edi-consulting.com/
Read the blog at:
http://blogs.ittoolbox.com/sap/ehadzipetros
Regards,
Jagadish -
How to find out which keywords were used to create a smart album?
Hi,
I actually have 2 questions;
a) Short of scrolling down my very long list of password on the HUD - is there an elegant way to do it - How to find out which passwords were used to create an existing smart album? It's a recurring challenge for me.\ 'cause I like using smart albums, but once in a while need to check or chane the passwords.
b) With annoying regularity when I try to get to this forum and choose Aperture, I get the following message - in pink, no less: It appears you're not allowed to view what you requested. You might contact your administrator if you think this is a mistake.
Any clues?
Thanks guys,
Raphael
<Edited by Host>b) With annoying regularity when I try to get to this forum and choose Aperture, I get the following message - in pink, no less: It appears you're not allowed to view what you requested. You might contact your administrator if you think this is a mistake.
Any clues?
Raphael,
that message may occur for four reasons at least:
Most frequently, when you are using an outdated link to a post that no longer exists, for example from an email notofication. Sometimes our community host will remove posts, that are in violation of the terms of use: see:
Apple Support Communities Terms of Use
Or you are using the edit button or a bookmark to an "Edit" window, after the fifteen minutes allowed for editing are up.
Or you want to view a page in a restricted section of the ASC - soem perta are only open for members of level 6 or higher.
Or it is one of the unexplained problems with the forum software right now.
a) Short of scrolling down my very long list of password on the HUD - is there an elegant way to do it - How to find out which passwords were used to create an existing smart album? It's a recurring challenge for me.\ 'cause I like using smart albums, but once in a while need to check or chane the passwords.
I really like Kirby's suggestion with the IPTC rule Keyword is. This is very useful for smart albums global to the library.
Frequently a different approach helps for my smart albums. Many of my smart albums are local to projects or folders. In this case the smart HUD will only show those keywords that have been used for the images in the selection. So if I only have tagged the images with the keywords "birds" and "slideshow", the smart settings HUD will only show these two keywords and the list is very short.
My Keywords HUD, is organized hierarchically; this way I can collapse large sections at once, and it is easier to focus on the keywords needed for a specific task.
I use the search field in HUD a lot, to filter the set of keywords shown.
Maybe you are looking for
-
Handling a panic when using DB_REGISTER
I have just run into a problem which I think is a bug in BerkeleyDB 4.4.20. I am checking to see if there is any known work-around or patch for this. We have a design in which two processes use one environment. Both processes employ the combination o
-
Zen Micro:The Full Story - Working ? Broken ? Happy or Sa
<SPAN>Ok i realise that there are a lot of people having problems with their Micro's so lets see how this all equates shall we ? I suggest we : <SPAN>. How many Micros have you had so far?<B><SPAN></B> <SPAN>2. Are you happy with your current Zen Mic
-
Can anyone help me with Error -3259? PLEASE :((
Re: My home button isn't working well so i went to my service provider to ask about the problem. They advised me to update my iPhone to iOS 5 but the problem is no matter what i do, there is always an error. What should I do? my home button isn't wor
-
How can I auto-sort with each new entry
I'm looking for a formula, a script, or automator service that will allow me to auto-sort by column every time I change an entry. My spreadsheet uses steppers. I want to automatically sort the column every time I increase the stepper. I'd prefer not
-
Urgent! How to stop a running publication
Hello all We're on CCM 2.0 (still with SP03). We have several CATALOG_PUBLICATION_REQUEST jobs running and stopping again immediately with 1 single error message (in SLG1) telling us that the publication of our master catalogue will again be schedule