Help in writing function

Hi All,
In my table one of the field contains such characters
`First Dance`
Hypnôse DramaNow my question is I have to remove the character " ` " from the code's first line
and from second line "ô" should be replaced with "o"
There are many such character in the columns so can anybody help me to write a function
for such characters.
Thanks

metzguar wrote:
Oracle did it for you:
SELECT CONVERT('Hypnôse poëlée', 'US7ASCII')
FROM DUAL
CONVERT('HYPNÔSEPOËLÉE','US7ASCII')      
Hypnose poelee                            And you can even create your own character set to use with CONVERT. Follow this link:
[http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch13custlocale.htm#i1006388]
UrsGood one, but it doesn't remove characters like the "`" as per initial requirements...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select '`First Dance`' as txt from dual union all
  2             select 'Hypnôse Drama' from dual)
  3  --
  4  SELECT CONVERT(txt, 'US7ASCII')
  5* FROM t
SQL> /
CONVERT(TXT,'US7ASCII')
`First Dance`
Hypnose Drama

Similar Messages

  • Need Help in writing a UDF

    Hi,
    Please help in writing a UDF for these fields in mapping, which I need for the object Iu2019m doing currently.
    The fields are like this:
    1)         batch_no = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/5000)+1",
    2)         lot_id = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/500)+1",
    3)        How to use JDBC connection factory class in the UDF.
    Some logic I can provide which I know i.e. Power (2, 28) means 2 to the power of 28 (2 multiplied 28 times), Trunc means truncate, X_TXN_SAP_Parts is a database table.The Target fields are Batch_no, lot_id & Objid.Actually, objid is mapped initially to a source field i.e. Object ID and in this function it is only being used for the calculation of the batch_no.
    Thanks in Advance,
    Sreedhar.

    Hi,
    Following with my query I've tried to use this code but still I'm unable to execute the mapping.
    import java.util.*;
    import com.sap.aii.mapping.lookup.*;
    import com.sap.aii.mapping.lookup.*;
    DataBaseAccessor accessor = null;
    DataBaseResult JDBCOutPayload = null;
    String BusinessSystem="clarify_dev_bizsys";
    //give your business system having channel name
    String CommunicationChannel="JDBC_TO_CDEV";
    //give your channel name
    String InputPayload= " select X_TXN_PRE_SITE_XFACE.nextval from dual;";
    //give your sql query
    try {
    Channel channel =
    LookupService.getChannel(BusinessSystem,CommunicationChannel);
    accessor = LookupService.getDataBaseAccessor(channel);     
    DataBaseResult resultSet = accessor.execute(InputPayload);
         for(Iterator rows = resultSet.getRows();rows.hasNext();){  
         Map rowMap = (Map)rows.next();
         Object cValue = rowMap.get("batchno");
    //field name of field required , as in database
          catch (Exception e) {}
          finally {
                  if (accessor != null)
                  accessor.close();
           result.addValue((String)cValue);
    --> I don't know what are the parameters to be used and how to be used in the UDF because this is the first time I'm writing a UDF.
    --> The problem in using this query is that both OBJID & BatchNo. are on the target side and the value for the OBJID is retrieved by a SELECT query from the database.
    Kindly help me how to resolve this query of mine.
    Thanks in Advance.
    Sreedhar.

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Writing Function Modules

    Hi
    I want to learn how to write function modules in ABAP please guide me  how should I proceed to learn it as fast as I can.
    Are there any Demos or PDF documents for that.
    I have gone through ABAPDocu  but it has a lot of unwanted materials as well and I found it a bit unstructured to learn writing function modules.

    Hi,
    Please chek this link
    Function Groups
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db992335c111d1829f0000e829fbfe/content.htm
    Creating Function Modules
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Best regards,
    Brijesh

  • Need help in writing data from JSP to excel

    Hi ,
    I need help in writing the data from JSP to excel.I somehow able to retrieve the data into excel but unable to get the required format.
    For eg: The amount should be displayed in 0.00 format .when i am exporting it to excel it is displaying as 0 :( .
    I am using the following code in JSP.
    "out.print(amt + '\t');"
    Would like to know if there is any otherway where in i can get my requirement.
    Thanks
    Tom

    Hi,
    Try using format part of the JSTL tag libs.
    Syntax :
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <fmt:formatNumber value="40" pattern="$#,##0.00"/>
    I need help in writing the data from JSP to excel.I
    somehow able to retrieve the data into excelHow do u convert the jsp to excel?
    One way to convert the jsp page to excel, is to render it as an excel appl instead of html. Set the content type of the response to application/ms-excel.
    response.setContentType("application/ms-excel")Hope this Helps....

  • Help in writing a query!

    Dear All,
    My database is 11gR2 on Linux.
    I am struck in writing a difficult query, need help from your guys.
    I have a table, an application is controlling the columns of this table. Columns are added by the application.
    This is the structure of the table:
    create table imran_test(
    2 username varchar2(100),
    3 layer1 number(1),
    4 layer2 number(2),
    5 layer3 number(2));
    -- where layer1, layer2, layer3.... are increased up to layer 22 and could be increased more...
    Now each username will have 1 in any one of the layer, and all other layers will have 0
    Like if I consider the above table this could be the sample data:
    imran 1 0 0
    hafeez 0 1 0
    james 0 0 1
    Now the result my query should return is:
    select username, <column name where value is 1> and value of it, as per sample data, this should be return by the query:
    imran layer1 1
    hafeez layer2 1
    james layer 3 1
    Note: Please remember the columns are not fixed, they are added/altered by application.
    Regards,
    Imran

    The table design is incorrect as it is not in 3NF and has a repeating group
    You should correct the 'design' first or turn the layer... columns in a VARRAY.
    Also my feeling is you should change your subject line 'Help in writing a query!' in 'Write my query' as that is what you actually ask, and leave out the exclamation mark.
    Basically you dump everything in this forum, and being a bit less demanding might suit you better.
    Also you still act rude by not marking your questions as answered.
    Change that
    Sybrand Bakker
    Senior Oracle DBA
    Edited by: sybrand_b on 1-apr-2012 12:09

  • Help with writing a formula

    Hi all,
    I am creating a report, and need help with writing a formula...
    I am creating a report that shows how many visits/touches our reps have made to various grade accounts. It is broken down by calendar week, and I currently have a weekly "goal" number set that the reps have to meet. That "goal" number increases each week to keep a running total. (example: week 1: 7, week 2: 14, week 3: 21)
    I have created some different formulas and one is this:
    SUM("Activity Metrics"."# of Activities" BY Date."Calendar Week")
    What this shows me is how many "visits" there are per calendar week to customers, however it show me the total for all reps per week.
    What I need is that total to show, but totaled for each rep individually.
    What I was trying is this:
    SUM("Activity Metrics"."# of Activities" BY Date."Calendar Week") BY Employee."Employee Name"
    But...I keep getting an error.
    Any suggestions?
    I have the reporting book by Lairson, and have been referring to it...but my brain at this point is fried.
    Thanks in advance for any help...(please forgive...I am new to OnDemand, and I am sure this is easy)

    Thanks for helping!
    I created this formula as a column: SUM ("Activity Metrics"."# of Activities" BY Date."Calendar Week"), it is called "total number of visits per week" and it shows the totaled number of visits that all the reps have done per calendar week. For example: Week 1: 10 visits, Week 2: 37 visits, Week 3: 20 visits.
    What I would like to do is take that column and break it down further, to show instead how many visits per week by sales rep there have been
    So what I was trying was to take the "total number of visits per week" (SUM ("Activity Metrics"."# of Activities" BY Date."Calendar Week")) and use "Activity Owner" (Employee."Employee Name") to break it down further.
    What I need to use is the total number of visits each rep has per calendar week.
    I think I am getting the error because you can't use "BY" twice in a formula?

  • Help with writing a batch file

    Hi :
    does anyone know anyplace online that I can get help in writing batch files?? I have never worked much with batch files before....
    any help is greatly appreciated
    thnx

    I suppose, since you're in a Java forum, you need batch files to load java applications.
    If you use windows :
    go to ms console (start/run/"cmd")
    type edit mybatch.bat
    write your command to load a java application, something like
    java myclass.class
    save and exit.
    Be sure the bat file and the class are in the same folder.
    And make certain you've set the classpath, and path variables correctly.
    If this was what you needed and you need more help just ask.
    (In this case it could be better to make executable jars)
    If you wanted to know about linux batches, it works pretty the same way.

  • Help in Writing XSLT

    Hello guys,
    I need help in writing XSLT.I have a XML structure as below.
    <PushEventResult>
         <pushEventDT>
              <id>XX</id>
              <serialNumber>111</serialNumber>
              <Mpxn>1X1</Mpxn>
              <EventData>
                   <alarmDtime>xxx</alarmDtime>
                   <alarmType>UP</alarmType>
                   <additionalData>dummy</additionalData>
              </EventData>
              <EventData>
                   <alarmDtime>xxx</alarmDtime>
                   <alarmType>DOWN</alarmType>
                   <additionalData>dummy</additionalData>
              </EventData>
         </pushEventDT>
    </PushEventResult>
    With XSLT I need to transform it in to this format.
    <PushEventResult>
         <pushEventDT>
              <id>XX</id>
              <serialNumber>111</serialNumber>
              <Mpxn>1X1</Mpxn>
              <EventData>
                   <alarmDtime>xxx</alarmDtime>
                   <alarmType>UP</alarmType>
                   <additionalData>dummy</additionalData>
              </EventData>
              </pushEventDT>
         <pushEventDT>
              <id>XX</id>
              <serialNumber>111</serialNumber>
              <Mpxn>1X1</Mpxn>
              <EventData>
                   <alarmDtime>xxx</alarmDtime>
                   <alarmType>DOWN</alarmType>
                   <additionalData>dummy</additionalData>
              </EventData>
         </pushEventDT>
    </PushEventResult>

    A possible attempt will be this set of templates.
    <xsl:template match="PushEventResult">
        <xsl:copy>
            <xsl:apply-templates select="pushEventDT" />
        </xsl:copy>
    </xsl:template>
    <xsl:template match="pushEventDT">
        <xsl:for-each select="EventData">
            <pushEventDT>
                <xsl:call-template name="const_struct" />
                <xsl:copy-of select="." />
            </pushEventDT>
        </xsl:for-each>
    </xsl:template>
    <xsl:template name="const_struct">
        <xsl:apply-templates select="preceding-sibling::*[not(name()='EventData')]" mode="const" />
    </xsl:template>
    <xsl:template match="*" mode="const">
        <xsl:copy-of select="." />
    </xsl:template>

  • To upload a data into SAP Table with the help of RFC function in BODS

    Hi,
    Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
    I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
    In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
    I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
    but it did not help me.
    Thanks,
    Abhishek

    Hi Abhishek,
    Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
    Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
    After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
    I hope this helps.
    Jan.

  • Need help for writing extract program

    hi
    i need help for writing extract program to retriew data from legacy system.
    i already developed bdc programs for me31k and me21.
    my requirement is to write extract program s for those t.codes.
    to retriew data from legacy system and stored in flat file.

    i need help with a java program. it is a program that allows the user to enter a student's GPA, number of extracurricular activities, and number of service activities. The user can not enter a gpa above 4.0 or below 0. The user can not enter a negative number for the number of both activities. If the student meets the following criteria: 1) GPA of 3.8 or above and at least one extracurricular activity and one service activity, 2) GPA below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities, 3) GPA below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities, the message "Scholarship candidate" should display. If the student does not meet the criteria above, then the message"not a candidate" should display. Can you help me, please?
    You haven't posted ANY 'java program' for us to help with.
    The forum is NOT a coding service. It is to help you with YOUR code.
    Post the code you have written and SHOW us (don't just tell us) how you compile it and execute it and the results you get. Then we can help you with any problems you are are having.
    If you need help understanding just what the program should be doing you need to ask your instructor to clarify the assignment.

  • Help with stored function

    Hi...I was wondering if I could get help with this function. How do i write a function to return hours between a begin date and an end date for an employee. Thanks so much

    EdStevens wrote:
    AlexeyDev wrote:
    sb92075 wrote:
    select (date2-date1)*24 from dual;not as above but as below
    select (date2-date1)/24 from dual;date2-date1 is amount of days. Divide it by 24 and what? if you multiply it on 24 you will have a chance to know how many hours between these two dates. :-)Don't forget that a DATE type also includes a time component.I suppose it doesn't matter if you did a difference between two dates. The result is always number of days.

  • How to call a Search help in a function module?

    Hi Experts,
    I am a novice to ABAP, I am working on search helps. My requirement is to call a search help in a function module.
    Can anyone  please throw some light on this.
    Any inputs will be helpful.
    Thanks,
    Amita

    yes you can do that..
    in side the source code ..
    write the select statement according to requirement and pass the internal table to below function moduel and return field to yor help field..
    call the below fm inside the function module..
    'POPUP_WITH_TABLE_DISPLAY' or 'REUSE_ALV_POPUP_TO_SELECT'
    see the sample code...
    FUNCTION Z_MFG_PLANTS_F4 .
    "*"Local Interface:
    "  IMPORTING
    "     REFERENCE(W_WERKS) TYPE WERKS OPTIONAL
    "  IMPORTING
    "      REFERENCE(W_MATNR)    TYPE MANTR OPTIONAL
    Alv popup display
    DATA : gc_selfield     TYPE slis_selfield,
           gt_fieldcat_drd TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    p_werks = W_WERKS.
    data : begin of t_marc occurs 0,
                werks type werks,
                matnr type matnr,
            end of t_marc
    select matnr werks from marc into table t_marc where werks = p_werks.
      IF t_disp[] IS NOT INITIAL.
      gt_fieldcat_drd-seltext_m = 'Material'.
      gt_fieldcat_drd-fieldname = 'MATNR'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
      gt_fieldcat_drd-seltext_m = 'WERKS'.
      gt_fieldcat_drd-fieldname = ''WERKS'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
    Allow the user to select the required plant
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_title               = 'Material Selection for Plant'
          i_selection           = 'X'
          i_screen_start_column = 5
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 20
          i_tabname             = 'T_MARC'
          it_fieldcat           = gt_fieldcat_drd[]
        IMPORTING
          es_selfield           = gc_selfield
        TABLES
          t_outtab              = t_MARC
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc  0.
      ENDIF.
      READ TABLE t_MARC INDEX gc_selfield-tabindex.
      IF sy-subrc = 0.
            w_matnr = t_matnr-matnr.
      ENDIF.
    ENDIF.
    ENDFUNCTION.
    rgrds,
    Shweta

  • Need helping in writing query for finding percentage of duration

    Can any one please help in writing query for this.
    The table is like this :-
    ID     Region     Month     Duration
    I1 R1     Jan     80
    I2     R2     Jan     70
    I3     R1     Jan     70
    I4     R3     Jan     40
    I5     R1     Feb     80
    I6     R2     Feb     30
    I7     R3     Mar     100
    I want to write a query to find
    % of duration for each and every region against each and every month.
    Please help in solving this query. I am in urgent need of this.
    Thanks in advance.

    I also have to do in MS Access 2003You also have to ask into an other forum since here it's an Oracle forum, to try to find Oracle solution.
    Nicolas.

  • Requried Help in creating function

    Hi All,
    i need one help in creating function my input parameters for that function will be 1 or 1,2 or 1,2,3
    my output should be
    If i pass as 1 as input parameter it should return 1
    If i pass 1,2 as input parameter it should return 1,2 in different rows
    Similarly If i pass 1,2,3 as input parameter it should return 1,2,3 in different rows.
    Can any one please help me in creating this function.
    Thanks in Advance.
    Edited by: p78 on Jan 16, 2012 3:31 AM
    Edited by: p78 on Jan 16, 2012 3:31 AM

    Hi,
    that will be something like this. First you need a type for returning the rows (use other datatype for example number if you need so):
    CREATE OR REPLACE TYPE t_list AS TABLE OF VARCHAR2 (4000);
    /Then the function will be a pipelined function:
    CREATE OR REPLACE FUNCTION in_list (p_list  IN  VARCHAR2)
      RETURN t_list PIPELINED
    AS
      l_text  VARCHAR2(32767) := p_list || ',';
      l_idx   NUMBER;
    BEGIN
      LOOP
        l_idx := INSTR(l_text, ',');
        EXIT WHEN NVL(l_idx, 0) = 0;
        PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
        l_text := SUBSTR(l_text, l_idx + 1);
      END LOOP;
      RETURN;
    END;
    /now you can query (or whatever the needs are):
    select * from table(in_list('aa','bb'));Herald ten Dam
    http://htendam.wordpress.com

Maybe you are looking for

  • I need to make a copy of my SL installation DVD

    I have SL installed in both my iMAC and my MacBook Pro. However, just for security's sake, I'd like to make a copy of the Snow Leopard installation DVD that Apple had sent me. I tried to do so using Disk Utility under SL, but when it came to actually

  • Acrobat 9 Pro - Reinstalling freezes during "Preparing for Installation..."

    Hi, I'm using an Apple MacBook Pro with Mac OS X 10.6.3 (Snow Leopard). I have installed Adobe Creative Suite 3 Web Premium and Adobe Creative Suite 4 Design Premium. As written in my other post (http://forums.adobe.com/thread/650516?tstart=0), I am

  • 1099:  Withholding tax not updating 1099

    Hello SAP Guru's, We updating the Withholding Tax Code under vendor master, then we ran the RFWT0010 program and confirmed the updates were made and now we are trying to re-print the 1099 via S_P00_07000134 and the 1099 still shows the value in the w

  • ARD says my client version is too old, but it's not.

    ARD 3.6.1 On the scanner windows, i see the computer I want to control. The icon is pale blue, not blue like others. When I double click on my client computer, under ADMIN panel, arm says : Your client execute a too old software, it must have ARD 3.3

  • Jbuilder7 on java 1.4

    When I run jb7 on java1.4, I experience strange gui behaviour - for example some controls seems to steal focus from the edit pane. There are more of such glitches - rendering the gui almost unusable. And since jbwheel doesn't work under jb7 anymore..