Regarding replace function

hi all,
i am using Forms [32 Bit] Version 6.0.8.24.1 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
i have a cursor select statement like below
cursor c_name is
SELECT SHIPPER_NAME
FROM B_DETAILS
WHERE BDL_REFERENCE = 20;i am viewing this file through xml format. so in that format the special characters like '&' and quotes(") are not allowed(means it will through error) i have to replace these characters.
but how i will come to know that in the column what i am fetching from the table the special characters are present.
Please help me..
Thanks..

Hi,
If you would like to remove only quotes(") and ampersand(&) use this
{code}
select regexp_replace('This is a test $%&^&" ', '[\&\"]', '') from dual;
if you like to remove most of the special characters you can try thisselect regexp_replace('$"This is a test $%&^&" ', '( *[[:punct:]])', '') from dual;
In case you cannot use the regexp then try this not very elegant but will workselect replace(replace('This is a test $%&^&" ', '&', ''), '"', '') from dual;
cheers
VT
Edited by: VT on Apr 4, 2011 3:44 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • A query regarding synchronised functions, using shared object

    Hi all.
    I have this little query, regarding the functions that are synchronised, based on accessing the lock to the object, which is being used for synchronizing.
    Ok, I will clear myself with the following example :
    class First
    int a;
    static int b;
    public void func_one()
    synchronized((Integer) a)
    { // function logic
    } // End of func_one
    public void func_two()
    synchronized((Integer) b)
    { / function logic
    } // End of func_two
    public static void func_three()
    synchronized((Integer) a)
    { // function logic
    } // End of func_three, WHICH IS ACTUALLY NOT ALLOWED,
    // just written here for completeness.
    public static void func_four()
    synchronized((Integer) b)
    { / function logic
    } // End of func_four
    First obj1 = new First();
    First obj2 = new First();
    Note that the four functions are different on the following criteria :
    a) Whether the function is static or non-static.
    b) Whether the object on which synchronization is based is a static, or a non-static member of the class.
    Now, first my-thoughts; kindly correct me if I am wrong :
    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisation, since in case obj1 and obj2 happen to call the func_one at the same time, obj1 will obtain lock for obj1.a; and obj2 will obtain lock to obj2.a; and both can go inside the supposed-to-be-synchronized-function-but-actually-is-not merrily.
    Kindly correct me I am wrong anywhere in the above.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation.
    Kindly correct me I am wrong anywhere in the above.
    c) In case 3, we have a static function , synchronized on a non-static object. However, Java does not allow functions of this type, so we may safely move forward.
    d) In case 4, we have a static function, synchronized on a static object.
    Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation. But we are only partly done for this case.
    First, Kindly correct me I am wrong anywhere in the above.
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".
    Another query : so far we have been assuming that the only objects contending for the synchronized function are obj1, and obj2, in a single thread. Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.a; and again obj1 trying to obtain lock for obj1.a, which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed. Thus, effectively, our synchronisation is broken.
    Or am I being dumb ?
    Looking forward to replies..
    Ashutosh

    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisationThere is no synchronization between distinct First objects, but that's what you specified. Apart from the coding bug noted below, there would be synchronization between different threads using the same instance of First.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.obj1/2 don't call methods or try to obtain locks. The two different threads do that. And you mean First.b, not obj1.b and obj2.b, but see also below.
    d) In case 4, we have a static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.Again, obj1/2 don't call methods or try to obtain locks. The two different threads do that. And again, you mean First.b. obj1.b and obj2.b are the same as First.b. Does that make it clearer?
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".That's what happens in any case whether you write obj1.func_four(), obj2.func)four(), or First.func_four(). All these are identical when func_four(0 is static.
    Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.aNo we don't, we have a thread trying to obtain the lock on First.b.
    and again obj1 trying to obtain lock for obj1.aYou mean obj2 and First.b, but obj2 doesn't obtain the lock, the thread does.
    which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed.Of course it won't. Your reasoning here makes zero sense..Once First.b is locked it is locked. End of story.
    Thus, effectively, our synchronisation is broken.No it isn't. The second thread will wait on the same First.b object that the first thread has locked.
    However in any case you have a much bigger problem here. You're autoboxing your local 'int' variable to a possibly brand-new Integer object every call, so there may be no synchronization at all.
    You need:
    Object a = new Object();
    static Object b = new Object();

  • Can I use Replace function in a decode??

    Hello,
    I am trying to use replace function inside a Decode Function,
    Here is how I am doing it:
    select
    SUBSTR (
    DECODE (
    IH.DRVD_ALT_MAIL_ADDR_PRIM_FLAG,
    'N',
    REPLACE (
    ih.subs_addr_1
    || ' '
    || ih.subs_addr_2
    || ' '
    || ih.subs_city
    || ','
    || ih.subs_state_code
    || ' '
    || ih.subs_zip_code,
    'Y',
    REPLACE (
    IH.PRINT_ALT_MAIL_ADDR_LINE_1
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_2
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_3
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_4
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_5
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_6,
    ) 1,
    50
    address from x
    Can anyone please tell me what am I doing wrong here, It always gives me an error about missing a right parenthesis.
    Thanks in advance.

    Hi Jimmy,
    Looks like you are missing the first comma in the SUBSTR function
    SELECT SUBSTR (
             DECODE (
               ih.drvd_alt_mail_addr_prim_flag,
               'N', REPLACE (
                         ih.subs_addr_1
                      || ' '
                      || ih.subs_addr_2
                      || ' '
                      || ih.subs_city
                      || ','
                      || ih.subs_state_code
                      || ' '
                      || ih.subs_zip_code,
               'Y', REPLACE (
                         ih.print_alt_mail_addr_line_1
                      || ' '
                      || ih.print_alt_mail_addr_line_2
                      || ' '
                      || ih.print_alt_mail_addr_line_3
                      || ' '
                      || ih.print_alt_mail_addr_line_4
                      || ' '
                      || ih.print_alt_mail_addr_line_5
                      || ' '
                      || ih.print_alt_mail_addr_line_6,
             ), -- HERE
             1,
             50
             address
    FROM   xRegards
    Peter

  • Replace() function doesn't work in Application Designer?

    I'm using PeopleSoft Application Designer 8.51. I'm trying to do a simple Replace function so I can escape single quotes rather than allow them to blow up the sql query.
    &deptid = Replace(&deptid, "'", "''");
    App Designer chokes when I hit Save: "Invalid function parameter type. (2,19)"
    According to the docs I'm using this correctly: http://docs.oracle.com/cd/E26239_01/pt851h3/eng/psbooks/tace/book.htm?File=tace/htm/tace14.htm#H4095
    Even if I try to execute the example right out of the documentation, I get the same error: REPLACE("StringFun", "Fun", "Number");
    Is this a bug in app designer? REPLACE is a super common thing, it's not something obscure. How can this not work?
    Thanks in advance.

    I figured this out. “Replace” is a strange duck function that relies on offsets. “Substitute” is the magic I needed, works just like I was expecting Replace to work. The documentation I was reading on Replace was for “ PeopleSoft Analytic Calculation Engine” rather than peoplecode. I’ll pay closer attention to that next time. Maybe this will help someone else...

  • Replace function not working for XML CLOB data

    Hi all,
    I am generating XML using DBMS_XMLGEN in oracle 10g. After generating the XML, I am replacing the ROW tags with appropriate tag name using REPLACE function. Sometimes the tag name is not replaced correctly.
    Eg.I am replacing </Cargo_ROW> with </CargoDetail>. But sometimes in one xml, this tag is coming as </CargoDetROW> or </CargoDetaiW>. The XML size is always huge and the same tag is repeated so many time in the loop and in the same XML, only one tag will be replaced incorrectly. This also not happening for all XMLs.
    If any one knows the cause about this problem or solution, please share the same.
    thanks,

    Yes Anton, you are right..
    It was typecasting problem
    replace supports clob
    Check this out
    SQL> declare
      2  xmldata clob;
      3  Begin
      4  xmldata:='<Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM" versio
      5  <Transaction>
      6  <TransactionType>ORIGINAL</TransactionType>
      7  <ControlNumber>60022449779</ControlNumber>
      8  <BookingHeader>
      9  <PortCodeOriginal>GBSOU</PortCodeOriginal>
    10  <Contact>.</Contact>
    11  <PhoneContact>.</PhoneContact>
    12  </BookingHeader>
    13  <PartyInformation>
    14  <PartyDetails>
    15  <PartyId>10002866</PartyId>
    16  <Type>SHIP</Type>
    17  <Name1>L LTD.</Name1>
    18  </PartyDetails>
    19  </PartyInformation>
    20  <Cargo>
    21  <CargoDetROW>
    22  <CargoHeader>
    23  <CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
    24  <CargoId>RW9330P013948</CargoId>
    25  </CargoHeader>
    26  <CargoDimensions>
    27  <Length>1</Length>
    28  <Width>2</Width>
    29  </CargoDimensions>
    30  </CargoDetail>
    31  <CargoDetROW>
    32  <CargoHeader>
    33  <CargoReceivedSeqNo>600015391791</CargoReceivedSeqNo>
    34  <CargoId>RW9330P01394AA</CargoId>
    35  </CargoHeader>
    36  <CargoDimensions>
    37  <Length>2</Length>
    38  <Width>2</Width>
    39  </CargoDimensions>
    40  </CargoDetail>
    41  <Cargo_ROW>
    42  <CargoHeader>
    43  <CargoReceivedSeqNo>600015391792</CargoReceivedSeqNo>
    44  <CargoId>RW9330P01322</CargoId>
    45  </CargoDetaiW>
    46  <CargoDimensions>
    47  <Length>1</Length>
    48  <Width>2</Width>
    49  </CargoDimensions>
    50  </Cargo_ROW>
    51  </Cargo>
    52  </Transaction>
    53  </Message>';
    54  xmldata:=to_clob(regexp_replac(xmldata,'</Cargo_ROW>|</CargoDetaiW>|</CargoDetROW>','</CargoDetail'));
    55  xmldata:=to_clob(regexp_replace(xmldata,'<Cargo_ROW>|<CargoDetaiW>|<CargoDetROW>','<CargoDetail>'));
    56  dbms_output.put_line(xmldata);
    57  end;
    58  /
    <Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM"
    version="1.0">
    <Transaction>
    <TransactionType>ORIGINAL</TransactionType>
    <Contro
    lNumber>60022449779</ControlNumber>
    <BookingHeader>
    <PortCodeOriginal>GBSOU</Por
    tCodeOriginal>
    <Contact>.</Contact>
    <PhoneContact>.</PhoneContact>
    </BookingHead
    er>
    <PartyInformation>
    <PartyDetails>
    <PartyId>10002866</PartyId>
    <Type>SHIP</Ty
    pe>
    <Name1>L
    LTD.</Name1>
    </PartyDetails>
    </PartyInformation>
    <Cargo>
    <CargoDetail>
    <CargoHea
    der>
    <CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
    <CargoId>RW9330P01394
    8</CargoId>
    </CargoHeader>
    <CargoDimensions>
    <Length>1</Length>
    <Width>2</Width>
    </CargoDimensions>
    </CargoDetail>
    <CargoDetail>
    <CargoHeader>
    <CargoReceivedSeq
    No>600015391791</CargoReceivedSeqNo>
    <CargoId>RW9330P01394AA</CargoId>
    </CargoHe
    ader>
    <CargoDimensions>
    <Length>2</Length>
    <Width>2</Width>
    </CargoDimensions>
    <
    /CargoDetail>
    <CargoDetail>
    <CargoHeader>
    <CargoReceivedSeqNo>600015391792</Carg
    oReceivedSeqNo>
    <CargoId>RW9330P01322</CargoId>
    </CargoDetail>
    <CargoDimensions>
    <Length>1</Length>
    <Width>2</Width>
    </CargoDimensions>
    </CargoDetail>
    </Cargo>
    </Transaction>
    </Message>
    PL/SQL procedure successfully completed.
    SQL> Twinkle
    Edited by: Twinkle on Nov 26, 2009 6:05 PM

  • Prolem in CLOB replace function

    Hi,
    I am working on Oracle 10g (release 2).
    Currently facing problem in replace function
    My given patterns are
    Replace(+string+, varchar2, clob)
    Replace(+String+, clob, clob)
    In both casese, I'm getting ORA-22828 error.
    Can anyone please suggest the solution.
    Thanks.

    Please see
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3388795154384573::::P11_QUESTION_ID:1533006062995

  • Replacement function modules/method for obsolete Funtion Modules in ECC 6.0

    We are working on Upgrade Project and need your help in finding the replacement Function module/ Methods for following obsolete Function Modules:
       1.   GET_FIELDTAB
       2.   WS_EXCEL
       3.  HR_DISPLAY_BASIC_LIST
       4.  LOG_SYSTEM_GET_RFC_DESTINATION
       5.  HELPSCREEN_NA_CREATE
       6. TR_RELEASE_COMM
    Thank in Advance.
    Sarita.
    Edited by: Sarita Yalamati on Mar 28, 2008 1:23 PM

    Hi sarita,
    for GET_FIELDTAB use 'DDIF_NAMETAB_GET'..here is sample code
      CALL FUNCTION 'GET_FIELDTAB'
           EXPORTING
                LANGU               = SY-LANGU
                TABNAME             = C_STRUCTURE_NAME
                WITHTEXT            = ' '
           TABLES
                FIELDTAB            = IDFIES
           EXCEPTIONS
               INTERNAL_ERROR      = 01
                NO_TEXTS_FOUND      = 02
                TABLE_HAS_NO_FIELDS = 03
                TABLE_NOT_ACTIV     = 04.
    Replacement :
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        TABNAME           =  C_STRUCTURE_NAME
      ALL_TYPES         = ' '
      LFIELDNAME        = ' '
      GROUP_NAMES       = ' '
      UCLEN             =
    IMPORTING
      X030L_WA          =
      DTELINFO_WA       =
      TTYPINFO_WA       =
      DDOBJTYPE         =
      DFIES_WA          =
      LINES_DESCR       =
    TABLES
      X031L_TAB         =
       DFIES_TAB         = IDFIES
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    For WS_EXCEL  use GUI_DOWNLOAD.. here is sample code
    CALL FUNCTION 'WS_EXCEL'
    EXPORTING
       FILENAME            = 'D:\FILE1.xls'
      SYNCHRON            = ' '
      TABLES
        DATA                = itab
    EXCEPTIONS
       UNKNOWN_ERROR       = 1
       OTHERS              = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Repalcement :
    data : l_filename type string.
    l_filename  = 'D:\FILE1.xls'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = l_filename
      FILETYPE                        = 'ASC'
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
      EXPORTING
        DOCUMENT               = 'D:\FILE1.xls'
       APPLICATION            =
       PARAMETER              =
       DEFAULT_DIRECTORY      =
       MAXIMIZED              =
       MINIMIZED              =
       SYNCHRONOUS            =
        OPERATION              = 'OPEN'
      EXCEPTIONS
        CNTL_ERROR             = 1
        ERROR_NO_GUI           = 2
        BAD_PARAMETER          = 3
        FILE_NOT_FOUND         = 4
        PATH_NOT_FOUND         = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED   = 7
        SYNCHRONOUS_FAILED     = 8
        NOT_SUPPORTED_BY_GUI   = 9
        others                 = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Bulk Replacements using Replace function in oracle 8i

    Hi All,
    Iam using oracle 8i version and i need to use Replace function for bulf replacements i mean i need to replace around 250 rows. So please anyone suggest me how to proceed
    on this request as iam using oracle 8i version.
    Thanks!
    Srini

    Write one update statement.
    The where condition is the filter what rows need to be touched.
    The SET condition will do the data change. For example it could use the REPLACE function if that is what it is needed.
    One single update statement over 20 rows would mean the task is done in BULK. 20 single updates that each handle one row would mean it is row by row = slow by slow processing.

  • SQL replace function in JDeveloper

    In SQL*Plus I run the following queries...
    select last_name, phone_number from employees
    LAST_NAME PHONE_NUMBER
    Chung 650.505.1876
    Dilly 650.505.2876
    Gates 916.764.6600
    select last_name, replace (phone_number, '.', '-') from employees
    LAST_NAME REPLACE(PHONE_NUMBER
    Chung 650-505-1876
    Dilly 650-505-2876
    Gates 916-764-6600
    If I try to use the "REPLACE" function in the JDeveloper by editing the sql statement in the view object editor and run the page the results returned for the phone number column on the page are blank.
    How can I substitute a dash for the period on the page?

    Try using AS:
    select last_name, replace (phone_number, '.', '-') AS phone_number from employees
    In this case is recommended for your VO a read only query.

  • Replace Function in Cold Fusion

    Hello All,
    The code below does the following: It finds an item in Spanish (in this case it's GetBasket.options, 2) and add `SPA` to the SKU code.
    <cfif ListContains(GetBasket.options, 2)><option value="2"><cfset basketsku = GetBasket.SKU & "SPA"></option></cfif>
    How do I do the following?
    The SKU code is a 5 digit code for all languages. For example: the SKU code in English is 902013, but the SKU code for Spanish is 903013. As you can see the 3rd number is being replaced with 3. It will be standard for all items in Spanish. How do I modify the code above to replace the 3rd number with 3?
    Thank you all very much in advance!

    not sure if you found an answer to this question but if you use the Replace function you can do this.
    Replace(DB.value, 2, 3 )

  • Replace function in TT7

    Hi,
    I have a database in TT Release 7.0.3.1.0 and other in Release 11.2.2.4.0. I need use replace sql function over Release 7.0.3.1.0.
    I know that it not apply in this version but I've tried with ttIsqlCS in node with TT11 through connection in database TT7 but I received this error:
    ttIsqlCS database_test_R7
    Command> select replace('asjkhdfkhaskdh','a','1') from dual;
    2818: Unknown function REPLACE
    The command failed.
    Command> version;
    TimesTen Release 11.2.2.4.0
    Any idea ??
    Thanks in advance.
    Babs.

    Hi Babs,
    I am afraid that you are out of luck. SQL is implemented in the TimesTen engine/libraries not in the ttIsql client. Since 7.0 SQL does not have th REPLACE() function there is no way to execute that in 7.0 regardless of the client you use. You'll need to find some other option to accomplish what you require (maybe upgrade the 7.0 database to 11.2.2?).
    Chris

  • Replace function in JDeveloper 3.2

    Hi JDev Team:
    Are there any global replace functions in JDev 3.2, for instance I have one word, say 'aaaa', in all of my projct files, .jsp, .java, .... I like to replace with 'bbbb'.
    Thanks

    The JDeveloper Editor provides Search & Replace functionality for files.
    What I typically do is
    Select menu: Search | Search Source Path...
    Enter Search String and Change Source path
    and other fields and press Start
    Then the Navigator displays a Search tab which lists all files with the matching string.
    Double click on first file in navigator and
    select menu Search | Replace
    In this dialog enter your search, replace, and other options-
    In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
    Select the Scope of Global
    Selectg the Origin of Entire
    When you are ready press the Multiple button to make multiple replacements.
    When you are done with this file,
    Press Ctrl-S to Save the file
    Press Ctrl-F4 to close the window
    Double click on the Next File
    Press Ctrl-R to invoke the Search | Replace dialog.
    You should not need to change any options.
    Press Alt-M to select the Multiple Button!
    While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
    Besides, you may learn a few JDeveloper tricks.
    Good Luck,
    -John

  • REPLACE function in PSP for formatting

    Hi everyone,
    <p>I am coding PL/SQL server pages at the moment and am trying to produce an onscreen report.
    <br>I was just wondering if it is possible to use the REPLACE function to replace a part of a string with the same thing but in bold?
    for example, I have tried:
    <p>
    htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'<b>TEST</b>'||')'||'</TD>'); <p>but it isn't working. I just wanted to check it was possible and if so, where am I going wrong??
    <p>
    Thanks in advance!

    This will work:
    htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'&lt;b&gt;TEST&lt;/b&gt;'||')'||'</TD>');I also suggest generating your table HTML using the htp.table... procedures.

  • Replace function Issue

    Hi All,
    I using replace in my package and facing this issue.
    In my code i have temp fields 1 to 15.
    so when i use replace function to replace :temp1 value it also replaces value of :temp11.
         :temp1 = some checks
         :temp2 = some checks
         :temp9 = some checks
         :temp10 = some checks
         till temp15
    Any Solutions for this?
    Thanks.

    like for example :
    i want to replace the value of temp1 field with 10 and temp10, temp11 ...with some other values.
    in code it will
    /*temp1*/
    if ('10') = some value then
    some actions;
    end if;
    /*temp10*/
    if ('10'0) = some value then -- value of temp1 gets replaced here
    end if;

  • Regarding Obsolete Function Modules

    Hi all,
            can anybody tell me the alternative ECC6.0 function modules of the following Obsolete function modules
    DOWNLOAD
    UPLOAD
    WS_DOWNLOAD
    WS_UPLOAD
    WS_FILENAME_GET
    WS_QUERY
    POPUP_TO_CONFIRM_STEP
    POPUP_TO_CONFIRM_WITH_MESSAGE
    thnks
    Sandeep

    here are replacement function modules for the obsolete ones.
    award points in case u feel this useful
    1. Obsolete Function Module: WS_UPLOAD.
          Replacement FM: GUI_UPLOAD.
    Note:
      1. If the FM ‘WS_UPLOAD' has file type as ASC, then we can use same file    
        type ASC for GUI_UPLOAD also.
    2. But if the FM 'WS_UPLOAD' has file type as DAT, we can not use DAT for  
      'GUI_UPLOAD' as it will give short dump.
        In this case we need use file type as ASC
          and
          HAS_FIELD_SEPARATOR = ‘X’.
    3. If the file name or file type of ws_upload have variables or constants   
        Instead of hard coding, then don’t use hard code values for gui_upload.
    3. The data type of file name always should be of character type for gui_upload
          The file type should be of Type Character and length 10.
      4. Always uncomment the exceptions for gui_upload.
      5. And also uncomment the code inside IF SY-SUBRC <> 0. and ENDIF after    
          gui_upload if the customer has not handled any exception in 46c version.
          If there is any code inside IF SY-SUBRC <> 0 and ENDIF for ws_upload in 46c
          version, Please use the same code in ECC also after gui_upload.
    Example:
       Example for File type ASC:
    CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
               FILENAME                = P_FILE
               FILETYPE                = 'ASC'
         IMPORTING
              FILELENGTH              =
          TABLES
               DATA_TAB                = P_I_DATA
          EXCEPTIONS
               CONVERSION_ERROR        = 1
               FILE_OPEN_ERROR         = 2
               FILE_READ_ERROR         = 3
               INVALID_TABLE_WIDTH     = 4
               INVALID_TYPE            = 5
               NO_BATCH                = 6
               UNKNOWN_ERROR           = 7
               GUI_REFUSE_FILETRANSFER = 8
               CUSTOMER_ERROR          = 9
               OTHERS                  = 10.
    Replacement FM:
    DATA L_P_FILE TYPE STRING.
         L_P_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = L_P_FILE
        FILETYPE                      = ‘ASC’
      TABLES
        DATA_TAB                      = P_I_DATA
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
      IF SY-SUBRC NE 0.
        MESSAGE E033 WITH P_FILE ' could not be opened'(E03).
      ENDIF.
    Example for file type DAT:
    CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
               FILENAME                = P_FILE
               FILETYPE                = 'DAT'
         IMPORTING
              FILELENGTH              =
          TABLES
               DATA_TAB                = P_I_DATA
          EXCEPTIONS
               CONVERSION_ERROR        = 1
               FILE_OPEN_ERROR         = 2
               FILE_READ_ERROR         = 3
               INVALID_TABLE_WIDTH     = 4
               INVALID_TYPE            = 5
               NO_BATCH                = 6
               UNKNOWN_ERROR           = 7
               GUI_REFUSE_FILETRANSFER = 8
               CUSTOMER_ERROR          = 9
               OTHERS                  = 10.
    Replacement FM:
    DATA L_P_FILE TYPE STRING.
         L_P_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = L_P_FILE
        FILETYPE                      = ‘ASC’
        HAS_FIELD_SEPARATOR           = ‘X’
      TABLES
        DATA_TAB                      = P_I_DATA
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    Else.
    2. Obsolete FM       : WS_DOWNLOAD
        Replacement FM: GUI_DOWNLOAD.
    Note:
      1. If the FM ‘WS_DOWNLOAD' has file type as ASC, then we can use same file    
        Type ASC for GUI_DOWNLOAD also.
    2. If the FM 'WS_DOWNLOAD' has file type as DAT, we can use DAT for  
      'GUI_DOWNLOAD' 
    3. If the file name or file type of ws_upload have variables or constants   
        Instead of hard coding,then don’t use hard code values for gui_download.
        Declare variables and assign the ws_download variables to new variables  
        and use These in the new FM.
    4. The data type of file name always should be of character type for gui_upload
          The file type should be of Type Character and length 10.
    5. The data type of file name always should be of character type for gui_ download.
      6. Always uncomment the exceptions for gui_download.
      7. And also uncomment the code inside IF SY-SUBRC <> 0. and ENDIF after    
          Gui_upload if the customer has not handled any exception in 46c version.
          If there is any code inside IF SY-SUBRC <> 0 and ENDIF for ws_ download in 
          46c  version, Please use the same code in ECC also after gui_download.
    Example:
    CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
               FILENAME            = P_FILENM
               FILETYPE            = 'DAT'       " split into records
          TABLES
               DATA_TAB            = L_ITAB
               FIELDNAMES          = T_HEAD
          EXCEPTIONS
               FILE_OPEN_ERROR     = 01
               FILE_WRITE_ERROR    = 02
               INVALID_FILESIZE    = 03
               INVALID_TABLE_WIDTH = 04
               INVALID_TYPE        = 05
               NO_BATCH            = 06
               UNKNOWN_ERROR       = 07.
    Replacement FM for above FM:
    DATA L_P_FILE TYPE STRING.
         L_P_FILE = P_FILENM.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       FILENAME                        = L_P_FILE
       FILETYPE                        = ‘DAT’
      TABLES
       DATA_TAB                        = L_ITAB
       FIELDNAMES                      = T_HEAD
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
    *EXPORTING
    *defaultoption  = 'N'
    *     extline1 = 'Soll das Include überschrieben werden?'(034)
    *     extline2 = i_inc-include
    *     itel     = 'Include existiert bereits!'(039)
    START_COLUMN   = 25
    START_ROW      = 6
    CANCEL_DISPLAY = 'X'
    IMPORTING
    answer = answer
    EXCEPTIONS
    OTHERS = 1.
    Replacement Method :
    DATA : l_question type string.
    Concatenate   'Soll das Include überschrieben werden?'(034)
                  i_inc-include
    into          l_question.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
    TITLEBAR = 'Prepack deletion'(019)
    DIAGNOSE_OBJECT = ' '
    TEXT_QUESTION = l_question
    TEXT_BUTTON_1 = 'Yes'(020)
    *ICON_BUTTON_1  = ' '
    TEXT_BUTTON_2  = 'No'(021)
    *ICON_BUTTON_2  = ' '
    *DEFAULT_BUTTON = '2'
    DISPLAY_CANCEL_BUTTON = 'X'
    *USERDEFINED_F1_HELP  = ' '
    *START_COLUMN = 25
    *START_ROW = 6
    *POPUP_TYPE =
    *IV_QUICKINFO_BUTTON_1  = ' '
    *IV_QUICKINFO_BUTTON_2  = ' '
    IMPORTING
       ANSWER = answer
    TABLES
    *PARAMETER =
    EXCEPTIONS
    TEXT_NOT_FOUND = 1
    OTHERS = 2    .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Note : 
       In FM  POPUP_TO_CONFIRM_STEP' , the value for import parameter ANSWER is
           J (YES),
           N (NO).
    But for  POPUP_TO_CONFIRM , the value for import parameter ANSWER is
           1 (YES),
           2 (NO).
    So, please change these values accordingly while replacing with the new FM.
       CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
            EXPORTING
                 DIAGNOSETEXT1 = TEXT-900
                 DIAGNOSETEXT2 = SY-MSGV1
                 DIAGNOSETEXT3 = TEXT-901
                 TEXTLINE1     = TEXT-902
                 TEXTLINE2     = TEXT-903
                 TITEL         = TEXT-904
            IMPORTING
                 ANSWER        = UP_ANSWER.
    replacement:
    The Diagnose object parameter Z_ZIMPCHK1_POPUP_TO_CONFIRM'
      is created in SE61 transaction as DIALOG TEXT object
        DATA: W_PARAM      TYPE SPAR,
               I_PARAMETERS TYPE STANDARD TABLE OF SPAR,
               W_TEXT_Q     TYPE STRING.
        MOVE TEXT-900   TO W_PARAM-VALUE.
        MOVE 'TEXT1'    TO W_PARAM-PARAM.
        APPEND W_PARAM TO I_PARAMETERS.
        WRITE SY-MSGV1  TO W_PARAM-VALUE.
        MOVE 'TEXT2'    TO W_PARAM-PARAM.
        APPEND W_PARAM TO I_PARAMETERS.
        WRITE TEXT-901  TO W_PARAM-VALUE.
        MOVE 'TEXT3'    TO W_PARAM-PARAM.
        APPEND W_PARAM TO I_PARAMETERS.
        CONCATENATE TEXT-902
                    TEXT-903
                    INTO
                    W_TEXT_Q.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
           TITLEBAR                    = TEXT-904
           DIAGNOSE_OBJECT             = 'Z_ZIMPCHK1_POPUP_TO_CONFIRM'
           TEXT_QUESTION               = W_TEXT_Q
         IMPORTING
           ANSWER                      = UP_ANSWER
         TABLES
           PARAMETER                   = I_PARAMETERS
         EXCEPTIONS
           TEXT_NOT_FOUND              = 1
           OTHERS                      = 2
        IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    call function 'UPLOAD'
             exporting
                  filename = umsfile
                  filetype = 'ASC'
             tables
                  data_tab = umsatz.
    replacement :
    DATA : I_FILE_TABLE1 TYPE  TABLE OF FILE_TABLE,
           W_FILETABLE1  TYPE  FILE_TABLE,
           W_RC1         TYPE  I,
           W_P_DEF_FILE1 TYPE  STRING,
           W_P_FILE1     TYPE STRING,
           w_usr_act1    TYPE I.
      W_P_DEF_FILE1 = umsfile.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
           EXPORTING
            WINDOW_TITLE            =
            DEFAULT_EXTENSION       =
              DEFAULT_FILENAME        = W_P_DEF_FILE1
           CHANGING
              FILE_TABLE              = I_FILE_TABLE1
              RC                      = W_RC1
              USER_ACTION             = w_usr_act1
            FILE_ENCODING           =
           EXCEPTIONS
             FILE_OPEN_DIALOG_FAILED = 1
             CNTL_ERROR              = 2
             ERROR_NO_GUI            = 3
             NOT_SUPPORTED_BY_GUI    = 4
             others                  = 5      .
    IF sy-subrc = 0
          AND w_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
         LOOP AT I_FILE_TABLE1  INTO W_FILETABLE1.
            W_P_FILE1 = W_FILETABLE1.
            EXIT.
          ENDLOOP.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = W_P_FILE1
         FILETYPE                      = 'ASC'
        TABLES
          DATA_TAB                      = umsatz
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
      CALL FUNCTION 'DOWNLOAD'
               EXPORTING
               BIN_FILESIZE            = ' '
               CODEPAGE                = ' '
                    FILENAME                = PT_FILE
                    FILETYPE                = 'DAT'
               ITEM                    = ' '
               MODE                    = ' '
               WK1_N_FORMAT            = ' '
               WK1_N_SIZE              = ' '
               WK1_T_FORMAT            = ' '
               WK1_T_SIZE              = ' '
               FILEMASK_MASK           = ' '
               FILEMASK_TEXT           = ' '
               FILETYPE_NO_CHANGE      = ' '
               FILEMASK_ALL            = ' '
               FILETYPE_NO_SHOW        = ' '
               SILENT                  = 'S'
               COL_SELECT              = ' '
               COL_SELECTMASK          = ' '
               NO_AUTH_CHECK           = ' '
          IMPORTING
               ACT_FILENAME            =
               ACT_FILETYPE            =
               FILESIZE                =
               CANCEL                  =
               TABLES
                    DATA_TAB                = BELEGE
               FIELDNAMES              =
               EXCEPTIONS
                    INVALID_FILESIZE        = 1
                    INVALID_TABLE_WIDTH     = 2
                    INVALID_TYPE            = 3
                    NO_BATCH                = 4
                    UNKNOWN_ERROR           = 5
                    GUI_REFUSE_FILETRANSFER = 6
                    OTHERS                  = 7.
    replacement:
    DATA: l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = PT_FILE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME             = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = l_fullpath
       FILETYPE                        = 'DAT'
      TABLES
        DATA_TAB                        = BELEGE
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.

Maybe you are looking for

  • Hard drive failure, how to transfer from ipod to imac

    OK, my iMac G5 hard drive failed....I had no good backup of my iTunes library, except on my iPod mini.....so, I thought that all I had to do was copy my library from my mini to my iMac. Problem is, I can't seem to do this. Can anyone help?

  • Cant find bean class from jsp page using Tomcat 4

    Hi I have searched numerpus forums and seen many posts from people who seem to have the same problem however none of the solutions seem to work for me. I have a jsp page which is trying to call a bean method however I get an error saying that the cla

  • Genius could not complete purchase in store

    I went into the local Apple store (Frisco, TX) today to pick up a 128GB iPhone 6.  Waited in line about 30 minutes. Was assigned Shane to work with.  Everything goes smoothly.  Verifies account, etc.  However, he was unable to select my data plan whe

  • [CS3 -JS-PC] ClipBoard History

    Is there a way to access the history of Microsofts ClipBoard? With out installing a 3rd party program? I would like to be able to load more than one item to the clipboard and have the ability to choose the item I would like to paste. Mahalo David

  • Hierarchies - How can transaction data be spillited as per different levels

    Hi, Every One. I have issue splliting data in diffrent leves of hierarchy,how it can be resolved! In detail,if i say We are getting all transaction and master data in flat file. Master Data is in the format- Global Parent ID,Global ID,Local ID,Compan