Timestamp Conversion Function Module

Hi all,
>>We are bringing time stamp value (like 20072404161312) from CRM ,we need to convert into date & time. I need function module which one does this...
>>We are are storing the time duration in min format (its key figure). I need to populate in reports as HR:MN:SS , How we can do this? Is there any function module is available for this?
Thanks in Advance

Hello Arun,
The timestamp is in the format <date><time>. In your example (20072404161312), the date is 20072404 and time is 161312. You can transfer the timestamp into a string and then split the data. You can use the following ABAP code to separate the date from the time:
* w_ts is your timestamp, w_s is the temporary string
*w_date and w_time will be your final date and time.
data: w_ts type timestamp.
data: w_s type string.
data: w_date type sy-datum,
      w_time type sy-uzeit.
w_ts = '20072404161312'.
* Here is the code you need:
w_s = w_ts.
w_date = w_s(8).
w_time = w_s+8(6).
Hope this helps.
Hope this helps.

Similar Messages

  • Conversion function module

    Hello Friends,
              When ever i down load into excel file the filed 'WERKS' is becoming from '0780' to 780 and when i try to upload i am getting as 780 which is creating  some problems. Is there any conversion function module to convert the the field WERKS from 780 to 0780.
    Thanks in advance.
    Siva Kumar.

    Hi
    When you are using FM 'GUI_DOWNLOAD' to download to excel file, you need to populate the parameter FILE TYPE with DBF.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = p_file
    <b>filetype = 'DBF'</b>
    Thanks
    Vijay
    PLZ reward points if helpful

  • Date Conversion Function Modules YYYYMMDD to MM/DD/YYYY

    Hi,
    I have a requirement to Conver the Dats from format: YYYYMMDD into the Format : MM/DD/YYYY. Can you  please suggest me a suitabble Standard Function Module if exists? If not please suggest me a solution for this data conversion.
    Thanks,
    Rajan.SA

    Hi,
    You can use WRITE FORMATING.
    Here the sample code:
    DATA: BEGDA       TYPE TEXT10,
          ENDDA       TYPE SY-DATUM.
      WRITE SY-DATUM TO BEGDA MM/DD/YYYY.
      WRITE SY-DATUM TO ENDDA MM/DD/YYYY.
    And of course you can use other format, like:
    ... DD/MM/YY
    ... MM/DD/YY
    ... DD/MM/YYYY
    ... MM/DD/YYYY
    ... DDMMYY
    ... MMDDYY
    ... YYMMDD
    Or you can use concatenate statement:
        concatenate SY-DATUM+4(2) SY-DATUM+6(2)
        SY-DATUM(4) INTO BEGDA separated by '/'.
    Regards,

  • Conversion Function module for Volume

    hi,
      Is there any standard function module to do the conversion of VOLUME.
    for example : if i have source volume in one unit & i want it in another unit.
    regards,
    srikanth,Intelligroup.

    If it is a straight conversion and you do not need to use the conversion factors tied to a material then you can do something like this.
    report zrich_0001.
    parameters: p_qtyi type p decimals 2,
                p_uomi type t006a-msehi,
                p_uomo type t006a-msehi,
                p_qtyo type p decimals 2.
    at selection-screen.
      call function 'UNIT_CONVERSION_SIMPLE'
        exporting
          input                      = p_qtyi
    *   NO_TYPE_CHECK              = 'X'
    *   ROUND_SIGN                 = ' '
         unit_in                    = p_uomi
         unit_out                   = p_uomo
      importing
    *   ADD_CONST                  =
    *   DECIMALS                   =
    *   DENOMINATOR                =
    *   NUMERATOR                  =
         output                     = p_qtyo
    * EXCEPTIONS
    *   CONVERSION_NOT_FOUND       = 1
    *   DIVISION_BY_ZERO           = 2
    *   INPUT_INVALID              = 3
    *   OUTPUT_INVALID             = 4
    *   OVERFLOW                   = 5
    *   TYPE_INVALID               = 6
    *   UNITS_MISSING              = 7
    *   UNIT_IN_NOT_FOUND          = 8
    *   UNIT_OUT_NOT_FOUND         = 9
    *   OTHERS                     = 10
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Regards,
    Rich Heilman

  • Unit conversion  function module

    Hi,
    Can anyone give me the details of this function module
    Function Module name: MENGE_UMRECHNEN.
    its urgent.
    Thanks in advance.
    vaibhav

    Hi Vaibhav,
    This function module gives you the provision of conversion of quantities from Base Unit of Measure to any of the Alternative Unit of Measures or vice-versa.
    But this function would be done only for the materials and its limitation would be determined by the data maintained for a material in T006 table.
    Using this FM you can convert a material quantitity of unit 'X' to unit 'Y' only if 'X' and 'Y' are of the same dimension.
    <b>Reward points if this helps,
    Kiran</b>

  • Quantity Conversion Function Module

    Hi,
    I am using BW7.0's feature - Quantity Conversion (TCode: RSUOM).
    I could use it for converting quantity for different unit on the fly during report time.
    Now, I would like to do convert during data upload. Is there any function module that can help?
    Please note that the quantity conversion factor is "Material dependent".
    Thanks in advance.
    Best Regards,
    Chris

    Hi,.
    1) In the BEx Tab page of
    Characteristic 0MATERIAL, maintained the field "Base Unit of Measure" as 0BASE_UOM .
    2) In the BEx Tab page of
    Characteristic 0MATERIAL, maintained the field "Unit of Measure for Char." by click on the New button, it will generate a DataStore Object, which will store information for calculating the conversion factor.
    3) Fill in the DataStore generated with data, using the DataSource 0MAT_UNIT_ATTR.
    Note that we must NOT use the the former infosource technique and update rules for loading data to it. Use transformation and DTP, else the SID could not be loaded to it.
    (I stuck with this problem before..:))
    4) Create a Quantity Conversion Type through TCode RSUOM, the Conversion factor can choose 1,3 or 4, with reference to 0MATERIAL InfoObject.
    5) Then in any query of cube with 0MATERIAL in it, the quantity conversion type defined in step 4 could be use for displaying data in other UOM~
    Hareesh

  • Currency conversion function module

    hi all,
    i want to change the currency to GBP so i need help regarding which standard sap function module will support for my solution.
    can any one help me out, thanks in advance.

    You can use
    <b>CONVERT_TO_LOCAL_CURRENCY</b>
    <b>SAP Documentation for the same is as follow :-</b>
    Translate foreign currency amount to local currency
    An amount in local currency is calculated from a specified foreign currency amount. For this, you may either specify the translation rate manually (Parameter RATE) or have the system determine it from table TCURR on the basis of the rate type, date and currency key. Because the ratios for the units of the currencies involved in the translation are significant for this translation, table TCURF is always read by the program, and there must be a valid entry there for the data specified. IF exchange rate fixing is defined for the exchange rate type TYPE_OF_RATE or an alternative exchange rate is defined for the currency pair, this information is transferred to the calling program.
    When table TCURR is read, the foreign currency key is always taken as the first part of the key and the local currency as the second part.
    Sample call-up:
      CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
        EXPORTING   DATE             = BKPF-WWERT
                    FOREIGN_CURRENCY = BKPF-WAERS
                    LOCAL_CURRENCY   = T001-WAERS
                    FOREIGN_AMOUNT   = BSEG-WRBTR
                     RATE             = BKPF-KURSF
                    TYPE_OF_RATE     = 'M'
        IMPORTING   EXCHANGE_RATE    = KURS
                     LOCAL_AMOUNT     = BSEG-DMBTR
                    FOREIGN_FACTOR   = FAKTOR-F
                     LOCAL_FACTOR     = FAKTOR-L
                     FIXED_RATE       = FIXKURS
        EXCEPTIONS  NO_RATE_FOUND    = 4
                    NO_FACTORS_FOUND = 8.
    Hope this helps you..
    Enjoy SAP.
    Pankaj Singh

  • Profit center conversion Function Module

    Hi,
    Is there Any Function Module to  Convert Profit Center from 4 digit into 10 digit.
    Regards,
    Dhanush.S.T

    Try using FM CONVERSION_EXIT_ALPHA_INPUT.
    data: lv_prctr type prctr value '1234'.
    CALL 'CONVERSION_EXIT_ALPHA_INPUT'
      exporting input = lv_prctr
      importing output = lv_prctr.
    "After this call lv_prctr will have values '0000001234'.
    Hope this helps.
    Thanks,
    Balaji

  • Function Module to get Date and Time out of Timestamp

    Hi,
    Source system timestamp field CREATED_TS of Type DEC-15
    BW PSA data in format 20.140.707.105.948
    In DSO, I have created two target InfoObjects; one for Date and one for Time.
    In transformation from PSA to DSO, in field level routine, I want to split timestamp into Date and Time.
    There is a function module CACS_TIMESTAMP_GET_DATE in source system but it is not available in BW. Another function module ADDR_CONVERT_TIMESTAMP_TO_DATE which is available in BW but returns only Date. 
    Does anyone know a function module in BW which takes Timestamp (PSA data in format 20.140.707.105.948) and returns Date and Time.
    Much better would be a FM which take timestamp and also Timezone  and returns Date and Time.
    Thanks
    Ahmad

    Timestamp to date time conversion (with time zone) is built into ABAP. Why use a function module?
    Read the ABAP help on CONVERT.

  • Function modules for unit conversion

    hai gurus.
    what is the function module to make one qty to the same unit as other qty.
    if one is in kg and other in pounds
    i want to make both in pounds.
    pls help me with this

    Hi
    chk UNIT_CONVERSION_SAMPLE
    also chk this
    CF_UT_UNIT_CONVERSION
    Some Insights-
    Unit conversions
    with NW2004s the HOW-TO GUIDE for qty conversion is obsolete.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/27/b65c42b4e05542e10000000a1550b0/content.htm
    As of SAP NetWeaver 2004s you can create quantity conversion types using transaction RSUOM.
    The business transaction rules of the conversion are established in the quantity conversion type. The conversion type is a combination of different parameters (conversion factors, source and target units of measure) that determine how the
    conversion is performed.
    In terms of functionality, quantity conversion is structured similarly to currency translation.
    Quantity conversion allows you to convert key figures with units that have different units of measure in the source system into a uniform unit of measure in the BI system when you update them into InfoCubes
    http://help.sap.com/saphelp_nw04s/helpdata/en/27/b38c4284a8c353e10000000a1550b0/content.htm
    It is entered in ODS table linked to info object (0material)
    What you need to do basically is-
    1 ) Goto your infoobject for eg- 0material
    2 ) In Info object Maintenance- Tab page- Bex Explorer
    3 ) Enter 0BASE_UOM in Base unit of measure
    4 ) Generate UOM ODS (System generates it with prefix UOM)
    It is made of 4 fields (1 more in case of compounding) with SID for them. This is the place where you enter numerator and
    denominator to calculate conversion factor
    5 ) Load the UOM ODS with conversion from 0MAT_UNIT_ATTR or flat file
    6 ) Define conversion type
    7 ) In the conversion type, then you can select 0Material in the dynamic determination of conversion factor
    8 ) Select source unit and target unit
    For more help refer SAP help file on NW2004s. It is comprehensive and even explain - How to do unit conversion in
    transformation rule?
    http://help.sap.com/saphelp_nw04s/helpdata/en/4f/707242df019c60e10000000a1550b0/content.htm
    Check this sample code,
      CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
        EXPORTING
    *     CLIENT                  = SY-MANDT
          DATE                    = pdate
          FOREIGN_AMOUNT          = p_amt1
          FOREIGN_CURRENCY        = p_curr1
          LOCAL_CURRENCY          = p_curr2
    *     RATE                    = 0
    *     TYPE_OF_RATE            = 'M'
    *     READ_TCURR              = 'X'
        IMPORTING
          EXCHANGE_RATE           = w_rate
          FOREIGN_FACTOR          = w_fact1
          LOCAL_AMOUNT            = w_amt
          LOCAL_FACTOR            = w_fact2
    *     EXCHANGE_RATEX          =
    *     FIXED_RATE              =
    *     DERIVED_RATE_TYPE       =
        EXCEPTIONS
          NO_RATE_FOUND           = 1
          OVERFLOW                = 2
          NO_FACTORS_FOUND        = 3
          NO_SPREAD_FOUND         = 4
          DERIVED_2_TIMES         = 5
          OTHERS                  = 6.
      IF SY-SUBRC <> 0.
        write: / 'Conversion to loc.curr. failed:',
                 p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
      ELSE.
        write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
               w_amt currency p_curr2, p_curr2,
               '(', w_rate, ')', w_fact1, w_fact2.
      ENDIF.
    http://www.geocities.com/victorav15/sapr3/examples/currconv.txt
    Check this
    CONVERSION_FACTOR_GET
    Measurement unit conversion: Get measurement unit conversion factor Not for Dimensionless Units of Measure
    UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding
    UNIT_OF_MEASURE_SAP_TO_ISO 
    UNIT_OF_MEASURE_ISO_TO_SAP
    MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa. For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.
    CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT
    CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT
    CONVERSION_EXIT_LUNIT_INPUT Conversion exit for technical (6-char) measurement unit INPUT
    CONVERSION_EXIT_LUNIT_OUTPUT Conversion exit for technical (6-char) measurement unit OUTPUT
    UNIT_OF_MEASUREMENT_HELP Input help for measurement units of a predefined dimension
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Reward all helpfull answers
    Regards
    Pavan

  • Function Module to get the TIMESTAMP

    Hi,
    Is there any function module to get the TIMESTAMP as Outout , if i give input Time and Date.
    Or,
    If I go for the concatenate statement.. Do I need to concate the commas in to the target field?
    Because,
    I am not getting the proper result with this concatenate statement where I concatenated the YYYYMMDDHHMMSS in to the DECIMAL 15 Variable.
    Thanks,
    Naveen Inuganti.

    Hi use
    IB_CONVERT_INTO_TIMESTAMP' or IB_CONVERT_FROM_TIMESTAMP'
    Example:
    * Declaring the work variables.......................
    DATA :
      timestamp like TZONREF-TSTAMPS,
      time      like sy-uzeit,
      date      like sy-datum.
    * The following function module is used to convert the
    * time and date into GMT timestamp
    CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
      EXPORTING
        i_datlo           = sy-datum
        i_timlo           = sy-uzeit
        I_TZONE           = 'INDIA'
    IMPORTING
       E_TIMESTAMP       = timestamp.
    * The following function module is used to convert the
    * above obtained timestamp to PST time zone date and time.
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        i_timestamp       = timestamp
        I_TZONE           = 'PST'
    IMPORTING
        E_DATLO           = date
        E_TIMLO           = time.
    write :/ 'Date and Time at PST zone is ',date, time.

  • Date conversion logic using function modules

    Hi there,
    I have been researching in the forum how data conversion is done in ABAP and I found out about the function modules
    CONVERSION_EXIT_LDATE_OUTPUT
    and
    MONTH_NAMES_GET
    It seems that the first function module can convert the date format 06/08/2011 to MONTH DD,YYYY and the second function can easily translate the month names once language SPRAS has been specified.
    Problem is I am not sure how I can convert my VBRK-FKDAT with format MM/DD/YYYY into the format DD MONTH YYYY format with the MONTH still dependent on the specified language.
    I tried to look at how to MONTH_NAMES_GET FM works and made this code:
    DATA: d_return like sy-subrc,
          itab_T247 like T247 occurs 0 with header line,
          gs_spras type spras.
    gs_spras = 'RU'.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
       LANGUAGE                    = gs_spras
    IMPORTING
       RETURN_CODE                 = d_return
      TABLES
        MONTH_NAMES                 = itab_T247
    EXCEPTIONS
       MONTH_NAMES_NOT_FOUND       = 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.
    Loop at itab_t247.
    Write:/ itab_t247-LTX.
    endloop.
    The code just lists the months in Russian (which is the language I need). I am just new to ABAP so I am an avid reader of the forum. I hope someone can help.
    Thanks,
    dgrachee

    Hi Dgrachee ;
    You can change it as follows.
    Best Regards.
    gs_spras = sy-langu. "'RU'.
    CALL FUNCTION 'MONTH_NAMES_GET'

  • Function Module for converting timestamp

    Hi all
    I have a scenario where in the timestamp is getting stored in a z table in the UTC format (i.e. 20,100,125,080,528).
    Now when i have to display this value to the user, it should be like "25.01.2010 08:05:28". Is there any standard function module to accomplish this? or is it like i have to do it in my code using the offset?
    please guide me.
    Thanks in advance.
    Regards
    Gaurav

    Hello
    Use this:
    DATA:
    tstamp  TYPE timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO DATE d TIME t.
    Just press F1 on TIME STAMP.

  • Function module required for time stamp conversion into MST

    Hello,
    Please let me know if there is a SAP function module that can convert timestamp from GMT or provided timestamp into MST. I will need to use this function in BW transformation.
    Thanks.

    Try this one: TZ_GLOBAL_TO_LOCAL.
    Haven't used it myself yet, but it looks good.
    Good luck!
    Best regards,
    Zhou

  • Function Module using Quantity conversion type

    Hi,
    I need to know the function module which uses the quantity conversion type created in RSUOM and should provide the converted value as the result.
    I know the function module which convert the units based on the input. But need to know the FM which uses conversion type.
    I tried conversion type available in the transformation rules. But it is not working for a particular case. So thought of doing the same inside a routine.
    Awaiting for your reply
    Thanks!

    Try this and check
    select vbakvbeln vbapposnr vbakvkorg vbakvtweg vbak~spart
    vbakvkgrp vbakvkbur vbapmatnr vbapmatkl vbap~zieme
    into CORRESPONDING FIELDS OF table it_data
    from vbak
    inner join vbap on vbapvbeln eq vbakvbeln
    where vbak-vbeln eq vbeln.
    Regards,
    Atish

Maybe you are looking for

  • Windows 8.1 UDI Task Sequence black background on Install software part

    Hi, when deploying Windows 8.1 to our notebooks, first part of task sequence we got normal background like shown here: but after applying OS and drivers and installing CM client, TS goes to installing software but with this black screen: It all goes

  • Creation of Source System(R/3)

    Hi,   I'm trying to create R/3 source system in BW(RSA1->Source system->Create) but it fails to create. I have created RFC Destination on both BW & R/3 systems. I tested them for 1) Test connection 2)Remote connection. Sucessfully able to remotely lo

  • PlSql Package in Jdeveloper

    I want to use Plsql packages for insert/update/delete in Jdeveloper Jsp forms . Can anyone help me regarding this . Thanks in Advance Thanks N.Nagarajan

  • Spell checker in SAP

    Hello, Please can I request that a spell checker be considered for a future release/version of SAP. Many thanks, Kate

  • About Physical Inventory

    Hi all, What is Physical Inventory? What are the different types of physical inventory processes does SAP support? Thanks in advance. Bhasker.