What is the difference between   nvl(sum (field), 0) & sum(nvl (field,0)) ?

What is the difference between nvl(sum (field), 0) & sum(nvl (field,0)) ?
For the below table data i don't see any different in results
CREATE TABLE FRUITS
TYPE VARCHAR2(10 BYTE),
VARIETY VARCHAR2(10 BYTE),
PRICE NUMBER(18,2)
TYPE     VARIETY          PRICE
apple     gala          2.79
apple     fuji          0.24
apple     limbertwig     2.87
orange     valencia     3.59
orange     navel          9.36
pear     bradford     7.77
pear     bartlett     7.77
cherry     bing          2.55
cherry     chelan          6.33
pear     bradford     
     navel          6.39
select variety, nvl(sum(price),0)
from fruits
group by variety;
VARIETY     NVL(SUM(PRICE),0)
limbertwig     2.87
bartlett     7.77
bing     2.55
marathon     0
gala     2.79
fuji     0.24
navel     15.75
bradford     7.77
chelan     6.33
valencia     3.59
select variety, sum(nvl(price,0))
from fruits
group by variety;
VARIETY     SUM(NVL(PRICE,0))
limbertwig     2.87
bartlett     7.77
bing     2.55
marathon     0
gala     2.79
fuji     0.24
navel     15.75
bradford     7.77
chelan     6.33
valencia     3.59
no difference in output.
what is the difference?
Thanks in advance

Do you see the difference now?
PRAZY@11gR1> create table testing(field number);
Table created.
Elapsed: 00:00:00.10
PRAZY@11gR1> insert into testing select null from dual connect by level<=5;
5 rows created.
Elapsed: 00:00:00.00
PRAZY@11gR1> select * from testing;
     FIELD
Elapsed: 00:00:00.01
PRAZY@11gR1> select sum(nvl(field,1)) from testing;
SUM(NVL(FIELD,1))
                5
Elapsed: 00:00:00.00
PRAZY@11gR1> select nvl(sum(field),1) from testing;
NVL(SUM(FIELD),1)
                1
Elapsed: 00:00:00.00In the former, we are substituting 1 to null value and summing-up. hence we got 5. in the later, we are summing-up the null, which is null and substituting 1 if the result is null. so we got 1.
Regards,
Prazy

