Displaying contents of two int. tables in same screen using grid display

Hello everyone,
   Can anyone give me any idea how we can print contents of two internal tables of different structures in same screen while we are using GRID display fm. This is working fine in LIST display with fm's like REUSE_ALV_BLOCK_LIST_INIT , BLOCK_LIST_APPEND and BLOCK_LIST_DISPLAY. But what about the same in Grid display?

Hi,
You have to define two containers in a single Screen.
Define two containers on a single screen
DATA: ok_code LIKE sy-ucomm,
      g_container TYPE scrfname VALUE 'CUSTOM2',
      grid1  TYPE REF TO cl_gui_alv_grid,
      g_custom_container TYPE REF TO cl_gui_custom_container.
DATA: i_cat            TYPE kkblo_t_fieldcat,
      i_fieldcatalog   TYPE lvc_t_fcat,
      ws_fcat        TYPE lvc_s_fcat,
       wa_layout     TYPE lvc_s_layo.
DATA:
      g_container1 TYPE scrfname VALUE 'CUSTOM3',
      grid2  TYPE REF TO cl_gui_alv_grid,
      g_custom_container1 TYPE REF TO cl_gui_custom_container.
DATA: i_cat1            TYPE kkblo_t_fieldcat,
      i_fieldcatalog1   TYPE lvc_t_fcat,
      wa_layout1        TYPE lvc_s_layo.
Display firstALV
  wa_layout-grid_title = text-029.
  wa_layout-zebra      = 'X'.  "Output rows with alternating colors
  wa_layout-no_author  = 'X'.  "Allow users to enter global layouts
  wa_layout-sel_mode   = 'A'.
  wa_layout-cwidth_opt = 'X'.
  ws_repid = sy-repid.
*Function module to get the field catalog in the kkblo_t_fieldcat format
  CALL FUNCTION 'K_KKB_FIELDCAT_MERGE'
       EXPORTING
            i_callback_program     = ws_repid
            i_tabname              = 'WS_OPEN_SUM'
            i_inclname             = ws_repid
       CHANGING
            ct_fieldcat            = i_cat
       EXCEPTIONS
            inconsistent_interface = 1
            OTHERS                 = 2.
  IF sy-subrc <> 0.
    MESSAGE e000 WITH text-003.
  ENDIF.
*Function module to get the field catalog in the lvc_t_fieldcat format
  CALL FUNCTION 'LVC_TRANSFER_FROM_KKBLO'
       EXPORTING
            it_fieldcat_kkblo = i_cat
       IMPORTING
            et_fieldcat_lvc   = i_fieldcatalog
       EXCEPTIONS
            it_data_missing   = 1
            OTHERS            = 2.
  IF sy-subrc <> 0.
    MESSAGE e000 WITH text-003.
  ENDIF.
  LOOP AT i_fieldcatalog INTO ws_fcat.
    IF ws_fcat-fieldname = 'BALANCE'.      "#CCE
#CCE - IF required
      ws_fcat-do_sum = 'X'.
      MODIFY i_fieldcatalog FROM ws_fcat.
    ENDIF.
  ENDLOOP.
  IF g_custom_container IS INITIAL.
    CREATE OBJECT g_custom_container
     EXPORTING container_name = g_container.
    CREATE OBJECT grid1
              EXPORTING i_parent = g_custom_container.
    CALL METHOD grid1->set_table_for_first_display
             EXPORTING
                 is_layout = wa_layout
             CHANGING
                 it_fieldcatalog  = i_fieldcatalog
                 it_outtab        =  i_open_sum.
  ENDIF.
Display second ALV
  wa_layout1-grid_title = 'SAP R/3 (GLPCT) Totals'.
  wa_layout1-zebra      = 'X'.  "Output rows with alternating colors
  wa_layout1-no_author  = 'X'.  "Allow users to enter global layouts
  wa_layout1-sel_mode   = 'A'.
  wa_layout1-cwidth_opt = 'X'.
  ws_repid = sy-repid.
