Difference between 'LIKE' and 'TYPE'

Hi all,
I am new to learning ABAP, kindly bear with my naive questions.........
can you please tell me what's the difference between 'type' and 'like' keyworkds.
also what does 'condense' do.
thanks
Sabrina.

Hi Sabrina
Check out Re: Diff b/n 'type' n 'like'

Similar Messages

  • Difference between "Like" and "Type" addition

    Hi abapers,
    I have doubt regarding the purpose and use of the additions "LIKE" and  "TYPE" with respect to variable(data objects). Please look into the following code,
    Data:numb1 type i value 30.
    Data:numb2 like numb1."Will the value 30 get copied to numb2
    write : / numb1, numb2.
    My question is while using "LIKE" addition with variables, will the value also get copied into the variable. That is, will the value 30 be copied into numb2 or only the technical attributes of numb1 will be copied into numb2.
    Another doubt is can we the following code in abap,
    Data : int_tab_1 type mara.
    Data : int_tab_2 like mara.
    Are they both same? If not what is the difference between them?

    hi
    when ever you declare a  data object of abap predefined objects or types that are created by using TYPES statement we use TYPE addition to declare a variable.
    if we try to declare a object which is already existing in the program for having the same technical attributes then we declare by using LIKE addition.
    ex
    TYPES:
       begin of fs_emp,
          name TYPE string,
       end of fs_string.
    data :
       w_i TYPE i,
       w_emp TYPE fs_emp.
    now if we want to create a data object which is having the same attributes of fs_emp then we can declare by using LIKE statement 
    data :
       w_employee LIKE w_emp.
    when u are using like then the object should already exists in the program
    regards
    PAVAN

  • Whats  basic difference between data and types while declearing the itab

    whats  basic difference between data and types while declearing the internal tables...
    DATA : BEGIN OF t_vbap OCCURS 0,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
       END OF t_vbap.
    vs
       TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
       END OF t_vbap.
    and vs
      TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbeln,
    posnr LIKE posnr,
    kwmeng LIKE kwmeng,
    netpr LIKE netpr,
    netwr LIKE netwr,
    werks LIKE werks,
    matnr LIKE matnr,
    arktx LIKE arktx,
       END OF t_vbap.

    hi,
    like -> used for refering existing data elements in data dictionary or in sap
    type -> used for refering existing data types in sap.
    types: used for creating used defined structure of tables which has fields from more tahn one table.
    diff b/w types and type in creation of internal tables is that when u create a table with types then u can use same for work area creation also.
    ex:
    TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbeln,
    posnr LIKE posnr,
    kwmeng LIKE kwmeng,
    netpr LIKE netpr,
    netwr LIKE netwr,
    werks LIKE werks,
    matnr LIKE matnr,
    arktx LIKE arktx,
    END OF t_vbap.
    data: itab1 type t_vbap
            wa_itab1 type t_vbap.
    when type is used then u have to create a defintion of work area for another time when internal table doesnt have headr line as
    ex:
    DATA : BEGIN OF t_vbap OCCURS 0,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
    END OF t_vbap.
    DATA : BEGIN OF wa_vbap,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
    END OF wa_vbap.
    if helpful reward soem points.
    with regards,
    suresh.

  • Difference between LIKE and =

    All,
    I know that theoratically LIKE operator is slower compared to = operator especially when using fixed string but how do I demonstrate it. Explain plan gives me the exact same execution plan and there is no difference to prove my point. Below is the statement and respective execution plan:
    SQL> select * from emp where ename like 'FORD';
    Execution Plan
    Plan hash value: 2564639655
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 37 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 37 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | ENAME_IDX1 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME" LIKE 'FORD')
    Statistics
    0 recursive calls
    0 db block gets
    3 consistent gets
    0 physical reads
    0 redo size
    823 bytes sent via SQL*Net to client
    396 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    SQL> select * from emp where ename = 'FORD';
    Execution Plan
    Plan hash value: 2564639655
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 37 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 37 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | ENAME_IDX1 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME"='FORD')
    Statistics
    0 recursive calls
    0 db block gets
    3 consistent gets
    0 physical reads
    0 redo size
    823 bytes sent via SQL*Net to client
    396 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    Db : Oracle 10g
    OS : windows XP
    The plan remain same even after analyzing the table without which only "- dynamic sampling used for this statement" method was used but after the statistics calculation, dynamic sampling is gone.
    Any thoughts?
    TIA

    Hi,
    Differrence between LIKE and = is LIKE will return the all the with what you give.= will return exact value of what you give.
    For example,
    create table emp(id number,emp_name varchar2(10));
    insert into emp values(1,'john paul');
    insert into emp values(2,'paul');
    insert into emp values(3,'fame');
    LIKE Example :
    select * from emp where emp_name like '%paul%';
    id emp_name
    1     john paul
    2     paul
    In this query,the query will return who all are having paul in thier names.
    = Example :
    select * from emp where emp_name = 'fame';
    id emp_name
    3     fame
    This query will return exact who have name paul.
    Regards,
    Fame

  • Difference between data and types

    dear friends
           Its a very simple question i am confused with why we create structures with types where we can create structures with data as well :
    Types: begin of stru
    end of stru.
    Data: begin of stru
    end of stru...
    regards
    Naim

    To construct a new structured data type struc_typein a program, you use several TYPES statements:
    TYPES BEGIN OF struc_type.
      {TYPES dtype ...} | {INCLUDE {TYPE|STRUCTURE} ...}.
    TYPES END OF struc_type.
    The syntax for directly declaring a variable as a structure is the same as you would use to define a structured data type using the TYPES statement:
    DATA BEGIN OF struc.
      {DATA comp ...} | {INCLUDE {TYPE|STRUCTURE} ...}.
    DATA END OF struc.
    The individual components of a structure are addressed in the program with the structure component selector between the structure name and component name as follows: struc_comp.
    Have a look at below link.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3364358411d1829f0000e829fbfe/content.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Performance difference between LIKE and "="

    May I know what will be the performance difference for
    select * from a where b = 'C'
    v.s.
    select * from a where b like 'C'
    In general, we don't notice any performance difference in using "LIKE" but under some situation we do. Any idea why?

    Equality is a relatively easy thing for the cost-based optimizer (CBO) to handle, so it is far more likely that it will generate the "right" query plan.
    It is a lot more difficult for the CBO to estimate how many rows a LIKE query will return, particularly since the vast majority of LIKE clauses have wild-cards. I would not be suprised if the CBO were occasionally generating incorrect plans if you are using LIKE where you could be using =.
    Justin

  • Difference between Table and Table Type

    Hi
       Can you please let me know the
    Difference between Table and Table Type and
    Difference between Structure and Table Type?
    Regards,
    Sree

    hi,
    table is a data dictionary object in sap. table is of different types
    1. transparent tables
    2. pool tables
    3. cluster tables
    table type gives option for u to select different types of internal tables. they r
    1. standard table
    2. sorted table
    3. hash table
    Structures :
    -Defined like a table and can then be addressed from ABAP programs.
    -Structures contain data only during the runtime of a program.
    -Just like user-defined data type.
    - they are not present in database server and only on application server.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • Difference between core switch types WS-C3750X-12S-S and N3K-C3524P-10G?

    Hello All,
    I am new to this domain and yet have to look after the setup of our datacenter for a new branch. Could any one of you provide difference between core switch types WS-C3750X-12S-S and N3K-C3524P-10G!
    Thanks in advance!!

    N3K-C3524P-10G
    24 fixed 1/10-Gbps SFP+ ports; upgradeable to 48 with a valid license
    Line-rate Layer 2 and Layer 3 throughput of up to 480 Gbps
    Compact 1RU form factor
    Dual redundant color-coded power supplies
    Four redundant color-coded fans

  • Looking for new laptop what are the differences between pro and air? Besides size. Does the air preform like the pro?

    Looking for new laptop what are the differences between pro and air? Besides size. Does the air preform like the pro?

    The NEW macbook Pro and Air are EXTREMELY close in form factor
    The newest macbook Pro is essentially a larger macbook Air with Retina display and options for speed in increasing prices up to an independent graphics and quad core processor.
    both Air and new Pro now have PCIe SSD and permanent RAM.
    The Air is the lightweight portable form factor, fast to boot and shut down, but with longer battery life than any of the macbook pro in 13"
    Now the new macbook Pro and macbook Air are extremely close in form factor and nature.
    both have 802ac wifi
    both have permanent RAM, no superdrive
    both are slim profiles and SSD
    The only real differences now are (in the most expensive Pros) faster processors and quadcore processors and top end model autonomous graphics.
    ....and of course the retina display
    both are now "very good for travel"
    Other than features the form factor of the Air and Pro are VERY close now,....so now its merely a matter of features and price more than anything.
    You need an external HD regardless of what you get for backups etc.   Drop into an Apple store and handle both and make your choice based on features, such as Retina or non-retina, .... both at a distance now look like the same computer.
    The Pro weighs more, ....but nowhere near what it used to just a month ago on the older macbook Pros
    The NEW macbook Pro is a different creature entirely than the older macbook Pro, .....the new Pro is thicker than the Air, but id frankly call the NEWEST Pro a "macbook Air with Retina display" , or
    Maybe a “macbook Air PRO with Retina display” 
    Instead of Air VS Pro now,.....its really a smooth transition from Air to pro without comparing say, 2 different creatures, now its like contrasting a horse from a race horse.
    Either one in 8gig of RAM (preferably)... the 4gig upgrade costs very little,  the I7 you will notice only 15% faster on heavy applications over the I5, and NOTHING on most APPS.....I5 has longer battery life.
    As you see below, the non-Retina 13" AIR is 82% of the Macbook with Retina display in resolution
    there is no magical number of pixels per inch that automatically equates to Retina quality.
    http://www.cultofmac.com/168509/why-you-might-be-disappointed-by-the-resolution- of-those-new-retina-display-macs-feature/
    A huge internal SSD isnt a game changer for anything, you need an external HD anyway
    what you WONT READ on Apple.com etc. is that the larger SSD  are MUCH FASTER due to SSD density
    "The 512GB Samsung SSD found in our 13-inch model offers roughly a 400MB/s increase in write speeds over the 128GB SanDisk/Marvell SSD"
    http://blog.macsales.com/19008-performance-testing-not-all-2013-macbook-air-ssds -are-the-same
    Here is an excellent video comparison between the 11” I5 vs. I7 2013 Macbook Air.
    http://www.youtube.com/watch?v=oDqJ-on03z4
    http://www.anandtech.com/show/7113/2013-macbook-air-core-i5-4250u-vs-core-i7-465 0u/2
    I5 vs. I7 performance 13” Macbook Air 2013
    Boot performance
    11.7 I5 ……11.4 I7
      Cinebench 
    1.1 I5….1.41 I7
    IMovie Import and Opt.
    6.69 I5….5.35 I7
      IMovie Export 
    10.33 I5…8.20 I7
    Final Cut Pro X
    21.47 I5…17.71 I7
      Adobe Lightroom 3 Export 
    25.8 I5….31.8 I7
    Adobe Photoshop CS5 Performance
    27.3 I5…22.6 I7
    Reviews of the newest Retina 2013 Macbook Pro
    13”
    Digital Trends (13") - http://www.digitaltrends.com/laptop-...h-2013-review/
    LaptopMag (13") - http://www.laptopmag.com/reviews/lap...play-2013.aspx
    Engadget (13") - http://www.engadget.com/2013/10/29/m...-13-inch-2013/
    The Verge (13") - http://www.theverge.com/2013/10/30/5...ay-review-2013
    CNet (13") - http://www.cnet.com/laptops/apple-ma...-35831098.html
    15”
    The Verge (15") - http://www.theverge.com/2013/10/24/5...w-15-inch-2013
    LaptopMag (15") - http://www.laptopmag.com/reviews/lap...inch-2013.aspx
    TechCrunch (15") - http://techcrunch.com/2013/10/25/lat...ok-pro-review/
    CNet (15") - http://www.cnet.com/apple-macbook-pro-with-retina-2013/
    PC Mag (15") - http://www.pcmag.com/article2/0,2817,2426359,00.asp
    Arstechnica (15") - http://arstechnica.com/apple/2013/10...-pro-reviewed/
    Slashgear (15") - http://www.slashgear.com/macbook-pro...2013-26303163/

  • Difference between 122 and 161 movement type

    Hi,
    Can anyone explain me the difference between 122 and 161 movement type?
    How will be the finance postings?
    Can these movement types will be used in outbound delivery? If so,what kind of scenarios this can be used?
    Thanks
    Srini

    Hi
    Both are belongs to vendor return
    1. 122 - return to vendor -total  consignment - return total received gr qty
         Migo - return delivery with 122- j1is - credit memo
    2. 161 - here you have to crate the return po. return to vendor for partial qty.
         after po- gr - j1is-credit memo
    Laxman

  • What's the difference between batch class type 022 and 023?

    Hi Guys,
    I find that some of my SAP client only have class 022 and some have 023, but no client has  them all. I don't know why it happed.
    So what's the difference between batch class type 022 and 023?  Which setting decide which class to be used ?
    Thanks.

    Hi nitin,
    Read  http://www.sapfans.com/forums/viewtopic.php?t=212819&highlight=022  you will know the difference between 022 and 023 .
    Use tcode OMCT you can switch batch level .

  • Difference between alternative calculation type and alternative condition b

    What is the difference between alternative calculation type and alternative condition base value?

    Hi Nitin
    Alternative calculation type:
    Suppose my gross price (PB) is Rs.100 for some metal per kg and I want to calculate surcharge based on todays RBI index of commodity rather than simply giving some 2%. I want to account todays RBI index in determinig Condition value.
    It is possible to do that by little alteration of regular routine.
    Alternate Condition base value:
    I am procuring 5 different variety of pens at different quantities at varying rates from 0 to 25 in a sing le PO. And I get the total header value of 1000. I will get a discount of 10% if the PO value reaches 1000. I have to subsequently pass on the discount of Rs.100 now to all the 5 line items. In general SAP calculates it based on the values of each line item and proportionately distributes. However If i want this discount to be distributed according to the quantity of each pen. You can acheive this with little alteration of Routine.
    Hope this clarifies your doubt.
    If found helpful, Pls reward.
    Regards
    edwin

  • The difference between batch class type 022 and 023

    what's difference between batch class type 022 and 023?  023 is described as standard batch class type, but there is only 022 type exists in my system. can i use 022?

    Hi,
    both classes mean the same, but which class is used is decieded by batch level. In case of material level or client level the system use automatically only class 023. If you define batch level to plant the system use automatically class 022.
    Regards,
    Abhee.

  • I would like to know the difference between OEL and RHEL

    I would like to know the difference between OEL and RHEL, are they same?
    If I test any application on RHEL, will it work on OEL too.
    Thanks
    Edited by: user10685113 on 08-Aug-2012 05:35

    The name OEL as such is not used anymore, since the product was renamed from Oracle Enterprise Linux to Oracle Linux with the release of version 5.5 in September 2010.
    The main technical difference between Oracle Linux and RHEL is that Oracle Linux ships with an Oracle exclusive and optimized Oracle UEK kernel. It does however still install and provide the original and older RHEL kernel for fallback.
    As of Oracle Linux 5.6, the Oracle UEK kernel is the default kernel. The current latest version of Oracle Linux 6.3 uses the Oracle UEK2 kernel, which is based on the Linux 3 kernel (2.6.39).
    Oracle Linux is binary compatible with RHEL.
    Oracle Linux has several advantages over RHEL, in particular if you plan to use it to install Oracle products.
    • The same kernel UEK and UEK2 versions are available for Oracle Linux 5.x and 6.x
    You do not necessarily need to perform a complete and unsupported system upgrade to use a newer kernel version and drivers.
    • Oracle Pubilc YUM
    Oracle provides a public yum repository for installing software packages including the latest patches. RHEL does not and requires a paid subscription for online access.
    • Oracle specific drivers and software
    Oracle Linux provides additional software and kernel drivers, for Oracle clustering, Dtrace, BtrFS and ASM, which is not available for RHEL 6.
    Oracle Linux provides additional packages which trigger the automatic installation of system software prerequisites, including kernel parameters and oracle account setup to install Oracle Database:
    oracle-validated (Oracle Linux 5)
    oracle-rdbms-server-11gR2-preinstall (Oracle Linux 6)
    And last not least you have just one vendor and support requirement for Oracle products.
    Have you checked the Internet:
    http://www.oracle.com/us/technologies/linux/index.html
    https://linux.oracle.com
    To obtain Oracle Linux:
    https://edelivery.oracle.com/linux
    https://wikis.oracle.com/display/oraclelinux/Downloading+Oracle+Linux (alternative)
    Edited by: Dude on Aug 8, 2012 2:29 PM

  • Difference between like profile and relignment

    Hello Friends,
    Difference between like profile and relignment ?
    useing like profile we can generate stat forecast for new product ,where as in relignment we can generate new cvcs if iam wrong pl correct me and iam looking for more details

    Sivaram,
    The Key differences between Like profile and Realignment are:
    1. For Like profile to work, you need to have CVCs for the new product in place before you can execute it. 
    In realignment, you can create the new CVCs and then copy the data from Old CVC to the new CVC during a realignment run.
    2. Like profile does not actually copy the demand history of one product to another and store it in livecache, it merely used the history by referring to the history KF and then generating forecast in the forecast number which does gets written to live cache.
    Whereas using realignment, you can do copy history from old CVC to the new CVC or for that matter any KF data can be copied from old CVC to new CVC that throughout the history and forecast horizons.
    3. Like profile works hand in hand with Statistical forecasting functionality of APO.
    Whereas Realignment is independent of Forecasting.
    Hari

Maybe you are looking for