Replacing sapces with 0 in character variables.

Hi,
Can anyone suggest a method to replace zeros instead of characters at left side.
I have a component of internal table which accepts character data --> size 10, however before it gets uploaded I want it to look like '0000000012' instead of 12.
I used replace and replace all occurances, I also tried using first SHIFT and later REPLACE but no use.
Can anyone help ?
Appropirate rewards for good answers.
Thank you,
Dipesh Jhala.

Hi,
use code as below :
data : a(10), b(10).
a = '12'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = a
IMPORTING
   OUTPUT        = b
write :/ a.
write :/ b.
Reward, if helpful,
Sandeep Kaushik
Message was edited by:
        Sandeep Kaushik

Similar Messages

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • Replacing all occurrences of characters in a string with one new character?

    Hi there,
    I'm looking for a way that I could replace all occurrences of a set of specific characters with just one new character for each occurrence.
    For example if I have a string which is "word1...word2.......word3....word4............word5" how would I be able to replace this with just one character such as ":" for each set of "." so that it would essentially appear like this "word1:word2:word3:word4:word5"
    If I just use replace(".", ":") I am left with "word1:::word2:::::::word4::::word5::::::::::::"
    So therefore I'm guessing this would require the use of replaceAll() maybe? but I'm not really very familiar with how regular expressions work and how this would be accomplished using them.
    Any help would be greatly appreciated :) Thanks.

    Yes, but "." means any character, so ".\+" means "any character repeated more than once". If you just mean a full stop ("period" for you Americans :p) you should use "\.+" as your regular expression, but remember that for Java you need a '\' escape to recognise '\' as '\', so in code you'd actually type your regex as:
    "\\.+"Here's an example of one way to do it:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class Test {
        public static void main(String[] args) {
           String string = "example1.......example2...example3.....example4";
         Pattern pattern = Pattern.compile("\\.+");
         Matcher stringMatcher = pattern.matcher(string);
         string = stringMatcher.replaceAll(":");
         System.out.println(string);
    }Edited by: JohnGraham on Oct 24, 2008 5:19 AM
    Edited by: JohnGraham on Oct 24, 2008 5:22 AM

  • Search/Replace for/with php variable name

    Hi all.
    I have just updated from Dreamweaver 5 to 5.5 and now I am missing a very handy functionality.
    What I want to do is to replace all occurences of $a with $b.
    In Dreamweaver 5 that was very easy by using "Find and replace":
    Find in: All open documents
    Search: Sourcecode
    Find: $a
    Replace: $b
    Active options: Match case and Match whole word !!!!
    Now in Dreamweaver 5.5 the option "Match whole word" is automatically disabled as soon as I enter a $ (dollar) in the search field.
    I assume this has something to do with regular expressions but I do NOT check the option "Regular expression" in the search and replace dialog.
    Is this a bug?
    What are my options now.
    If I don't have the possibility to to tick "Match whole word" my search does also replace all occurrences of $abc and $answer etc. with $b.
    Thank you for your help

    samet2011 wrote:
    I have Dreamweaver 5 and 5.5 running parallel on my computer.
    I can confirm that the way I described and used to use is working on Dreamweaver 5.
    I was the person who informed Murray that Dreamweaver CS5 and CS5.5 both behave the same way. I have just checked as far back as CS3, and it also disables "Match whole word" when you enter a dollar sign in the Find field of the Find and Replace dialog box. In fact, that option is disabled whenever you enter any nonalphanumeric character (except an underscore) in that field. It's not limited to dollar signs.
    Why it's not disabled in your version of CS5 is a mystery.
    However, to solve your problem, you don't need either a regex or "Match whole word". Simply type the name of your PHP variable followed by a space into the Find field. Also add a space after the name of the variable you're using as the replacement.
    What "Match whole word" does under the hood is to use a regular expression to find a word break. As long as you leave a space between your variables and any following code, simply adding the space to your search will do the trick.
    However, if you have cases where a variable is followed by a comma, closing parenthesis, or some other character, you will need to use the following regex:
    Find: \$variable_name\b
    Replace: $new_name
    The \$ looks for a dollar sign. The variable_name matches the literal text of the variable name (replace it with the actual text you're looking for). The \b matches a word break in exactly the same way as "Match whole word".
    In the Replace field, $new_name is the literal name of the new variable.

  • Need some clarification on Replacement Path with Variable

    Hello Experts,
    Need some clarification on Replacement Path with Variable.
    We have 2 options with replacement path for characteristic variables i.e.
    1) Replace with query
    2) Replace with variable.
    Now, when we use  "Replace with variable" we give the variable name. Then we get a list for "Replace with" as follows:
    1) Key
    2) External Characteristic Value Key
    3)Label
    4)Attribute value.
    I need detailed explanation for the above mentioned 4 options with scenarios.
    Thanks in advance.
    Regards
    Lavanya

    Hi Lavanya,
    Please go through the below link.
    http://help.sap.com/saphelp_nw70/helpdata/EN/a4/1be541f321c717e10000000a155106/frameset.htm
    Hope this gives you complete and detailed explaination.
    Regards,
    Reddy

  • Replacement path with text variable

    Hi experts,
    My client requirement is " when he enters the current year or current day then it should display the Description of that particular year r month r day."
    Can anyone explain me in detail how to create replacement path with text variable on FISCAL YEAR?
    Hope will solve my issue soon.
    Thanks in advance
    Jani Sk.

    Hi,
       goto the properties of your KF and click on the variable button side to that of the description field and click on new/Create option.Enter the technical name description for the text variable and select Replacement path as the Processing type and in the nxt screen select Fiscal year as the replacement variable and in nxt screen  specify as Key and provide offset values if necessary and click on finish.now select the variable by clickin on the variable button next to the description field.it comes after the description of the KF.Now run the query.
    Thanks,
    Sandeep

  • Can anyone explain with senairio for formula variables with replacement  pa

    can anyone explain with senairio for formula variables with replacement  path?

    See the below link
    An Example for Replacement path
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
    Document Count using Replacement path
    I've explained the steps in this thread.
    Query formula-Counter???
    Example for Replacement Path: Characteristic Variable.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
    Variable Replacement Example
    http://help.sap.com/saphelp_nw04/helpdata/en/af/809528939d5b4fbff7e16a5bdc0d85/content.htm
    Formula Variable.
    http://help.sap.com/saphelp_nw04/helpdata/en/ca/5f9ac61a205a459d0e7ef313d10321/content.htm
    Regs
    Gopi
    Assign points if it helps

  • HELP : Replacing Space with any character !

    Hi !
    How do I replace any spaces in a strings passed from a FORM INPUT, with a different character.
    I tried doing this
    String s= request.getParameters("info");
    s.replace(' ','_');
    But it keep giving me error.
    it there any simpler way of doign this?
    Thank you
    K

    Hi !
    I am new to JSP,
    It keep giving a null pointer exception when i use it with JSP
    So i did this it work fine on the try section
    and once it is in the catch section it keeps giving me Nullpointer exceptions again.
    IS there any other way replacing the space with a "-" or anything..?
    Thanks for your help.
    here is the code
    String r_space ="";
    try {
         r_space=value.replace(' ','+');
         out.println("r_space : try " r_space "<br>");
    catch(NullPointerException e) {
    System.out.println("Recaught: " + e );
    r_space=value.replace(' ','+');
    out.println("r_space : cathc" r_space "<br>");

  • Replace a string in a character field with a amount value

    Hi,
        I have a text field in which I want to replace a string with an amount value. while am trying to replace it , it gives me some empty space.
    For example:
    amount = '1200   '
    message = 'The STIP amount is &1'
    in my code :
    replace &1 with message into message.
    the result is
    'The STIP amount is 1200   '
    I dont want the space after 1200.
    I tried for condense no-gaps also but it is not working ..
    What may be the problem?
    Can you suggest some solution for this?
    Regards,
    Vimala

    Hi,
    replace &1 with message into message.
    I guess its replace &1 with amount into message.
    Convert the amount to a character type (example move amount to amount_c ), then condense it and and then replace it using the 'REPLACE' statement.
    regards,
    Advait.

  • Creating character variable with dynamic length

    Hello Experts,
    I need to send contents of an internal table via FTP in character mode,
    the entire contents of a internal table is concatenated in a string(v_string) which needs to be moved to the character variable of same size say l_count = strlen( v_string ).
    can anyone help me to define the character variable say of length l_count.
    I have already tried creating a dynamic character variable using CREATE DATA.
    eg   DATA: dref TYPE REF TO DATA.
      CREATE DATA dref TYPE c LENGTH l_count.
    but this is not working.
    Any response will be helpful.
    Thanks & Regards,
    Sumukh Kapoor.

    Hi Marcin,
    Thanks for your response,
    Reason i need character variable of dynamic length is because the requirement is to send data to client's Windows terminal . We already have FTP code in place and suddenly client has asked to send us data of an internal table in a single line.
    I have concatenated the entire table into a string and then thought of moving the entire data from string to that character.. as the size in character goes beyond 60000 characters in many cases....
    It seems this is not possible as the string cannot be converted to the data type of variable newly declared.
    anyways your input was of great help.
    Thanks  & Regards,
    Sumukh Kapoor.
    Edited by: Sumukh Kapoor on Jul 26, 2010 7:56 AM

  • [JS - CS3]  Can't REPLACE A with B within a string? Help Please...

    Hello Experts,
    First off - I'm a newbee to all this JS and especially with CS3.
    I have a string: '
    b myDocumentName
    which can have it's value as: '
    b 00000en_ Generator WX/WY
    Problem is, backshlashes ( / )are a bad thing for me...
    b Question:
    How can I do a 'replace' operation to replace the '/' from the string with a '_'?
    I have at the moment:
    > var myDocSaveName = oneResult[3]+oneResult[4]+oneResult[5];
    > myDocSaveName.replace(what "/", with "");
    > myDoc.save ("C:/DATA/"+myDocSaveName, undefined, undefined, true)
    I get an error Nr. 25... Offending text:"/"
    What am I doing wrong?

    'what' and 'with' are the names of those arguments. They should not be included in the statement:
    myDocSaveName.replace("/", "");
    But that still won't work because replace doesn't operate on a string in situ, it returns the modified string. So:
    myDocSaveName = myDocSaveName.replace("/", "");
    This too has its limitations. It'll change only the first instance of "/", not all of them. To change all of them, you need to restate the 'what' as a RegExp:
    myDocSaveName = myDocSaveName.replace(/\//g, "_");
    A RegExp literal is delimited by the "/" character, so to have it, alone, as the character to be sought you must use the backslash to escape the character. Then, to indicate you want the replace to happen globally within the string, you add the 'g' after the RegExp.
    Dave

  • JAVA Sax mapping replaces &_amp; with & causing mapping to fail

    Hi all,
    I have the following mapping scenario:
    Source XML -> Java Sax Mapping -> Graphical Mapping -> Target structure
    The source XML is valid and caters for special characters like & which appear as &_amp; in the XML (ignore the underscore _ without it the editor strips the amp;, isn't that ironic!).
    The second step of the interface mapping, which is the graphical map, is failing. It seems that the Java Sax mapping is replacing &_amp; with & in the XML, which is then causing the graphical map to fail as it cannot handle the special character &.
    Is there anyway I can prevent the Java Sax mapping from changing &amp; to &
    Or is the only solution for me to write extra code in the Java map to convert & back to &_amp; before passing to the second mapping step????
    Any help appreciated.
    Che
    Edited by: Che Eky on Feb 18, 2009 11:05 PM

    Hi..
    Use this in your source xml file for '&' ->"&_amp;" remove the underscore
    Regards..
    Krishna..
    Edited by: PrasannaKrishna Mynam on Feb 19, 2009 2:20 PM
    Edited by: PrasannaKrishna Mynam on Feb 19, 2009 2:20 PM

  • Issue with crystal's currentdate variable

    Hi all,
    I am trying to fix an old report. Here is the issue...this report is supposed to print last months data based on a create date.
    It has ' create date in the period LastFullMonth ' in the record selection formula..but it is printing dec 2009 data regardless of report run date. I looked at the sql generated by this report (database -> show sqi query) and it substituted create date >= dec 01 2009 and < jan 01 2010.
    I tried to print currentdate and it printed Jan 28 2010. Just to make sure there is nothing wrong with my system calendar, I created a new dummy report and printed currentdate on that report but it printed feb 08 2011 which is correct.
    I was under the impression that variables like currentdate actually look at the system date but this is weird. Does any one know the reason for this behavior?
    Appreciate ur help!
    Pree

    If CurrentDate is giving different results on 2 different reports then there's a good chance there's an issue specific to that 1 report and you probably couldn't reproduce it even if you tried. Sometime rpt files get corrupted and while I'm sure there's a reason I've never figured out why... It just happens.
    Before you go and start rebuilding the report from scratch, try replacing CurrentDate with Today or CurrentDateTime
    HTH,
    Jason

  • Problem with packed data type variable?

    Hi all,
    I have a problem while doing calculations with packed data type variables . As they are saving in the format '0,00'. so unable to do calulations because of ',' . 
    To convert these fields into str and replacing ',' with '.' is very time consuming because i have many packed data type variables.
    Can you please provide any other alternative for over coming this problem? Is there any option while defining these variables?
    Thanks,
    Vamshi.

    Hi VAMSHI KRISHNA,
    First check out SU01 Tcode (if u don't have permission then u can ask BASIS to do it)
    Enter User Name
    Execute
    Goto Defaults Tab
    Check Out Decimal Notation here... set it 1,234,567.89
    SAVE it
    Log Off once and again login with the same user id and check the result...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • How the Replacement path is working in the variable.

    Hi SDNers,
    Can any one give the scenario, how the processing type "Replacement path" is working in the variable.
    Thanks,
    Satya

    Hi,
    For example..
    If you want to find the Ton 10 customers for company you will develop a query and based on some condition you will get the top 10 customers.. and again if you want to see the top 10 customers sales or products what they purchased then you go for another query to develop. In this case.
    In the second query create a variable on Customer object with Replacement path as processing type in that you have to mention the previous query (i.e., top 10 customers). Then it gets the values of top 10 customers from the previous query and generates the report for requirement you want.
    Hope this is clear.
    Veerendra.

Maybe you are looking for

  • Is there a way to create menus without boxes around the text?

    I'm fairly new to Muse, but I'm hung up on this one issue.  I'd like to insert a text menu without the boxes around the text. What I have tried: Dragged in a horizontal menu from the Widget Library to my header for my master menu.  I've spent over an

  • HT5622 Update an app but came with another apple id but not my apple id

    hello im having a problem in appstore my apple id have login but when i go to update menu and im updating an app so it came another apple id , please help me for this situation (using 6.1.5, iPod Touch 4th Gen)

  • Problem in AIAB - Distribute (Capitalize Asset u. Const.)

    In table ANEP, I can see the all register of my asset Capitalize Asset but in transaction AIAB I can´t see the class movement 891 and 892 (revaluation) Please help....

  • Three timer application with defined endpoints

    I'm having trouble making a rather basic application. . . I am trying to create an application that has three timers (let's say A, and B, and X) that are triggered by three different keys on the keyboard (the "a", "b", and "space bar" keys respective

  • Re: error in billing document

    Hi gurus i am getting the bellow error while testing, please suggest me Billing Request 1108000001 has been saved No billing document were generated plese suggest me