Use proxy to send TXT file (FTP)
Hi experts!
I know it's possible to send a xml message by FTP using a proxy (called in an ABAP program). This is very easy.
I also know that it's possible to send TXT files cyclicly (every hour, for example) for FTP, using XI (or PI) as a FTP server.
What i don't know is that if it's possible to use a proxy, in an ABAP program, to send non xml files by FTP.
Is it? How can i do it?
Thanks in advance.
Best regards.
Valter Oliveira.
Hi again,
No, the idea is to use XI to send the csv file as an assyn message but i think this is not possible. Proxies always uses xml parser right?
If I can't do this, I can always schedulle a FTP sender channel to go to the directory and send it, but the idea was to use a proxy to do ti.
You mentioned "if you will be using XI, then you can not escape from converting it into XML and then FCC to convert it into csv."
How can i do this? Can i create a xml structure in the sender channel and convert it to csv in the receiver?
Best regards.
Valter Oliveira.
Similar Messages
-
How to send txt file as attachement in email
Hi Experts ,
How to sendĀ txt fileĀ as attachement in email .
which function module i useHi,
Try to use this one
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
Hope it can solve your problem!
Good luck!
Tao -
To send TXT file as an attachment through Email
Hi Experts,
I am working on requirement where i have to send a txt file as an attachment.
Could any one suggest me a solution.
Thanks and Regards,
Jeswanth KadaliHi,
Use the function module SO_NEW_DOCUMENT_ATT_SEND_API1.
We find it convenient to use a custom function module as a wrapper for that.
Here's the code.
FUNCTION Z_EMAILS_ATTACH.
""Local interface:
*" IMPORTING
*" VALUE(EMAIL_SUBJECT) LIKE SODOCCHGI1-OBJ_DESCR
*" VALUE(ATTACHMENT_SUBJECT) LIKE SOPCKLSTI1-OBJ_DESCR OPTIONAL
*" VALUE(ATTACHMENT_DOC_TYPE) TYPE SO_OBJ_TP OPTIONAL
*" REFERENCE(ATTACHMENT_HEADER) LIKE SOLISTI1 STRUCTURE SOLISTI1
*" TABLES
*" EMAIL_BODY STRUCTURE SOLISTI1
*" EMAIL_ATTACHMENT STRUCTURE SOLISTI1 OPTIONAL
*" RECEIVERS STRUCTURE SOMLRECI1
*" EXCEPTIONS
*" UNKNOWN_COMMUNICATION_TYPE
*" ERROR_SENDING_MAIL
*" EMPTY_ATTACHMENT
*" NO_ATTACHMENT_SUBJECT
*" USER_HAS_NO_EMAIL_ADDRESS
*" NO_RECEIVERS
NOTE
Single-testing when the tables passed to the function have reference
structure SOLISTI1 meets with a problem.
Entering non-blank rows into these tables is impossible, it seems.
This is believed to be because the single testing fails to cope with
the width of SOLISTI1-LINE [255 char].
For single testing, use CVDTLINE as the reference structure - it's
only 132 char. Then remember to change it back to SOLISTI1...
Based on Z_EMAIL_ATTACH which sends just one mail.
08.06.2007 JNM
DATA: document LIKE sodocchgi1.
DATA: packlist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: contents LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: header LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: RECVLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: NEXT_ROW LIKE SY-TABIX.
DATA: lines LIKE sy-tabix.
DATA: LAST_LINE_LENGTH TYPE I.
DATA: d_doc_size LIKE packlist-doc_size.
data: email_address type ad_smtpadr.
A user without an email address cannot email.
CALL FUNCTION 'Z_USER_EMAIL_ADDRESS'
EXPORTING
USER_NAME = SY-UNAME
IMPORTING
EMAIL_ADDRESS = email_address
EXCEPTIONS
UNKNOWN_USER = 1
NO_ADDRESS_KEY = 2
NO_ADDRESS_DATA = 3
NO_EMAIL_ADDRESS = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
raising USER_HAS_NO_EMAIL_ADDRESS.
ENDIF.
Receivers?
describe table receivers lines lines.
if lines eq 0.
raise no_receivers.
endif.
initialization
CLEAR: CONTENTS, DOCUMENT, HEADER, PACKLIST, RECVLIST.
REFRESH: CONTENTS, HEADER, PACKLIST, RECVLIST.
attachment?
DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
IF LINES EQ 0 AND ATTACHMENT_SUBJECT CN SPACE.
RAISE EMPTY_ATTACHMENT.
ENDIF.
IF LINES NE 0 AND ATTACHMENT_SUBJECT CO SPACE.
RAISE NO_ATTACHMENT_SUBJECT.
ENDIF.
email body
concatenate 'SAP client:'
sy-host sy-sysid sy-mandt
into contents separated by space.
append contents.
clear contents.
append contents.
APPEND LINES OF EMAIL_BODY TO CONTENTS.
header - row for body
HEADER = 'BODY HEADER'.
APPEND HEADER.
packing list - row for body
PACKLIST-TRANSF_BIN = SPACE.
PACKLIST-HEAD_START = 1.
PACKLIST-HEAD_NUM = 1.
PACKLIST-BODY_START = 1.
DESCRIBE TABLE CONTENTS LINES PACKLIST-BODY_NUM.
NEXT_ROW = 1 + PACKLIST-BODY_NUM.
*packlist-doc_type = 'EXT'.
PACKLIST-DOC_TYPE = 'RAW'.
APPEND PACKLIST.
IF ATTACHMENT_SUBJECT CN SPACE. " if there's an attachment
attachment into contents
APPEND LINES OF EMAIL_ATTACHMENT TO CONTENTS.
DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
READ TABLE EMAIL_ATTACHMENT INDEX LINES.
LAST_LINE_LENGTH = STRLEN( EMAIL_ATTACHMENT ).
header - attachment
if attachment_header is initial.
HEADER = 'ATTACH'.
else.
header = attachment_header.
endif.
APPEND HEADER.
packing list - row for attachment
CLEAR PACKLIST.
case attachment_doc_type.
when 'XLS'.
PACKLIST-TRANSF_BIN = 'X'.
when others.
PACKLIST-TRANSF_BIN = SPACE.
endcase.
PACKLIST-HEAD_START = 2.
PACKLIST-HEAD_NUM = 1.
PACKLIST-BODY_START = NEXT_ROW.
if not attachment_doc_type is initial.
packlist-doc_type = attachment_doc_type.
else.
PACKLIST-DOC_TYPE = 'RAW'.
endif.
packlist-doc_type = 'EXT'.
PACKLIST-OBJ_DESCR = ATTACHMENT_SUBJECT.
PACKLIST-OBJ_NAME = 'ATTACHMENT'.
PACKLIST-BODY_NUM = LINES.
D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
PACKLIST-DOC_SIZE = D_DOC_SIZE.
APPEND PACKLIST.
ENDIF. "attachment
document
document-obj_name = 'EMAIL'.
DOCUMENT-OBJ_DESCR = EMAIL_SUBJECT.
document-obj_langu = sy-langu.
document-obj_expdat = sy-datum.
document-sensitivty = 'F'.
document-obj_prio = 9.
document-no_change = 'X'.
document-priority = 9.
document-expiry_dat = sy-datum.
ADD 1 TO: DOCUMENT-OBJ_EXPDAT, DOCUMENT-EXPIRY_DAT.
DESCRIBE TABLE contents LINES lines.
D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
document-doc_size = d_doc_size.
call the mail function
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = document
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = header
packing_list = packlist
contents_txt = contents
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF SY-SUBRC > 0.
RAISE ERROR_SENDING_MAIL.
ENDIF.
ENDFUNCTION.
Also remember that the SAP user sending the email must have an email address in the user details, so that SAP has something to put in the "From" field when creating the email.
That's why we use this:
FUNCTION Z_USER_EMAIL_ADDRESS.
""Local interface:
*" IMPORTING
*" REFERENCE(USER_NAME) TYPE SYUNAME DEFAULT SY-UNAME
*" EXPORTING
*" REFERENCE(EMAIL_ADDRESS) TYPE AD_SMTPADR
*" EXCEPTIONS
*" UNKNOWN_USER
*" NO_ADDRESS_KEY
*" NO_ADDRESS_DATA
*" NO_EMAIL_ADDRESS
tables:
adr6,
usr21,
usr02.
SAP logon data
select single *
from usr02
where bname = user_name.
if sy-subrc ne 0.
message i017(ZREP) with
'SAP user' user_name 'is unknown'
raising unknown_user.
endif.
SAP user address key
select single *
from usr21
where bname = user_name.
if sy-subrc ne 0.
message i017(ZREP) with
'No address data assigned to SAP user' user_name
raising no_address_key.
endif.
SAP user address
select single *
from adr6
where addrnumber = usr21-addrnumber and
persnumber = usr21-persnumber.
if sy-subrc ne 0.
message i017(ZREP) with
'No address data found for SAP user' user_name
raising no_address_data.
endif.
email_address = adr6-smtp_addr.
if email_address is initial.
message i017(ZREP) with
'No address data found for SAP user' user_name
raising no_email_address.
endif.
ENDFUNCTION.
John -
Sending TXT files via FM SO_NEW_DOCUMENT_ATT_SEND_API1
Hi developers, I have the following question...
What should I do to attach a text file to an e-mail I send using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1"?
I succed at sending out the mail editing its body and its object, but I still can't attach a TXT file from my 'C:\' directory.
Coul you help me please?
Thanx to everybody.*& Report Z_TEST_MAIL *
REPORT Z_TEST_MAIL .
DATA: P_APP_ID(3) VALUE 'SPY',
P_AP_NUM(2) TYPE N VALUE '03',
P_TITLE(50),
EM_BODY LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF EM_ATTACH OCCURS 10,
ZZIPFROM(10),
ZZIPTO(5),
GAPFROM(12),
GAPTO(12),
END OF EM_ATTACH.
*_ Start of E-mail content.
EM_BODY = 'Dear User,'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'Please find in the attachment the Zip code Ranges that'.
CONCATENATE EM_BODY ' are missing' INTO EM_BODY.
APPEND EM_BODY.
EM_BODY = 'Please correct the same to ensure that all the Zip codes'.
CONCATENATE EM_BODY ' are maintained' INTO EM_BODY.
APPEND EM_BODY.
EM_BODY = 'In case of any clarifications please contact IT support.'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'Thanks,'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'IT Support.'.
APPEND EM_BODY.
P_TITLE = 'Missing Zip Code ranges'.
EM_ATTACH-ZZIPFROM = 'chandra'.
EM_ATTACH-ZZIPTO = 'Test1'.
EM_ATTACH-GAPFROM = 'Test2'.
EM_ATTACH-GAPTO = 'Test3'.
APPEND EM_ATTACH.
dATA : VAR1(80).
DATA : ATTACH_REC TYPE I.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE,
OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE,
OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE,
DOC_CHNG LIKE SODOCCHGI1,
TAB_LINES LIKE SY-TABIX.
Creation of the document to be sent
DOC_CHNG-OBJ_NAME = 'Mat Attach'.
*DOC_CHNG-OBJ_DESCR = 'Please check the error message'(002).
DOC_CHNG-OBJ_DESCR = P_TITLE.
APPEND LINES OF EM_BODY TO OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
*Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
DESCRIBE TABLE EM_ATTACH LINES ATTACH_REC.
IF ATTACH_REC GE '1'.
*Start of email attachement of internal table conversition
*objbin = 'From Code To Code Gap from Gap to'.
*append objbin.
APPEND LINES OF EM_ATTACH TO OBJBIN.
*end of email attachement of internal table conversition
DESCRIBE TABLE OBJBIN LINES OBJPACK-BODY_NUM.
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-DOC_SIZE = OBJPACK-BODY_NUM * 255.
OBJPACK-DOC_TYPE = 'TXT'.
OBJPACK-OBJ_DESCR = 'Missing Zip code ranges'. " Description
APPEND OBJPACK. CLEAR OBJPACK.
ENDIF.
*Completing the recipient list
RECLIST-RECEIVER = '[email protected]'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CLEAR RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
IF SY-SUBRC = 0.
WRITE:/ 'MAIL Sent'.
ENDIF.
hERE IS THE sample code of txt attachments. -
Using relative path for in file/ftp adapter
Hi All,
How to have a relative path for file/ ftp adapter's inbound/outbound operation?
Example: Consider $ORA_HOME = /home/oracle --> This environment variable can be different on different machines
i want to drop a file in to $ORA_HOME/folder1/folder2 (Or poll for a file).
<partnerLinkBinding name="FTP">
<property name="wsdlLocation">FTP.wsdl</property>
<property name="out_dir" type="LogicalDirectory">What do i write here???</property>
<property name="retryInterval">60</property>
</partnerLinkBinding>
if i cant configure this in partner link section or in activation agent sction, how else do i achieve this?
i am using 10.1.3.* version.
Thanks in advance.
Roshan.You can achive it using the deployment scripts if the directory is changing on the basis of the environment
If you want to change at run time than you can use the jca properties to set using the variables at runtime.
Regards,
Ajay -
Unzip file using operating system command in file/ftp receiver adapter
Hi,
I'm wonderdering how to unzip a zip-file in the receiver file/ftp adapter. I know it is possible to do it using the 'Operating system command' feature, but somehow the command I use seems to be ignored! (I'm using SP14, unix).
The command I entered is quite simple: unzip %F (also tried the %f, but i guess it doesn't really matter wich on I use).
Is it possible that I'm unzipping to another directory than the one i expect? the unzip should be performed to/in the current directory, and assumingly current directory is the one stated in the 'Target Directory', right?
Hope someone can clearify this issue for me.
Best regards,
DanielHi Daniel,
It seems to me also, that the files are being unzipped to a different location than what you are expecting. The OS command might getting executed in some default location(i am trying to fnd that out)on the server and not in the target directory of the channel(It seems logical to me)....
If you have time...pls try this out & see whether this would help...
Have a shell script written with the following commands in them
cd <path to target directory>
unzip $1(filename from the channel)
and in the OS command in the Channel give....
<absolute path to the .sh file> %F
Thanks,
Renjith. -
With webutil-client_host, send txt file to client printer
hi,
I wanna to learn how to send a txt file to client default printer(local or network),
I created txt file at client disk, and try to send printer directly,
just try some statement looks like below;
a.client_host('cmd /c start print C:\TEMP399899.txt /d:lpt1');
b.client_host('cmd /c start copy C:\TEMP399899.txt lpt1');
I do not know the command prompt syntax, please help me, reference me,
thanksHi,
on a command line type
print /?
for the help of how to print documents. On XP this help is
PRINT [D:device] [[drive:][path]filename[...]]
/D:device Specifies a print device.
Frank -
Can I use DME to generate .TXT file?
My client wants the withholding tax program to generate a .TXT file to meet his legal requirements. How is this done?Maybe can i generate a .DME file and then convert to .TXT file? Can .DME be converted to .TXT?
Hi,
How you are going to get data of the withholding tax? If it is through an custom ABAP program, you can write taxt file directly and no need to write DME file.
Thanks
Murali. -
I'm looking for the best method to send a Text file to a Mainframe box using sockets, I know that I can do this whit FTP, but I'm trying to get the best way to do it, if anybody can give me an idea I'll appreciate that,
Thank & RegardsYou'll need to elaborate on your requirements to get the best solution... Otherwise, you'll be hard pressed to find something better than FTP. It's a standardised protocol for file transfer. What more could you want?
-
Using B2B for sending PAYMUL files in EDIFACT format
Hi B2B Gurus,
One of our client has the following requirement.
1) Create Payment batches in Oracle AP and Format the payments using an EDI format program.
2) Translate the EDI format file into PAYMUL EDIFACT format.
3) Send the PAYMUL file across to the bank and receive the acknowledgments.
At the moment our client uses the services of a third party vendor to take care of the EDI translation, document management and transportation
features.
Would it be possible to achieve the above requirement using Oracle B2B Integration + Adapters?
If yes, would request you to provide me with the Adapters we need to buy (license required) and also the components that would be required to achieve the above functionality.
Thanks and Regards,
B2B Naive
Edited by: user5546779 on Feb 9, 2010 11:05 PMHi,
Oracle B2B can translate the EDI XML to native EDI format and vice-versa. It has support for both the flavours of EDI - EDIFACT and X12. It has the support for almost all the transport protocols as well. Moreover, for any customization, there is facility of java callouts as well.
Would it be possible to achieve the above requirement using Oracle B2B Integration + Adapters?From the high level requirement you posted, I can say that it is very much possible to achieve this using Oracle Integration B2B product only.
If yes, would request you to provide me with the Adapters we need to buy (license required) and also the components that would be required to achieve the above functionality.Now this will vary as per your network design, solution design and detailed requirements but at high level you need to buy only Oracle B2B. First of all you should decide the scope and requirements and then go for estimation. After that decide whether you may go with 10g version or you need 11g (as it has various supports which are not there in 10g).
For the start, below documents may help you out -
http://www.oracle.com/technology/products/integration/b2b/pdf/edi_cookbook_oracle_b2b.pdf
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_002_B2B_Standards_Supported.pdf
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_014_Questionaire_Sizing.pdf
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_015_Questionaire_SI_Assessement.pdf
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_016_Questionaire_Trading_Partner.pdf
http://www.oracle.com/technology/products/soa/b2b/collateral/b2b_11g_ds.pdf
http://www.oracle.com/technology/products/integration/b2b/Oracle_B2B_10g.html
Regards,
Anuj -
***Empty File handling,sender .txt file
Hi All,
Can we use the option Empty file Handle if the sender is a text file.
if so how to achieve this.
Thanks,
SrinivasaHi,
Refer the section of 'Empty File Handling' from the below link:
http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
You will get the required result.
Regards,
Supriya. -
Send .txt file format to application server (AL11)
Hi friends,
As per the user requirement, I need to send the BEx report through open hub/APD to application server (AL11) in .txt format with 'tab' delimiter.
I am aware that it can be done in .csv format but not about .txt.
Please help me with urgent requirement.
Regards,
AnkitaHi Ankita,
Sorry I don't have any idea aside from openhub and APD..
Try the function module GUI_DOWNLOAD, maybe this will help you..
Regards,
Loed -
How to use the same channel to send a file and messages to the server
I'm trying to develop a simple program that will send and receive files from the server and in the same time I need to communicate with the server through the messages
I'm using TCP Socket
my problem is
I have only one channel
so, I have no option, either I can use it for sending the file itself or sending the message .. but not both !
my question is : How can I use the same channel for sending and receiving (file & message)
I would appreciate for any clue or hint
bestkajbj wrote:
kmarwani wrote:
Thanks for reply
yes, that what I'm thinking to do
but, in case of sending binary file, if I attached a flag on its header, will it corrupt the file ?
bestThe other end would of course need to decode the messages that you get, and only write the "data" part to the file.Thanks
I'm gonna try to hard-code what you suggest and i will post what happen with me here
even though I'm not sure how can I add header to a binary file and remove it from the file at other end. (coz I read it as stream and send as array without touching its contents)
this how I'm sending the file
ConnSocket = CSocket.accept();
ToClient = new DataOutputStream(ConnSocket.getOutputStream());
File myFile = new File("abc.jpg");
FileInputStream myFileInStream = new FileInputStream(myFile);
BufferedInputStream mybuffInStream = new BufferedInputStream(myFileInStream);
myBytArray = new byte[(int) myFile.length()];
mybuffInStream.read(myBytArray, 0, myBytArray.length);
ToClient.write(myBytArray, 0, myBytArray.length);
ToClient.flush();
myFileInStream.close();best -
Java proxy to send binary data
Hi guys,
I needed a small clarification.
I'm using java proxy sender and file receiver in a scenario. I want to pick up binary files (i.e. the file could be of any format text,zip,pdf, image etc) using jakarta commons api to connect to ftp and then call the proxy to send this file data via proxy.
I'm not clear on how this requirement can be achieved or it can be achieved or not.Hi Stefan,
I'm referring to the comments given by Michal in the below blog.
[How to send any data (even binary) through XI, without using the Integration Repository|How to send any data (even binary) through XI, without using the Integration Repository] -
Interesting ? @ servlet reading a txt file
hi friends,
i need ur help for one interesting problem i m facing.
I want to read a txt file and wanna display the text from that file into an html, using a servlet.A txt file contains sentences( words with spaces in between ).When servlet reads the file, it is reading the whole sentence ,but while displaying that sentence, it is just showing the first word of the sentence.
html is not able to read the space between the words.
so what do i suppose to do now.
waiting for ur replies.......
thanx
amithi friends ,
i m giving the code , just give it a try//
This is a servlet ---------------------------------------
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class AdminGraphServlet extends HttpServlet
Properties ht;
FileInputStream fin;
FileOutputStream fout;
String s15,st;
public void init(ServletConfig config) throws ServletException
super.init(config);
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,ServletException
ht = new Properties();
try
fin = new FileInputStream("Data.txt");
catch(FileNotFoundException e)
System.out.println("FileNotFound");
try
if(fin != null)
ht.load(fin);
s15 = (String)ht.get("title");
fin.close();
catch(IOException e)
System.out.println("Error Reading File");
PrintWriter out = res.getWriter();
res.setContentType("text/html");
out.println("<html><body>");
out.println("<form method=post action=http://localhost:8080/servlet/MyServlet>");
out.println("<table><tr>");
out.println("<tr><td>Title</td>");
out.println("<td><Input Type=Text name=title value="+ s15 +"> </td></tr>");
out.println("</table>");
out.println("<input type=submit name=submit value=submit>");
out.println("<input type=hidden name=check value=save>");
out.println("</form>");
out.println("</body></html>");
public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
String Scheck = req.getParameter("check");
PrintWriter out1 = res.getWriter();
String ttl = req.getParameter("title");
if(Scheck.equals("save"))
ht.put("title",ttl);
fout = new FileOutputStream("Data.txt");
ht.store(fout,"Data");
fout.close();
out1.println("<html><body>");
out1.println("<h1>Stored This Data Successfully</h1>");
out1.println("</html></body>");
txt file is having a line
title=Are you smart enough?
The servlet should display this sentence in a text box.
But it is displaying only "Are".
still waiting...
have nice time..
amit
Maybe you are looking for
-
Trigger follow up action in Auto UD
Hello Gurus, we have defined follow up action after making UD of inspection lot. the logic is to move the stock from one Sloc to other after UD is made. This follow up action works well when we make UD in QA11 (foreground). however, we observed that.
-
About tax in the pricing procedure
Hi Gurus, I need your help. Our client says that the tax was incorrectly calculated from the start of SAP application. Before SAP Application, their tax is computed as follows based on the Pricing procedure used: 19% on Freight 6% on Value of goods B
-
Sqlplus is not working in oracle client machine.
In one of the application server on which Oracle client is installed, While login thru unix shell script im getting below error. "Error 6 initializing SQL*Plus Message file sp1<lang>.msb not found SP2-0750: You may need to set ORACLE_HOME to your Ora
-
Problem in Restoring the database the database
Hi guys, I am new to oracle , I am facing one problems is that , i having the backup of one oracle database in .dmp format. I have to restore it to 9i database. for that i have created on database , how to restore the backup file over the new databas
-
Significant time waiting for User I/O on the hot object
How to correct this warnings shone in enterprise manager's top most poor sql's in performance analysis ; The SQL statement with SQL_ID "dnpdchg674nrr" spent significant time waiting for User I/O on the hot object. Texto SQLSELECT COUNT(*) AS QTDCTA F