Data Conversion Type C - Type D (and Type T)

Hello,
I would know how to convert a data Type C (char) to a data Type D (dats) or a data Type T (time).
In fact I've got datas in char representing Dates(20060818) and Time (060126) and I want to convert them in BW in Dats and Time.
Do you know how to convert in routines?
Thanks for your help!!!

HI vince,
data : v_char(8) type c value '20060909',        v_dats    type dats.       v_dats = v_char.
check out this also,
Re: FM to convert char to dats type
Regards,
San!

Similar Messages

  • Date Conversion from GMT to Local and Local To GMT considering DST.

    Hi,
    I have a application which displays the time in GMT across all the screens,and saves in Local/Default TimeZone as application would be deployed in europe and India.I have written a utility which does the conversion.
    I just want to know that how to handle the Daylight Saving Time[DST] as we are taking the data from database and converting it to LocalTime Zone.This works fine but what would happen if the sever time is changes due to DST.There would be problem between the object saved before the DST and after DST because we are simply converting stored time to GMT to show on the screen.
    Please share if you some solution/suggestions.
    Thanks.
    Akash.

    YoungWinston wrote:
    jschell wrote:
    That statement is phrased oddly.
    A java.util.Date uses a UTC offset with millisecond resolution.
    A jdbc driver converts that value into a "correct" value for the target database.And from.
    The form that is stored in the database is entirely database dependent. The actual form stored in the database can take many forms.True, but it is highly likely to be an offset from some "epoch" (Progress, for example, uses 00:00:00 1/1/-3714 UTC as I recall, and has 1-second granularity).Yes but as I said the phrasing was odd. A timestamp, by definition, must be an offset of something. Doesn't matter how it is represented. After all the year 2009 is an offset in the Gregorian calander.
    However in terms of actual storage the way it is stored is unlikely to be similar to what Java does. As examples neither Oracle nor MS SQL Server uses a single numeric offset.
    It might not even have a concept of timezone.Again true, although I've yet to come across one; and since OP is only concerned about the timezone in Java I'm not quite sure how relevant that is.
    Relevant in terms of the description in terms of what java does, what the database does and how it gets from java to the database.
    I would also expect any JDBC driver that cannot translate to or from a Java date correctly to document the fact in 60-point bold type, since it's a violation of the implied contract of ResultSet.getDate().Except that depends on your definition of "correct".
    Examples of that
    - Oracle doesn't have millisecond resolution at all in its common format.
    - MS SQL Server doesn't have the same resolution as java, instead there is an odd resolution (one three-hundredth of a second).
    - MS SQL Server doesn't have timezones, so if you don't take care and your data crosses timezones the timestamp will be different.
    The drivers will not warn you of things like that. At least not that I have seen.
    Format for Oracle.
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:77562635789106]
    Format for MS SQL Server
    [http://msdn.microsoft.com/en-us/library/aa258277(SQL.80).aspx]

  • Data conversion for communication between Java and C/C++ program

    The real problem, i guess, is about data type conversion between Java and C programs. For instance, and int is supposed to be 4 bytes in Java, and also in C/C++. But, as far as I know, the size of and int in C depends on the processors architecture, so if it were a 64 bit arch., size of and int, double, etc. in C, would change. The real scenario would be a communication between a 32 bit machine (Java) and a 64 bit machine (C/C++).
    First of all, is this assumption correct?
    If so,
    how is it possible to deal with this problem in Java?
    Is there any way to know 'type length' automatically? or
    would it be necessary to modify the Java program to work with a C program in 32-bit or 64-bit arch?
    thx in advance

    cotton.m wrote:
    Yes you should develop the C part of the protocol first and then build from there.
    See http://forum.java.sun.com/thread.jspa?threadID=5243547 for a previous discussion of this topic.
    I understand what you mean, also the topic you referenced. I will explain the situation a bit more. The protocol is already defined: (16 bits message size, 16 message id, 32 bit time, etc.); it is also defined in C (structures and so on). So it would be easy to write my Java code using the specified protocol in bytes, and C types wouldn't be necessary to be considered. But, let's say that the C code can't be modified, and I thought (and don't know yet if its correct), that size of C types CAN changed depending on architecture. So if size changes for C types (code is specified in short, int, etc, and not in bit format), it all would be a mess, if I don't implement something in my Java code.
    cotton.m wrote:
    I don't believe that 32 or 64 bit enters the equation here at all.Maybe 32 o 64 doesn't mind, but sparc or PC could take a point here. Communication would be between a sun solaris sparc and windows x86 PC. But if type size in C/C++ does not change, I wouldn't really have any problem then...
    The situation is not ideal, I know, but is what I have; and I think I could have problems if I run the C program in other machines; so I would have to try to solve it whithin my Java Program.
    I hope it is clear now what I need.
    thx
    Edited by: MGasa on Jan 16, 2008 1:51 AM

  • Data Conversion for BOMs and/or Routings

    I am looking for any examples for design spec for Data Conversion of Bill of Materials and/or Routings.
    Not sure if this would be in form of MD050 but any example would be appreciated

    Hi;
    Please check below links:
    Oracle Bill of Materials User's Guide
    http://download.oracle.com/docs/cd/A85683_01/acrobat/115bomug.pdf
    http://horizon.more4apps.com/doco/BMWRelease/output/index.htm
    Also see:
    Getting Started With R12 - Discrete Manufacturing Support Enhanced Release Content Document [ID 415922.1]
    Regard
    Helios

  • 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'

  • Data conversion strategy for new SOB

    Dear Viewers
    on 11.5.10
    We are creating a new SOB with a change in currency from Feb-11 as this is the requirement
    For the same, we need to do data conversion.
    I have a confusion for Purchase Orders and Sales Orders
    Purchase Orders:
    Open purchase orders will be converted, means the unfulfilled PO`s i.e the ones not received and are fully open.
    The PO`s which have been recieved but not delivered, Requested the users to clear the intransit receipts.
    The PO's which are partially received, what to be done for them?
    If a PO is fully received and Delivered will not me converted to the new SOB as its not an open PO
    but If invoice comes after Feb-11, than how the matching will be done?
    What if a return has to be made moving forward in FEB-11 under new SOB
    Sales Orders:
    Open sales orders will be converted, that is the ones that have been entered and not yet booked.
    Users have been requested to clear off the Sales order lines which are already pick confirmed but not yet shipped, hence they will be shipped and interfaced to AR
    For the Sales orders that have been booked, those lines that are not yet processed further will also be converted.
    Now what if a receipt comes after feb 11, how to handle this as the sales order wiould not have been converted?
    Please give your advise on the data migration strategy for PO`s and SO's.
    Please do add any point that may have been missed by me
    Appreciate your help
    Thanks
    Emm

    Hi David,
    for master data conversion you can use LSMW and the RE-FX BAPIs. (please refer to SAP note  [782947|https://service.sap.com/sap/support/notes/782947] ).
    Regards, Franz

  • Crystal Data Conversion Issue (Error converting data type varchar to datetime)

    Hi,
    I can run stored procedure without error in SQL Server using my personal credentials as well as database credentials.
    I can also run Crystal Report after connecting to Stored procedure without error on my desktop using my personal credentials as well as database credentials.
    But when I upload the crystal report in BOBJDEV and when I run using database credentials report fails saying that "Error in File ~tmp1d1480b8e70fd90.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]" but I can run the crystal report successfully on BOBJDEV using my personal credentials.
    I googled (Data Conversion Error Message) about this issue & lot of people asked to do "Verify Database" in Crystal Report. So I did that, but when I do it I am getting a error message like this:
    Error converting data type varchar to datetime.
    Where do you think the error might be occurring? Did anyone faced this kind of issue before? If so, how to resolve it?
    (FYI, I am using Crystal Reports 2008, & for stored procedure I have used SSMS 2012 )
    Please help me with this issue.
    Thanks & Regards.
    Naveen.

    hello Naveen,
    since the report works fine in the cr designer / desktop, we need to figure out where you should post this question.
    by bobjdev do you mean businessobjects enterprise or crystal reports server? if so please post this question to the bi platform space.
    -jamie

  • Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).

    Hi,
    I have a file where fields are wrapped with ".
    =========== file sample
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    ==========
    I am having a .net method to remove the wrap characters and write out a file without wrap characters.
    ======================
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    ======================
    the .net code is here.
    ========================================
    public static string RemoveCharacter(string sFileName, char cRemoveChar)
                object objLock = new object();
                //VirtualStream objInputStream = null;
                //VirtualStream objOutStream = null;
                FileStream objInputFile = null, objOutFile = null;
                lock(objLock)
                    try
                        objInputFile = new FileStream(sFileName, FileMode.Open);
                        //objInputStream = new VirtualStream(objInputFile);
                        objOutFile = new FileStream(sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString(), FileMode.Create);
                        //objOutStream = new VirtualStream(objOutFile);
                        int nByteRead;
                        while ((nByteRead = objInputFile.ReadByte()) != -1)
                            if (nByteRead != (int)cRemoveChar)
                                objOutFile.WriteByte((byte)nByteRead);
                    finally
                        objInputFile.Close();
                        objOutFile.Close();
                    return sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString();
    ==================================
    however when I run the bulk load utility I get the error 
    =======================================
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).
    ==========================================
    the bulk insert statement is as follows
    =========================================
     BULK INSERT Temp  
     FROM '<file name>' WITH  
      FIELDTERMINATOR = ','  
      , KEEPNULLS  
    ==========================================
    Does anybody know what is happening and what needs to be done ?
    PLEASE HELP
    Thanks in advance 
    Vikram

    To load that file with BULK INSERT, use this format file:
    9.0
    4
    1 SQLCHAR 0 0 "\""      0 ""    ""
    2 SQLCHAR 0 0 "\",\""   1 col1  Latin1_General_CI_AS
    3 SQLCHAR 0 0 "\",\""   2 col2  Latin1_General_CI_AS
    4 SQLCHAR 0 0 "\"\r\n"  3 col3  Latin1_General_CI_AS
    Note that the format file defines four fields while the fileonly seems to have three. The format file defines an empty field before the first quote.
    Or, since you already have a .NET program, use a stored procedure with table-valued parameter instead. I have an example of how to do this here:
    http://www.sommarskog.se/arrays-in-sql-2008.html
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Data conversion error. Overflowed the specific type.

    Hi guys, as usual I am struggling with the data conversion. I have got a column BS as Float in SQL, the usual values is 10.5656445, 899.66552366 etc. I'll try to move in Excel the data but I wish to have only one decimal. I try decimal in the data conversion
    with precision 1 but it returns me the same value now I am trying
    numeric, precision 1 but it returns the error "Conversion failed because the data value overflowed the specified type". Any suggestion? Thanks

    Could you tell me what should be the result for 10.5656445, 899.66552366?  Is that 10.5, 899.6 ?
    If yes then, set Precision: 4, Scale: 1
    (This is a total of 4 digits, 3 digits for the whole number and 1 for the fractional)
    Cheers,
    Vaibhav Chaudhari

  • Data Carriers and Data carrier type

    Hi Sap Gurus,
    Pls let me know is there any necesssity of defining any new Data Carrier types other than PC,
    if so at what circumstances and requirements,
    also pls throw some light about data Carriers, when is the new data carriers required to be created
    at what circumstances and requirements.
    is that to access a document from different server or Different system, if it is so why is this required as the documents are always stored in a central content server and Once checked in, any one can access the document from Server,
    2) can we make use of Application softwares Installed in one System and make it run in another system, example,
    if there are say 4 system totally, among this S1 system1 has Autocad Installed in it ,
    rest of the 3 system have not installed Autocad, Can the system 2,3 and 4 edit the auto cad drawings in there system, does at this situations where Datacarries and Data carries types come in to picture,
    Please throw some light on this
    Thanks and regards
    Sathish

    Dear Christoph Hopf,
    Thanks a lot for your Quick Response
    as you have Explained,i assume it is mainly used to store a local copy or extra copy of the Original application files in the system which we use to View them, or if we feel to store the copy in any other system also.
    Example Say there are 3 systems S1, S2 and S3
    if we are viewing an original file in System S1 and want the same Copy to be stored in System S2  or S3.....
    then this data carrier configuration is required if iam right?
    But Sir apart from this funtionality can i also know the SAP definition purpose, as it defines  data carrier type as below
    The system requires the data carrier type in order to exchange data with other data carriers.
    This is the case, for example, if the user:
    wants to process original application files stored on another computer
    wants to use an application installed on another computer
    if i can interpret this in right way
    it tells us that, by use of data carrier and Data carrier types
    we can access a  original file stored in Different systems,
    if it is so why is this required as the documents are always stored in a central content server and Once checked in, any one can access the document from Server,
    2) can we make use of Application softwares Installed in one System and make it run in another system, example,
    if there are say 3 system totally, among this S1 system1 has Autocad Installed in it ,
    rest of the 2 system have not installed Autocad, Can the system 2, and 3 edit the auto cad drawings in there system, does at this situations where Datacarries and Data carries types come in to picture,
    if so how is this made possible?
    pls explain with example or Screen shots in Wiki if possible
    can u tell me what is the difference between Datacarrier and Datacarrier types with any examples as well
    Thanks and regards
    Sathish
    Edited by: sathish kumar on May 22, 2008 2:17 AM

  • One Conversion Type and two Exchange Rate Types in one report

    I have Conversion Type called TEST. In this Conversion Type there is Exchange Rate Type D selected (D-daily). I have also Fixed Target Currency selected. And the report works perfectly fine....BUT.......there is also Exchange Rate Type M defined in the system (and it used for the exchange rate used last day of the month).
    The question is: how to put both Exchange Rate Types into one Conversion Type so both types are used in the reports?

    Hi,
    You can go for a variable exchange rate type.
    Creating variable:
    For this you have create a varible which can take diffrent exchange rate types.
    Open query designer create a new dummy query in that search for infoprovider 0RTYPE.
    It will have one dimension(name ->key) with 0RTYPE in it.
    create a variable for 0RTYPE.
    Save and close the query.
    goto RSCUR -> give your translation type -> go to exchange rate tab -> choose Ex. Rate from var option -> give the variable you have created prviously for 0RTPYE.
    Rest all same but just for completion...
    Go to your query in which in u want to do cur conversion.
    Double click on the key fig
    Go to conversions tab-> select the conversion type u created in RSCUR.
    When you run the query you can select the exchange rate type in the variable screen.
    rgds,
    Raghu

  • EJB-QL and date/time types

    Hi,
    as far as I understand, EJB-QL does not support date/time values.
    Does anybody know how to work around this limitation?
    Using long values containing milliseconds is not an alternative, because the database stores
    date/time values.
    I need to compare these date/time values to input parameters in finder methods.
    Suggestions?
    Bye the way, is there any reason for this limitation in EJB-QL, or did they simply forget to include
    date/time types to the spec?
    Greetings
    Christian

    Greetings,
    Hi,
    as far as I understand, EJB-QL does not support
    date/time values. Actually, it does - EJB QL supports all types supported by a bean's abstract schema (IOW: available types for CMP/CMR fields). However, therein also lies the crutch - EJB QL is for querying beans, not the resource to which they map (EJB QL's similarity to SQL is purely for convenience; an Entity Bean, it should be remembered, may represent entities in any persistent store, not just RDBMSes). Therefore, you should be thinking in terms of Java types, not SQL ones... The specification, however, does place "restrictions" (ie. minimally required [vendor] support), on their use which should be limited to long millisecond values (by which a Date object performs an equals comparison... ;).
    Does anybody know how to work around this limitation?Depends on what you're attempting. If you're using a Date as an argument to a finder, eg:
    findByDateInRange( java.util.Date start, java.util.Date end )then this shouldn't pose a problem where your EJB QL would look like:
    SELECT OBJECT(a) FROM MyBeanSchema AS a WHERE a.myDate BETWEEN ?1 AND ?2Presuming the bean MyBean contains a CMP field of type java.util.Date called 'myDate'. If, however, you must use a literal date then you will have to use a long literal unless your vendor supports otherwise. However, it might be worth noting that EJB QL must still be mapped to the underlying resource QL (eg. SQL), and so a more intelligble value (one that meets the resource's format requirements ;), could be used in the actual rQL statement.
    Using long values containing milliseconds is not an
    alternative, because the database stores
    date/time values.I'm guessing you mean here something like "04/23/2002" and "13:13:35", etc. This, however, is not how the database actually stores the data - input/output formats such as these are supported for the convenience of us 'nuerically-challenged' humans (similar to internet hostnames vs. TCP/IP addresses ;) - nor do Java Date/Calendar/Timestamp types store them this way.
    I need to compare these date/time values to input
    parameters in finder methods.
    Suggestions?Ah, yes. Well then... refer back to the above. :)
    Bye the way, is there any reason for this limitation
    in EJB-QL, or did they simply forget to include
    date/time types to the spec?The EJB QL does not explicitly support any specific types beyond those "supported by an EJB's abstract schema", which is pretty much any Java type that can represent a compatible resource type. The reason for the noted "restriction" on date/time types, however, is (likely) due to the way the associated Java classes (not to mention the back-end resource), handle/represent these data internally and this gives the vendor an easily achievable minimal level of compliance for supporting these types.
    I hope this helps.
    ChristianRegards,
    Tony "Vee Schade" Cook

  • Data Vs Types  and  Type Vs  Like

    hi frds can you send main diffrences between
    Data Vs Types   and     Type Vs  Like.
    some what briefly explanation..........  i am in confusion in this

    Hi Madhu,
    Data is used to create data object ( means memory will be allocated)
    Types is used to create structures
    Type is used to refer to Predefined data types ( like n,i,f,d,t,p,x....)
    Like is used to refer the local variables.
    All ABAP programs can define their own data types. Within a program, procedures can also define local types.
    You define local data types in a program using the
    TYPES .
    TYPES: spfli_type TYPE spfli,
           surname(20) TYPE c,
           BEGIN OF address,
                 name       TYPE surname,
                 street(30) TYPE c,
                 city       TYPE spfli_type-cityfrom,
           END OF address,
           town TYPE address-city.
    This example shows the definition of two structure types in a program - SPFLI_TYPE and ADDRESS. The structure of the data type SPFLI_TYPE is taken from the database table SPFLI in the ABAP Dictionary. The components of SPFLI_TYPE are the same as the columns of SPFLI. The individual data types of the components are the ABAP equivalents of the data types of the columns of the database table. The structure type ADDRESS is newly defined. The component ADDRESS-NAME takes the data type of the previously-defined type SURNAME, the component ADDRESS-STREET is newly-defined, ADDRESS-CITY takes the data type of column CITYFROM of the structure type SPFLI_TYPE.
    TYPES: BEGIN OF struct1,
             col1 TYPE i,
             BEGIN OF struct2,
               col1 TYPE i,
               col2 TYPE i,
             END OF struct2,
           END OF struct1.
    TYPES mytype TYPE struct1-struct2-col2.
    The example shows how you can construct a nested structure type STRUCT1 with a complex component STRUCT2 by nesting TYPES BEGIN OF ... TYPES END OF blocks, and how you can address the inner components.
    local types in program
    referring to predefined ABAP types:
    TYPES: surname(20)  TYPE c,
           street(30)   TYPE c,
           zip_code(10) TYPE n,
           city(30)     TYPE c,
           phone(20)    TYPE n,
           date         LIKE sy-datum.
    local structure in program
    referring to the above types
    TYPES: BEGIN of address,
             name TYPE surname,
             code TYPE zip_code,
             town TYPE city,
             str  TYPE street,
           END OF address.
    local nested structure in program
    referring to the above types
    TYPES: BEGIN of phone_list,
             adr TYPE address,
             tel TYPE phone,
           END OF phone_list.
    This example shows how to create complex data types from simple type definitions. After a set of simple data types are created with ABAP predefined types, a structured type ADDRESS is defined using the data types defined earlier. Finally, a nested structure type, PHONE_LIST, is created, whose first component has the type ADDRESS.
    Table types
    Local tables in a program are called internal tables. To construct a new internal table type, use the syntax:
    TYPES  can be any known data type. Specifying the key is optional. Internal tables can thus be generic. For more information, refer to Internal Tables.
    DATA
    The Statements TYPES and DATA
    Each ABAP program define its own data types using the statement.
    TYPES dtype TYPE type ...
    and declare its own variables or instance attributes of classes using the statement
    DATA var {TYPE type} ...
    Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
    When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    Constructing New Data Types
    The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
    To construct new data types, the addition TYPE can be used with the following type constructors:
    ·        Construction of reference types
    REF TO type|dobj
    ·        Construction of structured data types
    BEGIN OF struc_type.
    END OF struc_type.
    ·        Construction of table types
    tabkind OF linetype
    These data types only exist during the runtime of the ABAP program.
    Referring to Known Data Types or Data Objects
    Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
    The known types or data that are referred to must be visible at the point where the data type or variable is declared.
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    TYPES: BEGIN OF struct,
             number_1 TYPE i,
             number_2 TYPE p DECIMALS 2,
           END OF struct.
    DATA:  wa_struct TYPE struct,
           number    LIKE wa_struct-number_2,
           date      LIKE sy-datum,
           time      TYPE t,
           text      TYPE string,
           company   TYPE s_carr_id.
    This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
    Referring to Generic Data Types
    If you refer to one of the generic predefined ABAP types of fixed length (c, n, p, x) in the TYPES or DATA statement, you must specify the undefined technical attributes.
    TYPES|DATA var[(length)] TYPE type ...
    TYPES|DATA var TYPE type ...
    DATA: text1,
          text2 LENGTH 2,
          text3 TYPE c LENGTH 3,
          pack TYPE p DECIMALS 2 VALUE '1.225'.
    This example creates three character variables with field lengths of one, two, and three bytes respectively, and a packed number variable with field length 8 bytes and two decimal places. If the attribute Fixed point arithmetic is set, the value of pack is 1.23.
    This example shows how to declare elementary data objects with reference to predefined ABAP types.
    PROGRAM demo_elementary_data_objects.
    DATA text1  TYPE c LENGTH 20.
    DATA text2  TYPE string.
    DATA number TYPE i.
    text1 = 'The number'.
    number = 100.
    text2 = 'is an integer.'.
    WRITE: text1, number, text2.
    This program produces the following output on the screen:
    The number              100 is an integer.
    In this example, the data objects text1, text2 and number are declared with the DATA statement. The technical attributes are determined by referring to the predefined ABAP types c, string, and I. Values from unnamed literals are assigned to the data objects. The contents of the named data objects are displayed on the list.
    Specifying a Start Value
    When you declare an elementary fixed-length variable, the DATAstatement automatically fills it with the type-specific initial value as listed in the table in the Predefined ABAP Types section.
    However, you can also specify a starting value of a fixed-length elementary variable (also within a structure declaration) using the VALUE addition in the DATAstatement:
    DATA var ... VALUE val|{IS INITIAL}.
    Specifying start values:
    DATA: counter TYPE p VALUE 1,
          date    TYPE d VALUE '19980601',
          flag    TYPE n VALUE IS INITIAL.
    After this data declaration, the character string flag contains its type specific
    Initial value ‘0’.
    Difference Between TYPE & LIKE
    Difference between TYPE & LIKE

  • Difference between Data carrier type and Data carrier??

    Hi experts,
    Could you please explain me the difference between Data carrier type and Data carrier with an example??
    Regards,
    Kiran T

    hi Kiran,
    Data carrier is to achive communication between server and user front end. We can define one data carrier type along with path as default for all or seperate data carriers type for specific users in define data carrier in SPRO. This defined data carriers again we assign to application in defining network for workstation application in SPRO.
    By using data carrier we can upload to & download originals from server. We can change and print the documents from server.
    Please award pts if its useful / need further information.
    Pramod

  • While executing in DTP, Conversion Type missing

    Hello Sir:
    I can see my data is loaded OK in PSA through infopackage. While executing DTP, I get the error "CONVERSION TYPE MISSING" for my keyfigure.  any idea for the error, and its fix
    Regards

    hi mark,
    u should have created transformation rule .
    1.go to transformation rule.
    2.u will have 2 tables one for source second for target table.
    3.two tables would be mapped one u give the data source right.
    4.here go to that infoobject that asks for the stated error.
    5.click the group rule for that infoobject.
    6.u find a pop up having conversions from source to target specify wat ever conversion u need and check it out.
    if error still persists .
    check for u r infobject is it a fixed currency/uom.
    try to write a routine for the target conversion in start routine .
    thank u.

Maybe you are looking for

  • How to create a node with attribute?

    hi, does anyone can help with creating an XML node with only attributes but no value? e.g. <root>    <category node_id='ND1'>       <value id='1'>some value in here</value>       *<extra_node desc="this is the new node i want to create"/>*    </categ

  • Filtering interactive report question

    hi all, i created an interactive report that uses a query like this.. SELECT i.issue_id "ID",   i.title "TITLE",   i.module "MODULE",   u1.last_name || ', ' || u1.first_name || ' ' || SUBSTR(u1.middle_name,   1,   1) || '.' "OWNER",   u2.last_name ||

  • Receive SMS in SharePoint

    Hi all, I'm facing a challenge that my users will be sending (sms) their name, employee ID which should be captured into my SharePoint server. After analysis I understood that I have to use SMS gateway software or to go with "SMS service provider". I

  • Mini Disc stuck and won't eject!

    My friend just stuck one of those mini-disc things into my DVD/CD slot. (You know, those mini versions of a cd)..anyway, I've tried doing what Disc Utility said to but its not working...PLEASE HELP!!

  • How can i get back a file that was erased?

    I made a video of my son, showed it after at my mother in law ands she deleted it by mistake Is there any way i can get back the video? I didn't do the back-up on pc nor the icloud nor itunes Not as far as i know