Zeroes in a variable

Hi All
I have to update a field with a value of '001',i have assigned it like this.
Data: variabe(3) type c value'001'.
but when i am concatenating this field with another field these zeroe are getting deleted can any tell me how to get the leading zeros??
Thanks

Hi,
Use N instead of C.
Data: var1(3) type n value'001',
        var2 type string,
        res_var type string.
concatenate var1 var2 into res_var.
Regards
Marcin

Similar Messages

  • Want to hide/eliminate the leading Zeros in the Variable popup for0MATERIAL

    I have a requirement where 0MATERIAL is having leading zeros and it has the MATN1 conversion routine in the production system.I want to only remove the leading zeros in the Variable popup in report for 0 MATERIAL witohut changing the definition of the object as it has too much production data to change.
    Best Regards
    Tagore

    Hi,
    You will have to write some code in F4 help BADI, please refer the sap note 1416952. And you can take help of following function module to remove leading zeros,
    CONVERSION_EXIT_ALPHA_OUTPUT.
    If above thing doesn't help then you will have to create virtual key figure.
    Regards,
    Durgesh.

  • Labview is reading zero from shared variable

    Hello everyone 
    -I have a problem in labview shared variable cause it reads only zero value for all inputs and outputs and timers in S-1200 ...etc
    but in NI OPC server using quick client it reads the correct value but when adding them in labview project they are not reading the correct value and only retruing zero
    any suggestions 
    Thanks

    Hi,
    I recently finished the commisioning of the system I started to work upon. Hence the delay to come back to this thread.
    During the commissioning of the system, I was concentrating on finalizing the system functionality and was using only the PC#1. Now when all the system functions were finalized, we duplicated the changes to PC#2 and started the operation.
    What we observed when the PC#2 was started, was that if we were to open the same HMI page as in PC#1, the operation of the HMI was very sluggish. When we selected a different page for both PC#1 and PC#2, the HMI operation was good,  all operations seemed to happen in real time!!
    To give a background of the HMI, we have a subpanel to which the desired HMI page/screen is loaded. This loads a VI related to the HMI page.
    Here, I am guessing that when I load the same page in both the PCs, the read/write operations to the shared variable(it is the same in both PC, and is deployed in a library on the cRIO) are some how hindered due both PCs trying to access the same network resource from different locations.
    Is this guess correct? Any work arounds or solutions? Do I need to post any more information?
    Thanks in advance,
    Regards

  • Adding zeros to a variable..

    I hav ea program that manipulates/works on six digit number entered by user.what i want is that if user enters less than 6 digits, program adds zeros at the end of number to make it 6 digit. like if user enters 241 program converts it into 241000 before manipulating it.which area i must look into? contecating or what?

    Strings? Strings? We don' need no stinkin' Strings!
      while(x < 100000) x *= 10;this code works for all non-zero input that is actually 6 digits or less.
    You didn't specify what you want to do for zero input, or negative input, or too long input. Here is some more robust code that works for all those cases, but you will need to check if it does what you want.
      int digitLimit = 1000000; // number of zeros here is number of digits.
      if(x<0){ // input was negative
        while(x <= -digitLimit){x /= 10;}
        x = -x; // done backwards to prevent failure on smallest possible negative number
      } else if (x = 0) { // input was zero
        x = 123456;
      } else if (x >= digitLimit) { // input was too big
        while(x >= digitLimit) {x /= 10;}  
      // this final pass deals with both small neg and small pos
      while(x < digitLimit/10){x *= 10;}

  • Set an undefined Loaded variable's alpha to 0

    Hi, I'm trying creating a flash navigation bar that can be edited via a simple text file. I'm able to load my different variables properly but i also want to give the user the ability to remove links. I can simply leave the variable from the text file blank and and have the text in the swf disappear but i also want to be able to set the alpha of the movieclip behind the text to zero when the variable is left blank. Alternatively, even if the user could simply set the variable to the string "Blank" and both the alpha of the dynamic text and movieclip would change to zero that would be functional as well. Here is the code i have so far.
    NavLoadVar = new LoadVars();
    NavLoadVar.load("navigation.txt");
    NavLoadVar.onLoad = function() {
         b1.text = NavLoadVar.b1text;
         b2.text = NavLoadVar.b2text;
         b3.text = NavLoadVar.b3text;
         b4.text = NavLoadVar.b4text;
         b5.text = NavLoadVar.b5text;
         b6.text = NavLoadVar.b6text;
         b7.text = NavLoadVar.b7text;
         b8.text = NavLoadVar.b8text;
    if (NavLoadVar.b1text == "Blank") {
         divider1._alpha = 0;

    Something like the following should work...
    NavLoadVar.onLoad = function() {
         for(i=1; i<9; i++){
              if (NavLoadVar["b"+i+"text"] == "Blank") {
                   this["divider"+i]._alpha = 0;
              } else {
                   this["b"+i].text = NavLoadVar["b"+i+"text"] ;

  • Leading zeroes truncated in Write statement

    Hi,
    I want to maintain leading zeroes into an variable
    but the following statement
    write (<char_from>) to l_char22. truncates the leading zeroes.
    Please let me know if there is any way that I could acheive this.
    Best Regards,
    Arun

    Ex: <ls_guidconv>-partner has a value of '000071'
    Consider the following code,
    l_char23 = '<ls_guidconv>-partner'.
    Assign l_char23 to <l_char24>.
    Write (<l_char24>) To l_char25
    This will give me a value of 71
    If I use move 
    Move (<l_char24>) To l_char25 >> syntax error
    Move <l_char24> To l_char25
    I get the result as a string <ls_guidconv>-partner
    <ls_guidconv>-partner can have values maximum of length 10
    since a variable we use is of 25 chars (l_char25)
    if i use the FM CONVERSION_EXIT_ALPHA_INPUT it does puts
    the leading 0's but for the maximum length of 25 instead
    of 10.
    Thanks for your quick response.
    Arun.

  • SAPSCRIPT - Symbol for removing leading spaces/zero's?

    Hi,
    How do you remove leading spaces/zeros in a variable that is sent from the print program?
    Do you use symbols and if so, how (i've never worked with symbols, ever)?
    Please help.
    Thanks,
    John

    I think the "Z" symbol will remove the zeros in the sapscript form.  For example,......
    /     &EKKO-EBELN(Z)&
    Regards,
    Rich Heilman

  • Command for remove zeros in sapscript

    Hello:
    I need to remove zeros of a variable in a sapscript,
    TALGN = 0000427795776
    and I need to remove the zeros so:
    TALGN = 427795776
    But sometimes will be 3, 4 or more zeros, is there a way to do it with a sapscript command? or this should be done in the program?
    Best regards and thank you for your help.
    Miriam

    Hi Miriam,
    In SAP Scripts , you have Layout Set Symbols which you can use for doing things like :-
    Getting Offset - &SYMBOL+4&
    Length - &SYMBOL(5)&
    If symbol is initial ,output nothing - &SYMBOL(I)&
    Suppress Leading zeroes - &SYMBOL(Z)&.
    And many more such symbols.
    Hence, you dunt need to write the code in your driving program  and pass to the Script.
    You can directly use these symbols in your script and get things done in simple manner.
    Hope this helps...
    Regards,
                 Samreen...

  • Error message with PCR.

    The logic of PCR is as follows :
    Compute 15% of /117.And assign this to WT 1223.
    Compute 27% of /117
    Subtract Wt /3F4,MF10,9805,9809 and 9810 from 27% of /117.Assign this to WT 1224.
    I have written a PCR which is giving an output error message :
    ****Variable ZVAR does not exist in table VAR                                             *   ZX      
    I have written a PCR with following code
        " /117 Superannuation Basis                       
            TABLEP0185 Read table fields                  
          " VARGBICTYP Tab.field VVVVV v.ky               
            " ZX                                          
                ZERO= RNA  AmtNumRteTime = 0              
                AMT=  /117 Set                            
                AMT*0.15   Multiplication                 
                ZERO=&ZVAR VVVV Set zero                  
                ADDWT&ZVAR VAR  Variable table            
                ADDWT 1223 OT   Output table              
                ZERO= RNA  AmtNumRteTime = 0              
                AMT=  /117 Set                            
                AMT*0.27   Multiplication                 
                ZERO=&ZVA1 VVVV Set zero                  
                ADDWT&ZVA1 VAR  Variable table            
                PRINT&ZVA1 Print variable VVVV            
                ZERO= RNA  AmtNumRteTime = 0              
                AMT=  /3F4 Set                            
                AMT+  MF10 Addition                       
                AMT+  9805 Addition                       
                AMT+  9809 Addition                       
                AMT+  9810 Addition                       
                ZERO=&ZVAR VVVV Set zero                  
                ADDWT&ZVAR VAR  Variable table            
                PRINT&ZVAR Print variable VVVV            
                ZERO= RNA  AmtNumRteTime = 0              
                AMT=&ZVA1  Set                            
                AMT-&ZVAR  Subtraction                    
                ADDWT 1224 OT   Output table              
    I am attaching the output from payroll log which is as follows :
    Rule   ESGPCR VaKey    Operation                                                                               
    ZSAN      *            TABLEP0185                                                                            
    ZSAN      *            VARGBICTYP                                                                            
    ZSAN      *   ZX       ZERO= RNA                                                                               
    ZSAN      *   ZX       AMT=  /117                                                                            
    ZSAN      *   ZX       AMT*0.15                                                                               
    ZSAN      *   ZX       ZERO=&ZVAR                                                                            
    ZSAN      *   ZX       ADDWT&ZVAR                                                                            
    ZSAN      *   ZX       NEXTR A                                                                               
    ZSAN      *   ZX       ADDWT 1223                                                                            
    ZSAN      *   ZX       ZERO= RNA                                                                               
    ZSAN      *   ZX       AMT=  /117                                                                            
    ZSAN      *   ZX       AMT*0.27                                                                               
    ZSAN      *   ZX       ZERO=&ZVA1                                                                            
    ZSAN      *   ZX       NEXTR B                                                                               
    ZSAN      *   ZX       ADDWT&ZVA1                                                                            
    ZSAN      *   ZX       PRINT&ZVA1                                                                               
    WType    Rate                         Number                 Amount                                                                               
    ZVA1                     0.00                         0.00               5,751.00                                                                               
    ZSAN      *   ZX       ZERO= RNA                                                                               
    ZSAN      *   ZX       AMT=  /3F4                                                                            
    ZSAN      *   ZX       AMT+  MF10                                                                            
    ZSAN      *   ZX       NEXTR C                                                                               
    ZSAN      *   ZX       AMT+  9805                                                                            
    ZSAN      *   ZX       AMT+  9809                                                                            
    ZSAN      *   ZX       AMT+  9810                                                                            
    ZSAN      *   ZX       ZERO=&ZVAR                                                                            
    ZSAN      *   ZX       ADDWT&ZVAR                                                                            
    ZSAN      *   ZX       NEXTR D                                                                               
    ZSAN      *   ZX       PRINT&ZVAR                                                                            
    ****Variable ZVAR does not exist in table VAR                                             *   ZX       PRINT&ZVAR****
    ZSAN      *   ZX       ZERO= RNA

    Hi
    Other variables are correct, please check, like ZVA1 etc.
    ZERO=&ZVAR VVVV Set zero
    ADDWT&ZVAR VAR Variable table
    In the first lines, you did not maintain print statement. Please check.
    Regards
    Team Member.

  • Report Prompt & User Response

    Hello All,
             Created a BOBJ Report from BEx query. I need to achieve the below tasks for the report.
             1. List of Values shows leading zeros on the Report Prompt, can we remove those leading zeros on the
                 report prompt ( BEx report doesnot show any leading zeros on the variable screen when running report)
             2. The Users need a set of selection values to be displayed on the report, For Ex: Material, Profit Center.
                 They want to see what they have selected at the prompt which was done using the User Reposne.
                  The question is they want to see the Key Value instead of the Text of the material, is this possible.
    Please look into and update with your valuable suggestions.
    Regards,
    Raj

    Hello Rohit,
            Thanks for your quick reply.
            I followed  your steps and created a variable for User Reposne and another variable with the where condition
            to populate the Material Key.
            But I am getting the following error as InList is looking for a list of values, not the User Reponse as the List Of Values.
            Error - Missing or bad operand in 'InList' expression at position 51. (WIS 10070)
           My Formula : =([L01 Material Key]) Where ([L01 Material] InList [vURMat])
           Where vURMat: =UserResponse("Material")
           L01 Material is the Material Desc.
           Please look into and let me know where I am going wrong.
    Regards,
    Raj

  • Printing value fields with negative sign??

    Hello Experts,
    I have developed a interface, which writes the invoice data to application server/unix, this is a notepad. My specifications are as below,
    MWSK1(2)   TaxCode                         65     2     KONV-MWSK1     
    KWERT(13)  Condition Value                  67     13   KONV-KWERT     
    KSTEU(1)  Condition Control                80     1     KONV-KSTE
    I have to print KWERT value from 67th position until 13 positions, meaning until 80 positions, fine. My code is as below,
      MOVE: wa_invoice_price-mwsk1  TO unix_file+64(2).
      WRITE: wa_invoice_price-kwert    TO unix_file+66(13) RIGHT-JUSTIFIED.
      MOVE:  wa_invoice_price-ksteu    TO unix_file+79(1),
    So, it printing like below (pls. note 0.04 minus value in right bottom corner)
    P26701ZCG620101006C          100.00         0.00USD  1    UGL            0.00A A 9
    P60001ZF3520101006C          100.00         0.00USD  1    UGLG          0.04-H B 9
    But, business want to have like below (pls. note the DIFFERENCE for 0.04 minus value in right bottom corner),
    P26701ZCG620101006C         100.00        0.00USD  1    UGL               0.00   A A 9
    P60001ZF3520101006C         100.00         0.00USD  1    UGLG             0.04 - H B 9
    meaning, the 13th position should be negative sign (if at all any value does have a negative sign, else its normal)....so, the negative sign should sit on 13th postion. As am using WRITE statement with RIGHT JUSTIFIED am facing thisissue!! as u know we can not send a 'P' type value to unix/apps server, pls. let me know how to get it done?
    Thank you

    why can't the user live with a leading sign, like '-   0.04'?  If possible, do
    shift <fieldname> circular up to '-'.
    Or, if value is less than zero, set another variable to '-', else set to space, and multiply value with '-1', like:
    if <field> < 0.
       lv_sign = '-'.                " neagtive value
      <field> = <field> * '-1'.  "reverse the sign
    else.
    lv_sign = space.          "positive value
    endif.
    then, adjust your field length and insert a sign column or simply add a column for the sign....

  • On migration of Mac Office Excel the date values are changed to mm/dd/yy

    I recently upgraded to new iMac and migrated my MacOffice 2008 and now find that all my date data is forced into the American date format (mm/dd/yy). I have phoned Apple support  - no help! Microsoft no online help. Not only is the entry data changed but I have to use the awkward data entry format of mm/dd/yy very unnatural to a non American.
    I have searched in Excel preferences and confirmed my OS X 10.10 settings (languages and date formats) all using dd/mm/yy as input and display.
    If I enter a date into the spreadsheet say 1/8/14 (meaning 1st August) it comes back with 8th January. Is there a fix or do I have to wear that nonsense?
    Any ideas out there? This problem did not exist in Mavericks.
    thanks, Sigi

    kumar73 wrote:
    v_date := TO_DATE(TO_CHAR(ZKAW__DATE_DT_MM)||'/'||TO_CHAR(ZKAW__DATE_DT_DD)||'/'||TO_CHAR(ZKAW__MAT_DT_CCYY),'MM/DD/YYYY') ;
    to get the date value . provided if all the above fields are having values not zeros .
    My requirement is if any of the above stated fileds are having spaces or zeros then I had to assign spaces or zeros to the variable .So many misconceptions.
    You start with numbers not dates. You convert those numbers to dates when you can and every time you need to use them, which is why it would be better to store dates in the first place.
    You cannot assign either 0 or spaces to a date variable because neither 0 or space is a valid date. You should probably assign it to null.

  • Suppression of nulls in Flash line graph

    I am running APEX 3.0.1. I have an application that displays a 2D Flash line chart of a time series of 4 variables as 4 different colored lines. This works quite well. In some cases one of the variables is null (data is not yet available). Currently, my Flash chart shows the variable going to zero if that variable is null. Instead, I would like my chart of that variable to stop at the last reported value, showing a break in the line when the variable is null.
    Any suggestions (custom XML, a chart setting change, etc) would be gratefully appreciated.
    Alvin Steele

    Alvin,
    This was requested by several APEX users, and the behavior will be updated for APEX 3.1. In APEX 3.0.1, I don't think there's much you can do without generating the XML entirely yourself using a custom procedure or process.
    You can check that 3.1 will work as you expect by testing on the Evaluation instance ( http://forums.oracle.com/forums/ann.jspa?annID=647)
    - Marco

  • BC4J: Updating calculated attributes

    We're working on some web services with BC4J. For querying data, we have various tags which are calculated. I'm looking for the best practice for receiving updates to those calculated values.
    For example, the web service needs to work with the <countyFIPSCode> element, which might have a value of 55043. Internally, that might relate to our county_code = 21.
    It's easy enough to build a BC4J calculated attribute for countyFIPSCode, and that's perfect for queries. But I'm looking for the best approach for handling an update or insert that has a value for countyFIPSCode.
    For example, one way would be to absorb the XML document, find the <countyFIPSCode> element, get the value, call a database function to get my internal county_code, and use it for the update. I can see lots of approaches, though, and I certainly haven't plumbed the depths of what BC4J can do, so I'm wondering what would be best approach.
    -- jim

    If you allow the transient CountyFIPSCode attribute to be updateable, then in the setCountyFIPSCode() method in the view row class (or optionally at the entity level if you want to enable this CountyFIPSCode->NormalCountyCode mapping), just after invoking the setAttributeInternal() method to set the value of the transient attribute, you can remap the value, then invoke the setCountyCode() method with the remapped value.
    How you accomplish the mapping would depend on how many different county-codes there are. If you have an existing stored function that does the mapping, you could just write an expert-mode view object that looks like:
    select yourfunction.map_fips_to_county(:0) as county_code from dualThen you can use this VO to set a value for the zero-th bind variable with the value of the FIPS code, then retrieve the value of the "CountryCode" attribute in the resulting row.

  • DSC alarms are blinking when they shouldn't

    I have a bunch of shared variables on my front panel.  Some of them have alarming enabled, with the option to blink when alarming.  I programmatically disable all alarms at startup of the VI, but some of them blink when there is a value of zero for the variable.  Anything above zero causes the blinking to stop.  It even does it for a variable that I disabled the alarming for, using the shared variable properties.  I can use the "Read Alarms" vi, and there is nothing being reported.

    Hi Brian,
    Couple of questions - what version of LV and DSC are you using? How are you having your shared variables set up to blink? It sounds like there is some other factor than the alarm that is triggering the blinking since Read Alarms doesn't have anything AND you have alarming turned off and they are still blinking. I would suggest either 1) deleting and re-adding your variables in case something became corrupt or there is some other underlying alarm that is causing the blinking or 2) get rid of the blinking feature, ensure the variables work correctly, and then add it back one at a time to check to see where the problem is. You could also post your code for myself or others to take a look at and possibly find the problem. Thanks!
    Stephanie

Maybe you are looking for

  • Every time I sync my Iphone and iPad to itunes it makes me restore them. Why?

    Every time I sync my Iphone and iPad to itunes, it makes me restore them, Why does it do this?

  • ABAP Code Corrections

    Hi Experts Please correct the ABAP CODE written as Field routine in Transformations Requirment If ZB_AMT = '0.00' then result should be '0.00' If ZB_AMT '0.00' and SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' the result should be CONCATENATE '$' SOURCE_FIEL

  • What is this error: "The item is not on an edit frame boundary."?

    I exported XML from one computer and imported into another and got the message: Final Cut Pro encountered an error importing the XML file.  The error log says: "The item is not on an edit frame boundary (durations+"80679599/3000000s": /fcpxml{1}/proj

  • Spotify and Flash Player 10.3

    My Spotify didn't functioning (didn't "answer") suddenly. When I deleted Flash Player 10.3 Spotify worked again. Trying to download Flash Player again; same result. This means I have to decide whether I shall give priority to Spotify or the abality t

  • Regarding bar code scanning

    Hi Gurus, I have one requirement. After scanning the barcode, that barcode value is populating in the selection screen of a program. My requirement is, after the value is filled in selection screen by barcode scanning, the report has to be executed a