Event handling operation on other software windows
Hi friends
I am able to execute another external program through java code using
Runtime.getRuntime().exec();
But now I want to perform Event Handling operation on such a opened external program(software) window.
Is it possible in Java to perform Event Handling operation on other software windows.
Thanks
Can anybody give me some idea. I already gave you hte idea. I told you to write the C++ code to do it. There is no other way. You cannot do that from Java.
WRT the sockets post:
whether you use JNI or sockets: the accessing code will still not be written in Java. Hence you still can't do it in Java.
Similar Messages
-
Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
correct the problem. It's as if they don't exist, because of the invalid search paths.
If I try to rename them in Windows Explorer I get following message.
The file name you specified is no valid or too long.
Specify a different file name.
Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
Linux altogether.
After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
Once there was a...
There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
that made it.
Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
in Server editions of Windows.
Then there's the Microsoft Knowledge Base article
289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
error.
It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
For example, the following maps the UNIX colon (:) to a Windows dash (-):
0x3a : 0x2d ; replace client : with - on server
I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
they are used to it by now. (Yes, the characters! They don't mind.)
Then there's this registry key.
HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
5. Back to square one!
So there you have it. They all lived happy for the rest of their lives...
I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows.Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
correct the problem. It's as if they don't exist, because of the invalid search paths.
If I try to rename them in Windows Explorer I get following message.
The file name you specified is no valid or too long.
Specify a different file name.
Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
Linux altogether.
After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
Once there was a...
There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
that made it.
Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
in Server editions of Windows.
Then there's the Microsoft Knowledge Base article
289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
error.
It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
For example, the following maps the UNIX colon (:) to a Windows dash (-):
0x3a : 0x2d ; replace client : with - on server
I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
they are used to it by now. (Yes, the characters! They don't mind.)
Then there's this registry key.
HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
5. Back to square one!
So there you have it. They all lived happy for the rest of their lives...
I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows. -
Event handling for closing a browser window on portal in web dynpro abap
Hi,
I am new to portal as well as web dynpro. Is it possible to handle portal events in web dynpro abap? My requirement is whenever a browser window is closed on portal, if any new system messge has been added I want to display them in a pop-up. I checked examples from the package 'SWDP_TEST' but they trigger events in web dynpro and pass them to portal. I want to subscribe to the close event of portal and handle it in my web dynpro abap application. How can I achieve this? Please suggest.
Thanks and regards,
AmruthaAmrutha S wrote:
Is it possible to handle portal events in web dynpro abap? My requirement is whenever a browser window is closed on portal, if any new system messge has been added I want to display them in a pop-up. I checked examples from the package 'SWDP_TEST' but they trigger events in web dynpro and pass them to portal. I want to subscribe to the close event of portal and handle it in my web dynpro abap application. How can I achieve this? Please suggest.
Hi,
I dont think that you can code to close IE browser window as you cannot access MS IE APIs in WD ABAP. I looked into closing IE browser and got http://p2p.wrox.com/general-net/16588-handling-ie-close-event.html . reading this, it seems the coding can be done in C#(asp) etc.
also refer Closing of IE window
I hope this is useful for you.
Thanks,
Chandra -
I can minimize the Firefox window, but *unless* I minimize it, I can't access other programs-- even if I click on a window behind the Firefox window or try clicking on the appropriate icon from the Windows taskbar. The Firefox window stays in front.
I'm using Firefox 18.0; I am on the update release channel.
My enabled add-ons are:
Adblock Plus Pop-up Addon 0.5
BetterPrivacy 1.68
Flashblock 1.5.15.1
RAMBack 1.0
and I have no toolbars installed. The only other thing I've recently installed is Amazon Cloud Drive-- but again, this problem is specifically and only with the Firefox window.
Thank you for any help you can give me!There is a bug in Adblock. If you disable, thing return to normal. In my experience, this only occurs after an ad is blocked.
-
Firefox 3.6.12 freezes up continuously even after pc restarts and virus scans. If i click on anything in Firefox then I need to click on any other open program window and return to Firefox for me to be able to take my next action in Firefox.
just to go get "trouble shooting information" copy and paste t below, I had to click on media player 5 different time to keep reactivating Firefox to complete the processDoes that happen only on web pages that are running a Flash presentation? <br />
When Flash "steals focus" from Firefox, you need to click outside the Flash presentation in the browser window, to regain focus in Firefox. A major problem arises when the Flash presentation is in the entire browser window, though. The Firefox developers are working on fixing that in Firefox, but it doesn't look like a fix is going to make it into Firefox 4.0, though. -
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DemoWindow extends JFrame
private final int WIDTH = 200, HEIGHT = 200;
public DemoWindow() {
//set title
setTitle( "Event-Handling Demostration" );
//get screen size
Dimension d = this.getToolkit().getScreenSize();
//1. if u want the fram to fill the whole screen use this code
setLocation( 0, 0 ); //may not need because it's default
setSize( d.width, d.height );
//2. if u have a custom frame size use this code to
// dynamically center it (assume the given size at top)
setSize( WIDTH, HEIGHT );
setLocation( (d.width-this.getWidth()) / 2,
(d.height-this.getHeight())/ 2 );
//to end program when frame is closed (using anynomus inner class)
addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e ) {
System.exit( 0 );
}); //end of inner class
public static void main( String[] args ) {
DemoWindow test = new DemoWindow();
test.setVisible( true ); }} //end of DemoWindow classWhen the program starts, the Demo window will fill � the area of the screen, and the center of the
window will be at the center of the screen. This sizing and positioning will be based on the current
screen display mode, not on hard-coded constants. The window title will be "Event-Handling
Demonstration". When the window is closed, the program will end.
The DemoPanel class will handle keyboard events using an inner class or classes. The
isFocusTraversable method will be used to allow the DemoPanel to obtain keyboard focus.
DemoPanel will collect from the keyboard all characters that are not action keys. Each time the Enter
key is pressed, DemoPanel will set the title of the Demo window equal to the characters collected since
the last time the Enter key was pressed, not including the Enter key. If the characters entered are an
integer number greater than 0, DemoPanel will set the current drawing square size (see below) equal to
this number. To set the square size, use a code structure similar to the following, where str is the
String of collected characters:
try {
squareSize = Integer.parseInt(str);
} catch (NumberFormatException xcp) {};
how do i do the second parthelp
-
How to add a custom PL/SQL code for a button event handler
Hi All,
I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
Q : How do I add a custom PL/SQL code for a button event handler?
Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
Hope I am able to explain my point.
Thanks in advance,
Abbas.Hi All,
I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
Q : How do I add a custom PL/SQL code for a button event handler?
Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
Hope I am able to explain my point.
Thanks in advance,
Abbas. -
Drop Down List in ALV with Event handler
Hi All ,
I have created an ALV grid with a dropdown as one of the columns. This all works fine, except that I want to be able to react to a change in the value of each line's dropdown the next column values should change according to the user selection in the 1st column .
Is this possible?
As an example, I have a table of records with one column as a dropdown called " Replace Function Module " and in 2nd column i have call function of that Replace Function Module , If a change in " Replace Function Module " should change the call function of in the 2nd column .
I am using these objects lvc_t_drop , lvc_s_drop and the method " set_drop_down_table ",
Please Can any 1 tel me how to do this with any event handler ar any other way !Hi,
You need to use event handler for this. Check if the below link gives some direction.
[http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]
I guess you should create a method inside which you call the FM using the FM name from the selected cell in ALV.
I have not tried it out, but its worth a try.
Hope this helps!
Regards,
Saumya -
About CL_GUI_ALV_GRID's event-handling & PAI/PBO
Hi, all,
I met a problem when using CL_GUI_ALV_GRID's event-handling.
I created a simple event-handling-class with an event-handling-method for DOUBLE-CLICK event of CL_GUI_ALV_GRID. And the event-handling-method, only makes some changes to the contents of itab to be shown in ALV_GRID.
The problem is: In my idea, after event-dispatch and event-handling in PAI, subsequent PBO will be called. Since SET_TABLE_FOR_FIRST_DISPLAY is called in PBO, I would saw the changed itab shown. BUT, I saw the contents of the itab remaining unchanged.
* PAI module, DISPATCH the event
CASE OK_CODE.
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
I debugged, and found that, after event-handling-method, PBO module doesn't execute.
That's my wondering, after the preceding PAI, shouldn't the subsequent PBO appear? OR is event-handling different from other user actions?
Many thanks.Hi,
for double click you need explicit handler ,
just check it.
REPORT ZTEST1234 MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID, "First
G_GRID1 TYPE REF TO CL_GUI_ALV_GRID. "Second
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST', "First Container
G_CONTAINER2 TYPE SCRFNAME VALUE 'TEST1',"Second container
GS_LAYOUT TYPE LVC_S_LAYO.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
LFDAT like lips-vfdat,
BOX(1),
HANDLE_STYLE TYPE LVC_T_STYL,
END OF ITAB.
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
**Handler to Check the Data Change
HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED
E_ONF4
E_ONF4_BEFORE
E_ONF4_AFTER,
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
MESSAGE I000 WITH V_ROW 'clicked'.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW.
V_COLUMN = E_COLUMN.
V_ROW_NUM = ES_ROW_NO.
IF E_COLUMN = 'VBELN'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
IF E_COLUMN = 'POSNR'.
MESSAGE I000 WITH 'Click on POSNR row number ' E_ROW.
"with this row num you can get the data
ENDIF.
ENDMETHOD. "handle_double_click
**Handle Data Change
METHOD HANDLE_DATA_CHANGED.
CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
EXCEPTIONS
FINISHED = 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.
ENDMETHOD. "HANDLE_DATA_CHANGED
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER, "handler
G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER. "Container2
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
"First Grid
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
CREATE OBJECT G_GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
"Second Grid
CREATE OBJECT G_CUSTOM_CONTAINER1
EXPORTING CONTAINER_NAME = G_CONTAINER2.
CREATE OBJECT G_GRID1
EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-BOX_FNAME = 'BOX'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
* SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_DATA_CHANGED FOR G_GRID.
data: ls_outatb like line of itab,
v_index type sy-tabix.
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
LOOP AT ITAB INTO ls_outatb WHERE POSNR = '000010'.
V_INDEX = SY-TABIX.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 8.
INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE ls_outatb-handle_style.
MODIFY ITAB INDEX V_INDEX FROM ls_outatb TRANSPORTING
HANDLE_STYLE.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
**Calling the Method for ALV output for First Grid
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
**Calling the Method for ALV output for Second Grid
CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
* EXPORTING
* IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Del Date'(015).
X_FIELDCAT-FIELDNAME = 'LFDAT'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards
vijay -
First time data is not transported to pop up window through event handler
Hi all,
I am using NWDS 7.0, Now I want to open a pop up on click of a action link.
There are two DCs DC-A and DC-B.
I am calling action from DC-A to DC-B. DC-B contains view of pop up window.
In DC-A I am using intreface controller of DC-B by using used coponents.
Now In the DC-B used components I have created one fireplugin which is connected ith pop up view of DC-B and that firplugin is called from DC-A action to transport data from Dc-A to DC-B.
Problem : when I click first time to open pop-up window then event handler is not called but the windows opened. When I close that window and again open the transported data start displaying on pop up window.
So can you please help me that why first time data is not transported to pop up window.
Thanks
KaushalYou'll need to use an OARawTextBean. Oracle doesn't support opening links in new windows using OAFormattedTextBean. Just be aware that you'll need to set the CSS class in the HTML as well if you need it formatted a certain way.
-
Jvm unnamed windows events handle leak 1.3.1_08-b03 - 1.4.2-b28
Hello,
I have an server application that leaks windows unnamed event handles on small loads. (200 network connections) I've used the process explorer from www.sysinternals.com to find the type of handles that where leaking. I've run my application through jprobe several times and i'm not leaking any java objects. it doesn't happen on every run. It can run about 5 to 10 times with no leak but as i continue running a request that has 200 network connnections it will leak one handle. Over time they add up memory increases and eventually we get a out of memory error and the server has to be restarted
My application uses the following
java version "1.3.1_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_08-b03)
Java HotSpot(TM) Client VM (build 1.3.1_08-b03, mixed mode)
windows server 2000 service pack 3 (I've tried sp1 and sp2 same issue)
starting and stopping threads
inet jdbc driver una2000
zlib compression libraries
encryption DES
sockets
no jni code
My network code uses input.available() and Socket.setSoTimeout() I don't think the setSoTimeOut time is timing anything out on these small runs.
I've also have run it with
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
I've tried not stopping any threads from my thread pool and it made no change. It still leaks! :-(
Does anyone know what creates the unamed event handles? Are they created by synchronization? Since my applications uses so many different api's it's like looking for a needle in a hay stack.
p.s. I've been working on this problem on and off for about 1 month. I've search the java forums and google.
Thanks
Alexander AnguianoMy message has been here for a while and is off the first page. :-( Oh, well. I thought I would update this just incase anyone was following it. (can I award my self those duke dollars?)
I think i've found the problem of why we are leaking handles. In the first 10 minutes it leaked 3 handles.(they may not have leaked but are resource that our application needed because of all the lazy initialization that we do) I've been runing a 200 task request every 5 minutes for the last 6 hours and have not leak any handles. The problem appears to be with calls to socket.setSoTimeout. I set it to 0. This effectively tells the socket to never time out. This is not an acceptable solution to the problem. I will be working on that next.
Has any one had problems with the socket.setSoTimeout?
If not then it may have to do with our simulated select. We have one thread that handles connection. Once the connection is established it's put on a list that get's polled [input.available()] that is handled by thread 2 if there is data then it gets handled by a worker thread [thread n-12]. Once the worker thread has read up to 4K of data it is put back on thread 2. I'm thinking that it has to do with so many thread doing a little work on it. -
Error in event handler method in window
Hi,
I have created configuration in SEFVISU, to receive the workitem i have created a parameter in event handler method in window
but it is throwing dump The ASSERT condition was violated, if i remove that parameter means application executing properly but i am not able to pass the unique, values please guide me.
Regards,
Srini.Hello Srini,
are you talking about the default event handler method of the window? if so then you need to ensure that the parameter name defined in the event and passed in name are same. And also its better to go for the parameter type as STRING.
other option would be instead of defining the static parameters in the event handler method, you can get the parameters from the WDEVENT itself by accessing WDEVENT->PARAMETERS table.
hope this helps.
BR, Saravanan -
hi to all
i m beginner in java programming and i want to do event handling on mouse click. i have a button and i want if i click that button a new window open
can anyone help meimport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ActionEvents implements ActionListener
JDialog dialog;
public ActionEvents(JFrame f)
dialog = new JDialog(f, "dialog");
dialog.getContentPane().add(new JLabel("hello world", JLabel.CENTER));
dialog.setSize(200,100);
dialog.setLocation(425,200);
public void actionPerformed(ActionEvent e)
if(!dialog.isVisible())
dialog.setVisible(true);
else
dialog.toFront();
private JPanel getPanel()
JButton button = new JButton("open dialog");
button.addActionListener(this);
JPanel panel = new JPanel();
panel.add(button);
return panel;
public static void main(String[] args)
JFrame f = new JFrame();
ActionEvents ae = new ActionEvents(f);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(ae.getPanel(), "North");
f.setSize(200,100);
f.setLocation(200,200);
f.setVisible(true);
} -
Event Handling - Swing Window to Console Switch
I have a serious problem with an app I am writing - I have a swing 'main menu' system built around a standard JFrame which calls a new instance of another class. This other class takes input from the keyboard and is displayed in the standard console window; i.e Using the standard System.out.print() syntax.
My problem is the Swing window will not release the input stream to allow the conole to take input from the keyboard. I have implemented inner-classes within the 'main menu's' class for event handling purposes; in this case the mouse-clicks of the menu's JButton components. The problem only manifests itself when the inner-class' event handling code is called - I wrote some test methods to call the console classes code without using the inner-class' and the console works perfectly. It is my conclusion, therefore, that the calling of the console-based method from within the inner-class of the Swing super-class reserves the input for the Swing components, failing to reactivate the console. I have tried creating new InputStream objects but to no avail.
Does anyone know how to release or terminate the methods within the inner-classes (they are all void / no return type as they implement the ActionListener abstract class)? This, I hope, will return the focus to the console.
Any advice would be most greatfully received.
LEC.If you were to have your connection object declared so that it could be referenced from anywhere in your class then you could use it in you actionPerformed method. For example:
public class Test extends JFrame
   private Connection con = null;
   public void actionPerformed(ActionEvent e)
   {
      MyDetails appmydet = new MyDetails(con, id); //connection, userID
      appmydet.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
   }
   public void setConnection(Connection theCon)
   {
      con = theCon;
   } -
Opening a new window from an event handler in IC WebUI
Hello ,
I want to open a new browser window on the click of a button (through the event handler) .This can be done using javascript ,but I ideally want it to be triggered from the event handler .The URL is dynamically
generated . Please do let me know if there are ways to achieve this .Hi,
In the place where you declare your button write this code.
ls_button-id = xx.
lv_string1 = 'javascript:window.open( "'.
lv_string2 = '" );'.
ls_button-on_client_click = 'javascript:window.open( "lv_url");'
CONCATENATE lv_string1
lv_url
lv_string2
INTO lv_string3.
ls_button-on_client_click = lv_string3.
ls_button-enabled = abap_true.
APPEND ls_button TO gt_editbutton.
pass your dynamic URL here to lv_url. Dont Pass anything to ls_button-on_click.
You can do this coding in DO_PREPARE_OUTPUT or IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS wherever your button is present.
Regards,
Masood Imrani S.
Maybe you are looking for
-
Webservice (oracle erp applications) to SAP PI to SAP R/3 scenario.
Hi All, I have to make webservice (oracle erp applications) to SAP PI to SAP R/3 scenario. 1. If I make Outbound Interface with 2 fields in SAP PI. Publish its Webservice in Service Registry and then send its WSDL URL to oracle erp applications
-
How do I create a group? I would like to a create for my wife's contacts and a group for my contacts so that I can tell iTunes to only synch her contacts to her phone and only my contacts to my phone.
-
When looking my e mails and downloading always get download unsuccessful
Mail
-
Buttons don't work unplugged, work plugged in
I am asking this question because I'm sure there's a way to fix it, but my iPod mini recently got a bit wet, and so I left it a few days and restored it and everything, but now if it is plugged into my computer and I eject it from iTunes, but leave i
-
Time stamps to string with seconds
Good Day Im writing a program for my DAQ system. Its required that my data is saved with hours, mins and secs. The get date/time string VI seems to only output a string with the date and with hours and minutes. How would I include the seconds into t