How to detect apostrophe and add double quote on that?

Hi!
  I have a user name is CH'NG
  His name has an apostrophe ' over there.
  I use GUI_UPLOAD to read from a xml file and store inside a local variable,
  <b>lv_name = 'CH'NG'.</b>
  I encounter the problem of endless ending because of these 3 apostrophes.
  Therefore, I wish to write some code like, if i detect the lv_name contains any apostrophe, i will add another 2 apostrophes infront of the single quote (which i viewed from other threads, saying that putting a 2 apostrophe can solve the problem ), such as:
  IF lv_name CA apostrophe.
     lv_length = strlen( lv_name ).
     lv_len = sy-fdpos + 1.
     CONCATENATE lv_name+0(sy-fdpos) 2 apostrophe lv_name+ lv_len(lv_length) into lv_result.
  ENDIF.
so, my lv_result: CH'''NG
Kindly advise.
thanks a lot!
br,
hy

Huai,
Just copy this code and execute
report ZTEST11.
DATA :         V_len type i,
              v_num type i.
parameters : v_str(20)   .
start-of-selection.
    v_len =  strlen( v_str ).
    do .
       v_num = v_num + 1.
     if  v_len eq v_num.
        exit.
      else.
         if v_str+0(v_num) ca '*'.
              REPLACE '*' WITH space  INTO v_str.
               v_num = v_num - 1 .
               v_len = v_len - 1.
         endif.
     endif.
    enddo.
    condense v_str.
    write v_str.
don't forget to reward if useful

Similar Messages

  • Add double quotes (") surrounding each field in GUI_DOWNLOAD

    Experts,
    Does anyone know if it is possible to add double quotes (") to all fields in .txt file using FM GUI_DOWNLOAD besides manually concatenate the quotes into each field before calling the FM?
    For example, output need to be:
    "0000123" "NAME1" "   200.00"
    Any advice is greatly appreciated.
    Best regards,
    Minami

    If you are interested, here is a complete solution.
    report zrich_0001.
    data: it001 type table of t001.
    data: xt001 type t001.
    data: iflatf type table of string.
    data: xflatf type string.
    data: filename type string.
    data: field_value type string.
    field-symbols: <fs>.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-002 .
    parameters: p_file type localfile default
                'C:Test.txt'.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001.
      loop at it001 into xt001.
        do.
          assign component sy-index of structure xt001 to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          concatenate '"' <fs> '"' into field_value.
          if sy-index = 1.
            xflatf = field_value.
          else.
            concatenate xflatf field_value into xflatf separated by space.
          endif.
        enddo.
          append xflatf to iflatf.
      endloop.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_download
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf.
    Regard,
    Rich Heilman

  • I deleted all the music on my iPhone, but all the albums still exist. How do I clear and add a fresh batch of music?

    I deleted all the music on my iPhone, but all the album artwork still exist. How do I clear and add a fresh batch of music?  Also my iTunes no longer recognizes my iPhone under the "devices" tab so I am unable to manually sync. I have disconnected it makes a beep sound when reconnected so I know my computer is finding the phone, the iPhone also appears on Explorer. Stupid question but I can't figure it out and wasting too much time.  Thank you.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.  Use your backup copy of your computer to put everything on the new one.
    If for some reason you have failed to backup, big mistake, then you can transfer itunes purchases from the iphone to the computer:  File>Transfer Purchases
    You may be able to buy a 3rd party program to get any other music off of the iphone ( not supported by Apple).
    When you sync the iphone, it will erase the current content and replace with content form the new computer.
    "Not happy with itunes right now, more then a bit of a joke"
    Not itunes fault that you did not do the very basics and maintain a backup copy.

  • I have question about hooking up an external hdd to a time capsule and still have my printer hooked up as well. Anyone got any tips for me, how to do it and what brand of harddrive that will work best for me 1 or 2 TB

    i have question about hooking up an external hdd to a time capsule and still have my printer hooked up as well. Anyone got any tips for me, how to do it and what brand of harddrive that will work best for me 1 or 2 TB

    You just need a powered hub.. if you already use one then fine.
    Plug in just about any external hard disk will work fine. Format has to be readable by the TC.. ie fat32.. or much better HFS+.. plug it into a Mac to prepare the drive.
    Pick whatever size suits.. nowadays 2TB are most economical.
    WD, Seagate have goobled up all the minor players.. so pick one.
    Whatever suits your budget and asthetics.
    NOTE.. The USB on the TC is fine for printers.. IMHO it is the wrong way to go with USB disks.. use the internal disk of the TC.. USB is less than half the native speed plugged into a Mac.. TC to USB is slow.. far slower than internal drive.. or using external drive as external.

  • How do I edit and save a word document that has been e-mailed to my ipad

    How do I edit and save a word document that has been e-mailed to my ipad and then re-send

    Use the paid version (install and activate) of Microsoft Word.
    https://itunes.apple.com/sg/app/microsoft-word-for-ipad/id586447913?mt=8

  • How can I remove and replace a purchased app that is malfunctioning.

    How can I remove and replace a purchased app that is malfunctioning.?

    Delete the App and redownload it...
    Touch the app and hold your finger down until all the apps start to jiggle.
    You will see a circled "x" in the upper left corner.
    Tap it to delete an app. When done press the Home button.
    ( You cannot delete any pre-installed iOS app.)
    http://www.apple.com/support/ipad/applications/
    Download Past Purchases
    http://support.apple.com/kb/HT2519
    Log into iTunes using the account the Purchase was made with... Click on Buy... and a notice will come up saying you already have it... do you wish to download it again... Click Yes...

  • How can I read and write text in rings that are inside an array?

    Hello All!!!
    How can I read and write text in rings that are inside an array?
    Regards and thanks in advance.

    Use a Property Node linked to the Ring inside the array.
    Of course, all elements in the array will have the same text values.
    B-)
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:47 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:48 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:49 AM
    Attachments:
    Strings-BD.PNG ‏17 KB
    Strings-FP1.PNG ‏23 KB

  • How do I find and delete my iPhon backup that is on my computer?

    How do I find and delete my iPhon backup that is on my computer?

    Launch iTunes. From the iTunes menu bar click iTunes > Preferences then select Devices.
    You can delete backups from there.

  • How to detect keystroke and control a digital potentiometer?

    Dear All,
    I want to use PCI-1200 to control a Xicor X9C103P digital potentiometer.
    The procedure is as follows: If the computer detects any keystroke from
    either UP or DOWN arrow keys, it send a chain of digital signals to a
    digital potentionmeter to increase or decrease its resistance accordingly.
    Each keystroke control the potentiometer to change a fixed amount, say,
    around 500 Ohm. How to detect these keystrokes using LabVIEW and
    send to digital potentiometer through PCI-1200?

    If you are refering to the ability to capture user key strokes you will need to add a listener to the class. If is a matter of is it a charater or a number then look into isDigit. Or are you trying to capture Hot-Keys? Please specify and will see if we can help - Bart

  • How to create a group and add class instances to that group using VSAE

    how can i create a group in VSAE and add the objects to the group that too instances of a class.
    should i use the ID of the object or some other rule to add members to that group
    Thanks & Regards, Suresh Gaddam

    Hi,
    The below links should be helpful for you to create group in VSAE:
    Computer and Instance Group Fragments in VSAE
    http://blog.scomskills.com/create-a-computer-or-instance-group/
    Create a Group of Health Service Watcher Objects Using VSAE
    http://blog.scomskills.com/create-a-group-of-health-service-watcher-objects-using-vsae/
    SCOM VSAE – Custom Dynamic Computer Groups Based On Server Registry Keys
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • FTP "PWD" and unescabe double quotes

    HI
    I am using LV8.2.1 and the internet toolkit.
    There is a FTP function called "PWD"(print working directory) who I think got a bug.
    It don't put out the working direktory.
    It take the reply text ( ex: Current working directory is "fs")and use the subVI "unescabe double quotes.vi" to remove the quotes, but this subVI need to have a string where the hole text is surrounded with double qoutes.
    The FTP "PWD" function send a string like this( ex: Current working directory is "fs") to the subVI and that result in an empty string out.
    Take a look at the attached pictures.
    regards Bjarne
    Attachments:
    FTP [PWD]_BD.png ‏5 KB
    Unescape Double Quotes_BD.png ‏11 KB

    Hi Bjarne,
    what FTP server are you using? It seems your FTP server doesn't follow the protocol. The response to a "PWD" should be like this:
    257 "/path/on/server" [is current directory.]
    It should start with the 257 code, followed by the path surrounded by double quotes.
    If the FTP server follows the protocol the PWD VI works just fine.
    As a workaround, you can use the "reply string" output of the PWD VI and use a match pattern to find the portion string between double quotes.
    Daniel
    Message Edited by dan_u on 03-11-2009 02:34 PM

  • XMLType and Curled Double Quotes (8220, 8221)

    The following select fails with an XML parser error:
    select xmltype('<tag>&#8220;A&#8221;</tag>') from dual
    I'm trying to definitively determine why...
    We have XML that goes into a CLOB column in our 9.2 database, then is put into an XMLTYPE variable (in PL/SQL) and manipulated as XML. (The above select statement is just a highly-simplified test case, but we do use XMLTYPE in this manner in our select to convert the CLOB to an XMLTYPE instance.) The data has occasional instances of curled double quotes, represented as &#8220; and &#8221; and when these exist, the XML parse error occurs.
    My impression is that these Unicode representations of the curled double quote characters are acceptable in XML. They parse and validate fine in XMLSpy for whatever that's worth. Also, I can construct a DOM document in Java, using Oracle's XMLParser V2, that contains these Unicode representations.
    Why can't I do this using XMLTYPE in PL/SQL?
    Thanks for any assistance!
    Jim

    In the prior message, the sentence that reads:
    ...represented as “ and ” and when these exist...
    the pair of double quotes should read, respectively, &# followed by 8220; and &# followed by 8221; - the forum renderer actually rendered those as the curled double quotes...

  • How to catch Find and add event of toolbar in UDO addon ?

    Hi experts ,
        please help me anyone How can i catch Find and add event of SAP  toolbar in my UDO addon ?
    thanks in advance
    Surajit

    Hi,
    Try This.....
    'In Menu Event
    If pVal.MenuUID = "1281" And pVal.BeforeAction = True Then   'Find
                      sbo_application.Messagebox("Find Mode")
    end if
    If pVal.MenuUID = "1282" And pVal.BeforeAction = True Then     'Add
                      sbo_application.Messagebox("Add Mode")
    end if
    Thanks
    Shafi

  • How do I view and add photos on the mobile app?

    QuestionHow do I view my photos and add new photos on the mobile app?
    Answer 
    To view your photos, you may either select the Photos icon from the Home screen:
    Or, you may select the Profile icon from the Home screen.
    From your profile picture, you can start scrolling to view your photos one by one. Or, touch the camera icon on your profile picture to view all your photos at once.
    To add new photos to your account, touch the camera icon on the top-right corner of your Photos page:

    http://support.apple.com/kb/DL1455?viewlocale=en_US&locale=en_US

  • (ask)how to detect locking and how to kill session

    I want to update a row in a table, table "X" for example.
    I got ORA-00054:resource busy and acquire with no wait spesified.
    How do i search and kill the session that is locking the table? i dont have oracle Enterprise Manager so i think it has to be done by querying against v$session, v$transaction etc. to get the session and kill it.
    Can anyone show me the select statement to find out the sesion and the command to kill it.
    thank you

    DBA_OBJECTS holds the object_id.
    Use the object_id to select locks from V$LOCK, where object_id equals ID1 or ID2 (depends on the type of lock).
    See Oracle Database Reference for more details.

Maybe you are looking for

  • HT4113 my ipad screen remains black and wont cut on... what steps can i take to fix it

    My Ipad screen randomly went black and wont turn on....Help

  • Cannot connect to backup sql server

    Hi, i'm new in Azure and MS SQL. I'm trying to create an Availability Group: Primary and backup SQL servers (msdn.microsoft.com/en-us/library/azure/dn275957.aspx) At Step 7 (Connect to Server) I get error: ADDITIONAL INFORMATION: The target principal

  • Why do we buy toshiba tv's????

    My tv like so many others tv's are broken after a little over a year old outside the warranty and the manufacture could care less. Same problems which mean same faulty parts which says they know and continue to put them in there tv's. Why? Cause we c

  • Getting XML Tag Attributes

    Hi, I am trying to get the attribute values of an XML Tag of a Textbox.  To get the xml tag of the selected element, I use InterfacePtr<IXMLTagSuite> xmlTagSuite(fCurrentSelection,UseDefaultIID());     if (xmlTagSuite)         UIDList tagUIDList = xm

  • Premiere / Encoder CC freezing during encode

    Hi, stuck rendering my project. My problem is similar to this description: When I render via encoder, it renders the first couple of seconds, then freezes. I have tried to render directly from premiere with no luck, it just sits at 0%, it doesn't eve