Sending a string of text line by line to printer

good day!
im not sure if this is the correct forum to post my question.
im still confused with the printing routine in java.
im collecting data from an access table and print each record line by line to the printer.
i would really appreciate all the help that i can get. thank you in advance for any reply.
more power to java!
randy

This my help:
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.*;
public class PrintS extends JFrame implements Printable
     Vector      v  = new Vector();
     JList       jl = new JList(v);
     JButton     jb = new JButton("Print");
public PrintS()
     super();
     setBounds(1,1,500,350);     
     addWindowListener(new WindowAdapter()
    {     public void windowClosing(WindowEvent ev)
               dispose();     
               System.exit(0);
     for (int i=0; i < 30; i++) v.add(" Entry ....   "+i);     
     getContentPane().add("Center",jl);     
     getContentPane().add("South",jb);     
     jb.addActionListener(new ActionListener()
     {     public void actionPerformed( ActionEvent e )
               printIt(); 
     setVisible(true);
private void printIt()
     PrinterJob pj = PrinterJob.getPrinterJob();  
     PageFormat pf = pj.defaultPage();
     pj.setPrintable(this,pf);
     if (pj.printDialog())
          try
               pj.print();
          catch (Exception e){}    
public int print(Graphics g, PageFormat pf, int pi)
                                            throws PrinterException
     if (pi > 0)
          return Printable.NO_SUCH_PAGE;
     g.translate((int)pf.getImageableX(),(int)pf.getImageableY());
     g.setColor(Color.black);
     for (int j=0; j < v.size(); j++)
          g.drawString( (String)v.get(j),0,j*16+12);
     return(Printable.PAGE_EXISTS);
public static void main (String[] args)
     new PrintS();  
}       Noah

Similar Messages

  • Text Lines to print on Marketing Documents

    How do I get line Types of Text to print on the documents?  2005A, SP1

    Hi Kathy,
    The exact instructions for this are in SAP Note 918132 on how to add Text lines to your PLD layout.  It details 2004 instructions and then 2005 (its easier in 2005).  If you do not have access to the note then I can paste it to you in a reply?
    Regards,
    Adrian

  • My group box is causing problems when searching for a text line in a text file.

    I am developing a booking system, so for this I need to ensure that no two clients can book the same appointment slot. So, on testing my code which prevents double booking, the system doesn't seem to find the text line being searched for in the text file
    when it (purposefully) should.
    I have tried isolating the problem using breakpoints, and I've found that when the 'SearchLine' (referring to my code below) does not include the 'TimeComboBox.text' piece and instead this value is written into the code, the system is able to find the SearchLine
    without any problems. But, when assigning the group box's value to a variable and using this in the SearchLine instead, or without even using a loop and just doing a simple line by line search, the program can't find this line of text in the file.
    I'm lost for ideas. I have tried everything I can think of. Could anyone make any suggestions as for what is the problem with my group box? (I'll explain the code beneath it).
    'Setting the value of the SearchLine (which is a String)
    SearchLine = String.Concat(DateTimePicker1.Value.Date & " " & TimeComboBox.text)
    Dim FoundApp As Boolean
    Dim objReader As New System.IO.StreamReader(basicfilepath & "Text Files\Client Booked Appointment DatesTimes.txt")
    FoundApp = False
    'Reading the file's contents and checking for the SearchLine
    Do While (objReader.Peek() <> -1) or (FoundApp = True)
    If (TextLine = SearchLine) Then
    'Line contains SearchLine. Appointment already exists.
    FoundApp = True
    Else
    'Line doesn't contain SearchLine. Carry on searching.
    Msgbox("Line not found.")
    End if
    Loop
    Explanation
    When the line is searched for, the 'FoundApp' value must be set to 'True' when it is found. If it is not found, it remains false.
    To isolate the problem, I've displayed the SearchLine in a message box in the past to make sure that the correct line of text is being searched for.
    In basic terms, my program is searching for the exact line of text which exists in the text file, but for some reason it is not coming up as 'Found'. The error occurs when the group box's value is used. The text file which is being read is
    definitely correct. Please help, any suggestions would be appreciated.
    Thank you

    Hi
    It would appear that your snippet doesn't actually read the file at all.
    Here is my test which works fine.
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim SearchLine As String = "18:09:38 : XTaskSettings.Load PARAMS: begin"
    Dim FoundApp As Boolean = False
    Dim TextLine As String = Nothing
    Dim objReader As New IO.StreamReader(Application.StartupPath & "\Data\Report Q1.txt")
    FoundApp = False
    Do While (objReader.Peek() <> -1) Or (FoundApp = True)
    ' this was missing
    TextLine = objReader.ReadLine
    If (TextLine = SearchLine) Then
    'Line contains SearchLine. Appointment already exists.
    FoundApp = True
    MsgBox("Line found.")
    Else
    'Line doesn't contain SearchLine. Carry on searching.
    MsgBox("Line not found.")
    End If
    Loop
    End Sub
    End Class
    Regards Les, Livingston, Scotland

  • Script error: Operator expected text = pDataMember.text.line[pQuestionNum] Void

    Text

    correction on last post:
    the prop at line 3 should be #pDataMember, not #pDataMember2
    "alchemist" <[email protected]> wrote in message
    news:[email protected]...
    >A friendly hint: Don't post lengthy code - as a rule,
    noone will bother
    >checking it.
    >
    > try changing the first handler with the one below, and
    see how it goes
    > from there.
    >
    > on getPropertyDescriptionList me
    > myList = [:]
    > myList.addProp( #pDataMember2, [#comment: "Data Member",
    #format:#text,
    > #default: ""] )
    > myList.addProp( #pCorrectSound, [#comment: "Correct
    Sound",#format:
    > #string,#default: ""] )
    > myList.addProp( #pWrongSound, [#comment:"Wrong Sound" ,
    #format: #string,
    > #default:""] )
    > myList.addProp( #pEndGameFrame, [#comment: "End Game
    Frame",#format:
    > #marker,#default: #next] )
    > return myList
    > end
    >
    >
    > "Proddy2k" <[email protected]> wrote in
    message
    > news:[email protected]...
    >> Here is the full coding:
    >>
    >> property pDataMember -- question text
    >> property pQuestionNum -- current question
    >> property pPossiblePoints -- points to add to score
    >> property pScore -- current score
    >> property pCorrectAnswer -- which is current correct
    answer
    >> property pCorrectSound, pWrongSound -- sounds
    >> property pEndGameFrame -- frame to go to when game
    is over
    >>
    >> on getPropertyDescriptionList me
    >> list = [:]
    >>
    >> addProp list, #pDataMember,\
    >> [ #comment: "Data Member",\
    >> #format: #text,\
    >> #default: VOID]
    >>
    >> addProp list, #pCorrectSound,\
    >> [#comment: "Correct Sound",\
    >> #format: #string,\
    >> #default: ""]
    >> addProp list, #pWrongSound,\
    >> [#comment: "Wrong Sound",\
    >> #format: #string,\
    >> #default: ""]
    >>
    >> addProp list, #pEndGameFrame,\
    >> [#comment: "End Game Frame",\
    >> #format: #marker,\
    >> #default: #next]
    >> return list
    >> end
    >>
    >> on beginSprite me
    >> pQuestionNum = 1
    >> pScore = 0
    >> showScore(me)
    >> askQuestion(me)
    >> end
    >>
    >> on askQuestion me
    >> -- get the data
    >> text = pDataMember.text.line[pQuestionNum]
    >>
    >> -- reset all the button sprites
    >> sendAllSprites(#makeVisible)
    >>
    >> -- get the question, answers and correct answer
    number
    >> the itemDelimiter = ";"
    >> question = text.item[1]
    >> answers = text.item[2]
    >> pCorrectAnswer = value(text.item[3])
    >>
    >> -- display the question
    >> member("Question").text = question
    >>
    >> -- display the answers
    >> the itemDelimiter = ","
    >> repeat with i = 1 to 4
    >> member("Answer"&&i).text = answers.item
    >> end repeat
    >>
    >> -- start the potential points at 1000
    >> pPossiblePoints = 1000
    >> showPossiblePoints(me)
    >> end
    >>
    >> -- update the possible points dispaly
    >> on showPossiblePoints me
    >> if pPossiblePoints < 0 then pPossiblePoints = 0
    >> member("Possible Points").text =
    "Points:"&&pPossiblePoints
    >> end
    >>
    >> -- update the score display
    >> on showScore me
    >> member("Score").text = "Score:"&&pScore
    >> end
    >>
    >> -- see if an aswer is correct
    >> on clickAnswer me, n
    >> if n = pCorrectAnswer then
    >> if pCorrectSound <> "" then puppetSound
    pCorrectSound
    >> -- add to scrore
    >> pScore = pScore + pPossiblePoints
    >> showScore(me)
    >> -- move on to next question
    >> nextQuestion(me)
    >> return TRUE
    >> else
    >> if pWrongSound <> "" then puppetSound
    pWrongSound
    >> -- subtract from potential score
    >> pPossiblePoints = pPossiblePoints - 100
    >> showPossiblePoints(me)
    >> return FALSE
    >> end if
    >> end
    >>
    >> -- move on to next question
    >> on nextQuestion me
    >> pQuestionNum = pQuestionNum + 1
    >> if pQuestionNum > pDataMember.text.line.count
    then
    >> -- no more questions
    >> go to frame pEndGameFrame
    >> else
    >> askQuestion(me)
    >> end if
    >> end
    >>
    >> on exitFrame me
    >> -- subtract from potential score
    >> pPossiblePoints = pPossiblePoints - 1
    >> showPossiblePoints(me)
    >> go to the frame
    >> end
    >>
    >> -- take any key presses and send to the button
    sprites
    >> on keyDown me
    >> sendAllSprites(#keyHit,the key)
    >> end
    >>
    >> I think it is to do with the version of Director I
    have which is MX 2004.
    >> The
    >> coding was orginnally for Director 7. Any ideas?
    >>
    >
    >

  • I am set to send my top of the line HP pc in for repair

    i am set to send my top of the line HP pc in for repair . im very pleased with HP as useual . i bought my HP AMD FX(tm)-8150 Eight-Core Processor with 8 gig ram 1 gig video card and all the good stuff over 1 year ago . i had blue screen problems from the begining . and i suspected it was a hareware issue and HP service was thinkoing it was software . so i was stuck with a top of the line pc with problems that could not be solved . but i didnt quit on HP  i know they would help if i could just prove my solution was in fact hardware ., so months went buy and as hardware goes it can stay hiden for long and the problem got biger . so now i have the isues being adressed by way of FED EX and the HP factory . at zero cost to me ofcourse . the thing is that i buy HP pc BECAUSE OF THE QUALITY AND SERVICE . yes i can build my own pc for less cost . i have done it befor . but the extra cost for a HP qulity seviced pc is a diference of about $300.00 . insted of building my own with all the same parts i got now i could have built the same thing . but it would not be the same at all . no 24 hour on line service . no free shipping and repairs . no consant kowlage of the latest driver and products . at to top it of i also bought anougher 3 year exstended warenty service for $150.00 . so i got 4 years of service coming to me still that will garenteed me a great pc that sill works like a top of the line product should . garenteed . yeah we you got to understand a bit about building your own pc . it would have given me 10 companys to call for hahaha service , thats a joke . the 10 companys i wpould have had to buy a part from each one and not one company is going to garentee anything of anoughter product . so with HP it one call to one company that garentees you a service under understandable rules . so i just got maybe $75.00 of my warenty paid for just in free FED EX shiping both ways . so if you add it up and i have bough crudy pc parts befor and there is no help like HP to save me . so yeah i didnt get the best pc day one but what could we do till we could understand the problem . so i just think my day has come 5that all my money that i cant AFORD IS GOING TO GET ITS VALUE FROM HP . thats what i payed for and a home build pc is not what it adds up to realy be in the catolog . so i ant going quit till i see my HP pc back in 2 weeks and its going to work great or why would they fix it . it was just a isues we had wether it was software (windows) or hard ware . they could not fix a hard ware problem so i was screewed if i didnt quit thinking HP  and me had toi get a solution and it can at last . i dont know how i new it was hardware . i built many pc befor just with junk parts and it was the same kinda thing is all i can tell ya . blue screen for all my exsperence has always been a hardware isues so i got the facts now my 1 gig  video card is now showing the hardware problem so im glad i was right . im like being a dumb fool believeing in trust and honor and they had a righouse point that if windows was doing it they couldnt be held responcable and i would have been stuck . but i got my service and quality i payed for thats all i got to say . so i tell you i do laughf at people with priter problem i must  say that my exsperence with printers is to just buy a new one every time it brecks i would not call HP for a printer glich . printers are crap that only last so long so . i buy a new one about once a year but its because they are so cheep that it would cost more  in postage then the thing is worth fixing . but i dont kid around about my $1,397.00 HP pc thats not crap at all and it worth every penny . and i know HP ant dummys if they got a error in the pc deartment there going to fix it or they are going to sell anything to make there launch money . thats what i think any way . so my faith is in the repair department for now and my pc never did couse much if a big problem . i been useing it everyday . it would just shut down on me every so often . but it did bug me to spend that much money i dont have for a glich in a pc i love . so i just say . boy i hope they fix it good and not just the video card error but the root of the whole problem . so it will all go away . i hope i do . thank you HP  and thank to all that suport a fine quality product and service that HP provides . im gonna go play my facebook game now . bye bye .

    There are quite a lot of possible things that are going on. Can you let us know
    1. What system you have (e.g. Windows 7, Mac OS Mavericks)?
    2. What version of Acrobat or Adobe Reader you have?
    3. WHO gets the message about a password (you or the receiver, or both)?
    4. What is the full text of the message, if you get it?
    5. If the receiver gets it, what security do you set on the file?

  • Issue with splitting string into multiple lines

    Hi Experts,
    I have a long string s. I want to split this string into several lines each having 72 characters. For this I have done following programming:
         String s = "For the first time it includes a supplementary report attempting to determine if extreme weather
    events can be linked to human-induced climate change. The research team, including members
    of the UK Met Office, identified recent episodes of extreme weather then used a computer to
    estimate the likelihood of the episode happening in a world without increased CO2." ;
         s = s.replaceAll("[\r\n]+", " ");
         char[] sAr = s.toCharArray();
         AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
         int start = 0; // start with
         int i = 72 ;
    //     for (int i = 71; i < sAr.length; i++) {
    while (i < sAr.length) {
    //     {     if (sAr[i] == ' ')
                   Bapitrtext Recepits7 = new Bapitrtext();
                   Recepits7.setTextid("TEXT");
                   Recepits7.setTextline(s.substring(start, i).replaceAll("[\r\n]+", ""));
                   RecepitsList7.add(Recepits7);
                   start = i+1;
                   i += 72;
         input.setText(RecepitsList7);
    The output of program is as below:
    For the first time it includes a supplementary report attempting to dete
    mine if extreme weather events can be linked to human-induced climate
    hange. The research team, including members of the UK Met Office, iden
    ified recent episodes of extreme weather then used a computer to estim
    te the likelihood of the episode happening in a world without increased
    Here as we can see last characters are getting deleted by program. For example in first line
    determine 'r' is missing in extreme right.
    In 3rd line c is missing in extreme left (word change is needed. Program
    prints hange.
    Also in 3rd line extreme right 't' is missing
    Also in 4th line extreme right 'a' is missing
    Also the last line is not being printed. In last line "CO2." " should appear.
    There are two issues:
    1. Why last word of each sentence is not being printed?
    2. Why last sentence is not being printed?
    I am struggling since last 2 days. Please help. I made all changes like replacing 72 by 71 etc.
    By making such changes, I am able to print first line correctly. However under all cases
    last character of 2nd line onward is not getting displayed.
    Also last line is not getting displayed. I did every thing like using while instead of for loop etc.
    Kindly help.
    Regards,
    Gary
    Edited by: 945655 on Jul 10, 2012 11:39 PM

    String s = wdContext.currentContextElement().getExpense_Text();
         s = s.replaceAll("[\r\n]+", " ");
         char[] sAr = s.toCharArray();
         AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
         int start = 0; // start with
         int i = 72;
    while (i < sAr.length) {
                   Bapitrtext Recepits7 = new Bapitrtext();
                   Recepits7.setTextid("TEXT");
                   System.out.println(s.substring(start, i));
                   RecepitsList7.add(Recepits7);
                   start = i+1;
                   i += 72;
         input.setText(RecepitsList7);
    Edited by: 945655 on Jul 11, 2012 2:25 AM

  • Compare two string in different line in textarea

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
                        public TextCounterPanel() {
                        setBackground(Color.DARK_GRAY);
                        textInput = new JTextArea();
                        textInput.setBackground(Color.WHITE);
                        JPanel south = new JPanel();
                        south.setBackground(Color.DARK_GRAY);
                        south.setLayout( new GridLayout(4,1,2,2) );
                             JButton countButton = new JButton("Process the Text");
                             countButton.addActionListener( new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       processInput();
                             south.add(countButton);
                        lineCountLabel = new JLabel(" Number of lines:");
                        lineCountLabel.setBackground(Color.WHITE);
                        lineCountLabel.setForeground(Color.BLUE);
                        lineCountLabel.setOpaque(true);
                        south.add(lineCountLabel);
                        setLayout( new BorderLayout(2,2) );
                        setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
                        JScrollPane scroller = new JScrollPane( textInput );
                        add(scroller, BorderLayout.CENTER);
                        add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel
    How can I compare two string in different line in text area

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
    public TextCounterPanel() {
    setBackground(Color.DARK_GRAY);
    textInput = new JTextArea();
    textInput.setBackground(Color.WHITE);
    JPanel south = new JPanel();
    south.setBackground(Color.DARK_GRAY);
    south.setLayout( new GridLayout(4,1,2,2) );
    JButton countButton = new JButton("Process the Text");
    countButton.addActionListener( new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    processInput();
    south.add(countButton);
    lineCountLabel = new JLabel(" Number of lines:");
    lineCountLabel.setBackground(Color.WHITE);
    lineCountLabel.setForeground(Color.BLUE);
    lineCountLabel.setOpaque(true);
    south.add(lineCountLabel);
    setLayout( new BorderLayout(2,2) );
    setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
    JScrollPane scroller = new JScrollPane( textInput );
    add(scroller, BorderLayout.CENTER);
    add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel

  • Slitting text in lines when printing

    I'm trying to send a string to the printer that is multiple lines. When printing on the paper the new line is ignored. How can I split my strings so that it will print on multiple lines? Thanks

    You can split String with the split method. This method requires a parameter. For example if you wanna split the String every time you reach a space, use this as: string.split("[  ]");
    if you wanna split it on ,'s, use string.split("[,]");
    if you wanna use both, use string.split("[ ,]");
    and so forth
    Don't know if you ment this, your question wasn't really clear

  • User defined function for getting last string in the line

    Hi Experts,
    I am not java expert, can anyone give me user defined function for getting last string in the line.
    for example if the source field is "NEW ARBOUR SQUARE"  i want to pass to target field only last string that is "SQUARE"
    please help me out of this.
    Kind Regards.
    Praveen.

    You don't even need a UDF for this. In the graphical editor look for the standard functions and once you do a scroll over on 'text functions; you will find what you are looking for.
    Just a piece of advice, try keeping UDF's to minimum unless really required or it is complicated without it.
    regards

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • Update info type 1002 (Description) unlimited text lines

    Hi Experts,
    I am trying to create description for infotype 1002 (HRT1002 table) for unlimited text lines using a BDC process. Is there any function module or bapi that I can use?
    Please help me out.
    Thank you.
    Best Regards,
    Felipe Alvarez
    Points will be rewarded.

    Hi
    I have a code that does create descriptions for Infotype 1002. You can modify it for your subtypes. I had used it for subtype 0120,0004.
    Just mention ur email address and I will send u the code.
    regards
    Waz

  • Text lines in the BW query variables screen

    Hi gurus.
    The bw users ask me to display some text lines in the BW query variables prompt.
    The text lines are saved in a custom table.
    The only idea that I've got is to use customer exit text variables and fill them in CMOD when I_step = 1.
    I don't like this solution (I should have more the 10 text lines and so I have to mantain more than 10 Text variables) but I can't find any other solution.
    Any new idea or solution?
    Is there in Bex enviroment a functionality (that I don't know) for doing somenthing like this ?
    Thanks fo any help.
    S.

    Hi,
    to resolve it you should create all the prompts in the BW query. You are using a query with 2 parameters and then a dynamic list of values. the dynamic list of values can only work after you entered the other values.
    Ingo

  • Cannot send email. When I click Write the window does not open properly. Does not have the "send, spelling, attach security save" line.

    Cannot send email. When I click Write the window does not open properly. Does not have the "send, spelling, attach, security, save line there. Then when I click File, then Send now it will not send. A message comes up saying my SMTP server failed. Have check and everything appears to be o.k.

    Hi Stephen,
    What version of MS Office are you using?
    Are you facing the issue similar to that mentioned here: Acrobat/Reader: Attach to Email button not working for PDFs referenced from long URLs
    Open Acrobat. Use the click-path Edit - Preferences - select the Category "Email Accounts". In the dialog there is the "Add Account" drop-down. Select "Add Other". The "Add Webmail Account" dialog presents. You'll fill out the dialog's fields with Outlook.com settings. (don't forget the "Advance Settings" button)
    From a look-see on the web it appears that the following are the needed settings. BUT, you'll be wanting to validate.
    The Outlook.com SMTP server settings for sending outgoing messages from an email program on desktop, cell phone or mobile device are:
    • Outlook.com SMTP server address: smtp.live.com
    • Outlook.com SMTP user name: Your full Outlook.com email address (not an alias)
    • Outlook.com SMTP password': Your Outlook.com password
    • Outlook.com SMTP port: 587
    • Outlook.com SMTP TLS/SSL encryption required: yes
    For incoming messages from an Outlook.com account to an email program using POP, use the Windows Live Hotmail POP3 server settings.
    The Outlook.com POP server settings for downloading new incoming messages to email program, cell phone or mobile device are:
    • Outlook.com POP server address: pop3.live.com
    • Outlook.com POP user name: Your full Outlook.com email address (not an alias)
    • Outlook.com POP password: Your Outlook.com password
    • Outlook.com POP port: 995
    • Outlook.com POP TLS/SSL encryption required: yes
    Regards,
    Rave

  • Sales Order Text Lines in SAP Query

    I have a requirement to output several text lines into a SAP query based around sales orders.
    I have included some code to read the details into my query and get no syntax errors, however the report gives a blank output for each of the text fields included, despite there definitely being some text with the specified attribute ID and text object in the table STXL.
    Where am I going wrong?
    Please find the coding below for one of the text field I'm trying to extract:
    TABLES:STXL.
    DATA:
        VBELN LIKE VBAP-VBELN,
        POSNR LIKE VBAP-POSNR,
        TDNAME LIKE STXL-TDNAME,
        MYLINE LIKE TLINE-TDLINE,
        ZE18_LINE(1200) TYPE C.
    DATA:BEGIN OF LINES OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF LINES.
    DATA:BEGIN OF MYHEADER.
            INCLUDE STRUCTURE THEAD.
    DATA:END OF MYHEADER.
    CLEAR TDNAME.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-VBELN
    IMPORTING
      OUTPUT = VBELN.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-POSNR
    IMPORTING
      OUTPUT = POSNR.
      CONCATENATE VBELN POSNR INTO TDNAME.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
            ID = 'ZAT2'
            LANGUAGE = SY-LANGU
            NAME = TDNAME
            OBJECT = 'VBBP'
         IMPORTING
            HEADER = MYHEADER
         TABLES
            LINES  = LINES
    EXCEPTIONS
            ID = 1
            LANGUAGE = 2
            NAME = 3
            NOT FOUND = 4
            OBJECT= 5
            REFERENCE_CHECK = 6
            WRONG_ACCESS_TO_ARCHIVE = 7
            OTHERS = 8.
    IF SY-SUBRC = 0.
      LOOP AT LINES.
        MOVE LINES-TDLINE TO TEXT.
        ENDLOOP.
    ENDIF.

    Hi -
    Please check in debuging.
    check the value of TDNAME correctly populated with sales order no and sales order item.
    You can cross check with the table STXH with TDNAME and see if any entries is available for TDID 'ZAT2' as your case.
    Here are sample code.
    DATA :    lv_tdname TYPE tdobname,
                     lw_line TYPE tline,
                    li_line TYPE STANDARD TABLE OF tline.
    CLEAR : lv_tdname , li_line[],
    cocatenate w_vbak-vbeln w_vbap-posnr into lv_tdname.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = 'ZAT2'
        language                = 'E'
        name                    = lv_tdname
        object                  = 'VBBP'
      TABLES
        lines                   = li_line
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
    IF sy-subrc = 0.
      CLEAR lw_line.
      loop at li_line INTO lw_line .
    * Put your logic
      endloop.
    ENDIF.

  • How to put text line just for a moment ?

    Hi,
    Do you know how to put a text line  just  for one photo? I mean I have more photos  in one portfolio but i need the text line to be seen just for one photo for the others no.
    Thank you in advance.

    You can use composition for this , where you can insert text frame for that specific photo where you want to add some description and for rest dont use text frame.
    Thanks,
    Sanjit

Maybe you are looking for

  • Email alert tone doesn't work

    I have my iPhone set to "chime" to be alerted when a new email comes in but it's not working? Any idea's/suggestions? Thank you.

  • Jdbc paging for ms sql server 2000

    I want to do paging in jdbc.As ms sql server 2000 does not support limit clause, so it is difficult for me to do paging.please guide me.

  • WLC Wired and Wireless Guests

    I am using WCS 6.0.132.0 and WLC 6.0.188.0.  I am creating guest ID's using the LobbyAmbassador interface, and I would like to allow guest users to use the same ID password either wired or wireless.  I cannot see any way to accomplish this, am I miss

  • Workflow Short Dump

    Hi i am working on workflow to send mails based on some conditions. I am receiving Runtime Error i.e. "DBIF_RSQL_SQL_ERROR" and exeception is "CX_SY_OPEN_SQL_DB". kindly let me know wat can be done in thsi regard.

  • Slow homesharing on OSX 10.8.4?

    Just picked up a new macbook air w/ OSX 10.8.4. Access to homeshared itunes library stored on another (older) macbook air (running 10.6.8) is either very slow or not at all. I could access the same library just fine with a recently deceased 10.8.3 ai