Reading text elements

Dear Friends;
I want to read text elements of a purchase request's lines. Is there a fm or method to read text elements of the relevant lines of a purchase requisition?
Thx in advance
Ali

Hi Please Look into the following sample code.
Like that you can use the READ_TEXT Function module for your case.
REPORT  ylsr_read_text_from_std_tcode.
DATA : w_id        TYPE thead-tdid,        " Text ID of text to be read
       w_name      TYPE thead-tdname,      " Name of text to be read
       w_object    TYPE thead-tdobject,    " Object of text to be read
       w_language  TYPE thead-tdspras.     " Language of text to be read
DATA: it_tline TYPE TABLE OF tline,
      st_tline TYPE tline.
w_id = 'F01'.
w_name = '450000004800010'.
w_object = 'EKPO'.
w_language = 'EN'.
CALL FUNCTION 'READ_TEXT'
  EXPORTING
    id                      = w_id
    language                = w_language
    name                    = w_name
    object                  = w_object
  TABLES
    lines                   = it_tline
  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.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
The required output will be avialable in the IT_tline table.
LOOP AT it_tline INTO st_tline.
  WRITE :/   st_tline-tdline.
ENDLOOP.
Message was edited by:
        Lakshmi Sekhar Reddy

Similar Messages

  • SAP Script - How to check a text element is empty in Script.

    Hello Friends,
                  I like to display a text element when it is not empty, otherwise I like to display some other text.
    I know how to read text element in Script, but 
    How to check a text element is empty in Script
    Thank you for your time.
    Senthil

    Hi Senthil,
    Inside text element, we print the variables.
    Variables actually gets printed in the form.
    if the variable contains value the variable gets printed on script. if not, then variable not gets printed.
    hope this helps.

  • Issue with if condition in smartform text elements

    Hi all.
    iam having a problem in smart forms
    itab has 3 fields
    id   matnr    werks
    1 a p1
    1 b p2
    1 c p3
    2 b l1
    2 c l2
    3 q u1
    3 l u2
    i neead output like in the smart form
    -id = 1-
    a p1
    b p2
    c p3
    -id = 2-
    b l1
    c l2
    -id = 3-
    q u1
    l u2
    I have aloop in main window
    itab into wa_itab.
    then i have program lines
    iam writing any perform statment insted iam write the code in here
    input paramters wa_itab-id
    output paramters id
    i declared id type zabc-id under global data in global definations
    CLEAR : ID.
    ON CHANGE OF WA_itab-ID.
    *BREAK point.
    ID = WA_ITab-iD.
    ENDON.
    after the program lines i have a text
    /: if &id& ne ' '.
    ---id = &id& ---
    /: endif
    &wa_itab-matnr&  &wa_itab-werks&
    now i see the output
    -id = 1-
    a p1
    -id=-  i don't need this (&id& has no value)
    b p2
    -id=-  i don't need this
    c p3
    -id = 2-
    b l1
    -id=-  i don't need this
    c l2
    -id = 3-
    q u1
    -id=-  i don't need this
    l u2
    I checked my code if two items have same id the id has no value and you can see the output also
    but for some reason its still goinng into the if condition
    And also is there away that i can debugg my text elements like in scripts. my break point doesn't take me to the text elements
    Thanks

    1. Move only the ID into one internal table say i_id,
    2. Now in your smartform,  create a table and loop at i_id into wa_id.
    3.Print your ID in a text, &wa_id-id&
    3. Now in main area  of the table Create a loop with the internal table you mentioned above with 3 elements, say, i_data into wa_data  give CONDITION as wa_data-id = wa_id-id.
    4. Print your other values &wa_data-matnr& &wa_data-werks&
    5. outside main area, clear the work areas.
    This should work fine as i use the same logic in one of my current developments!!!

  • Text element is not getting printed in the output

    Hi all,
    I'm trying to print address from table KNA1in address window through a text element.
    The corresponding code being :
    In Delivery Prg,
    Data : lv_kna1 type STANDARD TABLE OF kna1,
              lv_adr6 type STANDARD TABLE OF adr6.
    DATA : WA_ADR6 TYPE ADR6.
      SELECT SINGLE * FROM KNA1 WHERE KUNNR = VBPA-KUNNR.
      SELECT SINGLE * FROM ADR6 INTO WA_ADR6 where ADDRNUMBER = kna1-adrnr.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'DELIVERY_ADDRESS'
       WINDOW                         = 'DELIVADR'
    and calling the same text element 'DELIVERY_ADDRESS' as follows in the Script:
    /E           DELIVERY_ADDRESS
    /:           IF &LV_KNA1-TELF1& <> &SPACE&
    IL           Tel.: &LV_KNA1-TELF1&
    /:           ENDIF
    /:           IF &LV_KNA1-TELFX& <> &SPACE&
    IL           Fax : &LV_KNA1-TELFX&
    /:           ENDIF
    /:           IF &LV_ADR6-SMTP_ADDR& <> &SPACE&
    IL           E-mail : &LV_ADR6-SMTP_ADDR&
    /:           ENDIF
    But,this text element is not printing in the output.
    Any pointer on this would be of great help.
    Regards,
    Vamsee Priya.

    yes, it is.
    I'm trying to get the e-mail address from adr6 table with the corresponding address number  from table kna1.
    so I created two tables as below:
      Data : lv_kna1 type STANDARD TABLE OF kna1,
             lv_adr6 type STANDARD TABLE OF adr6.
    DATA : WA_ADR6 TYPE ADR6.
      SELECT SINGLE * FROM KNA1 WHERE KUNNR = VBPA-KUNNR.
      SELECT SINGLE * FROM ADR6 INTO WA_ADR6 where ADDRNUMBER = kna1-adrnr.
    now, I'm trying to fill e-mail adress from lv_adr6. but the problem is lv_adr6 is not getting filled.
    data is coming to work area wa_adr6.
    SAP is not allowing me to write the below statement:
    SELECT SINGLE * FROM ADR6 INTO LV_ADR6 where ADDRNUMBER = kna1-adrnr.
    Now, will any move-corresponding statement from work area to its table works?? Is that logically correct??

  • Text elements not centered anymore once project goes live

    Hi guys,
    I've discovered Edge Animate a few days ago and I really love that it looks and feels a lot like After Effects - you should exchange and implement some functions of EA to AE (i.e. the curves easing options) & vice versa though
    What I went through, until know
    First of all, I am a Worpdress user using a responsive theme and the Edge Suite plug in.
    I've created a typo animation using a custom licensed web font and it took me a while to get it to work properly - the web-kit generated by the myfonts.com kit builder didnt' work with EA, so I had to let fontsquirrel create one instead. Now, the SVG font file gets exported upon export, but the EOT, WOFF and TTF files don't - not sure if it's a bug, but it's an easy thing to copy the files via FTP to the "../uploads/edge_suite/project/..." folder in order to fix this.
    My Problem
    After uploading the animation to my server via the Edge Suite plug in, approx. 50% of the text elements are not in the right place anymore. The affected elements are all offset by a fixed amount of pixels vertically, while they actually should be centered. When I run the HTML file of the exported web animation locally, everything's fine though.
    The problem occurs in Chrome, Safari, Firefox and on the iPhone.
    Has anyone experienced a similar issue?
    Will

    It seems like it is related to Wordpress or the Edge Suite plug in.
    HTML
    I've uploaded the animation (using web publishing) to a folder on my server, and everything is fine.
    Wordpress
    I have analysed the code of the animation being rendered on my Wordpress site, but the CSS coordinates all correspond to the parameters inside EA.
    I've also installed the Edge Suite plug on a different Wordpress installation (a complete different site) of mine, and the results are even worse. It seems like the origin of some elements is being tossed around space.
    That said, I'm clueless.

  • How to call new window and text element without changing print program

    Hi Friends,
       I have requirement like this . i have a standard print prog and custom form. i want add 2 to 3 extra windows in the form and i have to print some data. but how can v do this with out changing the print program. i know that to pick new fields through subroutines. but how can v call new windows and new text elements with out changing the print program.
    usually in the print program we write as follows.
    write_form
    window = 'HEADER'
    textelemtn = 'HEADER'
    can we accomplish this one also through subroutines or any other way is there.
    can any one pls suggest this.
    Thanks in advance.
    Rahul

    u  copy the standard print program and make custom program.
    write your own codes in it.
    assign this program in the place of standard print program.
    Reward points, if helpful.

  • Reading text from server socket stream

    I have a basic cd input program i've been trying to figure out the following problem for a while now, the user enters the artist and title etc and then a DOM (XML) file is created in memory this is then sent to the server. The server then echos back the results which is later printed on a html page by reading the replys from the server line by line.
    The server must be run it listens for clients connecting the clients connect and send DOM documents through the following jsp code.
    <%@page import="java.io.*"%>
    <%@page import="java.net.*"%>
    <%@page import="javax.xml.parsers.*"%>
    <%@page import="org.w3c.dom.*"%>
    <%@page import="org.apache.xml.serialize.*"%>
    <%!
       public static final String serverHost = "cdserver";
       public static final int serverPort = 10151;
    %>
    <hr />
    <pre>
    <%
            Socket mySocket = null;          // socket object
            PrintWriter sockOut = null;      // to send data to the socket
            BufferedReader sockIn = null;    // to receive data from the socket
            try {
                //  #1 add line that creates a client socket
                mySocket = new Socket(serverHost, serverPort);
                // #2 add lines that create input and output streams
                //            attached to the socket you just created
                 sockOut = new PrintWriter(mySocket.getOutputStream(), true);
                 sockIn = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
            } catch (UnknownHostException e) {
                throw e; // This time the JSP can handle the exception, not us
            } catch (IOException e) {
                throw e; // This time the JSP can handle the exception, not us
    String cdTitle, cdArtist, track1Title, track1Time, track1Rating;
    // Retrieve the HTML form field values
    cdTitle = request.getParameter("cdtitle");
    cdArtist = request.getParameter("cdartist");
    track1Title = request.getParameter("track1title");
    track1Time = request.getParameter("track1time");
    track1Rating = request.getParameter("track1rating");
    // Create a new DOM factory, and from that a new DOM builder object
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    // Note that we are creating a new (empty) document
    Document document = builder.newDocument();
    // The root element of our document wil be <cd>
    // It gets stored as the child node of the whole document (it is the root)
    Element rootElement = document.createElement("cd");
    document.appendChild(rootElement);
    // Create an element for the CD title called <title>
    Element cdTitleElement = document.createElement("title");
    // Add a text code under the <title> element with the value that
    // the user entered into the title field of the web form (cdTitle)
    cdTitleElement.appendChild(document.createTextNode(cdTitle));
    // Place the <title> element underneath the <cd> element in the tree
    rootElement.appendChild(cdTitleElement);
    // Create an <artist> element with the form data, place underneath <cd>
    Element cdArtistElement = document.createElement("artist");
    cdArtistElement.appendChild(document.createTextNode(cdArtist));
    rootElement.appendChild(cdArtistElement);
    // Create a <tracklist> element and place it underneath <cd> in the tree
    // Note that it has no text node associated with it (it not a leaf node)
    Element trackListElement = document.createElement("tracklist");
    rootElement.appendChild(trackListElement);
    // In this example we only have one track, so it is not necessary to
    // use a loop (in fact it is quite silly)
    // But the code below is included to demonstrate how you could loop
    // through and add a set of different tracks one by one if you
    // needed to (although you would need to have the track data already
    // stored in an array or a java.util.Vector or similar
    int numTracks = 1;
    for (int i=0; i<numTracks; i++) {
      String trackNum = Integer.toString(i+1);
      Element trackElement = document.createElement("track");
      trackElement.setAttribute("id", trackNum);
      trackListElement.appendChild(trackElement);
      // Track title element called <title>, placed underneath <track>
      Element trackTitleElement = document.createElement("title");
      trackTitleElement.appendChild(document.createTextNode(track1Title));
      trackElement.appendChild(trackTitleElement);
      // Track time element called <time>, placed underneath <track>
      Element trackTimeElement = document.createElement("time");
      trackTimeElement.appendChild(document.createTextNode(track1Time));
      trackElement.appendChild(trackTimeElement);
      // Track rating element called <rating>, placed underneath <track>
      Element trackRatingElement = document.createElement("rating");
      trackRatingElement.appendChild(document.createTextNode(track1Rating));
      trackElement.appendChild(trackRatingElement);
    OutputFormat format = new OutputFormat();
    format.setIndenting(true);
    // Create a new XMLSerializer that will be used to write out the XML
    // This time we will serialize it to the socket
    // #3 change this line so that it serializes to the socket,
    // not to the "out" object
    XMLSerializer serializer = new XMLSerializer(writer, format);
    serializer.serialize(document);
            // Print out a message to indicate the end of the data, and
            // flush the stream so all the data gets sent now
            sockOut.println("<!--QUIT-->");
            sockOut.flush();
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String fromServer;
            String fromUser;
             #4 add a while loop that reads text from the
            server socket input stream, line by line, and prints
            it out to the web page, using out.println(...);
            Note that because the reply from the server will contain
            XML, you will need to call upon the toHTMLString() method
            defined below to escape the < and > symbols so that they
            will display correctly in the web browser.
            Also note that as you receive the reply back from the
            server, you should look out for the special <!--QUIT-->
            string that will indicate when there is no more data
            to receive.
            while ((fromServer = sockIn.readLine()) != null) {
            out.println(sockIn.readLine());
                // If the reply from the server said "QUIT", exit from the
                // while loop by using a break statement.
                if (fromServer.equals("QUIT")) {
                    out.println("Connection closed - good bye ...");
                // Print the text from the server out to the user's screen
                out.println("Reply from Server: " + fromServer);
                // Now read a line of text from the keyboard (typed by user)
                fromUser = stdIn.readLine();
                // If it wasn't null, print it out to the screen, and also
                // print a copy of it out to the socket
                if (fromUser != null) {
                    out.println("Client: " + fromUser);
                    sockOut.println(fromUser);
            // Close all the streams we have open, and then close the socket
            sockOut.close();
            sockIn.close();
            mySocket.close();
    %>
    I'm suppose to modify the commented sections labled with #.
    #1,2 are correct but i have doubts on the 3rd and 4th modification.
    for #3 i changed so i serializes to the socket not to the "out" object:
    from
    XMLSerializer serializer = new XMLSerializer(out, format);
    to
    XMLSerializer serializer = new XMLSerializer(writer, format);
    with "out" it prints out some of the results entered but it just hangs i'm thinking it might be the while loop that i added in #4. If i changed it to serialize the socket XMLSerializer serializer = new XMLSerializer(writer, format); it doesn't print out nothing at all; just a blank screen where it hangs.
    I can post the rest of the code (server thats in java and cdinput.html) but since i want to keep my post short and if required i'll post it later on i also omitted some of the code where it creates the DOM textnodes etc to keep my post short.

    On your previous thread, why did you say the server was using http POST and application/xml content type when it quite obviously isn't, but a direct socket communication that abuses XML comments for message end delimiters?
    The comments imply you need to wait for "<!--QUIT-->" on a line by itself, but your loop is waiting for "QUIT".
    Pete

  • How to translate text elements in forms from type : pdf

    does anybody know how to translate text elements
    in  pdf  from english to other languages.
    i tried the tran. se63 and filled in the desired language,
    but there was no effect on the output ,
    thanks,
    ami

    call this funcation. crate_text.
    CALL FUNCTION 'CREATE_TEXT'
             EXPORTING
               FID               =
               FLANGUAGE         =
               FNAME             =
               FOBJECT           =
             SAVE_DIRECT       = 'X'
             FFORMAT           = '*'
             TABLES
               FLINES            =
           EXCEPTIONS
             NO_INIT           = 1
             NO_SAVE           = 2
             OTHERS            = 3
           IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.

  • How to end text element in sap script

    how to end an text element in sap script
    this is the format.
    /E text element name
    &tablename-fieldname&
    text-text-text-text
    now if i do not end that text element it is not displayiny my below text , so what to do in this case

    Go through the links mentioned below.
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    http://www.sapmaterial.com/smartform_example.html
    Re: Hands on SAP Smart Forms
    smartforms
    Reward points if useful.

  • How to display the text as a Bold in the Text Element of a Smart Form

    Hi,
    I created one Smart Form.
    In that i created the Text element.
    I provide some data also in that.
    It is coming as a MS WORD.
    I executed my smart form.
    Customer Number:  &WA_KNA1-KUNNR&
    it display the data of the particular customer.
    But i need to display the Customer Number as BOLD or else Increase the Size.
    For this also I created one SMARTSTYLE.
    In that I created the Paragraph and Character Formats also.
    Now i assignee that SMARTSTYLE in the Output Option Tab of the Text Element also.
    But i unable to get the CUSTOMER NUMBER in Bold.
    In MS WORD we have BOLD button.
    I selected the Text and Press the BOLD button. At that time it is Highlighted.
    Whenever i press the SAVE Button.
    Then it is not saved with BOLD.
    It is coming in Normal Format.
    In the ECC 6.0.  I am unable to get the Text as a BOLD.
    This text Element is like a MS WORD.
    Can you please tell me how to display the Data with BOLD. please tell me. I am unable to get that one.
    Thank You.
    Regards,
    B. Krishna.

    Hi,
    Check where u have given BOLD. In character Format or in Paragraph format.
    In SMART FORM,
    1. Change to OLD EDITOR if u are confused with the new one.
            (This can be done by clicking the button left to new editor ).
    2. If it is PARAGRAPH FORMAT,
               Give the name of paragraph format in the editor.
                P1         &WA_KNA1-KUNNR&
        If it is CHARACTER FORMAT,
                             <C1> &WA_KNA1-KUNNR&
    Thanks,
    Nithya.

  • Addition of extra Space issue in site studio text element

    Hi,
    we have implemented WCM for our website. We are in webcenter PS3 version.
    At places where we have used text element for titles of various sections,
    if we append one extra space and save it, it displays as   in front end.
    When we remove the space, it does not clear. But if we cut and paste once the word once again it is perfect.
    Is there any solution to trim that space when it is displayed at front end. Please suggest.
    Regards,
    Bhaskar

    enclose your text element with strTrimWs.
    Removes spaces from the beginning and end of a string.

  • Issue with printing of multiple text elements in main window

    Hi experts,
    I have developed a sales order form in SAP script.
    I hv got two text elements in the main window. n i m calling these two text elements by using two write form functions in d print program.
    The first text element is gettin called n d relevant fields in dat particular text element is being displyed. (Window - Main)
    My problem is dat the second text element for the same main window is not gettin called n its relevant fields r not gettin displayed.
    Plz help me to solve the querry.
    Its urgent.
    Thanks n Regards,
    Purva

    Hi,
    Are you testing that from in same client where you developed, else make sure that after each change you need to transport the form to testing client.
    second thing is check with code did you mention the same text element in window editor and in the program.
    Reward if useful,
    Thanks,
    Sreeram.

  • Get (variable) file path and name in a text element

    How do you get the (variable) file path and name in a text element (label) in LCD? If you save the PDF and afterwards relocate it, it should update the values. Is that actually possible?

    Does anyone have any advice on this issue?
    Thanks in advance,
    Zack H.

  • How do I Hide the text printed from a standard Text Element in SAP Script?

    Hi,
    I have created one SAP Script which gets printed from IW33 using a standard print program.
    In config the standrad SAP script is replaced by the zsap script.
    Since the Zscript is printed from a Standard print program, I had to keep all the text elements used by the original(standard) SAP script.
    I only kept the text elemets and commented out the printing part.
    But still some values are printing. How do I hide these text element values?
    I want to delete whatever its printing from these text element. Icant delete the standard text elemetns , otherwise the standard print program will give error.

    Hi,
    I am not printing any text under these text element in my zscript.
    I had to include these standard text elemets as they are called from the standard print program using which my zscript is getting printed.
    for example:
    /E OPERATION
    Under operation i didnot print anything. Still some values which are passed in text element Operation by the print program is being printed in the form. i want to hide/delete these values.
    how do I do that?

  • Program text elements in German

    Hello,
    I copied a standard SAP program RFKQST80 to a "Z" program in order to make some enhancements. when I goto the text elements in SE38, the first thing that I get is a information box stating "untranslated texts from master language DE will also be displayed". I click okay and the "text symbols" and "selection texts" are displayed in german. i activated the program and now what i see is the text is displayed in english but when I try to change it, it is displayed in german. I need to modify some of the text. how do I get this to display in english. Is there something that I missed when I copied the original SAP program?
    thanks in advance

    hi
    good
    you have not copied it properly, that is the reson it is coming like this, try to copy it again it ll work fine, otherwise try to change the version and check wheather it is working or not.
    thanks
    mrutyun^

Maybe you are looking for

  • Can't Copy Files from Downloads to Time Capsule

    Hi all, this is my first post so please be gentle. I am experiencing a rather interesting problem with my Time Capsule. Currently it is accesed by 2 macs daily (an iMac and a Mac Pro) and we both access the files on the time capsule simultaneously (o

  • HP C309g scanning software for windows 8.1

    How do I scan from my HP C309g into my computer using Windows 8.1?

  • Error 1005 in Photos

    I am having trouble moving photos out of the new Photos app. I tried dragging an dropping, I tried dragging to PS Elements and then I tried exporting to a file on my desktop. Each time I get this message. It seems I cannot export ... any suggestions?

  • Proper function syntax

    I can not seem to find documentation explaining proper syntax for the Rank function. Can anyone help with locating syntax or even provide the syntax? Your assistance is greatly appreciated.

  • Installation Fails ( SILENT Install)

    I am using following syntax to install Oracle 10g using response file and silent option. /home/oracle/database/runInstaller -silent -responseFile=enterprise.rsp This fails with: Unexpected Signal : 11 occurred at PC=0xF7D807CE Function=(null) Library