HOW TO READ FILE AND HOW TO USE IT IN PATTERN EX. READ_TEXT

I WANT TO USE A PROGRAM'S CONTENT ND I WANT TO PASS AS PARAMETER IN A PATTERN..HOW TO DO THT.PLZZ REPLY...
EX. I HAV CREATED A STANDARD TEXT ZCREATE_TEXT AND I WANT TO SEND THIS AS A PARAMETER TO READ_TEXT...HOW TO DO THIS..

Hi,
When you create a Std Text in SO10 and save, it is saved with 4 parameters
like TEXT NAME, LANGUAGE, TEXT OBJECT, TEXT  ID. these are the four parameters by default will be created for any std text when you create a TEXT in SO10 or in any document.
You will know this 4 parameters from SO10 screen.
enter text, display.
from Menu -> GOTO -> HEADER, see them.
Next when you wants to fetch this text using READ_TEXT fun module
yopu have to pass this 4 parameters to that fun module.
see the doc
READ_TEXT
READ_TEXT provides a text for the application program in the specified work areas.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
Function call:
CALL FUNCTION 'READ_TEXT'
EXPORTING CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters:
CLIENT
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters ‘*’ or ‘,’.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
reward points
regards,
ANJI

Similar Messages

  • How to read file WITHOUT full path using TEXT_IO?

    We have a scenario like this:
    -- We have a Telco application.
    -- That has 3 types of installations. English and Spanish
    -- We have 2 App Servers (Eng & Spa) for the 2 installation types.
    -- But there is only ONE DB. I.e. users logging into Eng or Spa AS versions login to the same DB.
    -- We have to maintain 2 login forms because of Eng and Spa, because the menu labels have to come in 2 langs.
    -- I am trying to have one tree menu for this.
    -- To do this I did this.
    -- Put a text file in the Forms directory of the AS.
    -- The file has just one line. ENGLISH or SPANISH.
    -- I read this file and find out the language and then show labels according the language.
    Problem is that when I used TEXT_IO and gave file name like this filename:=GET_FILE_NAME('Avabill_AS_Language.txt', File_Filter=>'Text Files (*.txt)|*.txt|');
    I get a error saying file not found.
    I found out that with TEXT_IO you need FULL PATH of the file. Thing is path of the installation depends of installation to installation. I cannot create a parameter in the DB since the DB is COMMON. I HAVE TO use a text file in the AS directory.
    Is there any other way like reading the Default.env file or FormsWeb.cfg? Is there a parameter in any of these files which specifies the forms directory absolute path. I studied both file but could not find an entry.
    Any workaround would be greatly appreciated.

    Thanks BaiG for the quick response.
    U r right about that GET_FILE_NAME.
    I removed that and put the file name only and tried. Still get the same error.
    FUNCTION Avabill_Deployment_Type RETURN VARCHAR2 IS
    v_language VARCHAR2(100);
    in_file Text_IO.File_Type;
    BEGIN
    in_file := Text_IO.Fopen( *'Avabill_AS_Language.txt'* , 'r');
    Text_IO.Get_Line(in_file, v_language );
    Text_IO.Fclose(in_file);
    RETURN v_language;
    EXCEPTION
    WHEN OTHERS THEN
    Text_IO.Fclose(in_file);
    ALERT_MESSAGE(1,'FILE NOT FOUND: ' || SQLERRM);
    RETURN 'Normal';
    END;
    I get this error:
    *302000: non-ORACLE exception*
    As for you query:
    -- We have 2 app servers. One English and One Spanish.
    -- So we have 2 sets of forms. One English with English labels in the forms and the other with Spanish Labels.
    -- So we HAVE to have 2 menu forms as well, don't we? When the menu form is run how does it know whether the app server is English or Spanish.
    -- There is no way to find out. We cannot use a DB variable since BOTH use the same DB (at the same time). Eng users will enter in English while Spanish users will enter in Spanish.
    I don't see how we can have one menu form for this purpose. Can u elaborate your method further please?

  • How to read file and output base64 string?

    im having a hard time reading binary file and converting it to base64.
    is there a parameter in extendscript like file.read('base64') ??

    It is possible in HTML:
    var path = "/tmp/test"; 
    result = window.cep.fs.readFile(path, cep.encoding.Base64);
    if (0 == result.err) {
         //success
         var base64Data = result.data;
         var data = cep.encoding.convertion.b64_to_utf8(base64Data);
    else {
         ...// fail
    You can also refer to the following samples for more examples:
    https://github.com/Adobe-CEP/Samples/tree/master/Flickr
    https://github.com/Adobe-CEP/Samples/tree/master/Collage

  • How do I change permissions for West Dig USB HD, how said "read only" and can't use it.

    I have a West Did Hard drive from my PC that want to use on my Macbook.  Looking at the permissions said "read only".  I tried to move files on the drive and could not when attached to my Macbook.  Where do I change these settings that will allow me to use this drive.  Thanks for any help.
    This is my first Mac so do not know much about the Mac process, moving slow and steady.
    Donco

    Was this drive in use with a windows machine previously?
    If yes then I would guess that it is formatted as NTFS, Mac's can not write to NTFS discs.
    If you have sufficient space on your Mac copy the disk contents to a folder on your desktop and reformat the drive for use with Mac and Windows, then put the files back.
    Post back with some answers and I'll try to guide you through this

  • Ejb exampples and i want to know where to store java files and how make jar file and how to run

    hi,
    I am Nidhin Benjamin.This is the first i am working in Weblogic81 and EJB also.please
    can you tell about whole procedure and from where i want to start and

    Hi Nidhin,
    You could start by reading the EJB docs at
    http://e-docs/wls/docs81/ejb/index.html and playing with the examples at
    C:\bea810\weblogic81\samples\server\examples\src\examples\ejb20
    - Nick
    "Nidhin Benjamin" <[email protected]> wrote in message
    news:3ff127ff$[email protected]..
    >
    hi,
    I am Nidhin Benjamin.This is the first i am working in Weblogic81 and EJBalso.please
    can you tell about whole procedure and from where i want to start and

  • When I open iPhoto 9.2.1 it says that my library needs to be upgraded but when I upgrade the library I am trying to open (33 GB worth of pictures from 2006) the new application says it cannot read the files and how to find them on the system to reimport?!

    When I open iPhoto 9.2.1 it says that my library needs to be upgraded but when I upgrade the library I am trying to open (33 GB worth of pictures from 2006) the new application says it cannot read the files and how to find them on the system to reimport?! and then I'd like to erase the original files since the space requirement is huge!!!! Why is upgrading software iPhoto such a pain. I've gotta get a presentation done and all I get for my money is roadblock!!!

    hello, it sounds like the library is damaged.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 

  • How to read the and Write the PDF file give me the solution

    Hi all,
    How to read the and Write the PDF file give me the solution
    My coding is
    import java.io.File;
    import com.asprise.util.pdf.PDFImageWriter;
    import com.asprise.util.pdf.PDFReader;
    import java.io.*;
    import java.io.FileOutputStream;
    public class example {
    // public example() {
         public static void main(String a[])
              try
              PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
                   reader.open(); // open the file.
                   int pages = reader.getNumberOfPages();
                   for(int i=0; i < pages; i++) {
                   String text = reader.extractTextFromPage(i);
                   System.out.println("Page " + i + ": " + text);
    // perform other operations on pages.
    PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
                   writer.open();
                   writer.addImage("C:\\sam.doc");
                   writer.close();
                   System.out.println("DONE.");
    reader.close();
              catch(Exception e){System.out.println("error:"+e);
              e.printStackTrace();
    I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
    Please give response immtly
    i am waiting for your reply.
    thanks,
    Suresh.G

    I have some question flow
    How library to use this code.
    I try runing but have not libary.
    Please send me it'library
    Thank you very much!

  • [Urgent] How to read files from different directories?

    I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
    ProjectDirectory
    |--MainDirectory
    |--MainProgram.java
    |--SupplementDirectory
    |--SupplementProgram.java
    |--Pictures
    |--Image.gif
    What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
    Thanks

    Run through the I/O tutorial here. It should get you up to speed on this sort of thing...

  • How do I file and manage documents?

    How do I file and manage documents?
    New to iPad, very impressed.
    I want to stop using a PC and run my small B&amp;B using the iPad and iPhone
    Thanks

    The iPad does not include a file management system in the way that a PC does. You may want to think twice about giving up your PC. The iPad is not meant to completely replace a PC.

  • What are LRPREV files, and how do I open them?

    I uploaded some pictures onto my laptop from my phone. They seem to have disappeared completely, as they are no longer on my phone, in any of my laptop folders (i've checked several times) or my laptop recycling bin. Having said that, many LRPREV files have appeared in a couple of my folders, which I had not seen before. Putting 2 and 2 together, it seems like the photos from the phone may have unintentionally been converted into this file type.
    My main problem is that I can't open them, so I can't see them to find out. What are LRPREV files and how can I open them? Otherwise, would I be able to convert them into a file type which I should be able to view?
    I would also be grateful if anyone had any suggestions of where my photos may have gone to.
    Thanks.

    I am no expert but have had LR since LR3. Did you import the photos into your LR catalog? It sounds like you have at least viewed the photos using LR or they would not show up in your LRPREV files. LRPREV files are those that have been at least looked at in LR because LR automatically makes previews (thumbnails) of photos you have actually added to a catalog or at least attempted to import. When you upload photos from your phone what folder do you send them to? Why are the original files no longer on your phone, do you automatically delete photos after you import them? You shouldn't do that until you at least confirm you can see them on your computer and have backed them up to at least a second, preferably offline, location. I would open your LR catalog and look for for a line in your navigation module indicating recent imports? I probably haven't helped you much.

  • I have a iPad2 you tell me how to view movies and games to use facebook

    I have a iPad2 you tell me how to view movies and games to use facebook.
    Thanks and best regards,
    Luigi Vitali

    Hi Luigi,
    well, your Question is not very concrete.
    you can watch Film with Itunes. You can rent or buy there Movies.
    You also can sync movies from your mac to the Ipad - just add them to the Mediathek and sync the Folder/File. Quick Time give you the Function - put these open Video File to Itunes. You also have the possibilty in imvoie. 
    With Facebook games, i cant help help you - i dont like Facebook, and i dont use this service. But when these games are Flash Games you arenot able to use them with you Ipad, because ipad have not Flash support.

  • My MacBook Pro came with Lion pre-installed so I can't re-download it from the app store. Is it possible to get the installESD.dmg file and how can I get it if I can't re-download Lion in Apple Store option?

    My MacBook Pro came with Lion pre-installed so I can't re-download it from the app store. Is it possible to get the installESD.dmg file and how can I get it if I can't re-download Lion in Apple Store option?

    FYI Mac OS X is not designed to be installed on additional Macs, unless you purchased it from the App Store, in which case you can make as many copies as you wish and install it on as many Macs as you own.
    From the Recovery Disk Assistant -
    Notes
    If the computer shipped with OS X Lion or Mountain Lion, the external recovery drive may only be used with the system that created it.
    If the system was upgraded to Lion or Mountain Lion purchased from the App Store, the external recovery drive can be used with other similarly-upgraded systems.

  • How to read each and every word from a string.

    Hi all,
       I have a string which is having many label numbers. if the string is lv_str, its value is like, 11111111111111##22222222222222##3333333333333.
    I need to move the values alone into internal table. each value should be updated as a single row into one internal table. How to read each and every word of the string and move to an internal table.
    the internal table should be like this.
    11111111111111
    22222222222222
    3333333333333
    Can any one give me a suggestion in this regard.
    POINTS PROMISED.
    Regards,
    Buvana

    Hi,
    If you know the format and length of the data
    Use split at '#' so that you will get the individual values.
    Thean append it to internal table.
    Reward iof helpful.

  • Help!!! Can Anybody tell me how to read bookmarks of MS word using ABAP?

    It took me around 3 days , but there is still no solutions...
    Can Anybody tell me how to read bookmarks of MS word using ABAP ?
    Many thanks.

    Dear Nick  ,
    Thanks for your attention!
    I have MS word installed in the R3 server , and I uploaded my word doc with some self-defined bookmarks into SAP R3 system.
    Now I want to read these bookmarks using ABAP in this R3 system...
    Is it clear enough?
    Looking forward to your solution ...
    Thanks again..
    Best Regards,
    Leon.

  • How do I edit and sign documents using adobe?

    How do I edit and sign documents using adobe?

    To edit a document you will need Acrobat Pro.

Maybe you are looking for

  • ITunes won't open, IPod won't eject

    My mother asked me to unplug her iPod when I got home from work today, so I came to the computer to do so, but iTunes wasn't open. Which was a little strange, because iTunes was open last night, and I always leave it on. She says she didn't do anythi

  • Overflow during the arithmetical operation (type P) in program SAPLBBP_FRA

    Hi All I am receieving the following error the moment I log onto the SRM system via the browser. Overflow during the arithmetical operation (type P) in program SAPLBBP_FRAMEWORK Please can you advise what could possibly the problem. Thanks in Advance

  • Why I cant use the MSN messenger in my mac?

    I just downloaded the newest version about MSN messenger 5.0. But I cant sign in my msn messenger. I try many times,but it always popup one window says:"Sign in to Microsoft Messenger failed because the service is not available or you ma not be conne

  • CCM 2.0 Catalogs with Images

    When trying to load a catalog using CCM 2.0 the system stops at the colum with the images at the first line.  Each of the pictures and or URLs are valid...any suggestions on what may be causing this??  Thanks Here is what the header in the colum for

  • BP # from Vendor #

    Hi I know from the BP # you can get the customer/  vendor account #  Is there a way to find out from Vendor/ Customer a/c, the assignment of BP # if the BP # is different from the Customer/ Vendor a/c ? Regards Siva