*Function module to get the field catalog in the kkblo_t_fieldcat format
  CALL FUNCTION 'K_KKB_FIELDCAT_MERGE'
       EXPORTING
            i_callback_program     = ws_repid
            i_tabname              = 'WS_GLPCT_CHK'
            i_inclname             = ws_repid
       CHANGING
            ct_fieldcat            = i_cat1
       EXCEPTIONS
            inconsistent_interface = 1
            OTHERS                 = 2.
  IF sy-subrc <> 0.
    MESSAGE e000 WITH text-003.
  ENDIF.
*Function module to get the field catalog in the lvc_t_fieldcat format
  CALL FUNCTION 'LVC_TRANSFER_FROM_KKBLO'
       EXPORTING
            it_fieldcat_kkblo = i_cat1
       IMPORTING
            et_fieldcat_lvc   = i_fieldcatalog1
       EXCEPTIONS
            it_data_missing   = 1
            OTHERS            = 2.
  IF sy-subrc <> 0.
    MESSAGE e000 WITH text-003.
  ENDIF.
  LOOP AT i_fieldcatalog1 INTO ws_fcat.
    CASE ws_fcat-fieldname.
      WHEN 'HSLVT'.
        ws_fcat-do_sum = 'X'.
      WHEN 'HSL01' OR 'HSL02' OR 'HSL03' OR 'HSL04' OR
           'HSL05' OR 'HSL06' OR 'HSL07' OR 'HSL08' OR
           'HSL09' OR 'HSL10' OR 'HSL11' OR 'HSL12' OR
           'HSL13' OR 'HSL14' OR 'HSL15' OR 'HSL16' .
        ws_fcat-no_out = 'X'.
      WHEN 'RBUKRS' OR 'RACCT' OR 'RPRCTR' .
        ws_fcat-key = 'X'.
    ENDCASE.
    MODIFY i_fieldcatalog1 FROM ws_fcat.
  ENDLOOP.
  IF g_custom_container1 IS INITIAL.
    CREATE OBJECT g_custom_container1
     EXPORTING container_name = g_container1.
    CREATE OBJECT grid2
              EXPORTING i_parent = g_custom_container1.
    CALL METHOD grid2->set_table_for_first_display
             EXPORTING
                 is_layout = wa_layout1
             CHANGING
                 it_fieldcatalog  = i_fieldcatalog1
                 it_outtab        =  i_glpct_chk.
  ENDIF.
Then call the screen
  Call Screen 9000.
Regards
Subramanian

