How to get last 4 digits of a particular field?

Hi to all,
here i have three fields,
f1 length 18 char,
f2 length 4 char,
f3 length 4 char,
now i want to take last 4 char of f1 to f2 and the same i have to pass to f3.
how to do this?
regards,
swami

Hi,
1. Take the maximum length of the field. Pass it to an integer  variable. Lets say L1.
2. Subtract this variable by 4. Move this value to another variable. Lets say L2.
3. WRITE F1+L2(4) TO F3.
Sample Code.
REPORT  zmaytest.
DATA : f1 TYPE string VALUE 'abcdefghijk',
           f2(4) TYPE C,
           f3(4) TYPE C.
DATA : l1 TYPE i,
            l2 TYPE i.
START-OF-SELECTION.
  l1 =  STRLEN( f1 ).
  l2 = l1 - 4.
  WRITE f1+l2(4) TO f2.
  WRITE f1+l2(4) TO f3.
  WRITE: / 'F2', F2.
  WRITE: / 'F3', F3.
Regards,
Mayank

Similar Messages

  • How to get number of digits in given amount

    Hi Experts,
    How to get number of digits in given amount.
    Regards
    Mohit

    Check this :
    data: v_data1 type p decimals 3 value '12.860',
          v_char1 type char20,
          v_char2 type char20,
          v_char3 type char20,
          len type i.
    write v_data1 to v_char1.
    split v_char1 at '.' into v_char2 v_char3.
    len = strlen( v_char3 ).
    write:/ v_char2,
          / v_char3, " this holds the digit value
          / len.     " number digits

  • How to get last Build date of a dll in the real time target

    Info On My Project    
       I am working on LabWindows CVI 12.0 for development . This project is a real time application for hardware, which is having Phar Lap ETS as RTOS...  
    I am facing some problems while checking Build date of my Application file( .dll)
    I have tried to use GetFileDate API. But it is not supporting for realtime Target..
    So i have tried __DATE__ macro.. That also having some problems..
    How to get last Build date of a dll from the real time target  ??
    Please Help to solve this....
    Thanks
    Vaishakh A  K

    Please reply if any one have suggestion...

  • How to Get last page number in report 10g

    I want to get last page number in report but Current page number found from srw.get_page_num(n)
    but i want to get last page number for conditional formating like this
    srw.get_page_num(current_page)=last_page
    pls help me how can get last page number;
    pls help;
    thanks in advanced;

    Hi,
    you can use the Property Print Object On for this.
    Regards
    Rainer

  • How to get temperature from digital camera in to controller

    how to get temperature from digital camera in polarising microscope using t95 controller without adc.dll
     

    Ask the manufacturer of your camera…
    What kind of answer do you expect?

  • How to get last column used in report sorting?

    hi,
    how to get last column used in report sorting?
    simon

    How to identifiy which column was sorted having different reports on page?
    just use:
    'YOUR_STATIC_REGION_NAME' instead of p_static_id,
    :APP_ID for p_app_id,
    :APP_PAGE_ID for p_page_id
    :APP_USER_ID for p_app_user.
    and dont forget to grant SELECT on #OWNER# to APEX_030200.WWV_FLOW_PREFERENCES$
    good luck and thank you Juergen.Schuster
    Simon

  • How to get last date of the week

    hi,
    how to get last date of the week like FM WEEK_GET_FIRST_DAY gives the date of the first day of the week i need the date of the last day of the week..
    thnx

    data : p_week type KWEEK,
    p_Date type SYDATUM.
    p_week = <incoming value in week of year>
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
    week = p_week
    IMPORTING
    DATE = p_date
    EXCEPTIONS
    WEEK_INVALID = 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.
    To get the last day of the week.
    p_date = p_date + 6.
    You can find the available fm in the system from se37 transaction code.

  • How to get a minus sign with the cost  field in ALV.

    Hi ,
    How to get a minus sign with the cost field in ALV.
    The Ouput will be displayed like  Rs -1500 instead of 1500-
    I can't use concatenate also as i may have to use the sum functionality of ALV .
    Cheers
    Sunny

    Hi sunny,
    1. The OTHER FIELD
       has to be character field of say length 15.
    2. Write the original numeric value to
       this character field (in a loop)
    3. But simply writing won't help.
    4. use this kind of logic.
    5.
    REPORT abc.
    DATA : m TYPE i.
    DATA : chr(15) TYPE c.
    m = -100.
    WRITE m TO chr.
    IF m < 0.
      SHIFT chr RIGHT BY 1 PLACES.
      CONDENSE chr.
      CONCATENATE '-' chr INTO chr.
    ENDIF.
    WRITE chr.
    regards,
    amit m.

  • How to get a organization name for a particular user using API's

    Hi alll,
    How to get a organization name for a particular user using API's

    You need to do something like this:
    SearchCriteria criteria = new SearchCriteria("User Login", "XELSYSADM", SearchCriteria.Operator.EQUAL);
                   UserManager usrService = oimClient.getService(UserManager.class);
                   Set<String> retAttrs = new HashSet<String>();
                   retAttrs.add(UserManagerConstants.AttributeName.USER_ORGANIZATION.getId());
                   List<oracle.iam.identity.usermgmt.vo.User> users = usrService.search(criteria, retAttrs, null);
                   System.out.println("ORG KEY :: " + users.get(0).getAttribute("act_key"));

  • How to get the histoical data for newly added field in the cube?

    Hi Experts,
    I have small doubt on remodeling the infocube.
    After adding the characteristic or keyfigure  to a cube by using remodeling concept, how can I get the historical data for that particular field.
    I have searched in SDN also but I didn't get proper information.
    Please excuse me if I posted repeated question.
    helpful answer will be awarded with poitns.
    Thanks & regards,
    Venkat.

    hi
    depending on your customer need you could use the remodelling functionnality but sometimes you have no way to retrieve what you want so another option you should consider is the following:
    Advantages
    that will cost less effort and guarantee the result.
    Drawbacks
    data is redondant for a while
    space (depending on the volume of historical data)
    So here are the steps :
    step 1Adjust your extraction process according to the fields you need to add to populate the cube.
    step 2 Then create a dso next or even a cube, feed the dso with a full load with the enhanced extractor you adjusted with the new fields in step 1 only once in fact this should be one shot.
    step 3 Copy the query to the previous built  multi-provider on top of the new historical data from dso and the running live delta cube. Adjust the queries if necessary.
    optionnal Then if you want to get rid of the dso or new cube for historical data you could empty the actual one push the data from the new data provider and that's all.
    bye
    Boujema

  • How to get documents from RMS linked to particular case id using webdynpro

    HI friends,
    Can  anybody knows " How to get documents from RMS linked to particular case id."
    From end: webdynpro
    backend: RMS.
    please do the needful.
    Thanks and Regards
    -Sujatha

    HI friends,
    Can  anybody knows " How to get documents from RMS linked to particular case id."
    From end: webdynpro
    backend: RMS.
    please do the needful.
    Thanks and Regards
    -Sujatha

  • How to get the 4 digits year from 2 digits

    Hi ,
    I have a column which stores the last two digits of the year like 08,09,10 etc.. Now I need to get the complete year number from these two digits. Is there any function in oracle which will help this purpose.
    Thanks,

    Hi,
    user8640661 wrote:
    Hi ,
    I have a column which stores the last two digits of the year like 08,09,10 etc.. Now I need to get the complete year number from these two digits. Is there any function in oracle which will help this purpose.
    Thanks,What are the other two digits?
    If they're always '20', then concatenate '20' to your existing column (which I assume is a string):
    '20' || a_columnIf the first 2 digits are '20' when the existing sting is in the range '00' to '49', but '19' when the existing string is in the range '50' to '99', then use the 'RR' date format:
    TO_CHAR ( TO_DATE (a_column, 'RR')
            , 'YYYY'
            )but hurry; this will behave differently starting in 2050.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.

  • How to get last day of prev month?

    SELECT to_char(SYSDATE, 'MM') -1, last_day(sysdate)
    FROM DUAL;
    If current month is April, How to get the last day of March? Thanks.

    SQL> select sysdate, trunc(sysdate, 'mm') - 1 from dual ;
    SYSDATE     TRUNC(SYSDA
    06-APR-2004 31-MAR-2004
    1 row selected.
    SQL>

  • How to get last geo position, after 24 hours offline?

    I lost my iphone 5. Then i use the app "find my iphone". And it told that its offline, and i coudnt see the last geo position. How can I get last geoposition?

    Unless you installed a "finder" app that would upload that information there is no way to get previous locations.

  • How to get last used IP addres of my stolen mac?

    Hello, my mac was stolen. I was notified about address where it was used, also status changed to "Locked". How can I get last IP address of my mac, because it's the only way how I can help to police.

    Unfortunately, there is only the information which shown to you by "Find My iPhone".

Maybe you are looking for

  • New Computer and trying to download form Adobe my subscription to the new computer (Adopbe Acrobat) -

    New Computer and trying to download form Adobe my subscription to the new computer (Adopbe Acrobat) need help!

  • Hard Drive Failed, issue installing windows 7 pro

    Hi all, and thanks for the help. So, I have this HP computer that crashed. Unfortunetly I wasn't correctly running backups and something happened to the hard drive. So, I wiped it clean..... I never had a Windows 7 Pro install disk. So when I went to

  • HOW TO GET RANKED IN GOOGLE SEARCH ENGINE LIST

    Hello, My Name is Etay and We have published a website (Apex 4.x) few weeks ago : (http://www.postme.co.il) In order for google to rank the website I have used : 1. Page 0 method. 2. sitemap generated by : http://www.xml-sitemaps.com 3. Rewrite Mod (

  • Browse sequences in WebHelp Pro

    I publish my project to WebHelp Pro and the browse sequence buttons appear but they do not work. Do browse sequences work in WebHelp Pro. They work fine for the same project when published to WebHelp. Thanks for any help. I am using RoboHelp 7 and Ro

  • Cannot find mixers in java

    I am trying to find the mixers on the system using Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); but nothing is showing up in the array so I have no mixers available. I am on a Linux system and I can use input and output fine through an OSS mi