Similar Messages

  • What is the difference between hidden field and view state??

    Both view state and hidden field are use to store page specific information then, what is the difference between both of them??

    The ViewState of a page is actually stored in a large hidden field and it contains information about the entire page whereas a single hidden field that you define yourself is used to store some single value that should not be displayed.
    Please refer to the following page for more information about ASP.NET View State:
    http://msdn.microsoft.com/en-us/library/ms972976.aspx
    But please post your ASP.NET and web related questions at
    http://forums.asp.net in the future.
    Also, please remember to mark any helpful posts as answer.

  • What is the difference between exists and in

    hi all
    if i have these queries
    1- select ename from emp where ename in ( select ename from emp where empno=10)
    and
    2- select ename from emp where exists ( select ename from emp where empno=10)
    what is the difference between exists and in is that only when i use in i have to bring the field name or what.... i mean in a complex SQL queries is it will give the same answer
    Thanks

    You get two entirely different result sets that may be the same. Haah! What do I mean by that.
    SQL> select table_name from user_tables;
    TABLE_NAME
    BAR
    FOO
    2 rows selected.
    SQL> select table_name from user_tables where table_name in (select table_name from user_tables where table_name = 'FOO');
    TABLE_NAME
    FOO
    1 row selected.
    SQL> select table_name from user_tables where exists(select table_name from user_tables where table_name = 'FOO');
    TABLE_NAME
    BAR
    FOO
    2 rows selected.So, why is this? the WHERE EXISTS means 'if the next is true', much like where 1=1 being always true and 1=2 being always false. In this case, where exists could be TRUE or FALSE, depending on the subquery.
    WHERE EXISTS can be useful for something like testing if we have data, without actually having to return columns.
    So, if you want to see if an employee exists you might say
    SELECT 1 FROM DUAL WHERE EXISTS( select * from emp where empid = 10);
    If there is a row in emp for empid=10, then you get back 1 from dual;
    This is what I call an 'optimistic' lookup because the WHERE EXISTS ends as soon as there is a hit. It does not care how many - only that at least one exists. It is optimistic because it will continue processing the table lookup until either it hits or reaches the end of the table - for a non-indexed query.

  • 1)Now I use Lightrom 5.7 how to upgrade to 6 or CC? 2) What is the difference between 6 and CC vercion? 3) When I used lightromm 3, I could see inEXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is ve

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    2) What is the difference between 6 and CC version?
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

  • WHAT'S THE DIFFERENCE BETWEEN.....

    Hi friends,
    Please enlighten me ....
    What's the difference between using this.....
    1. Add User command functionality to ALVgrid report
    In order to add user command functionality to the ALV grid you need to perform the following steps:
                        1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM
                    2. Create 'USER_COMMAND' FORM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_callback_user_command = 'USER_COMMAND'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    and using this----
    2. Add User command functionality to ALVgrid report
    In order modify PF_STATUS of ALV grid report you need to perform the following steps:
         1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
                        i_callback_pf_status_set = 'SET_PF_STATUS' statement.
         2. Create 'SET_PF_STATUS' FORM
         3. Create pf_status (i.e. 'ZNEWSTATUS').
              - It is recommend that you copy standard status'STANDARD' from function group SALV
                and modify it accordingly. ALV standard function codes always start with '&'.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_pf_status_set = 'SET_PF_STATUS'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM SET_PF_STATUS                                         *
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZNEWSTATUS'.
                      "Copy of 'STANDARD' pf_status from fgroup SALV
    ENDFORM.
    I have assumed the former is used  when I am selecting a field on the list
    and the later when I have  created a pf-status. I mean to say... I have slected a field and click on some button to get further information.
    Please remove my confusion.
    Thanking you alll in advance,
    Hari Kiran.

    From their Terms & Conditions page:
    Grade A - Working phone in as new/mint condition. Complete with original box and accessories as sold new.
    Grade B (and Discounted) - Working phone in good condition with slight cosmetic blemishes. Charger supplied. If the phone includes a music player/radio then it is supplied with headphones. If the phone has PDA functionality a sync cable and/or docking cradle is supplied. Missing original packaging.
    Grade C (and Budget) - Working phone in poor cosmetic condition. Original or 3rd party charger supplied but missing accessories and original packaging.
    Substitute iPod for phone and I think it makes sense...
    tt2

  • What is the difference between 'CRM_ORDER_SAVE' and 'CRM_ORDER_MAINTAIN'?

    Hi Experts,
       What is the difference between these two FMs?
       'CRM_ORDER_SAVE' and 'CRM_ORDER_MAINTAIN'
       I want to change the user status of an order in CRM. I have seen several posts in the forum some of which advises to use CRM_ORDER_MAINTAIN' while others  'CRM_ORDER_SAVE'.
      I am really confused. Which one is the correct FM? I could not find any documentation for these FMs.
      Do we need to use both these FMs or only one of them?
    What is the correct order to call this FM?
    1. CRM_STATUS_CHANGE_EXTERN "Change the user status
    2. Commit work
    3. CRM_ORDER_INITIALIZE
    4. CRM_ORDER_MAINTAIN
    5. Commit work.
    6. CRM_ORDER_SAVE
    Also what is the meaning of Ref_kind field? When do we give 'A' and when do we give 'B'?
    ls_status-ref_guid = i_crmd_orderadm_h-guid.
    ls_status-ref_kind = 'A'.
    ls_status-status = 'E0003'.
    ls_status-activate = 'X'.
    APPEND ls_status TO lt_status.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    IT_STATUS = lt_status
    CHANGING
    CT_INPUT_FIELDS = lt_input_fields
    EXCEPTIONS
    ERROR_OCCURRED = 1
    DOCUMENT_LOCKED = 2
    NO_CHANGE_ALLOWED = 3
    NO_AUTHORITY = 4
    OTHERS = 5.
    Thanks
    Gopal

    First question:
    - the purpose of 'CRM_ORDER_MAINTAIN' is to set values of the fields (for example set header data, items, pricing...)
    - the purpose of  'CRM_ORDER_SAVE' is just to save objects (in this function you don't set data but just set which objects (guids) should be saved)
    Second question:
    - you can use only  'CRM_ORDER_MAINTAIN'  if you execute function in runtime (change data on the transaction that is opened on the screen) and then you save the object manualy
    - you need both functions if you execute function 'CRM_ORDER_MAINTAIN'  in the background because this function doesn't perform the save functionality by itself
    3rd question:
    The correct order is
    1. CRM_STATUS_CHANGE_EXTERN "Change the user status
    6. CRM_ORDER_SAVE
    You don't need fm 'CRM_ORDER_MAINTAIN', because CRM_STATUS_CHANGE_EXTERN calls at the end 'CRM_ORDER_MAINTAIN' by itself (it is a sort of subfunction of this function).
    4th question:
    With 'ref_kind' you set to which level are you refering (header or item). A is for header.
    Regards.

  • What is the difference between Firefox 7.0.1 and Firefox Desktop? I like what I see in Desktop. How do I get it.

    How do I go about getting Firefox Desktop. I have Firefox 7.0.1 now as my browser. Do I have to download Desktop or do an add-on?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

  • What is the difference between TO_CHAR and TO_DATE()?

    Hi everybody,
    i am facing a problem in my system.It is quite urgent, can you explain me "What is the difference between TO_CHAR and TO_DATE()?".
    According to user's requirement, they need to generate a code with format "YYMRRR".
    YY = year of current year
    M = month of current month (IF M >=10 'A' ,M >=11 'B' , M >=10 'C')
    RRR = sequence number
    Example: we have table USER(USER_ID , USER_NAME , USER_CODE)
    EX: SYSDATE = "05-29-2012" MM-DD-YYYY
    IF 10
    ROW USER_ID , USER_NAME , USER_CODE
    1- UID01 , AAAAA , 125001
    2- UID02 , AAAAA , 125002
    10- UID010 , AAAAA , 12A010
    This is the original Script code. But This script runs very well at my Local. Right format. But it just happens wrong format on production.
    12A010 (Right) => 11C010 (Wrong).
    SELECT TO_CHAR(SYSDATE, 'YY') || DECODE( TO_CHAR(SYSDATE, 'MM'),'01','1', '02','2', '03','3', '04','4', '05','5', '06','6', '07','7', '08','8','09','9', '10','A', '11','B', '12','C') ||     NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE FROM TVC_VSL_SCH                                                       
         WHERE TO_CHAR(SYSDATE,'YY') = SUBSTR(USER_CODE,0,2)                         
         AND TO_CHAR(SYSDATE,'MM') = DECODE(SUBSTR(USER_CODE,3,1),'1','01',          
              '2','02', '3','03', '4','04', '5','05',          
              '6','06', '7','07', '8','08', '9','09',          
              'A','10', 'B','11', 'C','12')                    
    I want to know "What is the difference between TO_CHAR and TO_DATE()?".

    try to use following select
    with t as
    (select TO_CHAR(SYSDATE, 'YY') ||
             DECODE(TO_CHAR(SYSDATE, 'MM'),
                    '01', '1',
                    '02', '2',
                    '03', '3',
                    '04', '4',
                    '05', '5',
                    '06', '6',
                    '07', '7',
                    '08', '8',
                    '09', '9',
                    '10', 'A',
                    '11', 'B',
                    '12', 'C') as code
        from dual)
    SELECT t.code || NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE
      FROM TVC_VSL_SCH
    WHERE SUBSTR(USER_CODE, 1, 3) = t.codeand yes you need check time on your prodaction server
    good luck
    Edited by: Galbarad on May 29, 2012 3:56 AM

  • What's the difference between segment filtering and reduced message type

    Hi gurus,
    What's the difference between segment filtering and reduced message type? It seems they have the same functionality: Reduce the segment while idoc is generated.
    Thanks in advance.

    Hi,
    BD53 is for IDoc Reduction.
    this allows you to create a reduced message based upon a standard message type.If you want see mandatory fields. go to T-coe BD53 and give one standard messege type name and eg: matmas
    there mandatory fields will be in Green color..
    And BD56- This transaction is used to filter out segments of IDocs for combination of sender and receiver. This is usefull in scenarios where a standard IDoc with many segments is used but the receiving partner is only interested in some of the segments
    the table related to this transation is TBD20
      please go through below blog you have an idea abt that,
    http://wiki.sdn.sap.com/wiki/display/ABAP/ReducedMessageTypes
    http://saptotal.com/IDoc%20Segment%20Filtering.html
    regards,
    ganesh.

  • What's the Difference Between OLAP and OLTP?

    HI,
    What's the difference between OLAP and OLTP ? and which one is Best?
    -Arun.M.D

    Hi,
       The big difference when designing for OLAP versus OLTP is rooted in the basics of how the tables are going to be used. I'll discuss OLTP versus OLAP in context to the design of dimensional data warehouses. However, keep in mind there are more architectural components that make up a mature, best practices data warehouse than just the dimensional data warehouse.
    Corporate Information Factory, 2nd Edition by W. H. Inmon, Claudia Imhoff, Ryan Sousa
    Building the Data Warehouse, 2nd Edition by W. H. Inmon
    With OLTP, the tables are designed to facilitate fast inserting, updating and deleting rows of information with each logical unit of work. The database design is highly normalized. Usually and at least to 3NF. Each logical unit of work in an online application will have a relatively small scope with regard to the number of tables that are referenced and/or updated. Also the online application itself handles the majority of the work for joining data to facilitate the screen functions. This means the user doesn't have to worry about traversing across large data relationship paths. A heavy dose of lookup/reference tables and much focus on referential integrity between foreign keys. The physical design of the database needs to take into considerations the need for inserting rows when deciding on physical space settings. A good book for getting a solid base understanding of modeling for OLTP is The Data Modeling Handbook: A Best-Practice Approach to Building Quality Data Models by Michael C. Reingruber, William W. Gregory.
    Example: Let's say we have a purchase oder management system. We need to be able to take orders for our customers, and we need to be able to sell many items on each order. We need to capture the store that sold the item, the customer that bought the item (and where we need to ship things and where to bill) and we need to make sure that we pull from the valid store_items to get the correct item number, description and price. Our OLTP data model will contain a CUSTOMER_MASTER, A CUSTOMER_ADDRESS_MASTER, A STORE_MASTER, AN ITEM_MASTER, AN ITEM_PRICE_MASTER, A PURCHASE_ORDER_MASTER AND A PURCHASE_ORDER_LINE_ITEM table. Then we might have a series of M:M relationships for example. An ITEM might have a different price for specific time periods for specific stores.
    With OLAP, the tables are designed to facilitate easy access to information. Today's OLAP tools make the job of developing a query very easy. However, you still want to minimize the extensiveness of the relational model in an OLAP application. Users don't have the wills and means to learn how to work through a complex maze of table relationships. So you'll design your tables with a high degree of denormalization. The most prevalent design scheme for OLAP is the Star-Schema, popularized by Ralph Kimball. The star schema has a FACT table that contains the elements of data that are used arithmatically (counting, summing, averaging, etc.) The FACT Table is surrounded by lookup tables called Dimensions. Each Dimension table provides a reference to those things that you want to analyze by. A good book to understand how to design OLAP solutions is The Data Warehouse Toolkit: Practical Techniques for Building Dimensional Data Warehouses by Ralph Kimball.
    Example: let's say we want to see some key measures about purchases. We want to know how many items and the sales amount that are purchased by what kind of customer across which stores. The FACT table will contain a column for Qty-purchased and Purchase Amount. The DIMENSION tables will include the ITEM_DESC (contains the item_id & Description), the CUSTOMER_TYPE, the STORE (Store_id & store name), and TIME (contains calendar information such as the date, the month_end_date, quarter_end_date, day_of_week, etc).
      Database Fundamentals > Data Warehousing and Business Intelligence with Mike Lampa
    Search Advice from more than 250 TechTarget Experts
    Your question may have already been answered! Browse or search more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.

  • What's the difference between setFollowRedirect() and setinstanceFollowRedi

    What's the difference between setFollowRedirect() and setInstanceFollowRedirect() ?????

    Hi there,
    setFollowRedirects and setInstanceFollowRedirects both set flags that indicate whether or not the HtppURLConnection should follow a redirect if it receives one from the server that it is connecting to. The difference is that setFollowRedirects() is a static method that changes the behaviour for all instances of the HttpURLConnection class (or more likely the implementation class, HttpURLConnection is abstract) and setInstanceFollowRedirects() just changes it for the instance on which you call it.
    BTW: The field set by setFollowRedirects is private (followRedirects) while the flag set by setInstanceFollowDirects is protected and is listed in the API docs (instanceFollowRedirects)
    Hope this helps
    Amanda

  • What's the difference between full & large when importing video?

    In my preference menu, it shows I can import video as either full-original size or large-960x540. Does it make a difference in the size of the file, in the quality of the view, in what can be done with the file? Also, can I determine whether I want it imported as a .mov or .dv or .iprojectimovie? Thanks

    since vers08, it is a well-known fact, that iM can not handle interlaced material, there are tons of threads on this topic alone on this board. and it seems as though, that iM does a very 'simple' de-interlacing, by dropping one field: 1920x1080i => 1920x540'p'
    I don't like to go into detail, but modern hardware, beyond tubes and arial broadcast, doesn't use, can not handle interlace, any flat-screen, computer or TV, de-interlaces anyhow.
    so, if you need for any reason, that extra horizontal resolution, keep it full, otherwise use large.
    lubrom wrote:
    ... I apologize for my ignorance but what is the difference between a container, a media wrapper, codec and folder structure?
    sorry for my ignorance, but you asked for it ... ( ? )
    lubrom wrote:
    ... can I determine whether I want it imported as a .mov or .dv or .iprojectimovie?

  • What is the differences between the older version of Oracle Financials and the 11 i

    What is the differences between the older version of Oracle Financials and 11i?

    Vijay,Thanks for your answer,but I am still not clear about it,I have a instance to describe my question at detail.
        If there is a final product A, and the planning strategy for A is 20(MTO), the procurement type of A is F(external procurement) at the view mrp2 in the material master datas.
    step1: I creat a sales order.
    step2: run MRP for A.
    step3: transfer the purchase requistion into a purchase order,and the field of acc.***.cat. in the purchase order will be filled out M automatically, because the acc.***.cat. in the planning strategy 20(MTO) is set with E.
        Well, the purchase order is created, what is the relationship between the sales order and the purchase order? What will be happened about costing between the SO and the PO?
        If I delete the E, I make the PO become a standard PO, what is difference between standard PO and the PO including E?
    Best Regards
    Bob

  • What is the difference between (SEPA Structured) and (SEPA Unstructured)?

    Hi,
    Could you please teach me about "Format Payments (SEPA Structured)"
    and "Format Payments (SEPA Unstructured)"?
    1.What is Format Payments (SEPA Structured)?
    Is (SEPA Structured) used with which case?
    2.What is Format Payments (SEPA Unstructured)?
    Is (SEPA Unstructured) used with which case?
    3.What is the difference between (SEPA Structured) and (SEPA Unstructured)?
    The customer is checking Note.791226.1.
    However, he says that he cannot understand these two differences.
    Please teach me.
    Thanks.

    From the European Payments Council website:
    Remittance information: structure the unstructured
    The SEPA Credit Transfer Scheme permits the end-to-end carrying of remittance data on a structured or unstructured basis appropriate to the nature of the payment (the remittance information usually contains details of the contract underlying the transaction such as an invoice number, for example). The length of the remittance information in the SCT Scheme is fixed at a standard length of 140 characters and banks are obliged to pass on the full remittance information.
    The EPC supports a proposal developed by the European Association of Corporate Treasurers (EACT), which allows companies to agree on a structure for the remittance information. The EACT suggestion on how to structure the "unstructured" remittance fields allows companies exchanging a credit transfer to agree, among other, on information to be transmitted in a specific manner. Banks will carry remittance information structured in such an agreed way unaltered throughout the process chain.

  • What is the difference between  ABAP and HR-ABAP?

    Hi people,
    Could u just tel me abt what is the difference between ABAP and HR-ABAP?
    Thanks in advance,
    Sanjeev K.V

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    Also,
    HR:
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    And finally,
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet  screen. You now have the option of creating field groups and assigning fields as required for non-HR InfoSets. Field groups that correspond to infotypes and already contain fields, however, are always created for HR InfoSets. The field groups are displayed in an overview tree in the top right section of the screen.
    The infotypes that you included in the InfoSet are displayed in an overview tree on the left of the screen. The infotype fields that are already included in field groups are displayed in a different color, and the corresponding field group ID is displayed.
    In the standard system, a field group is created automatically for each infotype that you included in the InfoSet (a field group corresponds to an infotype).
    In the standard system, each field group contains the infotype-specific fields. To ensure that working with the InfoSet is as easy as possible, you are advised to restrict your use of fields in each field group to those you really require. This means you should remove fields that are not required.
    An infotype's fields must only be assigned to the pertinent field group. Make sure this assignment is correct. If the assignment is incorrect, the InfoSet could be rendered unusable.
    When an InfoSet is created, the following fields are transferred automatically to the first field group:
    § Logical database PNPCE or PNP Personnel number
    § Logical database PAP Applicant number
    § Logical database PCH Object ID, plan version, and object type
    6. Determine the fields that must be included in the field groups of your InfoSet. If you require further information, see Assigning Fields to a Field Group.
    If you want, you can change the default sequence of field groups and fields as required using Drag&Drop.
    7. To save the InfoSet, choose .
    8. To generate the InfoSet, choose .
    On the Change InfoSet (InfoSet name) screen, you can choose Edit ® Change infotype selection to add more infotypes to the InfoSet, or to remove infotypes from the InfoSet. Remember to regenerate the InfoSet afterwards.
    This screen also enables you to update InfoSets if, for example, the system contains new additional fields for specific key values. To do so, choose InfoSet ® Additional functions ® Update additional HR fields.
    9. Go back to the initial screen for InfoSet maintenance.
    10. Choose User group assignment.
    11. Select a user group, and save your entry.
    sample code
    START-OF-SELECTION.
    GET pernr.
    rp_provide_from_frst p0000 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0001 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0001-plans. " earliest.
    endif.
    endif.
    rp_provide_from_last p0014 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0014 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0014-LGART. .
    endif.
    endif.

Maybe you are looking for

  • Ok the help is needed i need this help so i can graduate

    How do you go about writing the code to change the font size in my program my cluster in High school is computer programming and i haven't begun to learn Java at school yet so i am now learning by myself at home but i have a 80 year old book and i ne

  • Order by absolute value

    Hi, I am trying to write a SQL query which returns the % difference between 2 columns in a table, in sorted descending order, based on the absolute value. The statement goes like this: SELECT ((col1 - col2)/col2)*100 FROM table1 WHERE col2 > 0 UNION

  • My History is not showing up

    I have done everything I could think of to fix the problem but nothing is working. Firefox is not remembering the history and the time is wrong if it is. I have tried updating to a new Firefox I have checked the option of remember my history but it's

  • My computer got hit with a virus. Had to reinstall Windows.

    My Acobat Pro 9 key is locked now. Can I get my key reset?

  • Bind to in-process report server failed --- urgent

    Dear all, I installed 10g R2 application server on RHEL AS 4.0 with infrastructure and Business intelligence in the same machine. After the installation I tested the forms, iit is working fine by running a test form but when i tried to test a demo re