Text File Access on school server help!!!!

I am writing a poll applet for my school website and this is what i have:
import javax.swing.*;
import java.io.*;
import java.util.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
//import java.net.URL;
public class Poll extends Applet implements ActionListener
     static final long serialVersionUID=64154651;
     private String input;
     private BufferedReader inputStream;
     private int option1=0;
     private int option2=0;
     private int option3=0;
     public Poll()
     public void start()
          setLayout(new GridLayout(3,1));
          input=JOptionPane.showInputDialog(null,"Enter your school ID");
          Button choice1=new Button("1: Ben is cool");
          choice1.setActionCommand("1");
          choice1.addActionListener(this);
          add(choice1);
          Button choice2=new Button("2: Ben is Sweet");
          choice2.setActionCommand("2");
          choice2.addActionListener(this);
          add(choice2);
          Button choice3=new Button("3: Ben is Nerdy");
          choice3.setActionCommand("3");
          choice3.addActionListener(this);
          add(choice3);
          setVisible(true);
          //while(true);
     public void stop()
     public void actionPerformed(ActionEvent e)
          String action=e.getActionCommand();
          //JOptionPane.showMessageDialog(null,"Action");
          try
               inputStream = new BufferedReader(new FileReader("poll1.txt"));
               PrintWriter pw=new PrintWriter(new FileOutputStream("poll3.txt"));
               String line= inputStream.readLine();
               StringTokenizer st;
               while(line!=null)
                    pw.println(line);
                    st= new StringTokenizer(line);
                    switch(st.nextToken().charAt(0))
                         case '1':     option1++;
                                        break;
                         case '2':     option2++;
                                        break;
                         case '3':     option3++;
                                        break;
                    line=inputStream.readLine();
               if(action.equals("1"))
                    pw.println("1 "+input);
                    JOptionPane.showMessageDialog(null,"You voted Ben is cool");
               if(action.equals("2"))
                    pw.println("2 "+input);
                    JOptionPane.showMessageDialog(null,"You voted Ben is sweet");
               if(action.equals("3"))
                    pw.println("3 "+input);
                    JOptionPane.showMessageDialog(null,"You voted Ben is nerdy");
               JOptionPane.showMessageDialog(null,"Votes for choice 1: "+option1+"\nVotes for choice 2: "+option2+"\nVotes for choice 3: "+option3);
               JOptionPane.showMessageDialog(null,"Thank you for your opinion!");
               pw.close();
               inputStream.close();
               inputStream = new BufferedReader(new FileReader("poll3.txt"));
               pw=new PrintWriter(new FileOutputStream("poll1.txt"));
               line= inputStream.readLine();
               while(line!=null)
                    pw.println(line);
                    line=inputStream.readLine();
               pw.close();
          catch(FileNotFoundException ex)
               JOptionPane.showMessageDialog(null,"File poll.txt not found.");
               System.out.println("File poll1.txt not found.");
          catch(IOException ex)
               JOptionPane.showMessageDialog(null,"Error reading from file message.txt.");
               System.out.println("Error reading from file message.txt.");
          catch(Exception ex)
               JOptionPane.showMessageDialog(null,ex.toString());
          destroy();
          System.exit(0);
     public static void main(String[] args)
          Poll p= new Poll();
          p.start();
When I run the applet on the local folder offline in eclipse applet viewer, it works, when I put it on a website, I get a security exception saying that I cant read poll1.txt. How do I read and write to text files that will be up on the same ftp as the class file?

When I run the applet on the local folder offline in
eclipse applet viewer, it works, when I put it on a
website, I get a security exception saying that I
cant read poll1.txt. Think about it, you're trying to read a file on someone else's machine. That's a super mega security violation.

