Integrate html tags in a string and display it in a multiline text area

Hi ABAPers!!
First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.
I'm working on an ALV OO, the program consists on creating an ALV using OO, In my selection screen there's a parameter of type ddobjname I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM: 'DDIF_FIELDINFO_GET' then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar, the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table(MySQL) in the generated script are only the selected ones by cheking the checkbox in the ALV.
I store my script in a string.
My problem is that I want to show my script in a text area, but I don't know how to create a multiline text area!!
And I want to use HTML tags in my string.
I don't want to my string like this :
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
But I want it to be shown like  this:
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
FLTIME INT ( 10 ) ,
DEPTIME DATETIME ( 6 ) ,
DISTANCE DOUBLE ( 9 ) ,
FLTYPE VARCHAR ( 1 ));
Thanks in advance
Regards
SMAALI Achraf
Edited by: SMAALI90 on May 11, 2011 7:12 PM

Hi again!!
You know what!! let's forget the HTML and focuse on what I want to show.
As I told you, I've a string which contains my script.
I don't want that it will be shown as a simple line like this :
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
But I want it to be shown as follows:
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
FLTIME INT ( 10 ) ,
DEPTIME DATETIME ( 6 ) ,
DISTANCE DOUBLE ( 9 ) ,
FLTYPE VARCHAR ( 1 ));
and finally I want to show it in a multiline text area.
Plz what shud I do?!!! If possible I need a piece of code.
PS : I create a HTML Viewer using this code :
DATA : go_conteneur          TYPE REF TO cl_gui_docking_container,
             go_controle_html    TYPE REF TO cl_gui_html_viewer.                 
  CREATE OBJECT go_conteneur                     
    EXPORTING                                    
      repid     = sy-repid                       
      dynnr     = '0100'                         
      side      = go_conteneur->dock_at_bottom   
      extension = 1000                           
      name      = 'CONTENEUR'                    
    EXCEPTIONS                                   
      OTHERS    = 1.                             
  CREATE OBJECT go_controle_html                 
    EXPORTING                                    
      parent = go_conteneur                      
    EXCEPTIONS                                   
      OTHERS = 1.
But when it's shown my ALV disappears!!!

