How to refresh table display using slis and 'reuse_alv_grid_display method.
hello,
how to refresh table display using slis and 'reuse_alv_grid_display method'.
when i'm refreshing table display it performs once again reuse_alv_grid_display.and when i back the previous value appear.how to solve it?
neon
are you chaning any value in the gird if so use this..
Pass the user_command form name to the Import parameter
I_CALL_BACK_USERCOMMAND .
and have the Dynamic form implementation..
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
"The below is important for Editable Grid.
DATA: gd_repid LIKE sy-repid, "Exists
ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data .
ENDIF.
CASE ucomm.
WHEN 'REFRSH'.
ENDCASE.
selfield-refresh = 'X'.
ENDFORM. "user_command
Similar Messages
-
How to restrict values displayed using a select-options
Can someone please tell me how to restrict values displayed using a select-options.
Example- in my table I have 100 entries. However when the user will click on the required field- I want to be display only 25 options based on a given value of another field in the table.
Thanks,
Mahesh.get the screen value for the selectd field using the fm
DYNP_VALUES_READ.
for that value filter the internal table values and pass the table to f4 help of the field.
below code will help u
write the f4 help for the field.
At Selection Screen on value request *
F4 help for Corporate
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CORP.
Get Corporates for selected division
PERFORM GET_CORP.
PERFORM F4HELP_CORP.
*& Form GET_CORP
Get the corporates for the selected division
There are no interface parameters to be passed to this routine
FORM GET_CORP .
Table for conglomerate
DATA:
LT_CONG LIKE STANDARD TABLE OF FS_CORP,
Fields of current screen
LFS_DYNPREAD TYPE DYNPREAD,
Table for current Screen fields
LT_DYNPREAD LIKE STANDARD TABLE OF LFS_DYNPREAD.
LFS_DYNPREAD-FIELDNAME = 'P_DIV'.
APPEND LFS_DYNPREAD TO LT_DYNPREAD.
Get selection screen value for division
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = LT_DYNPREAD
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC EQ 0.
READ TABLE LT_DYNPREAD INTO LFS_DYNPREAD INDEX 1.
IF SY-SUBRC EQ 0.
P_DIV = LFS_DYNPREAD-FIELDVALUE.
ENDIF. " IF SY-SUBRC EQ 0
ENDIF. " IF SY-SUBRC EQ 0
REFRESH T_CORP.
Get the conglomerate for the selected division
SELECT KUNNR " Conglomerate
FROM KNVH
INTO TABLE LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ SPACE.
IF SY-SUBRC EQ 0.
SORT LT_CONG BY KUNNR.
DELETE ADJACENT DUPLICATES FROM LT_CONG
COMPARING KUNNR.
Get the corporates for the selected conglomerates
SELECT KUNNR " Customer Number
FROM KNVH
INTO TABLE T_CORP
FOR ALL ENTRIES IN LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ LT_CONG-KUNNR.
IF SY-SUBRC NE 0.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-005.
STOP.
ENDIF. " IF SY-SUBRC NE 0
ELSE.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-004.
STOP.
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " GET_CORP
*& Form F4HELP_CORP
F4 help for corporate
There are no interface parameters to be passed to this routine
FORM F4HELP_CORP .
F4 help for corporate
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'KUNNR'
DYNPPROG = 'Z_EXCESS_USAGE'
DYNPNR = '1000'
DYNPROFIELD = 'P_CORP'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_CORP
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
Do nothing
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " F4HELP_CORP -
How to connect one page using button and by link in BSP
how to connect one page using button and by link in BSP
hi,
use on 'onclick' functionality.
1. In layout, onclick = 'NEXT_PAGE' of the button
2. Capture the event in onInputprocessing,
DATA: event_id TYPE REF TO cl_htmlb_event.
case event_id.
when 'NEXT_PAGE'.
navigation->goto_page( 'URPAGE URL' ). -
Explain How delivery date is calculated using backward and forward schedul
How can anyone please explain how delivery date is calculated using forward and backward scheduling
I want to have it broken down into the following steps
for eg for delivery date calculation following dates are used
Material Availabilty Date
Material Staging Date
Pick/pack time
Transportation PLanning date
Loading date
Goods issue date
Transit Date
Delivery Date
Can some one please give me an example and explain wht these dates are
for eg customer needs delivery date on 11/20/2008
how would the system cacluate whether it can meet the delivery date using backward scheduling
and if it doesnt meet how does the system do the forward scheduling
also i am not clear with the following dates
material avaialibilty date
material staging date
transportation date
can some one please explain me all this in detail
ThanksHi,
Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the following link.
If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
Please go through the link in SPRO
LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
In customisation following data is maintained
Material Availabilty Date
Material Staging Date
Pick/pack time
Transportation PLanning date
Loading date
Goods issue date
Transit Date
Delivery Date
Hope you got the idea of CRSD calculation
Regards,
Prashant. -
Need java code to perform refresh button action using swings and awt
i need java code to perform refresh button action using swings and awt.please help me
Wait ! Noboby ? OK, I'll do it
public void onBtnAction ()
if (!fresh)
refresh ();
}Seriously, did you expect anyone to answer such a cryptic question ? -
Using mutator and accessor methods in main.
Would somebody explain to me exactly how mutator and accessor methods make a class and it's driver program work together. I understand the principle of encapsulation, but I'm obviously missing something. I get the syntax, but what actually happens? I'm hoping a fresh perspective on it will help me understand better.
I guess another way to ask the question could be: how do you use accessor and mutator methods in the main program that calls them?>
the assignment says to have a
"reasonable set of accessor and mutator methods
whether or not you use them". So in my case I have
them written in the class but do not call them inthe
driver program. And like I said, the program does
what it's supposed to do.This class you're in worries me. I'm sure what
polytropos said is true: they're trying to make you
think about reuse. But adding to an API without cause
is widely considered to be a mistake, and there are
those who are strongly opposed to accessors/mutators
(or worse, direct field access) on OOP design grounds.The class is based on the book Java: Introduction to Computer Science and Progamming, by Walter Savitch. Until now I've been pretty happy with it. Another problem, to me anyway, is that so far we've done a few, cumulative programming projects per chapter. This time, there was one assignment for the whole chapter that is suppsoed to incorporate everything. But that's just me complaining.
Here is the code I have and that it looks like I'll be turning in... criticisms welcome.
Here is the class:
public class GradeProgram//open class
private double quiz1;
private double quiz2;
private double mid;
private double fin;
private double finalGrade;
private char letterGrade;
public void readInput()//open readInput object
do
System.out.println("Enter the total points for quiz one.");
quiz1 = SavitchIn.readLineInt();
System.out.println("Enter the total points for quiz two.");
quiz2 = SavitchIn.readLineInt();
System.out.println("Enter the mid term score.");
mid = SavitchIn.readLineInt();
System.out.println("Enter final exam score.");
fin = SavitchIn.readLineInt();
if ((quiz1>10)||(quiz2>10)||(quiz1<0)||(quiz2<0))
System.out.println("Quiz scores are between one and ten. Re-enter scores");
if ((mid>100)||(fin>100)||(mid<0)||(fin<0))
System.out.println("Exam scores are between zero and one hundred. Re-enter scores.");
while ((quiz1>10)||(quiz2>10)||(quiz1<0)||(quiz2<0)||(mid>100)||(fin>100)||(mid<0)||(fin<0));
}//end readInput object
public void output()//open output object
System.out.println();
System.out.println("You entered:");
System.out.println("Quiz 1: " + (int)quiz1);
System.out.println("Quiz 2: " + (int)quiz2);
System.out.println("Mid term: " + (int)mid);
System.out.println("Final exam: " + (int)fin);
System.out.println();
System.out.println("Final grade: " + (int)percent() + "%");
System.out.println("Letter grade: " + letterGrade());
}//end output object
public void set(double newQuiz1, double newQuiz2, double newMid, double newFin, double newFinalGrade, char newLetterGrade)
if ((newQuiz1 >= 0)&&(newQuiz1 <= 10))
quiz1 = newQuiz1;
else
System.out.println("Error: quiz scores are between zero and ten.");
System.exit(0);
if ((newQuiz2 >= 0)&&(newQuiz2 <= 10))
quiz2 = newQuiz2;
else
System.out.println("Error: quiz scores are between zero and ten.");
System.exit(0);
if ((newMid >= 0)&&(newMid <= 100))
mid = newMid;
else
System.out.println("Error: exam scores are between zero and one hundred.");
System.exit(0);
if ((newFin >= 0)&&(newFin <= 100))
fin = newFin;
else
System.out.println("Error: exam scores are between zero and one hundred.");
System.exit(0);
letterGrade = newLetterGrade;
public double getQuiz1()
return quiz1;
public double getQuiz2()
return quiz2;
public double getMid()
return mid;
public double getFin()
return fin;
public char getLetterGrade()
return letterGrade;
private double finalPercent()//open finalPercent object
double quizPercent = (((quiz1 + quiz2) /2) * 10) / 4;
if (((((quiz1 + quiz2) /2) * 10) % 4) >= 5)
quizPercent++;
double midPercent = mid / 4;
if ((mid % 4) >= 5)
midPercent++;
double finPercent = fin / 2;
if ((fin % 2) >= 5)
finPercent++;
finalGrade = (quizPercent + midPercent + finPercent);
return (finalGrade);
}//end final percent object
private double percent()//open percent object - helping object
double percentGrade = finalPercent();
return (percentGrade);
}//end percent object
private char letterGrade()//open letterGrade object
double letter = percent();
if (letter >= 90)
return ('A');
else if (letter >= 80)
return ('B');
else if (letter >= 70)
return ('C');
else if (letter >= 60)
return ('D');
else
return ('F');
}//end letterGrade object
private double quizScore()//open quizScore object
double quizes = ((quiz1 + quiz2) /2) * 10;
return (quizes);
}// close quizScore object
}//end classAnd here is the driver program:
public class GradeProgramDemo
public static void main(String[] args)
String cont;
do
GradeProgram firstStudent = new GradeProgram();
firstStudent.readInput();
firstStudent.output();
System.out.println();
System.out.println("Enter more student grades? Enter Y to continue");
System.out.println("or press enter to quit.");
cont = SavitchIn.readLine();
System.out.println();
while (cont.equalsIgnoreCase("y")); -
How to refresh a region using Active Data Service
Hi,
I need to refresh the region using ADS.
I am creating jsff which contains dynamic tables rendering. This jsff is bound to a task flow (having input parameter and refresh property set to "ifNeeded). The bounded task flow is dropped on a jspx as a region.
Now in order to refresh the region, I need to pass the updated param value, which would cause the region refresh.
I am able to do so on a button click from jspx page. But I have to make it auto refresh using ADS as per app requirement.
The issue is "AdfFacesContext.getCurrentInstance return null..if I am using it in startActive Data or changeData Update (where I am using ActiveDataUpdateEvent)".
Please guide me how can I achieve this.
I am using Jdev 11.1.1.4.
Thanks.
Edited by: 977455 on Jan 3, 2013 7:35 PMHi,
try a variation of this blog entry: http://matthiaswessendorf.wordpress.com/2010/01/22/flexible-active-data-service/
Instead of showing a popup, you do the following
1. set clientComponent=true for the hidden field
2. configured the PartialTrigger property of the region to point to the hidden component
If this doesn't work then try this
1. use <af:clientListener type="propertyChange" method="activeDataCallback" /> as used in the sample
2. define an af:serverListener that points to a managed bean that has access to the region (RichRegion) instance
3. The af:serverListener needs to be defined as a child of the outputText
4. change "activeDataCallback" to queue the server listener event (CustomEvent)
5. Use the managed bean to refresh the region
Frank -
How to specify table name using xdoclet
Hi
I'm trying to specify a table name using xdoclet 1.2.
I've tried the @sql.table, but that ain't working (no table mapping name is
writen to the *.jdo)
I've tried using the @jdo.class-vendor-extension with key=table and
value=tablename, but that ain't working either.
I guess number two approach ain't working because kodo want table name
extension inside another extension like this:
<extension vendor-name="kodo" key="jdbc-class-map" value="base">
<extension vendor-name="kodo" key="table" value="tablename"/>
</extension>
But, how do I specify the above using xdoclet?
Regards
JesperOk.
Is it possible somehow to just tell kodo to use another table name without
having to create mapping extensions for collections and stuff. Even better
if one could specify a table name prefix to be used on all tables.
My problem is that I need use kodo on an existing database having tables
names that conflict with kodo's auto-generated tables names. The schematool
will then try alter these tables :-(
Regards
Jesper
"Stephen Kim" <[email protected]> wrote in message
news:[email protected]...
When you use metadata mapping extensions, you should not generate
.mapping files as all that info is stored in the .jdo file. You should
instead set kodo.jdbc.MappingFactory to metadata.
Jesper Ladegaard wrote:
Thanks.
However, I still can't get it to work.
I've created a java class named Role with xdoclet like this:
* @jdo.persistence-capable
* @jdo.class-vendor-extension
* vendor-name="kodo" key="jdbc-class-map" value="base"
* @jdo.class-vendor-extension
* vendor-name="kodo" key="jdbc-class-map/table" value="BW_ROLE"
* @jdo.class-vendor-extension
* vendor-name="kodo" key="jdbc-class-map/pk-column" value="JDOID"
Xdoclet generates a jdo file like this:
<jdo>
<package name="dk.pine.users.services.model">
<class name="Role"
identity-type="datastore"
<!-- end class tag --><extension vendor-name="kodo"
key="jdbc-class-map"
value="base">
</extension>
<extension vendor-name="kodo"
key="jdbc-class-map/table"
value="BW_ROLE">
</extension>
<extension vendor-name="kodo"
key="jdbc-class-map/pk-column"
value="JDOID">
</extension>
<field name="users"
default-fetch-group="true"
<!-- end field tag --><collection
element-type="dk.pine.users.services.model.User"
embedded-element="false"
<!-- end collection tag --></collection>
<extension vendor-name="kodo"
key="inverse-owner"
value="roles">
</extension>
</field>
</class>
</package>
</jdo>
Now I run the mappingtool (with option refresh) and it generates a
mapping
file like this:
<mapping>
<package name="dk.pine.users.services.model">
<class name="Role">
<jdbc-class-map type="base" pk-column="JDOID"
table="dbo.ROLE0"/>
<jdbc-version-ind type="version-number"column="JDOVERSION"/>
<jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
<field name="description">
<jdbc-field-map type="value" column="DESCRIPTION"/>
</field>
<field name="name">
<jdbc-field-map type="value" column="NAME0"/>
</field>
<field name="systemRole">
<jdbc-field-map type="value" column="SYSTEMROLE"/>
</field>
<field name="users">
<jdbc-field-map type="many-many"
element-column.JDOID="JDOID" ref-column.JDOID="ROLES_JDOID"
table="dbo.USER0_ROLES"/>
</field>
</class>
</package>
</mapping>
I expected it to create a BW_ROLE, but it create a ROLE0 table????
"Stephen Kim" <[email protected]> wrote in message
news:[email protected]...
You can use slashes to denote sub extensions.
See the example near the bottom of this link:
http://solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_integrati
on_xdoclet.html
Jesper Ladegaard wrote:
Hi
I'm trying to specify a table name using xdoclet 1.2.
I've tried the @sql.table, but that ain't working (no table mapping
name
>>
is
writen to the *.jdo)
I've tried using the @jdo.class-vendor-extension with key=table and
value=tablename, but that ain't working either.
I guess number two approach ain't working because kodo want table name
extension inside another extension like this:
<extension vendor-name="kodo" key="jdbc-class-map" value="base">
<extension vendor-name="kodo" key="table" value="tablename"/>
</extension>
But, how do I specify the above using xdoclet?
Regards
Jesper
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com -
How to Split the string using Substr and instr using loop condition
Hi every body,
I have below requirement.
I need to split the string and append with single quotes('') followed by , (comma) and reassign entire values into another variable. so that i can use it where clause of update statement
for example I am reciveing value as follows
ALN varchar2(2000):=(12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434);
Note: In the above variable i see 8 transactions, where as in real scenario i donot how many transaction i may recive.
after modification i need above transactions should in below format
ALTR Varchar2(2000):=('12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434');
kindly help how to use substr and instr in normal loop or for loop or while loop while modifying the above transactions.
Please help me to sort out this issue.
Many Thanks.
Edited by: user627525 on Dec 15, 2011 11:49 AMTry this - may not be the best way but...:
create or replace type myTableType as table of varchar2(255)
declare
v_array mytabletype;
v_new_str varchar2(4000);
function str2tbl
(p_str in varchar2,
p_delim in varchar2 default '.')
return myTableType
as
l_str long default p_str || p_delim;
l_n number;
l_data myTableType := myTabletype();
begin
loop
l_n := instr( l_str, p_delim );
exit when (nvl(l_n,0) = 0);
l_data.extend;
l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
l_str := substr( l_str, l_n+length(p_delim) );
end loop;
return l_data;
end;
begin
v_array := str2tbl ('12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434', ',');
FOR i IN 1 .. v_array.COUNT LOOP
v_new_str := v_new_str || ''''||v_array(i)||'''' || ',';
END LOOP;
dbms_output.put_line(RTRIM(v_new_str, ','));
end;
OUTPUT:
=======
'12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434'HTH
Edited by: user130038 on Dec 15, 2011 12:11 PM -
How to transfer tabl content using ALE
Hi All
I need to to transfer the content of a HR table (T526) using an ALE scenario. However I have not found a way to do this. I stumpled over CONDA2 but not quite sure if this suits the bill. Anybody out there who can help.
I am not an HR wiz so bear with me if this is dead obvious.
Hope somebody can help
CheersHello Bowie,
Could you please help in how to use CONDA2 message type in ditributing HR Configuration data like data from following tables..
T001P Personnel Area/Subarea
T500P Personnel Areas
T503 Employee Group/Subgroup
T511 Wage Types
T512T Wage Type Texts
T512Z Permissibility of Wage Types per Infotype
T528B Positions
T554S Attendance and Absence Types
T554T Attendance and Absence Texts
Thaks,
Venkat -
How to create store procedure using cursor, and looping condition with exce
Hi,
I am new in pl/sql development , please help me for follwoing
1. I have select query by joining few tables which returns lets say 100 records.
2. I want to insert records into another table(lets say table name is tbl_sale).
3. If first record is inserted into tbl_sale,and for next record if value is same as first then update into tbl_sale else
insert new row
4. I want to achieve this using store procedure.
Please help me how to do looping,how to use cursor and all other necessary thing to achieve this.DECLARE
b NUMBER;
BEGIN
UPDATE tbl_sale
SET a = b
WHERE a = 1;
IF SQL%ROWCOUNT = 0
THEN
INSERT INTO tbl_sale
(a
VALUES (b
END IF;
END;note : handle exceptions where ever needed
Regards,
friend
Edited by: most wanted!!!! on Mar 18, 2013 12:06 AM -
How to handle table controls using LSMW
Hi All,
how to use LSMW to handle table control like header and item details eg. VA01 , ME21 etc. To handle these kind of trnasactions can we use LSMW instead BDC to upload data. Please let me know.
Thanks in advance.
Regards,
KalpanaHi Kalpana,
You can have your own custom programs for LSMW if the standard DI/BI IDOC , BAPI dont meet your requirements.
Its little bit complex. You need to register you custom program in table through SM30.
SDX0 - Program Definition ( BI or DI )
SDX1 - Program Assignment
SDX2 - Declaring Structures
SDX3 - Declaring field identifiers for structures
You can goto SM30 and can view the standard BI/DI programs definition by using the four digit Obejct Number...
<b>AS</b> -
Doh, I thought I had to cram the question into those few words - didn't realise it wa sa title! Our iCal has just recently refused to automatically refresh - if you delete it and subscribe again it won't let you. All machines affected. We use MobileMe and I've been on the account and all looks good. Is there someone we can phone to talk this through? We're a mag so we really need to all work on the same schedule and know who is off etc? Any clues?
Cheers
BeverleyHave you got a firewall? - these can sometimes cause problems.
If you are in a business environment and all on the same LAN, you might like to consider abandoning MobileMe and buying BusyCal. It's like iCal Pro in effect, with more facilities, including the ability to display ToDos in the day area: it uses the same database as iCal.
You would revert to local calendars, and BusyCal can sync them instantly between computers on the same network, with read/write access if required. (Syncing can only take place when Macs are on).
It's available in the Mac App Store and their site has a free trial period (it's more expensive on the site so you would want to delete the trial and buy from the App Store).
http://www.busymac.com
Instructions on syncing over a LAN - http://www.busymac.com/help/sync/busycal-lan.html
Instructions on publishing on a server - http://www.busymac.com/help/sync/busycal-lan-host.html
It's possible to do all this over the internet, though it's more complicated - http://www.busymac.com/help/sync/busycal-wan.html
I have no connection with this firm. -
How to search for files using wildcards * and ?.
Hi All,
I've been searching the forum for a couple of hours now and have been unable to find a good example of how to search a directory (Windows OS) for a file using wildcards * and/or ?. Does anyone out there have a good example that they can share with me?
ThanksHi All,
First of all I want to thank everyone for taking the time to respond to my question. All of your responses where greatly appreciated.
I took the example code that was posted by rkconner, thanks rkconner, and modified it to allow me to search for files in a directory that contain * and/or ?. Yes, I said and/or! Meaning that you can use them both in the same file name, example: r??d*.t* would find readme.txt.
I've posed my complete and thoroughly document code below. I hope it is very helpful to other as I have searched many forums and spent many hours today trying to resolve this problem.
Enjoy
* File Name: WildcardSearch.java
* Date: Jan 9, 2004
* This class will search all files in a directory using the
* asterisk (*) and/or question mark (?) as wildcards which may be
* used together in the same file name. A File [] is returned containing
* an array of all files found that match the wildcard specifications.
* Command line example:
* c:\>java WildcardSearch c:\windows s??t*.ini
* New sWild: s.{1}.{1}t.*.ini
* system.ini
* Command line break down: Java Program = java WildcardSearch
* Search Directory (arg[0]) = C:\Windows
* Files To Search (arg[1]) = s??t*.ini
* Note: Some commands will not work from the command line for arg[1]
* such as *.*, however, this will work if you if it is passed
* within Java (hard coded)
* @author kmportner
import java.io.File;
import java.io.FilenameFilter;
public class WildcardSearch
private static String sWild = "";
* @param args - arg[0] = directory to search, arg[1] = wildcard name
public static void main(String[] args)
String sExtDir = args[0]; // directory to search
sWild = args[1]; // wild card to use - example: s??t*.ini
sWild = replaceWildcards(sWild);
System.out.println("New sWild: " + sWild);
File fileDir = new File(sExtDir);
File[] arrFile = fileDir.listFiles(new FilenameFilter()
public boolean accept(File dir, String name)
return (name.toLowerCase().matches(sWild));
for (int i = 0; i < arrFile.length; ++i)
System.out.println(arrFile.getName());
} // end main
* Checks for * and ? in the wildcard variable and replaces them correct
* pattern characters.
* @param wild - Wildcard name containing * and ?
* @return - String containing modified wildcard name
private static String replaceWildcards(String wild)
StringBuffer buffer = new StringBuffer();
char [] chars = wild.toCharArray();
for (int i = 0; i < chars.length; ++i)
if (chars[i] == '*')
buffer.append(".*");
else if (chars[i] == '?')
buffer.append(".{1}");
else
buffer.append(chars[i]);
return buffer.toString();
} // end replaceWildcards method
} // end class -
How to automlog into webside using username and password using java program
I am trying to log in to a website using password and username. What libraries i can use. I searched online and came to know that i can use Apache's commons HttpClient library to do that. I am new to this please let me know what can i use.
For starting purpose i wrote this code:
public static void main(String[] args) throws URIException {
try {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod("http://www.google.com");
int returnCode = client.executeMethod(method);
System.err.println(method.getResponseBodyAsString());
method.releaseConnection();
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
but this is giving me an error. please see below,
java.net.UnknownHostException: www.google.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at com.verizon.zoeott.ingest.PropertyFileReader.main(PropertyFileReader.java:48)
Another thing is that we use proxy to get internet connection. In internet explorer-->internet options-->LAN Settings-->using automatic configuration script to connect to the internet.
I don't know how to configure this into java program. please help.
Thanks,
amol
Edited by: 877846 on Jan 20, 2012 9:16 AM
Edited by: 877846 on Jan 20, 2012 9:21 AMAlso please let me know about how to connect internet through proxy server.As I said above, if you are using the Apache HTTP client, no we can't, as this is not an Apache forum. I also told you where to find that answer.
If on the other hand you don't want to use that client any more, setting the system properties http.proxyHost and http.proxyPort will do it for java.net.HttpURLConnection. See the Java Custom Networking tutorial for examples.
Maybe you are looking for
-
Why can't I hear music from my iPod Touch in the car using the auxilliary jack?.
When I am in my car I am not able to hear much of my music from my iPod touch. I use an auxilliary jack. Is there some setting or adjustment that can be made?
-
Need to change the date format in Bex
HI All In SAP BI I have created a BEx Query. We can see BEx reports in MS Excel. Date format in the report is DD/MM/YYYY and i want it to be displayed like YYYYMMDD. but only for one date column in the report the rest stay the same. Please help.
-
Solaris 10 11/06 installation problem?
hi, i am new to solaris and just started to install the solaris 10 11/06, the partition for solaris installation is the first primary partition, auto slices was 4,4 GB for /, 1,4 GB for ovarlape,10 GB for /export/home and 500 MB for swap but i custom
-
I have a question about using Spotlight. I lost a document. It was misfiled, that is, I put it somewhere that seemed logical at the time but it turned out to be the wrong place. By enormouse luck, I found it again using Sopotlight, but I still don't
-
ML: Screen stays black when moving mouse and screen protector kicks in
This is the second time that this happens to me. Setup: MBP 5.4 2 monitors (extended) ML 10.8.2 updated to date Screen saver kicks in after X minutes Require password after Y seconds after sleep / screen saver I have set my protector screen to kick i