Small doubt

hi friends, how can i update in a flat file like ( abc.txt). i would like to search a string in file and replace something in the row and update
in the same position. how to do that.
with regards.

Try this, this sample read and write the file 'x.x', put your code in the write_1 method.
import java.io.*;
public class RandomF
     RandomAccessFile rf;
public  RandomF() 
     String s;
     long   p;
     try
          rf = new RandomAccessFile("x.x","rw");
          p  = rf.getFilePointer();
          s  = rf.readLine();
          while (s != null)
               write_1(s,p);
               p = rf.getFilePointer();
               s = rf.readLine();
          rf.close();
     catch(FileNotFoundException e)
     catch(IOException e)                                     
public void write_1(String s, long wp)
     try
          long p = rf.getFilePointer();
          rf.seek(wp);
// put your code here
          rf.writeBytes(s);
          rf.seek(p);
     catch(IOException e)                                     
public static void main (String[] args) 
     new  RandomF();
}     

Similar Messages

  • Small doubts regarding devices and permissions

    Hill all,
    Continuing with my experiences with Oracle 11gR2 and Solaris 11, i came up with some "small" doubts regarding the permissions and owners of the devices to be used as ASM diskgroups. I was able to install Grid and the database, both 11.2.0.3.0, in a single-instance configuration, but i had a small issue when creatind the diskgroup for the database data (+DATA). I created 3 devices (VirtualBox) to be used in the +DATA dg, and gave the the "oracle:dba" owner, with the permission 660. My doubts are:
    1) It wouldn't be more correct to make the owner of the device the user grid? (grid:dba)
    2) The permission 660 to the devices is the correct, or recommended permission? It did work with this permission.
    Thanks in advance.

    It depends on the user and group that runs the ASM instance. It can be oracle/dba, but can also be a different user, e.g. grid/asmadmin
    http://docs.oracle.com/cd/E11882_01/install.112/e22489/storage.htm#CHDFAGJD
    660 means rw. That should be ok. No other user/group than the ASM instance needs to access the devices.

  • Urgent--- small doubt

    Hi
    I need some docs for 8i installation on win2K. Also I've a small doubt.... I want to move one database (8.1.7.4) to a new server. On this new server I have to install Oracle 8.1.0...... Now the doubt is if I do backup/restore from the old server, do I still have to apply patch 4 on the new server???
    Any input is appreciated.
    Regards

    Hi,
    I suggest you apply the patch becuase the database backup has the version info which is 8.1.4. Thus when you will use the 8.1.0 Oracle kernel to start a 8.1.4 database then it might give an error. It is best suited to apply the patches in the new server the way it is in the old one. Once you have applied the patches in Oracle kernel (Oracle Software) you may go ahead with opening the database.
    This will keep the versions of the Oracle kernel and the version info in the database control file in sync.
    Regards.

  • Small Doubt Regarding SY-MANDT

    Hi All,
         SELECT changenr FROM cdhdr CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
                                             WHERE mandant = syst-mandt
                                             AND   objectclas = 'MATERIAL'
                                             AND   objectid   = wa_matl-matnr
                                             AND   tcode      = 'MM02'.
         I have written the select stament as shown above.
         In this i have a doubt like adding a field sy-mandt  in the where condition will increase the Efficiency of program or not.
    regards,
    raghu.

    Hi..
    No doubt the efficency would be affected but from business point of view there will many  things that need to be checked as in:
    If you are viewing data from CDHDR and CDPOS which is client specific then you are not viewing complete data.
    These tables give us and document changes made to a particular object in SAP but if anything is cross client like company code(lets assume) then changes to it wont be visible in all the clients..
    so there can be some key information you can miss out while working on some of the objects.
    else in this case its good to make query cross client.
    regards
    vishal

  • A small doubt in credit management

    hi,
    i have a small query related to credit management, 
    Eg: For customer XXX there is 1000/- as credit limit.  He has used all the total amount which is shown in credit exposure 999%.
    How the system behaves or what is the impact on credit exposure that is 999% for this customer when it comes to raising of credit memo request to the same customer let's take credit memo request value is 100/-.
    please explain.
    regards,
    balajia.

    Hello Friend,
    See basically the Credit Management Works as:
    1. Every Invoice & Debit Memo increses the Debit Amount which is Receivables from Customers. Thus this increases the Credit exposure.
    2. Every Credit Memo decreases the Debit Amount (as it is a Credit entry) which decreses the Receivables from Customers. Thus thus this reduces the Credit exposure & the percentages...
    Hope this clears...
    Thanks,
    Jignesh Mehta

  • Small doubt(about pivot table)

    while creating a report i am getting error in Table view,if i create a same report in pivot view it is working fine in pivot view.
    after this i want to add this view to the compound view then i will have to delete the table view from the compound view .but while adding the pivot view to the compound view it is throwing error because by default compound view has only table view and tital view.it is not allowing me to add pivot view to the compound view.
    can anyone suggest me is there any other way i can add the pivot view to compoud view i want to view the title view and pivot view only in the compond view.(here the problem is i am unable to add pivot view to the compound view because error in the table view)

    Actually i placed couple of column in the excluded. now its working fine. i just want to know how can i add pivot tabler to the compound view at this situation

  • Small doubt in query

    Hi
    SQL> CREATE TABLE char_test (col1 CHAR(10));
    Table created.
    Elapsed: 00:00:00.03
    SQL> INSERT INTO char_test VALUES ('qwerty');
    1 row created.
    Elapsed: 00:00:00.00
    SQL> SELECT col1, length(col1), dump(col1) "ASCII Dump" FROM char_test;
    COL1 LENGTH(COL1)
    ASCII Dump
    qwerty 10 Typ=96 Len=10: 113,119,101,114,116,121,32,32,32,32
    Elapsed: 00:00:00.02
    SQL>
    Please explain the bolded one. 10 Typ=96.
    Thanks in advance.
    -SATHYA

    Hi,
    CHAR datatype is always blank padded if you are storing any value less than the specified length.
    See the below link:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/datatypes.htm#BABGIHIJ
    Regards

  • Small doubt on displaying variables in sap script

    HI all,
    Can anyone let me know if i am in the correct way or not.
    i'm modifying one existing script. to display some data in the script i am doing like this :
    get the data into itab.
    loop at itab into wa.
    call FM write_form
       element = 'TEXT'.
    endloop.
    in the layout i am using this elements and variables
    /E TEXT
    S1 <D1>&WA-FIELD1&</> <D1>&WA_FIELD2&</>
    but the work in not having any data in the layout whereas before call write_form its having data.
    can anyone suggest me who to deal with this.
    thanks

    You can check if your SAPScript is able to talk with the driver program.
    In SE71
    Open in Change Mode
    Form > Check > Text
    Select the Include Res checkbox .. Press Enter
    Enter your Program in the Next popup by "Append Print Program"
    Now, press Copy.
    It will show you the errors.
    In your proram WA must a in TOP include or Globally declared.
    Regards,
    Naimesh Patel

  • Small doubt in select query

    i want to count the no. of employees whose endda = '31/12/9999' and stat2 = '3'.
    tables are pa0000.
    can anyone tell me the select query?

    DATA: w_noemp TYPE i.
    SELECT COUNT(*) INTO w_noemp FROM  pa0000
           WHERE  endda  = '99991231'
           AND    stat2  = '3'.

  • ABAP-HR small doubt

    Hi,
    HRP1000-OBJID and PA0001-PLANS whether these two or same or not.
    please let me know.
    if these two or not same, can you please provide the logic how to link between these two fields.
    Regards
    Raj.

    Hi Raj
    HRP1000-OBJID is a collection of all OM objects, but P0001-PLANS is particularly Positions in PA of HR. P0001-PLANS is a subset of HRP1000-OBJID. For example even P0001-ORGEH, P0001-STELL is also linked to HRP1000-OBJID. These org,. objects are differentiated in HRP1000 table through the field HRP1000-OTYPE. This will take different value like 'S' for P0001-PLANS, 'O' for P0001-ORGEH, 'C' for P0001-STELL etc ... Hope it is what i explained here.
    To link HRP1000-OBJID and P0001-PLANS we can do some thing like
    HRP1000-OTYPE = 'S'
    HRP1000-OBJID =  P0001-PLANS
    ~Ranganath
    Reward points for all useful answer !!

  • Small Doubt in ALE config

    Hi,
    Iam reffering this blog to do ALE settings
    /people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi
    If i completly follow this Blog means ,  Is there is any need to do in WE20 & WE21 entries ????
    Instead of doing through this blog can i do in this way....
    1) Create LS in SALE
    2) Create RFC Destination in SM59 with the above created LS name
    3) Create WE21 Port
    4) Create We20 Partner Profile
    Is this way is ok rather than going in the Above mentioned Blog.
    What is the difference between these Two Approches
    Regards

    Hi Vamasi,
    After creating distribution model, you can generate partner profile automatically by just one single push button. It avoids our manual process of creating partener profile.
    However you can create partner profile manually as well using WE20 / WE21. But in both cases you need distribution model if you want to send message to XI system.
    "Generate the partner profiles by selecting the navigation path from the main menu, Environment --> Generate Partner profiles " --> Will make life easier by auto. generating profile for you base on distribution model parameter. ( Just one click n everything would be done).
    Both are doing same thing.
    Hope this will ans. your query.
    Thanks,
    Nilesh

  • Small doubt  reg upload from tab delimited text file

    Hi  all,
    i am uploading a tab delimited text file to a ztable.
    I moving the text file in to internal table
    data : begin of i_tab occurs 0,
           text(1024) type c,
           end of i_tab.
    then i have passed to FM GUI_UPLOAD.
    and then splitting
    loop at i_tab.
    split i_tab at con_tab
                              into i_xyz-matnr
                                   i_xyz-werks.
        append i_xyz.
    endloop..
    is this the right approach . iam getting the results but iam just curious to know.
    Do i need to internal like the one i created
    data : begin of i_tab occurs 0,
           text(1024) type c,
           end of i_tab.
    or do i need to create one with field that i have in text file.
    data : begin of i_tab occurs 0,
       matnr like mara-matnr,
      werks like marc-werks
    end of i_tab.
    WHICH ONE OF THE TWO IS RIGHT.
    THANKS IN ADVANCE

    There will be NO difference,i guess in the 2 methods.
    you can use which you like.
    Check the below program,i also given quantity fields F2,F3.
    its working fine
    REPORT  ZSRIM_TEMP13.
    data : begin of itab occurs 0,
             f1(20) type c,
             f2     type i,
             f3(10)     type p DECIMALS 2,
           end of itab.
           CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
               FILENAME                      = 'c:a.txt'
              FILETYPE                      = 'ASC'
              <b>HAS_FIELD_SEPARATOR           = 'X'</b>
    *          HEADER_LENGTH                 = 0
    *          READ_BY_LINE                  = 'X'
    *          DAT_MODE                      = ' '
    *          CODEPAGE                      = ' '
    *          IGNORE_CERR                   = ABAP_TRUE
    *          REPLACEMENT                   = '#'
    *          CHECK_BOM                     = ' '
    *          VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
    *          NO_AUTH_CHECK                 = ' '
    *        IMPORTING
    *          FILELENGTH                    = FILELENGTH
    *          HEADER                        = HEADER
             TABLES
               DATA_TAB                      = ITAB
            EXCEPTIONS
              FILE_OPEN_ERROR               = 1
              FILE_READ_ERROR               = 2
              NO_BATCH                      = 3
              GUI_REFUSE_FILETRANSFER       = 4
              INVALID_TYPE                  = 5
              NO_AUTHORITY                  = 6
              UNKNOWN_ERROR                 = 7
              BAD_DATA_FORMAT               = 8
              HEADER_NOT_ALLOWED            = 9
              SEPARATOR_NOT_ALLOWED         = 10
              HEADER_TOO_LONG               = 11
              UNKNOWN_DP_ERROR              = 12
              ACCESS_DENIED                 = 13
              DP_OUT_OF_MEMORY              = 14
              DISK_FULL                     = 15
              DP_TIMEOUT                    = 16
              OTHERS                        = 17
           IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.
           LOOP AT ITAB.
             WRITE :/ ITAB-F1, ITAB-F2,ITAB-F3.
           ENDLOOP.
    my input file i created with TAB seperated text file,
    here is the input file
    LINE1     1000     123.25
    LINE2     2000     234.25
    LINE3     3000     345.25
    LINE1     1000     123.25
    LINE2     2000     234.25
    LINE3     3000     345.25
    Regards
    Srikanth
    Message was edited by: Srikanth Kidambi

  • Hi small doubt on network app?

    Hi we have developed an app in java which works on LAN. But according to new requirement we need to run that app on LAN which is established via WIFI. I mean all the systems connect to LAN using WIFI. So is there anything special that we have to do to make the app run on the WIFI LAN?

    I am not sure but i think the network protocol(collision detection etc) will be implemented by OS By the TCP/IP networking stack, inside the OS.
    and then then the tcp/ip is implemented by sockets. Am i right?Not so much right as meaningless. A socket is an endpoint of a TCP connection, or a UDP endpoint.
    as far as i know networking is a concept. if it has to be established there should be a protocol well implemented. One such protocol is WIFI which makes the systems to establish LAN. Please correct me if i am wrong.I don't really np know what all this is supposed to mean or how it affects your project, whatever that is. Perhaps you could ask a specific question?

  • Hi guies small doubt

    In Lo-Extaction, Why do u click Trasfer icon?

    To make the delivered version of datasource to activate version..

  • On Idoc small doubt

    In the Idoc we will transfer data between production servers Ok. suppose If I am transferring the  vendor master data,  between which system we will transfer ( I think one is SALES system and another one I don't know) 
    If I am transferring Customer master data between which system we will transfer plz tell me
    This one

    In real time usually master data is transfered through ALE technology with in the organization.
    I will explain one scenario.
    In my company Master data is stored in one server that is central system, company having branches all the countries, each country is maintaining their own server, and every one don't required all the customer / vendor details.
    with whom they are doing bussiness their addresses are maintained in their server, if they want to add any other customer details which is existing in central system then get the information in form of idoc.
    if any changes are there in customer details u can send idoc to all system who are using that customer from central system.
    i hope u understood.
    Reward points if useful
    Madhavi

Maybe you are looking for