Similar Messages

  • Text file import to sql server

    hello experts
    i am looking the best practise considering performance to import a text file to a sql server 2008r2. i have 1,500 files that need to be imported to sql server? thank you as usaual.

    efratb,
    SSIS would be an good option:
    http://www.codeproject.com/Articles/155829/SQL-Server-Integration-Services-SSIS-Part-1-Basics
    http://blog.sqlauthority.com/2011/05/12/sql-server-import-csv-file-into-database-table-using-ssis/
    in addition to ssis, you can also achieve the same thru bcp. check:
    http://databases.about.com/od/sqlserver/a/bcp.htm
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • You don't have permission to access ** on the server, HELP please

    For the last months I've been working with Muse and updating my website through Muse without any problems.
    I use my extern HTML for update pages in Muse, and usually this went without any problems too.
    But if I test my new update, when I want to download a specific clip, it says: "You don't have permission to access ** on this server."
    The files are in the correct place on my FTP, the link is correct and when I open the specific link in my browser without using my website, I CAN download the file.
    How is it possible that this suddenly doesn't work anymore? Last time I updated this way was one week ago - without any problems.
    Can anyone help, seeing I have done everything I usually do, and everything is in the correct place and the link does work.
    Thanks

    In my case I have to close/quit Muse. Then re-open the program. For me the problem goes away. This only happens occasionally.

  • Creating a link to text file in a tomcat server not working in JSP webapp

    I am using netbeans to create an web application within my desktop, and then I load the build/web folder to a tomcat server to test the application. Everything works fine. However, when I try to link up my JSP pages to text files (.txt) create by the application on the server, I seem to be getting files that might be kept in a terminal.
    When I get the Real path of the servlet context, I find that it is to a C:\ type file rather than a //hostname type of directory. So obviously those files are not being reached.
    Does anybody know how to deal this problem?

    There are a number of ways to get to the Flash Global Security settings dialog.
    My favourite way is just to double click on a Captivate SWF (not the HTM file) to open it in a web browser, then right click on the playing screen to get the Flash context menu.  On the context menu, click the Global Settings option.
    In the web page that opens, click the link on the left to Global Security Settings.
    Add the folder or drive location of your published Captivate content to the Trusted Locations.

  • Reading from a text file in to an array, help please

    I have the following
    public class date extends Loans{
    public int dd;
    public int mm;
    public int yyyy;
    public String toString() {
    return String.format( "%d,%d,%d", mm, dd, yyyy );
    public class Loans extends Borrowing {
    public String name;
    public String book;
    public date issue;
    public char type;
    public String toString(){
    return String.format( "%s, %s, %s, %s", name, book, issue, type );
    import java.util.Scanner;
    import java.io.*;
    public class Borrowing extends BorrowingList {
    private Loans[] Loaned = new Loans[20];
    if i want to read in from a text file in to that array how do i do it?

    sorry to keep bothering you and thanks loads for your help but now I am getting the following error mesage
    C:\Documents and Settings\MrW\Menu.java:43: cannot find symbol
    symbol : class IOException
    location: class Menu
    }catch(IOException e){
    Note: C:\Documents and Settings\MrW\Borrowing.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    BUILD FAILED (total time: 0 seconds)
    for this line
    }catch(IOException e){                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reading a text file and connecting two server

    Hi,
    I am newbie at java and I have two question ,
    asume you have two server and a client. every server reads its own text file and the client connect both of them and read output data, and counts number of words. you must use socket programming to communicate to servers.
    I need litle code.
    Thanks for your help

    Hi,
    While using ArrayList, use add your elements into it
    as an object subtype if you do not specify ArryList
    certain type.
    But recall that if you use certain
    type(ArrayList<String>,....), you do not add any
    other different type element.What the heck is this all about Merde?

  • Ergent problem with the jsp file access in tomcat. HELP...

    I use tomcat as my server, I have one JSP file located in :
    webapps\abc\war\WEB-INF\jsp\index.jsp
    You see my project name is abc, I want to access the index.jsp file, I define another jsp file in the path: webapps\abc callled outside.jsp. I want to use outside.jsp to invoke the index.jsp.
    Inside outside.jsp it is :
    <html>
    <head>
    <title>index</title>
    </head>
    <body>
    <%@ include file="war/WEB-INF/jsp/index.jsp" %/>
    </body>
    </html>
    When I open the browser, and access, http://localhost:8080/abc/outside.jsp , the content of index.jsp was shown as expect. But, all the link pages of the index.jsp can not shown (PS: the link pages is located in the same path as index.jsp, they are all jsp files). I guess the problem may be that the <%@ include file="war/WEB-INF/jsp/index.jsp" %/> inside outside.jsp include the index.jsp as a static file. Is there any method to make all the link pages of index.jsp can be shown when call from outside.jsp???HELP
    Message was edited by:
    Mellon
    Message was edited by:
    Mellon

    I don't know why your links can't be shown, but I can tell you that your suspect:
    I guess the problem may be that the <%@ include file="war/WEB-INF/jsp/index.jsp" %/> inside outside.jsp include the index.jsp as a static file.is wrong, because included jsp is dynamic, not static.

  • Folders and Files access denied from Server 2008 on Windows 7

    I upgraded my server from 2003 to 2008. Now my Windows 7 machines can't open files in the Shared Documents on the server.  Error comes back with access denied.  Can use remote desktop with a Windows 7 machine and have access to the Shared Documents
    folder.  Any help as to why getting access denied would be great.

    Hi,
    Plesase check ntfs permisions and share permssions of the shared folder. You could try to set share permissions to Full Control for the Everyone group to see if the issue still exists. 
    Share and NTFS Permissions on a File Server
    http://technet.microsoft.com/en-us/library/cc754178.aspx
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • File Access from DB Server/Unix Mounting

    We have an Oracle Database that runs on Unix Box and a cold fusion application/web server runs on a Windows box. We have a data intensive stored procedure that gets data from DB, does lot of massaging and then create bunch of html files with sorting capabilities etc. This process happens upon user request from website (cold fusion/html page calling Oracle stored procedure). After this, the cold fusion server need to get access to these html files to display to the user.
    Our Unix DBA's does NOT want to do File Mounting as they think the windows box is not secure. Hence we are exploring other options.
    Below are the options we are exploring. But very well open to suggestions...
    1. Let cold fusion query the data from Database and let it do the data manipulation/massaging
    2. We explored the external tables (based on file) but the files are dynamic and could not find a way to do this
    3. FTP transfer from Unix to NT box but there could be time delay and may not be available for immediate display
    4. Create a temporary table, let the DB procedure insert data into table. Then Cold fusion will query from there.
    Any other suggestions?

    Hi,
    Its not required to handle for #
    just read the dataset into the string and split the string into work area fields seoparated by TAb delimiter.
    Eg:
    READ DATASET <filename> INTO l_string.
    SPLIT l_string
                   AT cl_abap_char_utilities=>horizontal_tab "Horizontal tab
                  INTO l_funcloc_clas-tplnr
                       w_funcloc_clas-class
                       w_funcloc_clas-klart
                       w_funcloc_clas-atnam
                       w_funcloc_clas-atwrt
                       w_funcloc_clas-atfor.
    append w_funcloc_clas to l_funcloc_clas.
    With Regards,
    Dwarakanath.S

  • Need to calculate sum in an e-text file for positive pay--PLEASE HELP!!!!

    Hi All,
    Need some help formatting e-text output in positive pay. In the trailer record I need to display the sum of all checks run in that payment process. However if the check is "VOID", I should not add that check amount to the summary total in the trailer record. So, I need to conditionally sum the check amounts in the payment register.
    Here is my XML:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PositivePayDataExtract>
    - <OutboundPayment>
    - <PaymentSourceInfo>
    <ApplicationInternalID>200</ApplicationInternalID>
    <ApplicationName>SQLAP</ApplicationName>
    <PaymentServiceRequestID>50175</PaymentServiceRequestID>
    - <FunctionalCategory>
    <Code>PAYABLES_DISB</Code>
    <Meaning>Payables Disbursements</Meaning>
    </FunctionalCategory>
    - <PayerOrganization>
    <OrganizationInternalID>484</OrganizationInternalID>
    - <OrganizationType>
    <Code>OPERATING_UNIT</Code>
    <Meaning>Operating Unit</Meaning>
    </OrganizationType>
    <OrganizationName>US_OU</OrganizationName>
    </PayerOrganization>
    <EmployeePaymentFlag>N</EmployeePaymentFlag>
    </PaymentSourceInfo>
    - <PaymentNumber>
    <DocCategory />
    <SequenceName />
    <SequenceValue />
    <PaymentReferenceNumber>64812</PaymentReferenceNumber>
    <LogicalGroupReference />
    <CheckNumber>180159</CheckNumber>
    </PaymentNumber>
    <PaymentDate>2012-07-10</PaymentDate>
    <PaymentDueDate />
    <MaturityDate />
    - *<PaymentStatus>*
    *<Code>VOID</Code>*
    <Meaning>Void</Meaning>
    </PaymentStatus>
    - <Payee>
    <PartyInternalID>848060</PartyInternalID>
    <PartyNumber>46702</PartyNumber>
    <Name>ABC INT</Name>
    <TaxRegistrationNumber />
    <LegalEntityRegistrationNumber>9999</LegalEntityRegistrationNumber>
    <AlternateName />
    <SupplierNumber>12975</SupplierNumber>
    - <Address>
    <AddressInternalID>32488</AddressInternalID>
    <AddressLine1>48078ABC ST</AddressLine1>
    <AddressLine2 />
    <AddressLine3 />
    <AddressLine4 />
    <City>ABC</City>
    <County />
    <State>AB</State>
    <Country>US</Country>
    <ISO3DigitCountry>USA</ISO3DigitCountry>
    <CountryName>UB</CountryName>
    <PostalCode>12345-7890</PostalCode>
    <AddressName>ABC</AddressName>
    <Addressee />
    <AlternateAddressName />
    <PreFormattedConcatenatedAddress>ABC</PreFormattedConcatenatedAddress>
    <PreFormattedMailingAddress>ABCD</PreFormattedMailingAddress>
    </Address>
    - <ContactInfo>
    - <ContactLocators>
    <PhoneNumber />
    <FaxNumber />
    <EmailAddress />
    <Website />
    </ContactLocators>
    </ContactInfo>
    <SupplierSiteCode>ABC</SupplierSiteCode>
    </Payee>
    - <TradingPartner>
    <PartyInternalID>848060</PartyInternalID>
    <PartyNumber>46702</PartyNumber>
    <Name>ABC INT</Name>
    <TaxRegistrationNumber />
    <LegalEntityRegistrationNumber>12345</LegalEntityRegistrationNumber>
    <AlternateName />
    <SupplierNumber>12975</SupplierNumber>
    - <ContactInfo>
    - <ContactLocators>
    <PhoneNumber />
    <FaxNumber />
    <EmailAddress />
    <Website />
    </ContactLocators>
    </ContactInfo>
    <AdditionalInformation />
    </TradingPartner>
    <PayeeBankAccount />
    - <Payer>
    <PartyInternalID>788764</PartyInternalID>
    <PartyNumber>39224</PartyNumber>
    <Name>UB_LE</Name>
    - <PartyType>
    <Code />
    <Meaning />
    </PartyType>
    <TaxRegistrationNumber />
    <LegalEntityRegistrationNumber>12345</LegalEntityRegistrationNumber>
    <LegalEntityInternalID>40287</LegalEntityInternalID>
    <LegalEntityName>UB_LE</LegalEntityName>
    - <Address>
    <AddressInternalID>24652</AddressInternalID>
    <AddressLine1>ABC STREET</AddressLine1>
    <AddressLine2 />
    <AddressLine3 />
    <City>TREY</City>
    <County>Hari</County>
    <State>TX</State>
    <Country>US</Country>
    <ISO3DigitCountry>USA</ISO3DigitCountry>
    <CountryName>United States</CountryName>
    <PostalCode>12345</PostalCode>
    <PreFormattedConcatenatedAddress>ABC STREET, TREY, TX 12345</PreFormattedConcatenatedAddress>
    <PreFormattedMailingAddress>ABC STREET, TREY, TX 12345</PreFormattedMailingAddress>
    <AddressName>ABCD Services (U.S.) Inc.</AddressName>
    </Address>
    - <ContactInfo>
    - <ContactLocators>
    <PhoneNumber />
    <FaxNumber />
    <EmailAddress />
    <Website />
    </ContactLocators>
    </ContactInfo>
    </Payer>
    - <BankAccount>
    <BankAccountInternalID>64034</BankAccountInternalID>
    <BankName>XXX BANK</BankName>
    <AlternateBankName />
    <BankNumber />
    <BranchInternalID>1236444</BranchInternalID>
    <BranchName>24</BranchName>
    <AlternateBranchName />
    <BranchNumber>12345</BranchNumber>
    <BankAccountName>43</BankAccountName>
    <AlternateBankAccountName>INTERNAL</AlternateBankAccountName>
    <BankAccountNumber>123</BankAccountNumber>
    <MaskedBankAccountNumber>123</MaskedBankAccountNumber>
    <UserEnteredBankAccountNumber>123</UserEnteredBankAccountNumber>
    <BankAccountSuffix />
    <SwiftCode>ABC</SwiftCode>
    <IBANNumber />
    <CheckDigits />
    - <BankAccountType>
    <Code />
    <Meaning />
    </BankAccountType>
    - <BankAccountCurrency>
    <Code>USD</Code>
    </BankAccountCurrency>
    - <BankAddress>
    <AddressInternalID>56057</AddressInternalID>
    <AddressLine1>111 ABC ST</AddressLine1>
    <AddressLine2 />
    <AddressLine3 />
    <AddressLine4 />
    <City>SanJo</City>
    <County />
    <State>IN</State>
    <Province />
    <Country>US</Country>
    <ISO3DigitCountry>USA</ISO3DigitCountry>
    <CountryName>United States</CountryName>
    <PostalCode>12345</PostalCode>
    <PreFormattedConcatenatedAddress>ABC STREET</PreFormattedConcatenatedAddress>
    <PreFormattedMailingAddress>ABC STREET</PreFormattedMailingAddress>
    </BankAddress>
    - <DescriptiveFlexField>
    <AttributeCategory>Yes</AttributeCategory>
    <Attribute1 />
    <Attribute2>108</Attribute2>
    <Attribute3 />
    <Attribute4 />
    <Attribute5 />
    <Attribute6 />
    <Attribute7 />
    <Attribute8 />
    <Attribute9 />
    <Attribute10 />
    <Attribute11 />
    <Attribute12 />
    <Attribute13 />
    <Attribute14 />
    <Attribute15 />
    </DescriptiveFlexField>
    - <FederalBankAccountInfo>
    <FederalRFCIdentifier />
    <FederalAgencyLocationCode />
    <FederalAbbreviatedAgencyCode />
    <FederalEmployerIdentificationNumber />
    </FederalBankAccountInfo>
    - <EFTUserNumber>
    <AccountLevelEFTNumber />
    <BranchLevelEFTNumber />
    </EFTUserNumber>
    </BankAccount>
    - <Beneficiary>
    <Name>ABC INT</Name>
    </Beneficiary>
    - <PaymentAmount>
    *<Value>2612.39</Value>*
    - <Currency>
    <Code>USD</Code>
    <Name>US Dollar</Name>
    </Currency>
    </PaymentAmount>
    <PaymentAmountText>Two Thousand Six Hundred Twelve Dollars And Thirty-Nine Cents*******************************************************</PaymentAmountText>
    - <PaymentMethod>
    <PaymentMethodInternalID>CHECK</PaymentMethodInternalID>
    <PaymentMethodName>Check</PaymentMethodName>
    <PaymentMethodFormatValue>CHECK</PaymentMethodFormatValue>
    </PaymentMethod>
    <PayAlongFlag>N</PayAlongFlag>
    - <SettlementPriority>
    <Code />
    <Meaning />
    </SettlementPriority>
    - <AmountWithheld>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </AmountWithheld>
    - <DiscountTaken>
    - <Amount>
    <Value>0</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </Amount>
    </DiscountTaken>
    - <BankCharges>
    - <BankChargeBearer>
    <Code />
    <Meaning />
    </BankChargeBearer>
    - <Amount>
    <Value>0</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </Amount>
    </BankCharges>
    - <DeliveryChannel>
    <Code />
    <Meaning />
    <FormatValue />
    </DeliveryChannel>
    - <PaymentReason>
    <Code />
    <Meaning />
    <FormatValue />
    </PaymentReason>
    <PaymentReasonComments />
    <RemittanceMessage />
    <RemittanceMessage />
    <RemittanceMessage />
    - <BankInstruction>
    <BankInstructionCode />
    <Meaning />
    <FormatValue />
    </BankInstruction>
    - <BankInstruction>
    <BankInstructionCode />
    <Meaning />
    <FormatValue />
    </BankInstruction>
    <BankInstructionDetails />
    <PaymentTextMessage />
    <PaymentTextMessage />
    <PaymentTextMessage />
    <PaymentDetails />
    - <RegulatoryReporting>
    <DeclarationFlag>N</DeclarationFlag>
    - <Amount>
    <Value>0</Value>
    - <Currency>
    <Code />
    </Currency>
    </Amount>
    </RegulatoryReporting>
    - <FederalPaymentInfo>
    <FederalAllotmentCode />
    <FederalOffsetEligibilityFlag />
    <FederalAccountingSymbol />
    </FederalPaymentInfo>
    <DocumentPayableCount>1</DocumentPayableCount>
    - <DocumentPayable>
    - <DocumentNumber>
    <DocumentInternalIDSegment1>21202</DocumentInternalIDSegment1>
    <DocumentInternalIDSegment2>174838</DocumentInternalIDSegment2>
    <DocumentInternalIDSegment3>1</DocumentInternalIDSegment3>
    <DocumentInternalIDSegment4 />
    <DocumentInternalIDSegment5 />
    <ApplicationInternalID>200</ApplicationInternalID>
    <ApplicationDocumentSubType>PAYABLES_DOC</ApplicationDocumentSubType>
    <ApplicationUniqueInternalID>21202</ApplicationUniqueInternalID>
    <ReferenceNumber>183464</ReferenceNumber>
    - <UniqueRemittanceIdentifier>
    <Number />
    <CheckDigit />
    </UniqueRemittanceIdentifier>
    <DocCategory>STD INV</DocCategory>
    <SequenceName>USA_Payables_Purchases</SequenceName>
    <SequenceValue>24389</SequenceValue>
    </DocumentNumber>
    <PONumber>UNMATCHED</PONumber>
    - <DocumentStatus>
    <Code>REMOVED_PAYMENT_VOIDED</Code>
    <Meaning>Removed - Payment Voided</Meaning>
    </DocumentStatus>
    <DocumentDate>2012-04-23</DocumentDate>
    <DocumentCreationDate>2012-07-10</DocumentCreationDate>
    <PaymentDueDate>2012-05-23</PaymentDueDate>
    - <DocumentType>
    <Code>STANDARD</Code>
    <Meaning>Standard</Meaning>
    </DocumentType>
    <DocumentDescription>STORAGE 04/01/12 - 06/30/12</DocumentDescription>
    <ExpenseReportCreditCardNumber />
    <EmployeePaymentFlag>N</EmployeePaymentFlag>
    - <TotalDocumentAmount>
    <Value>2612.39</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </TotalDocumentAmount>
    - <PaymentAmount>
    <Value>2612.39</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </PaymentAmount>
    <PayAloneFlag>N</PayAloneFlag>
    - <SettlementPriority>
    <Code />
    <Meaning />
    </SettlementPriority>
    - <AmountWithheld>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </AmountWithheld>
    - <DiscountTaken>
    - <Amount>
    <Value>0</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </Amount>
    <DiscountDate />
    </DiscountTaken>
    - <BankCharges>
    - <BankChargeBearer>
    <Code />
    <Meaning />
    </BankChargeBearer>
    </BankCharges>
    - <DeliveryChannel>
    <Code />
    <Meaning />
    <FormatValue />
    </DeliveryChannel>
    - <PaymentReason>
    <Code />
    <Meaning />
    <FormatValue />
    </PaymentReason>
    <PaymentReasonComments />
    <RemittanceMessage />
    <RemittanceMessage />
    <RemittanceMessage />
    - <Charge>
    - <TotalDocumentChargeAmount>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </TotalDocumentChargeAmount>
    </Charge>
    - <TotalDocumentTaxAmount>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </TotalDocumentTaxAmount>
    - <CreditAmountApplied>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </CreditAmountApplied>
    - <InterestAmountApplied>
    <Value />
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </InterestAmountApplied>
    <InterestRate />
    - <DocumentPayableLine>
    <LineNumber>1</LineNumber>
    <PONumber />
    - <LineType>
    <Code>ITEM</Code>
    <Meaning />
    </LineType>
    <LineDescription />
    - <LineGrossAmount>
    <Value>0</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </LineGrossAmount>
    <UnitPrice />
    <Quantity />
    - <UnitOfMeasure>
    <Code />
    <Meaning />
    </UnitOfMeasure>
    - <Tax>
    <TaxCode />
    <TaxRate />
    </Tax>
    </DocumentPayableLine>
    - <DocumentPayableLine>
    <LineNumber>2</LineNumber>
    <PONumber />
    - <LineType>
    <Code>ITEM</Code>
    <Meaning />
    </LineType>
    <LineDescription />
    - <LineGrossAmount>
    <Value>2612.39</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </LineGrossAmount>
    <UnitPrice />
    <Quantity />
    - <UnitOfMeasure>
    <Code />
    <Meaning />
    </UnitOfMeasure>
    - <Tax>
    <TaxCode />
    <TaxRate />
    </Tax>
    </DocumentPayableLine>
    - <DocumentPayableLine>
    <LineNumber>3</LineNumber>
    <PONumber />
    - <LineType>
    <Code>TAX</Code>
    <Meaning />
    </LineType>
    <LineDescription />
    - <LineGrossAmount>
    <Value>0</Value>
    - <Currency>
    <Code>USD</Code>
    </Currency>
    </LineGrossAmount>
    <UnitPrice />
    <Quantity />
    - <UnitOfMeasure>
    <Code />
    <Meaning />
    </UnitOfMeasure>
    - <Tax>
    <TaxCode>USA_SALES_TAX</TaxCode>
    <TaxRate>0</TaxRate>
    </Tax>
    </DocumentPayableLine>
    - <Extend>
    <CLL_ERROR>ORA-20070: INVALID COUNTRY CODE</CLL_ERROR>
    </Extend>
    <DocumentPayerLegalEntityName>UB_LE</DocumentPayerLegalEntityName>
    <DocumentPayerLegalEntityRegNumber>9999</DocumentPayerLegalEntityRegNumber>
    <DocumentPayerTaxRegNumber />
    </DocumentPayable>
    - <Extend>
    <CLL_ERROR>ORA-20070: INVALID COUNTRY CODE</CLL_ERROR>
    </Extend>
    <VoucherNumber>11020</VoucherNumber>
    <RoutingNumber />
    </OutboundPayment>
    I tried the following way and it did not work:
    Sum(OutboundPayment[OutboundPayment/PaymentStatus/Code=’ISSUED’]/PaymentAmount /Value)
    I tried another way and even this did not work:
    decode(PaymentStatus/Code, 'VOID', ‘0’, PaymentAmount/Value*100)
    Can you please let me know how I can do this.
    Thanks in advance.

    Can you provide code on how I can create a loop?
    I'm not getting any error when calculating sum.
    Here is what I'm trying to do, lets say I have two checks:
    CHK1
    Amount:200.00
    Status: Issued
    CHK2
    Amount: 500.00
    Status: Void
    When calculatiing the tota for the checksl, I should see the total as 200 only because, the Check2 has been voided and it is considered zero.
    I tried the following ways and it did not work:
    Sum(OutboundPayment[OutboundPayment/PaymentStatus/Code=’ISSUED’]/PaymentAmount /Value)
    I tried another way and even this did not work:
    decode(PaymentStatus/Code, 'VOID', ‘0’, PaymentAmount/Value*100)
    Please help!!!!!!

  • Downloading a text file from application server

    Hi Freinds,
    I am genarating a text file in our application server (Folder /usr/sap/dbi/) I need to download this text file in my destop pc or some other windows server.
    What do I have to do? What is the procedure, Pls help.
    If someone have sample code, pls send.
    We are running SAP ECC5.0 on an iSeries (AS/400) Database DB2/400.
    Regards
    Thanura

    Hi,
    try this:
    REPORT ZGRO_TEST.
    DATA: DATEI_A(30) TYPE C VALUE '/tmp/matnr.txt'.
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: ITAB        TYPE TABLE OF MARA WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM DATEI_EINLESEN.
      PERFORM DATEI_DOWNLOAD.
    FORM DATEI_EINLESEN.
      OPEN DATASET DATEI_A FOR INPUT IN TEXT MODE.
      IF SY-SUBRC NE 0. STOP. ENDIF.
      DO.
        READ DATASET DATEI_A INTO ITAB.
        IF SY-SUBRC <> 0. EXIT. ENDIF.
        APPEND ITAB.
      ENDDO.
      CLOSE DATASET DATEI_A.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_EINLESEN
    FORM DATEI_DOWNLOAD.
    Datei downloaden
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = DATEI_PC
          FILETYPE                = 'ASC'
        CHANGING
          DATA_TAB                = ITAB[]
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          OTHERS                  = 24.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_DOWNLOAD
    Regards, Dieter

  • Reading text file from database server in OA Page

    Hi Guys,
    I am trying to embed an applet with in an OA Page. The applet is used to mainly for showing Gantt chart. I have to pass my connection details from OA Page to applet, I dont pass directly the connection details to the applet so i am placing all the server details, user name and password in a text file on the database server.
    So from the OA Page i have to read the contents of the file on the database server and pass them to the applet using the <PARAM> tag. My question is how to read the text file from the database server.Any Inputs?
    Thanks in advance for your help.
    Regards,
    Nagesh Manda.

    If the file to be read is on the database, then it makes sense to use the pl/sql code to read the file. Make a call to this pl/sql code from page controller to get back the values.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                           

  • Error importing text file into SQL Server when last column is null

    Hello all. Happy holidays!
    I'm trying to import a text file into a SQL Server table, and I get the error below when it gets to a row (row 264) that has null in the last column. I'm guessing the null jumbles up the delimiters somehow. The nulls are not errors, and I need to import
    them into the table with the rest of the rows. Any idea how I can do that?
    Thanks!
    [Flat File Source [1]] Error: Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
    [Flat File Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "XYZ" (178)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "XYZ"
    (178)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [Flat File Source [1]] Error: An error occurred while processing file "ABC.txt" on data row 264.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Flat File Source" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    WeeLass

    Hi WeeLass,
    The error that” Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".” is generally error message, and the error indicates
    that there is data type mismatch issue between the input columns and the output columns.
    Based on your description, the issue is that you trying to convert a column contains empty value from string to integer data type for the output column "XYZ" in Flat File Source [1]. Please note that we cannot type an empty value as integer data
    type column value, so the error occurs.
    To fix this issue, just as you did, we should convert the data type for the output column "XYZ" in Flat File Source [1] back to DT_WSTR or DT_STR, then use a derived column task to replace the current column (UBPKE542). But the expression should
    be like below:
    LEN(TRIM(UBPKE542)) > 0 ? (DT_I8)UBPKE542 : NULL(DT_I8)
    In this way, the data type of the column in SQL table would be int, and the empty value would be replaced with NULL.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Problem with saving data in text file in Application server

    Hello Experts,
    I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
    Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
    The logic I implemented is the following:
    *Open file
      open dataset g_accnt_file for output in text mode encoding utf-8.
      if sy-subrc = 0.
        clear g_header_record.
    *Building header record for Accounting Validation file
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
        transfer g_header_record to g_accnt_file.
    *Move Cost center data to file to create a detail record for Accounting
    *Validation file
        loop at gt_csks into gs_csks.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_csks-kostl
            importing
              output = gs_csks-kostl.
    *      Overlay gs_csks-kostl with space.
    *      SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
    *Prepare Cost Centre String
          perform prepare_costcentre_string.
    *Prepare detail record with Company Code & Cost Centre
          perform prepare_detail_record.
          clear:g_detail_record,gs_csks,g_coa.
        endloop.
    *Move Order data to file to create a detail record for Accounting
    *Validation file
        loop at gt_aufk into gs_aufk.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_aufk-aufnr
            importing
              output = gs_aufk-aufnr.
    *      SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
    *Prepare Order String
          perform prepare_order_string.
    *Prepare detail record with Company Code & Order
          perform prepare_detail_record.
          clear:g_detail_record,gs_aufk,g_coa.
        endloop.
    *Move WBS data to file to create a detail record for Accounting
    *Validation file
        loop at gt_prps into gs_prps.
          call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
            exporting
              input  = gs_prps-pspnr
            importing
              output = g_wbs_element.
    *      SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
    *Prepare WBS Element String
          perform prepare_wbs_string.
    *Prepare detail record with Company Code & WBS Element
          perform prepare_detail_record.
          clear:g_detail_record,gs_prps,g_coa.
        endloop.
    *Building trailer record for Accounting Validation file which will
    *contain the total number of detail records in file
        concatenate gc_trail_desc
                    g_total_count
                    into g_trailer_record
                    separated by gc_deliminator.
        transfer g_trailer_record to g_accnt_file.
    *Close file
        close dataset g_accnt_file.
        if sy-subrc = 0.
          message s036(/lig/fi).
        endif.
      endif.
    endform.                    " SELECT_DATA
    Edited by: Matt on Sep 30, 2010 11:02 AM - added   tags

    Hi Pankaj,
    Can u check the concatenate statement with one more data. Check the no of lines for a single file.
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    sy-subrc
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
    Regards,
    Amitava

  • Table update from text file on server

    How do I get a table in dreamweaver to update from a text
    file thats on the server it will be posted on? Do I need to use
    some sort of weird coldfusion or asp.net, or can i do it in basic
    html. It would be sweet to make happen for my portfolio news
    section ... thanks!

    Hello,
    What you need is to know the structure (fields) of your internal table LS_BKPF at runtime.
    The standard SAP class CL_ABAP_TYPEDESCR contains Methods to describe not only repository structures but also variables used in your ABAP program.
    DESCRIBE_BY_DATA : Description of data object type
    DESCRIBE_BY_NAME : Description of object type using relative/absolute names
    DESCRIBE_BY_OBJECT_REF : Description of object type using reference
    DESCRIBE_BY_DATA_REF : Description of data object type using reference
    Example on how to do this can be found here :
    [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID1687263150DB21033411053326729243End?blog=/pub/wlg/2071|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID1687263150DB21033411053326729243End?blog=/pub/wlg/2071]
    After you have retrieved the fieldnames of your internal table at runtime you can add them in the first line of your dataset.
    Success.
    Wim

Maybe you are looking for

  • Why when I plug in my iPod does it say I don't have the privilege to makes changes?

    I plugged in my iPod to my computer a couple of days ago at night to sync new music and in the morning when I unplugged it, all the music on my iPod was deleted. I then restored my iPod (as my iTunes instructed me to do) and now when I plug my iPod i

  • Getting video onto my ipod

    I am having problems importing video to my itunes. I want to import some of my favourite movies. When I go to import then open. I have a list of options to open from the video file. When I select a variety of the files nothing happens. Is there a spe

  • Sales person

    My Program is related to  transactions from FI point of view for Cutomer Dt and Ct note transactions.. For my program can u please help me what is the the table name for sales person ...How to fetch this  which is not from SD side ... How to know the

  • Billing Document- Condition types- report -reg

    Hi experts, 1. I see a billing document in VF03, 2. I select a line item and click on pricing button. 3. I get all the pricing condition types and the corresponding values against them.        Pls let me know how do I get the values of "Net Value Bef

  • Error in cfquery insert

    I have a form that is submitting a list of values, The insert query worked fine until I needed a where clause in it and now it bombs out. Here is the code, and help would be appreciative.