Similar Messages

  • HTML tag in Coldfusion string not appearing

    Hey guys I'm wondering what I'm doing wrong when trying to
    store an html tag in a string. Basically I'm dynamically creating a
    list for use in a javascript menu, so when building the menu, I do
    this:
    menu = "< ul id = """ & mainID & """
    ><br>";
    to generate a list (of course thats only part of the list
    code). This line produces < ul id = "mainID" >
    What I need is for the spaces to be removed, so it would
    produce <ul id="mainID">
    But in my Coldfusion function, if I write:
    menu = "<ul id=""" & mainID & """><br>";
    nothing shows up! A space between < and ul works fine, but
    once I delete them, nothing! Any help would be really appreciated,
    thanks.

    actually found the answer elsewhere, I declared a variable
    open = &lt; now instead of using the <, i just write open,
    which generates the list fine.
    but a followup, the list is being generated now, but on the
    page instead of the javascript/css menu catching it and formatting
    it, it just displays the whole list, tags and all. I tried
    htmlEditFormat( ), that only changed all the symbols to their I
    guess ASCI couterparts. Any ideas why its showing the list as text
    rather than creating a menu??
    also I tried it without the menu, which should have shown a
    bulleted list, but that didn't work either...

  • How to remove HTML tags from a String ?

    Hello,
    How can I remove all HTML Tags from a String ?
    Would you please to give me a simple example ?
    Best regards,
    Eric

    Here's some code I cooked up. I have created an object that processes code so that it can be incorporated directly into a project. There is some redundancy so that the it can be used in more than one way. Depending on your situation you might have to make the condition statement a little more sophisticated to catch stray ">" tags.
    I have also included a Tester application.
    //This removes Html tags from a String either by submitting the String during construction and then
    // calling getProcessedString() or
    // by simply calling " stringwithoutTags=removeHtmlTags(stringWithTagsSubmission); "
    //Note: This code assumes that all"<" tags are accompanied by a ">" tag in the proper order.
    public class HtmlTagRemover
         private String stringSubmission,processedString,stringBeingProcessed;
         private int indexOfTagStart,indexOfTagEnd;
         public HtmlTagRemover()
         public HtmlTagRemover(String s)
              removeHtmlTags(s);          
         public String removeHtmlTags(String s)
              stringSubmission=s;
              stringBeingProcessed=stringSubmission;
              removeNextTag();
              return processedString;
         private void removeNextTag()
              checkForNextTag();
              while((!(indexOfTagStart==-1||indexOfTagEnd==-1))&<indexOfTagEnd)
                   removeTag();
                   checkForNextTag();
              processedString=stringBeingProcessed;
         private void checkForNextTag()
              indexOfTagStart=stringBeingProcessed.indexOf("<");
              indexOfTagEnd=stringBeingProcessed.indexOf(">");
         private void removeTag()
              StringBuffer sb=new StringBuffer("");
              sb.append(stringBeingProcessed);
              sb.delete(indexOfTagStart,indexOfTagEnd+1);
              stringBeingProcessed=sb.toString();
         public String getProcessedString()
              return processedString;
         public String getLastStringSubmission()
              return stringSubmission;
    public class HtmlRemovalTester
         static void main(String[] args)
              String output;
              HtmlTagRemover h=new HtmlTagRemover();
              output="The processed String: "+h.removeHtmlTags("<Html tag>This is a test<another Html tag> string<yet another Html tag>.");
              output=output+"\n"+" The original string:"+h.getLastStringSubmission();
              System.out.print(output);

  • Stripping HTML Tags from a String

    What's the best way to remove html tags from a string (i.e. user input)?

    Can you give an example? You can do substring, if your passing spaces between pages you can do a trim to the variable. Also look at the indexOf(). Look at methods relating to java.lang.String.

  • HTML tags in Hidden Item not displaying correctly

    I have created a HTML Text Region which includes a Javascript function. The function references a Hidden Item also created and linked to the region. The Hidden item returns a text field from the database with concatenates multiple rows together into a single string with HTML tag -br- between each row.
    The tags are not been recognised as HTML tags and is displayed :-
    -br-Record 1-br-Record 2-br-Record 3-br-'
    I want the page to display :-
    Record 1
    Record 2
    Record 3
    Any ideas?
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley

    Hello,
    Check to make sure you don't have those items set to escape html.
    Past that are you sure your javascript is putting in the &lt;br /&gt; tags correctly? before you submit fire a alert that shows the value of the hidden item and make sure it's correct there.
    Carl

  • Remove HTML tags from a string

    I have a string that contains a couple of HTML or XHTML tag, for example
    lv_my_string = '<p style="something">Hello <strong>World</strong>!</p>'.
    For a special use case, I want to remove all HTML from that string and process only the plain text
    lv_my_new_string = 'Hello World!'.
    Is there any method, function module, XSLT or anything else for that already?

    Hi Daniel,
    I tried using the FM (SWA_STRING_REMOVE_SUBSTRING) but I guess it is expecting a particular pattern which is not so apparent in your case. Iu2019ve written a small piece of code which you can try using in a FM or a PERFORM and that should do the trick. Please let me know if you have any questions.
    PARAMETER: P_LINE(100).
    TYPES: BEGIN OF TY_LINE,
             LINE(100),
           END OF TY_LINE.
    DATA: T_LINE TYPE STANDARD TABLE OF TY_LINE,
          WA_LINE LIKE LINE OF T_LINE.
    DATA: W_LINE(100),
          W_LEN(100),
          W_COUNT TYPE I,
          W_FLAG,
          W_FLAG1,
          W_I TYPE I.
    W_COUNT = STRLEN( P_LINE ).
    DO W_COUNT TIMES.
      IF P_LINE+W_I(1) = '<'.
        W_FLAG = 1.
        W_I = W_I + 1.
        IF NOT WA_LINE-LINE IS INITIAL.
          APPEND WA_LINE-LINE TO T_LINE.
          CLEAR WA_LINE.
        ENDIF.
        CONTINUE.
      ELSEIF P_LINE+W_I(1) = '>'.
        W_FLAG = 0.
        W_I = W_I + 1.
        CONTINUE.
      ENDIF.
      IF W_FLAG = 1.
        W_I = W_I + 1.
        CONTINUE.
      ELSE.
        CONCATENATE WA_LINE-LINE P_LINE+W_I(1) INTO WA_LINE-LINE.
        W_I = W_I + 1.
      ENDIF.
    ENDDO.
    LOOP AT T_LINE INTO WA_LINE.
      CONCATENATE W_LINE WA_LINE-LINE INTO W_LINE SEPARATED BY SPACE.
    ENDLOOP.
    SHIFT W_LINE LEFT DELETING LEADING SPACE.
    WRITE: W_LINE.
    Input:
    <p style="something">Hello <strong>World</strong>!</p>
    Output:
    HELLO WORLD !
    Regards,
    Pritam

  • Masked HTML tags in substitution strings after upgrade to Apex 2.2

    Hello,<br>
    <br>
    in my application developed with htmldb 2.0 I had the following scenario which worked fine until upgrade to 2.2:<br>
    <br>
    Requirement: a multiline text should be displayed as entered on a html report page.<br>
    My solution:<br>
    - a onload page process of the form <br>
    select replace(description,chr(10),'&lt;br&gt;') into :P1_DESCRIPTION from mytable where id = :P1_ID;<br>
    - and a page template containing <br>
    ...<br>
    <td>&P1_DESCRIPTION.</td><br>
    ...<br>
    <br>
    This worked in HTML DB 2.0.<br>
    <br>
    My problem: After upgrade to Apex 2.2 the report doesn't display the carriage returns anymore. Instead of interpreted BR tags I get masked BR tags printed as text:<br><br>
    <br>this is the first line&lt;br&gt;this is the second line<br><br>
    It's quite obvious that the substitution mechanism changed in Apex 2.2. Any ideas how to change my app ?

    Take a look at this thread:
    Computed Region TItles being Escaped in Apex 2.2
    You may have to change the type of your P1_DESCRIPTION item.

  • Method to Format a string column containing HTML tags as simple string.

    Hello,
    I am working with formating a string column which holds Html tags.
    I want to remove these tags from the actual data which has to be shown on the BI Publisher report.
    Can you suggest how can we format this in the DataSet designer of BI publisher so that my data is recognised on the Layout designer.
    I have been trying to create an expression using the "Add Element by Expression" option to format this html tag data as normal string without the tags.
    Can you suggest if this is the correct method to do this.
    I found this below code being used in an existing DateSet but i am not able to recreate a similar formating on this kind of data column.
    <![CDATA' || '['|| TO_CLOB(SUCCESS_CRITERIA) || ']' || ']>
    Kindly suggest if you have any idea on the above mentioned issue.
    Thanks,
    Shweta

    And read this:
    Navigate yourself around pitfalls related to the Runtime.exec() method
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Getting file data and displaying it in a dynamic text box

    The purpose of this function is to load and display a
    specific menu for a restaurant (lunch, dinner, dessert, etc.)
    This script is located inside of a movie clip that has the
    text box and buttons.
    There are 4 buttons that have event listeners that go to a
    function that determines which button was pushed, and then sends a
    call to loadMenu with a string that has the filename.txt.
    In frame 1 of the movie clip, the variables used in the code
    are declared as such:
    var newMenuRequest:URLRequest = new URLRequest();
    var newMenuLoad:URLLoader = new URLLoader();
    var loadThisMenu:String = ""; //This is the variable the
    buttonclick function alters and sets as the string to send to the
    loadMenu.
    My error is 1195: attempted access of inaccessible method url
    with static type flash.net:URLRequest
    Any ideas?

    quote:
    Originally posted by:
    GWD
    newMenuRequest is an instance of a URLRequest.... and it
    doesn't have a url method.
    It has a url property.
    I would be inclined to create a new URLRequest each time. But
    perhaps that's not necessary.
    Try changing
    newMenuRequest.url(menuName);
    to:
    newMenuRequest.url=menuName;
    see if that works.
    Yeah I realize it's a little inefficient.
    THANK YOU SO MUCH FOR THE SUGGESTION. works perfectly.

  • Add text item data and display the output in another text item

    Hi! All,
    I have four text item. like HA,DA,basic_salary and total_sal.I want to add the data entered in the text item in HA,DA,basic_salary and display in total_sal text item.How can I do this.Please help in this matter.
    Thanks,
    Abha

    1.Select the text item TOTAL_SAL
    2.Open property palette
    3.Under Calculation node
         Set calculation mode as Formula
         Set Formula as nvl(:ha,0)+nvl(:da,0)+nvl(:basic_salary,0)                                                                                                                                                                                                                                                                                                                                                                                               

  • Can an external html file be loaded into and displayed in Flash?

    I currently pull an html file into our site via iframe.  (due to various factors, I cannot host the information in the html on our site and need to host it elsewhere).  Is it possible to use a loader or other method to pull this information into flash?

    Thanks.  I didn't think so, but needed confirmation from someone much smarter than me.

  • View source shows not only HTML but also external JS and displays it in an unorganized format, how come?

    Whenever I use the view source feature, the pane does not only show the HTML, but it also pastes in all Javascripts which are in an external file. On top of that all the indents are gone making it pretty much unreadable.
    I have this issue with every single site I try to view the source of. I turned of and uninstalled all add-ons. Started up in safe mode. But nothing seems to work. I had this in firefox 3.6 and upgraded to 4 hoping it would solve it but it doesn't.

    If you have the problem in three different browsers, it suggests something "upstream" or shared at the system level, since each has a separate cache and Safari/Chrome use Webkit, not Gecko, as their rendering engine.
    Is it possible that all the source views use a font which has become corrupted? In Firefox you could test that theory by changing your Monospace font here:
    Edit > Preferences > Content > (Fonts & Colors section) Advanced button
    If that doesn't help, do you browse through a proxy server either on your Mac, your network, or out on the internet? Sometimes a security scanner has an embedded proxy server.

  • How to display an image in a Text Area

    Hi, I will like to display an image in a textarea that I created. Whereby, I will click on File>>Open>>then select an image from a file or folder. But when I select the image, all I see is a bunch of encrypted stuff. I will really appreciate it if someone out there could give me a hand. Thanks a lot in advance!!
    Cheers,
    Yinx

    Maybe if you use JEditorPane instead of TextArea, you
    could use HTML to embed the image that you open inside
    that pane.
    Quick question, how do I use HTML to embed the image in the pane? An example will be very helpful! Thanks a lot again in advance!!
    Cheers,
    Yinx

  • Pulling Data Containing HTML TAGS

    We have a DB application that allows users to freely enter data. Our problem is that if a users enters HTML tags as their data and submits it to our DB, we are able to encode the response and store the data in it's original context (a requirement).
    Now, here is the problem. When the data is pulled out from the DB and displayed on the HTML page, if the user had submitted HTML tags, our page doesn't display the HTML tags but rather their browser interprets the tag.
    We do not want the browser to interpret the tag, just want the actual characters displayed.
    so if a user enteres <B> HELLO WORLD</B>
    we want the less than and greater than signs to be displayed..not the phrase HELLO WORLD to be displayed in bold.
    Any help is appreicated.

    Darn,
    When you pull the string from the DB, you would be able to pass it through a simple 'filter' method that converts important HTML characters to the display element equivelents.
    For example, you would want to change all < tags to &lt; all & to &amp; and quotes to &quot; This might just about do everything you would need.
    It might be as easy as doing a few
    dbString = dbString.replaceAll("<", "&lt;");
    etc...

  • Html tags in pdf printing

    Hi ,
    I have a pl/sql region which I use to display a report .
    Now I want a Pdf output of this pl/sql region. For this I used the Bi publisher and was able to design the report query and report layout as required.
    However my problem is that some of the columns in my table have html tags (since the input for these column is through an text area with html editor) . When the PDF is generated the html tags are not converted.
    Please advice me on this.
    Thanks,
    Deepa
    Edited by: Deepa J on Sep 25, 2008 6:01 AM

    Hi Deepa.
    You wont get the HTML to be interpreted in the BI Publisher output I'm afraid.
    You'll need to wait for APEX 4.0 for that functionality.
    If you're seeing the HTML tags in your PDF and you use a Classic report region you can try selecting the "Strip HTML" option in the Layout and Pagination settings.
    Regards
    Simon Gadd

Maybe you are looking for

  • Can't Get SSL to Fully Work

    I have now tried two SSL certificates, one from RapidSSL and another one from QuickSSL.    Both are from Geotrust, and it appears both require an intermediate certificate. I have installed the intermediate certificate to both, by downloading and then

  • Can't get printer to connect to my samsung galaxy tab 10.1.

    Hp photosmart premium C410A  Windows 7    64- Bit  won't print. after installing app from the market it still wont print. wondering is there another app that I need for this to work? oh yes trying to connect with my samsung galaxy 10.1 tablet. any id

  • Strange System Shares appear on SOFS management page

    Hi, my SOFS cluster is working perfectly fine, but Strange Shares keep appearing on the Server management page for the file and storage > shares section, it grows all the time and more shares appear, I have deleted them and it hasn't caused any issue

  • Wrong number of unread messages N9

    One of POP3 accounts is misinformation about the number of unread messages. Where this information is stored and if we can change it. I have 0 messages in this box, but in accounts screen in Fenix i have 1 unread. Some days ago i try to delete one un

  • Error U43M1D204 with Premiere Pro

    I recieve this error when using the trial version of Creative Cloud, seems to only apply to Premiere.