Similar Messages

  • Function module for comparing contents of two internal tables

    Hi All,
    Is there any function module to compare contents of two internal tables of same structure?
    If yes please let me know.
    Thanks in advance.
    Amol

    Hi
    call SE16 with table TFTIT in order to get a full list (it will be long...)
    A list of FMs with parameters can be found in table FUNCT.
    Finally go to sm37rsdf4
    that will give you all the function modules with description
    Here is the list:
    http://www.erpgenie.com/abap/functions.htm
    hope this helps...
    Regards
    CSM Reddy

  • How to get common datas from two int.tables

    hi,
    please tell me , how to i will get the common datas between two int. tables
    & place them in third int. table.
    give me syntax.
    regards
    subhasis.

    Hi Subhasis,
    <b>SORT :</b></u>
    SORT itab.
    Extras:
    1. ... BY f1 f2 ... fn
    2. ... ASCENDING
    3. ... DESCENDING
    4. ... AS TEXT
    5. ... STABLE
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
    Effect
    The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
    Addition 1
    ... BY f1 f2 ... fn
    Effect
    Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
    You can also specify the sort fields dynamically in the form (name). If name is blank at runtime, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
    If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table.
    You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
    If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
    Addition 2
    ... ASCENDING
    Effect
    Sorts in ascending order. This is also the default if no sort order is specified directly after SORT. For this reason, it is not necessary to specify ASCENDING explicitly as the default sort order.
    With the addition BY, you can also specify ASCENDING directly after a sort field to define ascending order explicitly as the sort sequence for this field.
    Addition 3
    ... DESCENDING
    Effect
    Sorts in descending order. If the addition comes right after SORT, DESCENDING is taken as the default for all fields of the sort key.
    With the addition BY, you can also specify DESCENDING directly after a sort field.
    Addition 4
    ... AS TEXT
    Effect
    Text fields are sorted appropriate to the locale. This means that the relative order of characters is defined according to the text environment being used.
    When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the logon language specified in the user master record. If necessary, however, you can change the text environment explicitly in your program by using a SET-LOCALE statement.
    If the addition comes directly after itab, locale-specific rules are used for all fields of the sort key where the type of these fields is C or W. After the sort, the sequence of entries usually does not match the sequence which results otherwise, without using the addition AS TEXT, i.e. with binary sorting.
    With the addition BY, you can also specify AS TEXT directly after a sort field, provided it is of type C or W, or a structured type. Otherwise, a runtime error occurs. In sort fields with a structured type, AS TEXT only affects subcomponents with type C or W.
    In case of an invalid character, a SYSLOG message is written, and the respective record is inserted at the end.
    Note
    Please keep the rules for site-specific sorting in mind.
    Example
    Sort a name table with different keys:
    TYPES: BEGIN OF PERSON_TYPE,
             NAME(10)   TYPE C,
             AGE        TYPE I,
             COUNTRY(3) TYPE C,
           END OF PERSON_TYPE.
    DATA: PERSON TYPE STANDARD TABLE OF PERSON_TYPE WITH
                      NON-UNIQUE DEFAULT KEY INITIAL SIZE 5,
          WA_PERSON TYPE PERSON_TYPE.
    WA_PERSON-NAME    = 'Muller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Moller'. WA_PERSON-AGE = 25.
    WA_PERSON-COUNTRY = 'FRG'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Möller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Miller'. WA_PERSON-AGE = 23.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    SORT PERSON.
    Now, the sequence of the table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Muller  22  USA
    Möller  22  USA
    If, for example, you apply German sort rules where the umlaut comes directly after the letter 'o' in the sort, the data record beginning with 'Möller' would not be in the right place in this sequence. It should come second.
    Provided a German-language locale is set (e.g. sorting is according to German grammatical rules, see also SET LOCALE), you can sort the names according to German rules as follows:
    SORT PERSON BY NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Möller  22  USA
    Muller  22  USA
    Further examples:
    SORT PERSON DESCENDING BY COUNTRY AGE NAME.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Möller  22  USA
    Muller  22  USA
    Moller  25  FRG
    SORT PERSON DESCENDING BY AGE ASCENDING NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Muller  22  USA
    Möller  22  USA
    Miller  23  USA
    Moller  25  FRG
    Addition 5
    ... STABLE
    Effect
    Uses a stable sort, that is, the relative sequence of entries that have the same sort key remains unchanged.
    Unlike additions 2 to 4, you cannot use this addition directly after a sort field.
    Notes
    General:
    The number of sort fields is restricted to 250.
    The sort process is only stable if you use the STABLE addition. Otherwise, a predefined sequence of fields used to sort a list is not usually retained.
    It does not make sense to use the SORT command for a SORTED TABLE. If the table type is statically declared, the system returns a syntax error if you try to SORT the table. If the table type is not statically declared (for example, because the table was passed to a FORM routine as an INDEX TABLE in a parameter), and the system can interpret the SORT statement as an empty operation, it ignores the statement. This is the case when the key in the BY clause corresponds to the beginning of the table key. Otherwise, a runtime error occurs.
    To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement.
    When using the addition AS TEXT, the sequence of entries after the sort does not usually match the sequence resulting from a binary sort, i.e. if the addition AS TEXT is not specified. The consequence of this is that after the SORT, you are not allowed to access with the READ TABLE itab ... BINARY SEARCH statement.
    If you still want to access data sorted apppropriate to the locale with a binary search, you can do this by including an additional component in the table where you can explictly store the data formatted using the CONVERT TEXT ... INTO SORTABLE CODE statement. This is also recommended for performance reasons if you have to re-sort the table several times according to locale-specific criteria.
    If the internal table has more than 2^19 lines or is larger than 12 MB, the system sorts it physically using an external auxiliary file. You can specify the directory in which the file should be created using the SAP profile parameter DIR_SORTTMP. By default, the system uses the SAP data directory (SAP profile parameter DIR_DATA).
    Notes
    Performance:
    The runtime required to sort an internal table increases with the number of entries and the length of the sort key.
    Sorting an internal table with 100 entries with a 50 byte key requires about 1300 msn (standardized microseconds). Using a 30-byte key, the runtime is about 950 msn.
    If one of the specified sort criteria is itself an internal table, SORT may sometimes take much longer.
    The runtime increases if you use a stable sort.
    Physical sorting reduces the runtime required for subsequent sequential processing.
    Reward If Useful.
    Regards,
    Chitra

  • How to display two grids in same screen using SALV Method

    Hi Freinds,
    Please let me know how to display two grids in same screen using SALV Method.
    Thank you
    Regards,
    SDV

    Using the same concept as described in How to dispaly Three Internal Table  Data (One below another) in ALV OOPS .
    All you need to add is passing your new containers as r_container parementer of factory method.
    "1st one
          cl_salv_table=>factory(
             EXPORTING
               R_CONTAINER    = g_top_container
    "2nd one
          cl_salv_table=>factory(
             EXPORTING
               R_CONTAINER    = g_bottom_container
    Regards
    Marcin

  • Get the Common from Two Internal Tables with same structure

    Hi ,
    I need to get the Common data from Two Internal Tables with same structure with using the looping method.
    For e.g.
    I have two internal table say ITAB1 and ITAB2.
    ITAB1 has values A,B,C,D,E,F
    ITAB2 has values A,H,B,Y,O
    Output at runtime should be : A,B

    Hi mohit,
    1. If u want to compare all fields,
       for matching purpose,
       then we can do like this.
    2.
    report abc.
    data : a like t001 occurs 0 with header line.
    data : b like t001 occurs 0 with header line.
    loop at a.
      LOOP AT B.
        IF A = B.
          WRITE :/ 'SAME'.
        ENDIF.
      endloop.
    ENDLOOP.
    regards,
    amit m.

  • How to compare the contents of two different tables

    hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
    example, i have a table named Main List and a table named New List.
    The contents of the New List should be compared to the contents of the
    Main List, to check if they are equal. I don't have any idea how to manipulate
    this data. Hoping for your help. Thanks.

    it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections

  • Display 2 different structured internal tables in single screen using ALV

    Hi,
    I have two internal tables. Both has different structures. My requirement is to display both the internal tables in single screen using ALV Grid but NOT using OO ALV Grid display.
    Is there any way of spliting the Final ALV display screen into two with two different headers and details as shown below.
    Header1 for internal table 1
    Data of internal table 1
    Header1 for internal table 2
    Data of internal table 2
    Can anyone suggest a better way to display this.
    Regards,
    Senthil

    hi
    first think i can say ALV GRID means only for OO ALV it is not possible to display two I.T. data in singr report screen.
    better to use of the fm: REUSE_ALV_BLOCK_LIST_DISPLAY
    so that u can display both I.T. data in separate report list under single screen
    Check the example programs:
    BALVBT01 Testprogram ALV: Block list
    BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
    Regards,
    deepak

  • Two persons with the same screen name?

    Am I seeing things, or here we have two persons with the same screen name?
    http://forums.adobe.com/people/Federico_Plat%C3%B3n
    http://forums.adobe.com/people/federico%20platon
    (Yes, I know it's really two identities belonging to the same person, but to my eye both screen names look identical on screen; and I thought the system prevented entering a screen name already in use).

    Jochem van Dieten wrote:
    Claudio González wrote on 4/21/2010 9:53 PM:
    Rick, I must confess that I had never thought of looking for participant's screen names down there. And I still find it curious that the accent is absent at the obvious position of screen names.
    Have you ever considered investigating this sort of thing? Create a new
    Adobe ID, change values for userID, screenname, firstname and lastname
    on the Adobe side and see what changes on the Jive side? The logic may
    turn out to be surprisingly simple.
    No, I haven't and most probably I will not, at least in the foreseeable future. I have enough problems with my own account, and I waste too much time as it is on re-logging in, and on waiting for pages to load and messages to be posted, to indulge in such an investigation. Even if the logic behind two accounts that on screen seem to be associated with exactly the same screen name turns out to be exceedingly simple.

  • Two fact tables with same dimensions

    Good Morning,
    I am just assigned to a new project. This is my first maintenance request: two fact tables F1 and F2 that shares same set of dimemsion tables D1 and D2. In the Answers report, if I use a foreign key in either F1 or F2, for example F1.k1, I get an error of meta data inconsistency. But if I use same column from dimension table D1.k1, then no error.
    Your help is very much appreciated.
    May

    This is proberly #3 on the most popular topics list, behind SSO and a variables. Please use the search, what you need to do to set up conformed dimensions with multiple facts in the same report has been covererd many times.

  • Downloading two internal tables in same text file

    I have one internal table as like below.
    Data:begin of itab1 occurs 0,
         rec(5),
         end of itab1.
    Itab1 is getting updated from input text file(Continuous text).
    Here Itab1 contains one record with Indicator '01 and n number of records with indicator '02'.
    This needs to be seperated in to two internal tables.
    data:Begin of Itab_Head occurs 0,
         Rec_ind(2) type C,
         Name(3) type C,
         end of itab_Head.
    data:Begin of Itab_Item occurs 0,
         Rec_ind(2) type C,
         Id(3) type C,
         Status(10,
         end of itab_Item.
    loop at itab1.
    If itab1-Rec+0(2) = '01'.
       Itab_Head-Rec_Ind = itab1-rec+0(2).
       Itab_Head-Name = itab1-rec+2(3).
       Append Itab_Head.
    elseif itab1-rec+0(2) = '02'.
       Itab_Item-Rec_Ind = itab1-rec+0(2).
       Itab_Item-Id = itab1-rec+2(3).
       Append Itab_Item.
    endif.
    endloop.
    After moving to the internal tables I am doing some processing and updating the status of Itab_item.
    After all these again I have to download the internal table as a text file.Now my question is.
    I have values in 2 diff internal tables.How to download the two in same file.

    See this sample code.
    data: itab1 type string occurs 0 with header line,
          itab2 type string occurs 0 with header line.
    itab1 = 'itab1_text'.
    append itab1.
    itab2 = 'itab2_text'.
    append itab2.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        exporting
          FILENAME = 'C:\ftext.txt'
        APPEND = 'X'
        changing
         DATA_TAB = itab1[].
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        exporting
          FILENAME = 'C:\ftext.txt'
          APPEND = 'X'
        changing
         DATA_TAB = itab2[].
    Svetlin

  • How do two users on the same iMac use the same iPhoto library?

    How do two seperate users on an Imac, use the same iphoto library? 

    See iTunes: How to share music between different user accounts on a single computer.
    tt2

  • Two users (on the same Mac) using same RAID simultaneously?

    O.K. I know you should never never ever connect two different Macs to the same RAID unless using Xsan. . .
    How about connecting two users on the same Mac simultaneously?
    In other words, can I have one user manipulating data on the RAID in the background while reading the data using a second user (on the same Mac)?
    Thanks,
    Ed

    That depends on the application in question.
    Since all the data requests are coming from the same Mac, you don't have the issues you would have if you had two different machines talking at the same time.
    However, it now depends on whether the application(s) you're using supports file locks.
    As long as the application that's manipulating the data properly locks the part of the file it's working on, and that the application you're using to read the file reads the locks and knows whether or not it's OK to use that part of the file, you should be OK.

  • Combine two ints into a long without using chars or strings.

    Hi
    I have two ints and i need to combine (not add) them into a long value. The reason for this is because I need the make keys for a DB containing both values.
    eg.
    int1 = 3567453647
    int2= 6368535795
    long combination = combine(int1, int2);
    and the value of combination should be 35674536476368535795
    I know you can doing it by turning the ints into strings, combining the strings and then using the combined string as intput to a new Long(String) but I really need a faster way using pure maths (maybe bit shift?) as this combination function will be used billions of times.
    Thanks
    Edited by: user8908143 on 29-Sep-2010 19:52

    It's also a good way to get rid of boneheaded comments once one realizes how boneheaded they were. :-)A posteriori editing is another way :o)
    [OT: Forum features and moderators] A posteriori edition ( self- or mod- )
    Edited by: jduprez on Sep 30, 2010 6:21 PM
    That being said (and mocked), the binary shift left solution seems correct (although I'd definitely go for a custom class and double-column key instead).

  • Loading File name and file contents into two separate tables using Sqlloadr

    Hi All,
    I have situtation like to load File contents into One table and File name into one table . File comes with .txt extension
    Example :
    File name : product_09_abc.txt
    File contents :
    Productcode
    ABC
    CDE
    EFT
    Can you please help me out this how can we acheive this using SQLLOADER.

    SQL*Loader will not pass through the filename for you to be able to insert into a table.
    You will need to have a controlling o/s script that picks up the file name, calls sql*loader and then also call's an SQL script (using sql*plus?) to insert the filename into a.n.other table.

  • Where statement on two different tables with same column name

    Hello,
    I have 2 financial tables:
    tblincome, tblexpenses
    in each table I have column name "monthPayed" (have values of all the months of the year).
    I would like to create a balance view table that will show me the financial status for the Q1 (for example).
    I have a column totalIncome and totalExpended respectively.
    I've create a view table that shows me the financial balance at the moment but I want it to be devide to Quarters of the year...
    Regards

     
    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Where is the code you already tried? Or are you so lazy, so rude or so privileged that you did not do anything for yourself? 
    In fact that silly “tbl-” prefix is so bad that it has a name! It is called Tibbling and Phil Factor even wrote a humor article on bad programmers that use it. 
    Your narrative is vague; it sounds like this is the DDL: 
    CREATE TABLE Incomes
    (payment_month CHAR(10) NOT NULL PRIMARY KEY,
     income_amt DECIMAL(12,2) NOT NULL
      CHECK (income_amt > 0.00),
    CREATE TABLE Expenses
    (payment_month CHAR(10) NOT NULL PRIMARY KEY,
     expense_amt DECIMAL(12,2) NOT NULL
      CHECK (expense_amt > 0.00),
    >> in each table I have column name "monthPayed" (have values of all the months of the year). <<
    I hope not! 2014 has not gotten to September, November or December yet! And the ISO-11179 data element name should be “payment_month”; but it is still wrong! An expense is not a payment! An income is not a payment! 
    >> I would like to create a balance view table that will show me the financial status for the Q1 (for example). <<
    Report Period Table
    Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
    The report period table gives a name to a range of dates that is common to the entire enterprise. 
    CREATE TABLE Something_Report_Periods
    (something_report_name CHAR(10) NOT NULL PRIMARY KEY
       CHECK (something_report_name LIKE <pattern>),
     something_report_start_date DATE NOT NULL,
     something_report_end_date DATE NOT NULL,
      CONSTRAINT date_ordering
        CHECK (something_report_start_date <= something_report_end_date),
    etc);
    These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
    data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
    Now figure it out for yourself, show us what effort you put into this, then we will help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

Maybe you are looking for

  • IPod Touch reseting after iOS 4.0 upgrade

    I upgraded my 32GB iPod touch Monday and noticed that if I am playing music and the screen has locked, sometimes I have to reset the iPod to get it to turn back on. So far it has happened about 5 times in the last 3 days, usually after listening to a

  • Read one record at a time

    Hi ! One of our Java folks here need at function where he reads one record at at time in id order; create table url_recs (id number, url varchar2(4000)); insert into url_recs values(1,'www.fona.dk'); insert into url_recs values(2,'www.dr.dk'); insert

  • Error With Crystal Reports On Windows Server 2012

    Hello, I have a VB.NET exe application created in Visual Studio 2010 that prints a crystal report directly to the printer.  On Windows Server 2008 it worked fine but it does not work on Windows Server 2012.  The report was originally created in Cryst

  • How can make the header repeat in every page?

    I followed the instructions in pages' help nad it does work for text heardes, however it does not work with images and graphics. Daoes anyone know how to make graphic and/or images headers repeat in each page? Thanks in advance. Ruben

  • What are the steps to publish Captivate 6 project for use on an iPhone?

    I found this URL: http://blogs.adobe.com/captivate/2010/09/publish-to-iphone-from-captivate-5-and-elearning- suite-2.html But this seems dated. Here's what I just tried: - Hit Publish - Checked the SWF AND the HTML5 boxes in teh Output Format Options