Merging (Joining) two tables into one

Is it possible to merge two adjacent tables into one table in Pages? Also, how can you split one table into multiple tables?

If we use the exact meaning of the words, the response is no and no.
If we play a bit with the meanings we may do the trick.
(1) I create a table with 6 columns and 5 rows.
(2) select cells D1 …F5, copy, paste in the document but out of the table. We get the right half of the table.
From the tool bar, reduce the number of columns of table 1 fom 6 to 3. Bingo we have the two halves of the original table.
(3)Select the first half and increase the number of rows from 5 to 10
(4) copy the entire second half, select cell D1 in the enlarged table, paste.
Bingo, we have the merged table.
For sure, a merge and a split tables features would be welcome but as the table tool is the one used in the spreadsheet, I would be surprised if these features where introduced one day.
_Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
Then, cross your fingers, and wait _at least_ for iWork'11
Yvan KOENIG (VALLAURIS, France) jeudi 22 avril 2010 17:28:48

Similar Messages

  • Join two tables to one recordset with nested table?

    Hello all!
    I want to "de-normalize" two tables into one for presentation reasons. For example:
    CREATE TABLE foo(id number)
    CREATE TABLE bar(foo_id number, value varchar2(4))
    And with some data:
    FOO:
    1
    2
    BAR:
    1, 'gaz'
    1, 'boz'
    2, 'blah'
    Now I want to create a view that holds the value of the BAR table in a nested table, if possible and efficient enough..
    VIEW:
    1, nested_table('gaz,'boz')
    2, nested_table('blah')
    Any clue for creating such a view? I would prefer a view, because this view will be joined with other tables later.
    Thanks in advice!

    Or
    SQL> with foo as
      2  ( select 1 id from dual union all
      3    select 2 id from dual
      4  ),
      5  bar as
      6  (
      7    select 1 foo_id, 'gaz'  value from dual union all
      8    select 1 foo_id, 'boz'  value from dual union all
      9    select 2 foo_id, 'blah' value from dual
    10  )
    11  --
    12  --
    13  select id,
    14         cast(multiset((select value from bar where id=foo_id)) as sys.dbms_debug_vc2coll) value
    15    from foo
    16  /
            ID VALUE
             1 DBMS_DEBUG_VC2COLL('gaz', 'boz')
             2 DBMS_DEBUG_VC2COLL('blah')or from 10g on
    SQL> with foo as
      2  ( select 1 id from dual union all
      3    select 2 id from dual
      4  ),
      5  bar as
      6  (
      7    select 1 foo_id, 'gaz'  value from dual union all
      8    select 1 foo_id, 'boz'  value from dual union all
      9    select 2 foo_id, 'blah' value from dual
    10  )
    11  --
    12  --
    13  select id,
    14         cast(collect(value) as sys.dbms_debug_vc2coll) value
    15    from foo, bar
    16    where id=foo_id
    17    group by id
    18  /
            ID VALUE
             1 DBMS_DEBUG_VC2COLL('gaz', 'boz')
             2 DBMS_DEBUG_VC2COLL('blah')Edited by: michaels2 on Oct 8, 2008 2:27 PM

  • Combining two tables into one result

    Hi all, I am fairly inexperienced with Crystal but have gained good results from the reports I have created, I am fluent in SQL and Basic to an extent.  I am interigating a Pronto database and I want concatenate two tables into one report.
    Table One: Customer Orders
    Fields:  Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
    Table Two: Archived Customer Orders
    Fields:  Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
    I want to complete a report that will tell me the sales for a given period and the outstanding orders for each customer total for all fields in each table combined into one figure.
    Any help would be greatly appreciated.
    Thanks in advance

    Hi Grant,
    As you said you are goot at writing SQL, in Crystal write a SQL statement in Add Command to join both table using Union / Union all
    If you use Union then it will filter duplicate records and pull the data from database, If you use Union All then it will include all your duplicate records.  Please use Union / Union All as required.
    Once you get all data into the report create a parameter for date range and generate the summaries as required.
    Thanks,
    Sastry

  • Collapsing two tables into one table or one queue

    When you have data that exists in 2 tables A and B and B is essentially a child of A if you want to process these records such that you see all A's before their assoociated B how can you use either Streams or AQ to collapse these two tables into one? The data exists at it's source in database tables it will be replicated to another location and at that location I want to keep the data as it exists at the source but also process it in the ordered fashion I described above. My thinking is to publish the data to one queue but the challenge is to ensure that all A's are put on the queue before their B is. I don't just want a priority queue whereby all A's are processed before B's because if that happens B's will never be processed. but I simply want to avoid reading a B off the queue before I've read it's A.

    No version number and no clarity of what you are trying to accomplish.
    Without knowing that the problem is a nail ... I'd hardly be recommending using a hammer.

  • How can i add two table into one internal table

    I WANT TO ADD THIS TWO DIFFERENT TABLE INTO ONE INTERNAL TABLE PLEASE HELP.
    TABLES: J_1IEXCHDR, J_1IEXCDTL.
    SELECT * FROM J_1IEXCHDR WHERE STATUS = 'P'.
    WRITE: / J_1IEXCHDR-LIFNR,
              J_1IEXCHDR-DOCNO,
              J_1IEXCHDR-EXYEAR,
              J_1IEXCHDR-BUDAT.
    SELECT * FROM J_1IEXCDTL WHERE TRNTYP = J_1IEXCHDR-TRNTYP
                              AND DOCYR  = J_1IEXCHDR-DOCYR
                              AND DOCNO  = J_1IEXCHDR-DOCNO.
       WRITE: / J_1IEXCDTL-EXBAS,
                J_1IEXCDTL-EXBED,
                J_1IEXCDTL-RDOC1,
                J_1IEXCDTL-ECS.
    ENDSELECT.
    ENDSELECT.
    THANKS IN ADVANCED.

    U have to link these 2 tables like this
    <b>SELECT
    J_1IEXCHDR~DOCNO
    FROM J_1IEXCHDR inner join J_1IEXCDTL
    on J_1IEXCHDRDOCYR  = J_1IEXCDTLDOCYR
    WHERE STATUS = 'P'.</b>
    this is sample code only, and u have to check the F.key relationship.
    Regards
    Prabhu

  • Merging of  two rows into one

    HI,
    Would you help me to write aquery such that merges two data into one,
    for example,
    Take a table Student
    Its content are
    Roll no Name
    1 Rahul
    2 Shyam
    We reqiure a query such that we get out put as
    Rahul;Shyam

    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • Join two tables into a new one

    I have two tables that I would like to save as one. They are related by a key (id).
    I've tried this:
    - Created empty table_new with the same columns as table1 and table2.
    - Then:
    SELECT *
    INTO table_new
    FROM table1
    LEFT OUTER JOIN table2
    ON table1.id = table2.id;
    I get the error "Missing keyword".
    If I do just a SELECT with LEFT OUTER JOIN, the result shows exactely what I want to store in the table. But how can I store it?
    Any other idea, how to solve the problem is welcome too. Attaching the columns of table2 to table1 would also be a solution.

    Like this?
    SQL> drop table t2;
    Table dropped.
    SQL> drop table t1;
    Table dropped.
    SQL> create table t1 (id number, text varchar2(100));
    Table created.
    SQL> create table t2 (id number, my_text varchar2(100));
    Table created.
    SQL> insert into t1 values(&id, '&text');
    Enter value for id: 1
    Enter value for text: aaa
    1 row created.
    SQL> /
    Enter value for id: 2
    Enter value for text: bbb
    1 row created.
    SQL> /
    Enter value for id: 3
    Enter value for text: ccc
    1 row created.
    SQL> insert into t2  values(&id, '&my_text');
    Enter value for id: 1
    Enter value for my_text: asdf
    1 row created.
    SQL> /
    Enter value for id: 2
    Enter value for my_text: ;lkj
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> drop table t1t2;
    Table dropped.
    SQL>  create table t1t2 as select t1.id, t1.text, t2.my_text from t1, t2 where t1.id = t2.id (+);
    Table created
    SQL> select * from t1t2;
            ID TEXT                                                                                                 MY_TEXT
             1 aaa                                                                                                  asdf
             2 bbb                                                                                                  ;lkj
             3 ccc-Arun

  • Merge 2 internal tables into one and show first record from common fields

    Hello PPl,
              I have 3 tables kna1 knb1 and knvp i have to join kna1 and knb1 on kunnr and move the data into an internal table it_data then  on the basis of that data in it_data i have to retrieve records FOR ALL ENTRIES from KNVP and move it into it_knvp.
    Then both it_data and it_knvp should be merged in it_alv and from that internal table report has to be displayed.
    [NOTE: i had tried using loop twice but the report got messed up]
    Apart from that for these set of values
    0000000004
    0000000418
    0000000954
    0000001190
    0000001222
    0000001451
    0000001453
    0000001455
    0000001470
    0000001508
    finally knvp is showing records in such a way that for 2 records kunnr is same and so does all the other fields except PARZA and KUNN2 so the req. is to display only the first record among 2.
    Plz help me by providing code for that its urgent......
    Below i m providing my code so far, i hope it will be of some help.
    TREMENDOUS REWARD POINTS GURANTEED!!!!!
    REPORT  zfanz_alv_report_whv.
    TYPE-GROUPS                                                         *
    TYPE-POOLS: slis.
    TYPES                                                               *
    TYPES: BEGIN OF ty_data,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           END OF ty_data,
           BEGIN OF ty_knvp,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_knvp,
           BEGIN OF ty_alv,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_alv,
           BEGIN OF ty_kna1,
           kunnr TYPE kunnr,
           END OF ty_kna1,
           BEGIN OF ty_knb1,
           bukrs TYPE bukrs,
           END OF ty_knb1.
    *DATA: IT_KNVP TYPE KNVP,
    DATA: it_knvp TYPE STANDARD TABLE OF ty_knvp WITH HEADER LINE.
    DATA: it_data TYPE STANDARD TABLE OF ty_data WITH HEADER LINE.
    Report data to be shown.
    DATA: it_alv TYPE STANDARD TABLE OF ty_alv WITH HEADER LINE.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    *DATA: fieldcatalog type standard table of slis_fieldcat_alv with header
    *line.
    DATA: fieldcatalog TYPE  slis_t_fieldcat_alv WITH HEADER LINE.
    *TABLES
    tables:knvp,kna1,knb1.
                     CONSTANTS                                           *
    CONSTANTS: c_kunnr TYPE char5 VALUE 'KUNNR',
    c_ort01 TYPE char5 VALUE 'ORT01',
    c_pstlz TYPE char5 VALUE 'PSTLZ',
    c_regio TYPE char5 VALUE 'REGIO',
    c_bukrs TYPE char5 VALUE 'BUKRS',
    c_zterm TYPE char5 VALUE 'ZTERM',
    c_vkorg TYPE char5 VALUE 'VKORG',
    c_vtweg TYPE char5 VALUE 'VTWEG',
    c_spart TYPE char5 VALUE 'SPART',
    c_parvw TYPE char5 VALUE 'PARVW',
    c_parza TYPE char5 VALUE 'PARZA',
    c_kunn2 TYPE char5 VALUE 'KUNN2',
    c_lifnr TYPE char5 VALUE 'LIFNR'.
    WORKAREA                                                           *
    DATA: wa_data TYPE ty_data,
          wa_knvp TYPE ty_knvp,
          wa_alv TYPE ty_alv,
          wa_fcat  TYPE slis_fieldcat_alv,
          wa_layout TYPE slis_layout_alv.
    ======================= Selection Screen ==========================
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *DATA: wa_kunnr LIKE kna1-kunnr,
         wa_bukrs LIKE knb1-bukrs,
         wa_vkorg LIKE knvp-vkorg,
         wa_vtweg LIKE knvp-vtweg,
         wa_spart LIKE knvp-spart,
         wa_parvw LIKE knvp-parvw.
    SELECT-OPTIONS                                                      *
    SELECT-OPTIONS s_kunnr FOR kna1-kunnr NO INTERVALS OBLIGATORY
    SELECT-OPTIONS: s_bukrs FOR knb1-bukrs NO-EXTENSION NO INTERVALS,
    s_vkorg FOR knvp-vkorg  NO-EXTENSION NO INTERVALS,
    s_vtweg FOR knvp-vtweg NO-EXTENSION NO INTERVALS,
    s_spart FOR knvp-spart NO-EXTENSION NO INTERVALS,
    s_parvw FOR knvp-parvw NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN: END OF BLOCK b1.
    AT SELECTION-SCREEN                                            *
    AT SELECTION-SCREEN ON s_kunnr.
      PERFORM validate_data.
    START-OF-SELECTION                                                   *
    START-OF-SELECTION.
      PERFORM get_data.  "fetch data from table and perform join on them
      PERFORM final_table.
      PERFORM build_fieldcatalog.            "populate field catalog
      PERFORM build_layout.
      PERFORM grid_display.                  "display the result in ALV grid
    END-OF-SELECTION                                                     *
    END-OF-SELECTION.
    describe
    SUBROUTINES (FORMS)
    *&      Form  get_data
          Gets the information to be shown in the report.
          Join on tables KNA1, KNB1 and for all enteries in KNVP
    -->  p1        text
    <--  p2        text
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      SELECT vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  knvp~kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
    ENDFORM. " get_data
    *ENDFORM. " get_data
    *&      Form  FINAL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM final_table .
      LOOP AT it_data.
        it_alv-kunnr = it_data-kunnr.
        it_alv-ort01 = it_data-ort01.
        it_alv-pstlz = it_data-pstlz.
        it_alv-regio = it_data-regio.
        it_alv-bukrs = it_data-bukrs.
        it_alv-zterm = it_data-zterm.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
      LOOP AT it_knvp.
        it_alv-vkorg = it_knvp-vkorg.
        it_alv-vtweg = it_knvp-vtweg.
        it_alv-spart = it_knvp-spart.
        it_alv-parvw = it_knvp-parvw.
        it_alv-parza = it_knvp-parza.
        it_alv-kunn2 = it_knvp-kunn2.
        it_alv-lifnr = it_knvp-lifnr.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      IF it_alv[] IS NOT INITIAL.
        wa_fcat-fieldname   = c_kunnr.
        wa_fcat-seltext_l   = 'Customer Master'(001).
        wa_fcat-col_pos     = 1.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_ort01.
        wa_fcat-seltext_l   = 'City'(002).
        wa_fcat-col_pos     = 2.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_pstlz.
        wa_fcat-seltext_l   = 'Postal Code'(003).
        wa_fcat-col_pos     = 3.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_regio.
        wa_fcat-seltext_l   = 'Region'(004).
        wa_fcat-col_pos     = 4.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_bukrs.
        wa_fcat-seltext_l   = 'Company Code'(005).
        wa_fcat-col_pos     = 5.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_zterm.
        wa_fcat-seltext_l   = 'Terms of payment'(006).
        wa_fcat-col_pos     = 6.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vkorg.
        wa_fcat-seltext_l   = 'Sales Organization'(007).
        wa_fcat-col_pos     = 7.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vtweg.
        wa_fcat-seltext_l   = 'Distribution Channel'(008).
        wa_fcat-col_pos     = 8.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_spart.
        wa_fcat-seltext_l   = 'Division'(009).
        wa_fcat-col_pos     = 9.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_parvw.
        wa_fcat-seltext_l   = 'Partner function'(010).
        wa_fcat-col_pos     = 10.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_kunn2.
        wa_fcat-seltext_l   = 'Customer number of partner'(011).
        wa_fcat-col_pos     = 11.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_lifnr.
        wa_fcat-seltext_l   = 'Account Number of Vendor'(012).
        wa_fcat-col_pos     = 12.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
       wa_fcat-fieldname   = c_parza.
       wa_fcat-seltext_l   = 'Partner counter'(013).
        wa_fcat-col_pos     = 13.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
    *fieldcatalog-fieldname   = c_kunnr.
       fieldcatalog-seltext_l   = 'Customer Master'(001).
       fieldcatalog-col_pos     = 1.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_ort01.
       fieldcatalog-seltext_l   = 'City'(002).
       fieldcatalog-col_pos     = 2.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_pstlz.
       fieldcatalog-seltext_l   = 'Postal Code'(003).
       fieldcatalog-col_pos     = 3.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_regio.
       fieldcatalog-seltext_l   = 'Region'(004).
       fieldcatalog-col_pos     = 4.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_bukrs.
       fieldcatalog-seltext_l   = 'Company Code'(005).
       fieldcatalog-col_pos     = 5.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_zterm.
       fieldcatalog-seltext_l   = 'Terms of payment'(006).
       fieldcatalog-col_pos     = 6.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vkorg.
       fieldcatalog-seltext_l   = 'Sales Organization'(007).
       fieldcatalog-col_pos     = 7.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vtweg.
       fieldcatalog-seltext_l   = 'Distribution Channel'(008).
       fieldcatalog-col_pos     = 8.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_spart.
       fieldcatalog-seltext_l   = 'Division'(009).
       fieldcatalog-col_pos     = 9.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parvw.
       fieldcatalog-seltext_l   = 'Partner function'(010).
       fieldcatalog-col_pos     = 10.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_kunn2.
       fieldcatalog-seltext_l   = 'Customer number of partner'(011).
       fieldcatalog-col_pos     = 11.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_lifnr.
       fieldcatalog-seltext_l   = 'Account Number of Vendor'(012).
       fieldcatalog-col_pos     = 12.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parza.
       fieldcatalog-seltext_l   = 'Partner counter'(013).
       fieldcatalog-col_pos     = 13.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
      ENDIF.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout .
    Set layout field for field attributes(i.e. input/output)
    wa_layout-stylefname = 'FIELD_STYLE'.
      wa_layout-zebra             = 'X'.
    endform.                    " build_layout
    *&      Form  GRID_DISPLAY
          text
    FORM grid_display. "using t_data type ty_tbl_data.
      IF it_alv[] IS NOT INITIAL.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
       IS_LAYOUT                         = wa_layout
         it_fieldcat                       = fieldcatalog[]
        TABLES
          t_outtab                          = it_alv[]
      EXCEPTIONS
            program_error            = 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.
      ENDIF.
    ENDIF.
    ENDFORM.                    "GRID_DISPLAY
    *&      Form  VALIDATE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM validate_data .
      DATA : li_kna1 TYPE STANDARD TABLE OF ty_kna1,
             li_knb1 TYPE STANDARD TABLE OF ty_knb1,
             li_knvp TYPE STANDARD TABLE OF ty_knvp.
      SELECT kunnr
      FROM kna1
      INTO TABLE li_kna1
      WHERE kunnr IN s_kunnr.
      IF sy-subrc <> 0.
        MESSAGE 'Invalid Customer Number'(013) TYPE 'E'.
      ENDIF.
      SELECT bukrs
      FROM t001
      INTO TABLE li_knb1
      WHERE bukrs IN s_bukrs.
        IF sy-subrc <> 0.
          MESSAGE 'Invalid Company Code'(014) TYPE 'E'.
        ENDIF.
        SELECT vkorg
        FROM tvko
        INTO TABLE li_knvp
        WHERE vkorg IN s_vkorg.
          IF sy-subrc <> 0.
            MESSAGE 'Invalid Sales Organization'(015) TYPE 'E'.
          ENDIF.
          SELECT vtweg
          FROM tvtw
          INTO TABLE li_knvp
          WHERE vtweg IN s_vtweg.
            IF sy-subrc <> 0.
              MESSAGE 'Invalid Distribution Channel'(016) TYPE 'E'.
            ENDIF.
            SELECT spart
            FROM tspa
            INTO TABLE li_knvp
            WHERE spart IN s_spart.
              IF sy-subrc <> 0.
                MESSAGE 'Invalid Division'(017) TYPE 'E'.
              ENDIF.
              SELECT parvw
              FROM tpar
              INTO TABLE li_knvp
              WHERE parvw IN s_parvw.
                IF sy-subrc <> 0.
                  MESSAGE 'Invalid Partner function'(018) TYPE 'E'.
                ENDIF.
            ENDFORM.                    " VALIDATE_DATA

    *1----
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      CHECK it_data[] IS NOT INITIAL.
      SELECT kunnr
             vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
      IF sy-subrc EQ 0.
        SORT it_knvp BY kunnr.
      ENDIF.
    ENDFORM. " get_data
    *2----
    FORM final_table .
      LOOP AT it_data INTO wa_data.
        READ TABLE it_knvp
        INTO wa_knvp
        WITH KEY kunnr = wa_data-kunnr
        BINARY SEARCH .
        IF sy-subrc = 0.
          MOVE-CORRESPONDING wa_data TO wa_alv.
          MOVE-CORRESPONDING wa_knvp TO wa_alv.
          APPEND wa_alv TO it_alv.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    Edited by: Faisal Khan on Mar 27, 2008 1:59 PM

  • Retrive data from two tables into one internal table.

    Hi SDN,
    I am downloading the Assets data from two tables ANLA,ANLZ.
    there is a common field ANL1in both tables and i have to retrive the data by using anl1 into the internal table.
    can you please send me the SELECT Syntax for this probl.....
    Thank you & Regards,
    Manoj

    Hi manoj,
    Please see the following sample code. But kindly don't use join as it may hamper ur performance. No trouble in using two select query.
    data: begin of itab occurs 0,
            BUKRS like anla-BUKRS,
            ANLN1 like anla-ANLN1,
           BDATU like anlz-BDATU,
            end of itab.
    select anlabukrs anlaANLN1 anlzBDATU  into corresponding fields of table itab from anla inner join anlz on anlaanl1 eq anlz~anl1 where (logexp).
    Please come back for any clarification.
    Thanks and Regards,
    saurabh

  • Join two ODS into one cube!

    Hello Experts -
    I need to join fields of 2 ODS into one cube. I know the common field. We are in BI 7.0.
    Can someone guide me through the steps?
    I know there are two transformation rules. And I have created them. How do I link them so that I have one record when the common field matches?

    Syed!!!
    What your are trying is very complicated, if you want to do infoset that even worst, not only data wise, but only performance. If you are planning to get key figure only from one ods and only characteristics coming from different ods, infoset might work as long as you know the relationship (one-to-one relationship will work fine in infoset). Performance wise, MP is very good, but the question again, you will get multiple lines unlike infoset.
    So before, someone decided to use infoset, MP or even some other data model, they need to know well the reporting requirement and well divers in the relationship of the ods.
    I have faced the same situation in many of my projects, there are places I used infoset and MP, and also created a different infoobject as a master data and turned the attributes as NAV. Attribute.
    Thanks.
    Wond

  • HT5621 I have 2 Apple ID , how I merge the two ID into one .

    I have 2 Apple ID . How do I merge it into one - all apps and notes etc

    You cannot merge Apple ID's, all purchases are assigned to one account and cannot be transferred to another.

  • Stepper motor 8SMC1-USBhF and power meter PM100D: how to merge the two VIs into one and make a XY graph of the current position and the power

    Hi there,
    I have a stepper motor (8SMC1-USBhF) and a power meter (PM100D). I want to measure the power while the stepper motor is moving, and obtain an XY graph with the current position on x axis and the power on y axis. So I just merged the two VIs together by copying and pasting, and created local variables for current position and readout value, and changed them to read, and then linked them to the XY graph, but apparently it doesnt work.
    So could you please instruct me how to merge them and obtain an XY graph appropriately?
    Attached are the two VIs.
    Thank you!
    Attachments:
    PM100D Simple Example.vi ‏42 KB
    StepperMotor.vi ‏97 KB

    Hello,
    The XY graph requires that each datapoint on the X axis corresponds to a datapoint on the Y axis.  To create XY data you will need to creat two arrays of X data and Y data with the same amount of elements then cluster the two arrays together to wire into the XY graph.  As an example take a look at the VI snippet below.  Is there a specific error being thrown?
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • Joining Two Fields Into One Field for a View

    I am trying to create a view based off of multiple tables.
    I have all of the joins and everything done nicely and working properly.
    However, when I get to this one step, that's when I start running into problems.
    I just want to join (or concatenate) two fields together with a period character in between them.
    For example, if I take FirstName and LastName, then I want them to become one field called Name, appearing as "JOHN.DOE"
    When I try to join them together, the problem comes up with the period character.
    A sample code of what I have done is here:
    BEGIN
    EXECUTE IMMEDIATE 'create view VIEW_LALALA
    as SELECT t1.FirstName + '.' + t2.LastName as Name, t1.something as Something, t2.ooo as OOO
    FROM (tableFirstNames t1 inner join tableLastNames t2 on t1.nameID = t2.nameID)
    END;

    832667 wrote:
    I am trying to create a view based off of multiple tables.
    I have all of the joins and everything done nicely and working properly.
    However, when I get to this one step, that's when I start running into problems.
    I just want to join (or concatenate) two fields together with a period character in between them.
    For example, if I take FirstName and LastName, then I want them to become one field called Name, appearing as "JOHN.DOE"
    When I try to join them together, the problem comes up with the period character.
    A sample code of what I have done is here:
    BEGIN
    EXECUTE IMMEDIATE 'create view VIEW_LALALA
    as SELECT t1.FirstName + '.' + t2.LastName as Name, t1.something as Something, t2.ooo as OOO
    FROM (tableFirstNames t1 inner join tableLastNames t2 on t1.nameID = t2.nameID)
    END;to concatenate two string together do not use "+", but "||"
    SELECT FIRST_NAME||'.'||LAST_NAME FROM EMP;

  • Error while joining two table in one VO

    hello friends,
    my requirement is:
    i have a search page in which there are 3 fields for search operations,2 of them are present there in the custom table having no primary key and the third one i am using is the Oracle table.Oracle table also contains one colmn which is among one of the two fields of the custom table.Now in the search page i have to search in such a way that either of the three fields could be entered and depending on that result should be shown in the result table below the search fields.Third field is unique for the one of the field of the other 2 fields in the page in the ORacle table.
    What i am doing is:
    I have to use only one VO which should have both EO's .In the query it is showing where clause using only WHO colmns like LAST_UPDATE_DATE_table1=LAST_UPDATE_DATE_table2 same for other WHO colmn but the thing is due to this query it is not fetching the rsults.
    I tried removing the where clause but it says "can't select rowid from a join view w/o a takey preserved table" ...As i dnt have any primary key for the custom table so automatically at VO creation step it assigns RowID as primary key.
    Help me guys ..its really urgent and i am stuck here from the past couple of dayz.

    You requirement is not exact clear?
    What the exact eception youa re getting?
    Thanks,
    Kumar

  • Join two records into one

    Hi
    I have a table as
    Table 1
    ID phonetype number 1 number2 number3
    1 off 32123 23233 45455
    1 res 43545 45455 45543
    1 cell 34232 63453 45432
    now I want to combine them into a single record as
    id phone1 num1 num2 num3 phone2 num1 num2 num 3
    1 off 32123 23233 45455 cell 34232 63453 45432
    please help me in this
    thanks

    try this...
    with tab_1 as
    (select 1 ID, 'off' phonetype , 32123 num1, 23233 num2, 45455 num3 from dual union all
    select 1, 'res', 43545, 45455, 45543 from dual union all
    select 1, 'cell', 34232, 63453, 45432 from dual),
    tab_2 as
    (select 1 id, 'ABC' name from dual)
    select tab_1.id,tab_2.name,
    max(decode(rn,1, tab_1.phonetype)) phonetype1,
    max(decode(rn,1, tab_1.num1)) num1,
    max(decode(rn,1, tab_1.num2)) num2,
    max(decode(rn,1, tab_1.num3)) num3,
    max(decode(rn,2, tab_1.phonetype)) phonetype2,
    max(decode(rn,2, tab_1.num1)) num11,
    max(decode(rn,2, tab_1.num2)) num12,
    max(decode(rn,2, tab_1.num3)) num13
    from (select id,phonetype,num1,num2,num3, row_number() over (partition by id order by id) rn from tab_1) tab_1,tab_2
    where tab_1.ID = tab_2.ID group by tab_1.id;
    ID NAM PHON NUM1 NUM2 NUM3 PHON NUM11 NUM12 NUM13
    1 ABC off 32123 23233 45455 cell 34232 63453 45432

Maybe you are looking for

  • "Save As" and "Open" file dialog windows very slow to appear...

    I have a home network with 4 PCs, three using XP/3 and 1 using Win7.  Until recently, I had the three XP boxes in one workgroup (not homegroup) and the Win7 box in a different workgroup.  Everything was running fine.  I got anal and decided to rename

  • Problem playing back HDV from FCP HD

    FCP 5.0.4 I am doing my first HD project and am experiencing a problem I cannot solve. Using both a Sony HDV HC1 and Sony HDR FX1 as playback devices, I cannot get the video to play back from FCP using HDV1080i60. Under Video playback, the options fo

  • How to change the PARTITION(P#) is replace of PYYMMDD format

    hi hi everybody, i am developing the appl is used to jsp and oracle.. i need to change # is replace of YYMMDD format in oracle.. i want to display the partition wise data (like p070220) based on the query.. how can you change the query (p#, p070220).

  • Special gl indicator

    Hi Gurus, 1) the reason to have spl gl indicator is because we cannot post to customer or vendor gl recon account yet when certain transaction done with customer or vendor as the amount not yet recognised so must post to another recon account which i

  • EReaders 101

    What is an eReader? An eReader (short for electronic reader) is a handheld device for storing and reading books.  There are a lot of options out there, but we have a few tips for picking the right eReader. What screen is right for me? eReaders have o