How To Supress Few Characters From a ZTable field.

Hi,
  I have a Field called 123-abc in my Ztable. That is driven by concatinating 2 fields from standard SAP Table.
Now I want to Compare the Ztable-field with one of the field from Standard SAP field like 123.
How to do that??

Do something like this -;)
REPORT ZDUMMY_ATG.
DATA: T1 TYPE STRING,
      T2 TYPE STRING,
      POS TYPE I,
      LONG TYPE I.
T1 = '123-ABC'.
T2 = '123'.
TRANSLATE T1 TO UPPER CASE.
SEARCH T1 FOR '-'.
POS = SY-FDPOS + 1.
LONG = STRLEN( T1 ).
LONG = LONG - POS.
IF T1+0(LONG) EQ T2.
  WRITE 'The Same...'.
ELSE.
  WRITE 'Not the Same...'.
ENDIF.
Greetings,
Blag.

Similar Messages

  • [Forum FAQ] How to remove div characters from multiline textbox field in SharePoint 2013

    Scenario:
    Need to avoid the div tags and get data alone from multiline textbox field using JavaScript Client Object Model in SharePoint 2013.
    Solution:
    We can use a regular expression to achieve it.
    The steps in detail as follows:
    1. Insert a Script Editor Web Part into the page.
    2. This is the complete code, add it into the Script Editor Web Part and save.
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js");
    function retrieveListItems() {
    // Create an instance of the current context to return context information
    var clientContext = new SP.ClientContext.get_current();
    //Returns the list with the specified title from the collection
    var oList = clientContext.get_web().get_lists().getByTitle('CustomListName');
    //use CAML to query the top 10 items
    var camlQuery = new SP.CamlQuery();
    //Sets value that specifies the XML schema that defines the list view
    camlQuery.set_viewXml('<View><RowLimit>10</RowLimit></View>');
    //Returns a collection of items from the list based on the specified query
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(this.collListItem, 'Include(Title,MultipleText)');
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
    //Returns an enumerator to iterate through the collection
    var listItemEnumerator = this.collListItem.getEnumerator();
    //Remove div tag use a regular expression
    var reg1 = new RegExp("<div class=\"ExternalClass[0-9A-F]+\">[^<]*", "");
    var reg2 = new RegExp("</div>$", "");
    //Advances the enumerator to the next element of the collection
    while (listItemEnumerator.moveNext()) {
    //Gets the current element in the collection
    var oListItem = listItemEnumerator.get_current();
    alert(oListItem.get_item('MultipleText').replace(reg1, "").replace(reg2, ""));
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Result:<o:p></o:p>
    References:
    http://www.w3schools.com/jsref/jsref_obj_regexp.asp
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Nice article :)
    If this helped you resolve your issue, please mark it Answered

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • How to delete first few characters from all the elements of an array of strings

    hi
    I have a 2-dimensional array of strings length 104. I have to delete first 6 characters from all the elements of array and then change the strings to int. how to do it?? plz help

    Attached you can find the screenshot showing how to do so.
    Bye!
    Licia
    Attachments:
    array.jpg ‏14 KB

  • How to stop control characters from being tokenized?

    In Oracle 11.2.0.3
    I have documents which has embeded Arabic and so there is a control character \u202b to indicate right-to-left string. How do I stop these kinds of control characters from being tokenized. Doing a search with CONTAINS(search_string,' \u202b')>0 finds documents. Do I just add the '\u202b' as a stopword?

    What lexer are you using, Amin?
    I assume from what you say that the characters are getting indexed as whole tokens?  If so, adding them as stopwords should work, but I'm surprised they're getting indexed at all - sounds like a fault in the "alphanumeric indentification" code to me.
    I'm going to take a guess this is the World Lexer.  Am I right?

  • How to force all characters in prompt text field will be in uppercase???

    Hi everybody
    How to get that all characters in a prompt field of a Webi report will be compared in uppercase with the database field ?? Even if the user input text in lower case.
    this is due to the database all filelds are in uppercase, and avoid to say to the users they input fileds in uppercase.
    i looked for a parameter in a universe and in oracle.prm filed, and i didn´t find it.
    Thanks in advance
    Guillermo
    DB: ORACLE 10G
    BO: XI r2

    Thanks a lot rohy.
    now i use that solution, but my intention is try to solve to all objects, not each object individualy, due to i have a lot of objects that a user can choose from a prompt, and i have a lot of filters to do that
    i would like to change some parameter to do that at one time.
    i investigate about it......
    thanks again.
    best regards Guillermo
    have a nice day

  • How To Block a User From Changing Total Field In AR Invoice

    Hi all,
    I would like to find out how to block a user from being able to change the total field at the bottom right hand side of the AR Invoice.  Currently if a user creates an invoice and is still busy in that invoice they can adjust the total field which in turn will update the discount field as well.
    Is this simply an authorization issue or am I going to have to do it in the transaction notification?
    We are using SAP Business One PL 30 currently.

    Hi
    Please review by note again -This is by system design .
    I don't know why you are so worried abt this because by setting up discount max ,if user cannot post the document ,that means it is not in the system ,no matter they change multiple times in the fields .
    But I think your scenario is different ,
    You are copying with certain discount from Delivery to AR invoice and i think you don't want user to change the discount field , then you can solve your issue by using approval or sp_notification
    If you really want it to be greyed out ,I think you might have to go through by SDK or Boyum addon.
    Thank you
    Bishal

  • How to make html file from a text field data

    hi!
    I want to know how to make a file with .html extension and the data in this file should be from a text field. like i want to enter some thing in a text area and have to place it in a file on server side in html formate.

    so you told us what you want, but what is your question?

  • Regular expressions-how to replace [ and ] characters from a string

    Hi,
    my input String is "sdf938 [98033]". Now from this given string, i would like to replace the characters occurring within square brackets to empty string, including the square brackets too.
    my output String needs to be "sdf938" in this case.. How should I do it using regular expressions? I tried several possible combinations but didn't get the expected results.

    "\\s*\\[[^\\]]+\\]"

  • How to remove the characters from first and last position of a string?

    Hi all,
    I am creating an application where i am using vb script to export the data to excel.
    In the excel sheet most of the values are entered with double " quotes.
    so the entry looks like ""http://www.sap.com"".
    Notice that it is starting with "" and not " . so the vb takes it as a line feed and shows an error .
    It will be great if anybody can tell me how to remove these set of quotes ,so that the value should come as "http://www.sap.com" . A sample code wil be of great help.
    Thanks in advance,
    mahima.

    Hi,
    To modify you excel you have 2 options, 1) you can filter them in excel itself by using filter ...etc in excel itself. or 2) you can do it by using ABAP code.
    Below code may help you.
    Get the data from Excel to Internal table using FM :
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      exporting
        filename                = 'c:\temp\test.xls'
        i_begin_col             = 1
        i_begin_row             = 1
        i_end_col               = w_values
        i_end_row               = 10
      tables
        intern                  = t_alsmex_tabline
      exceptions
        inconsistent_parameters = 1
        upload_ole              = 2
        others                  = 3.
    Now replace all unwanted "" in internal table with space.
    replace all occurrences of '""' in itab-field with '   '.
    Again you can export to Excel using
      call function 'GUI_DOWNLOAD'
        exporting
          filename                = lv_file
          filetype                = 'DAT'
          append                  = ' '
          write_field_separator   = 'X'
        tables
          data_tab                = itab.

  • How can I retrieve more than 256 characters from a longtext field?

    I have a longtext field in an ACCESS database. I have setup a datasource for the DB and access it with the JDBC:ODBC driver. When I used the simple resultset.getString, it only gave me the first 256 characters of the contents of the field. So, I looked at the other methods and found that resultset.getAsciiStream was the way to go for longtext fields. So I changed the resultset.getString line to the following code:
    InputStream msgIn = rs.getAsciiStream("RAW_MESSAGE");
    StringBuffer stringbuffer = new StringBuffer();;
    int inbyte = 1;
    try {
    while (inbyte > 0) {
    inbyte = msgIn.read();
    stringbuffer.append((char)inbyte);
    } catch (IOException ex) {
    ex.printStackTrace();
    String msg = stringbuffer.toString();
    Unfortunately, after 256 characters I get a -1 returned. The field contains more like 1000 characters. I would appreciate any advice.
    Thanks

    Found the "Search Entire Library" option - click on the small (VERY small for my eyesight) down arrow next to the magnifying glass. Also need to select "Filter by: Songs", and then the songs in the main window show the results.
    I'm going to leave this up on the board because 1) in case someone else has this question, and 2) I don't know how to delete it anyway.

  • How to send Chinese Characters from BPEL to SAP through JCA Adapter

    Hi All,
    We want to do a POC using a BPEL process to send Chinese characters to SAP System through a JCA Adapter.
    If anyone has implemented the similar requirement, please share your thoughts on how to achieve it? Or if there had been any problems?
    Also, please let us know which SAP API we can use to test this?
    Appreciate your quick help!

    Hi Srini,
    I am working on 9.0.3 EBS 11i.
    Now i am able to encode using the below code:
    in = new BufferedReader(new InputStreamReader(uploadedByteStream.getInputStream(),"UTF-8"));
    if(linetext[7]!=null&&!"".equalsIgnoreCase(linetext[7]))
    col8=linetext[7].toString();
    vendor = new String(linetext[7].getBytes("UTF-8"),"EUC_CN");
    Now i am able to encode to chinese character when the file is in ANSI encoding, i see the CSV data in some form(not chinese).
    But when the file is in UTF-8 , and i can see the CSV data in Chinese (when i open in edit plus) , the encoding is not proper. when i remove the encoding the chinese data is coming properly.
    The data i am printing on the OAF screen.
    Now my doubt is : What type of file shd i be uploading ANSI/UTF-8????
    When i see on the local jdev as sop's , the data is seen as ???? but on the screen its printing correctly.
    but the data has to be passed to pl/sql procedure.
    Regards,
    Roopa.

  • How to extract special characters from a field

    Hi there.
    I am a novice when it comes to Web Intelligence reports. I have been tasked with producing a final report that I can export to Excel which shows a project number and a project name. Very simple. Ultimately I need to import my final Excel file to a third party software. However, the issue is the project name field consists of special characters such as hyphens, parenthesis, asterisks, etc. I need to be able to create a formula which extracts all special characters and just leaves me with alpha-numeric characters and spaces. I also need to limit the character count to no more than 34 characters. I will not be able to import my final Excel file unless I can product those results. With the help of a very knowledgable person in the Crystal Reports forum, I was able to do that by using the following formula:
    stringvar a:=left({Projects.ProjectName},34);
    numbervar i;
    Local StringVar fin;
    for i:= 1 to len(a) do
        if a[i]in ["a" to "z"] then
            fin := fin & a[i]
        else if a[i] in ["1" to "9"] then
            fin := fin & a[i]
    else if a[i] = " " then
         fin := fin & a[i];
    fin;
    It worked amazingly well in Crystal Reports but this report now needs to move to Web Intelligence. Is there a way to do this in a Web Intelligence report? Itried but the formula is not recogizable. I tried creating a variable and using this formual but I couldn't get it to work.  I appreciate all helpful responses. The version of Web Intelligence I am using is SAP Business Enterprise XI. I am working in a PC environment using Windows 7 if that helps at all.
    Thank you!
    Lauren

    Hi Lauren, Please provide with some sample data...
    In SQL, by writing some Functions/Procedures you can eliminate special characters. Ask your database team to do that.
    or
    Create an object with the following syntax... It Works in SQL.
    = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE([String_Object],'&',' '),'*',' '),'(',' '),'^',' '),'%',' '),'!',' '),'@',' '),'#',' '),'$',' '),'~',' '),')',' '),'+',' '),'=',' ' ),'-',' '),'_',' '),'/',' '),':',' '),';',' '),',',' '),'<',' '),'.',' '),'>',' '),'?',' '),'"',' '),'''',' '),'[',' '),']',' '),'{',' '),'}',' '),'\',' '),'|',' ')
    Example: Input: '~!@#$%^&*()_+{}:"<>-=[]./\|/*-+ascdfv123'
                  Output: ascdfv123

  • How to eliminate few subelements from source pay load structure

    Hi,
         I have requirement like this, there are 4 sub elements in the source structure, but I need only 2 sub elements in the target structure. The following is the source pay load,
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns9:MTI_MANU_PROMOTION xmlns:ns9="http://limited.com/usa/Sap_appl/SapRetail/PromoPriceZone">
    - <RECORDS>
                - <UDT_PRICELOCZONE action="INSERT">
    - <access>
                          <LOC>0000000003</LOC>
                          <U_PRMOPRICEZONE1>EVENT1</U_PRMOPRICEZONE1>
                     </access>
    - <access>
                          <LOC>0000000009</LOC>
                          <U_PRMOPRICEZONE1>1</U_PRMOPRICEZONE1>
                     </access>
    - <access>
                          <LOC>4323</LOC>
                          <U_PRMOPRICEZONE1>1</U_PRMOPRICEZONE1>
                     </access>
    - <access>
                          <LOC>0000000008</LOC>
                          <U_PRMOPRICEZONE1>1</U_PRMOPRICEZONE1>
                     </access>
                </UDT_PRICELOCZONE>
           </RECORDS>
      </ns9:MTI_MANU_PROMOTION>
    So how to eliminate other 2 sub elements in the source structure?
    Any one with better suggestions, about this idea?
    Thanks in advance for all.

    Hi
    raju jut check LOC exists with the help of exists functionality (node functions)
    Use this for input for ifwithout else(boolean function)
    And use your access node as a input at "then"
    I hope you will get the output.
    Check your other thread regarding http sender.
    Regards
    Piyush.

  • Removing first few characters from an infoobjects

    Hi,
    I have an Infoobject where we load 9 character long records like - Ab1234567.
    I have to transfer everything to a new Infoobject but not the first 6 character. Could you please let me know the best code with all the details...I have limited ABAP knowledge
    Thanks for you help.

    Please search before you post -
    transformation routine: delete 4 first characters..
    First N characters

Maybe you are looking for

  • Could U Please Tell me the Link B/W  Work Center and Plant ?

    Urgent Issue ...

  • Deploy SRDemoSample to JBoss

    Hi, I am trying to deploy the SRDemoSample to JBoss jboss-4.0.3SP1. I have followed instructions contained in paragraph 22.7 of 'ADF Development Guide' for setting up JBoss. When I deploy the ear to JBoss through JDeveloper 10.1.3.0.4 I have the foll

  • Want to upgrade but running bootcamp! What to do?

    I want to upgrade to mountain lion from snow leopard so I can have icloud capabilities.  However, I'm running bootcamp because I am an architecture student and the programs I need aren't made for macs.  Is there a way to upgrade to mountain lion with

  • MacBook does not start after installing more RAM

    Ok i bought a second hand MacBook from early 2009 and planned to use it to record songs in a small home studio using GarageBand, Live and protools, it came with 2gigs Of RAM and i tought i should take it up to 4 -the max it can handle- so i bought 2

  • Problem in DAM video conversion

    Hi, I am using Webcenter Content 11.1.1.8.0 and I configured IBR for video conversion. When I uploadmp4 video file, I am getting below error, Content item 'Content000242' was not successfully checked in. Unable to set the default rendition set for DA