Common field

Hi All
I have to enter the container number in the PO line item and it has to be there in inbound delivery.so my requuirement is to find out the common field in both the documents to enter the container numbr.
Please guide me in this issue.
regards
chandra

Sorry, I misunderstood your requirement. You need to join to facoa twice. Once to get the description for pur_type and again to get the description for prty_scode. Something like:
SELECT a.compcode,b.descrip type_descrip, c.descrip scode_descrip, 
       pur_inv_no, pur_inv_dt, pur_num, pur_date, prty_scode,
       SUM((pur_amt - discount)+ bed_amt + sed_amt) value,
       SUM(stax_amt) stax_amt, SUM(pur_total) pur_total
FROM fapurh a, facoa b, facoa c
WHERE a.compcode = b.compcode and
      a.pur_type = b.scode and
      a.compcode = c.compcode and
      a.prty_scode = c.scode and
      stax_code = 'VAT05' and
      pur_date BETWEEN TO_DATE('01-apr-2005', 'dd-mon-yyyy') AND
                               '30-apr-2005', 'dd-mon-yyyy') and
      pur_type <> 'JW0001'
GROUP BY a.compcode, b.descrip, c.descrip, pur_inv_no, pur_inv_dt,
         pur_num, pur_date, prty_scodeHTH
John

Similar Messages

  • What are the common fields in table KONV = J_1IEXCHDR,EKKO,EKPO,MSEG

    Helo everyone,
    I need wht are the common fields between table of KONV and J_1IEXCHDR,EKKO,EKPO,MSEG. Pls give me details
    thanks in advance
    suresh

    check out LIFNR,KUNNR ETC

  • Common field required in LIPS AND VEKP

    Hi,
    is there any common field  in b/w LIPS AND VEKP tables to relate both the tables.
    Subbu.

    hi
    first u go for link between
    LIPS and VEPO  --  VBELN(Delivery Doc num)  and   POSNR(item) are common fields
    then Link VEPO and VEKP -- VENUM(Shipping unit Number) is the common field...
    Regards
    Smitha

  • How to find out the common fields

    Hi all
    I want to pull out data from the following tables
    OPCH,PCH1,OCRD,OVPM
    Vendor Name OPCH
    GL Date PCH1
    Bill No PCH1
    Bill Date PCH1
    Due Date PCH1
    Bill Amount OPCH
    TDS PCH1
    Advance Adjusted OPCH
    Total Due OPCH
    Amount Paid OVPM
    Mode of payment OCRD
    Cheque/EFT  No OVPM
    How do i know which are the common fields ?
    Regards
    Farheen

    Hi,
    Are you looking for query like this :
    select t0.cardname as 'Vendor Name',
    t0.docnum as 'Bill Number', t1.docdate as 'Bill Date',
    t0.docduedate as 'Due Date',
    t0.doctotal as 'Bill Amount', t4.WTAmnt as 'TDS Amount',
    t0.dpmAppl as 'Advance Adjusted', (t0.doctotal - t0.paidtodate) as 'Total Balance Due',
    t3.sumapplied as 'Amount Paid', t5.checknum as 'Cheque No.' 
    from OPCH t0
    inner join PCH1 t1 on t0.docentry = t1.docentry
    left join PCH5 t4 on t4.absentry = t0.docentry
    left join OCRD t2 on t0.cardcode = t2.cardcode
    left join VPM2 t3 on t0.transid = t3.doctransid
    left join VPM1 t5 on t5.docnum = t3.docnum
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Combine two tables without common field

    Hi Experts,
    I have two database tables, DBSTATORA(stores inform about all the tables involved in infoproviders), and RSDODSO ( stores information about ODS Objects. I have to list the ods objects and its associated tables as the output, but there is no common field in these two tables how will i combine these two tables, can anyone please suggest me. Any help will be fine.
    thanks,
    Prabhu.

    Hi Everyone,
    I know the ods tables names are stored like /bix/a<ods_name>00 and /bix/a<ods_name>40 and for change log it is /bic/b*. But my requirement is I have to display the size of the tables belonging to a particular ods object. So for all the tables the size is stored in DBSTATTORA which gives information about
    DBSTATTORA
    fields of this tables are:
    TNAME --> Table Name
    ANDAT --> Analyzing Date
    AMETH --> Analysis method for collecting Statistics
    NROWS --> No of rows in a table
    OCCBL --> Used blk(size) of table in KB
    EMPBL --> Empty blk(size) of table in KB
    AFREE --> Avg Freespace in a used db block
    INDBS --> Used Blk(size) of an index kb
    This is a table which stores the statistics information.
    It displays all the tables of infocubes and ods objects, but does tell that this table belongs to this infoprovider.
    I have to display data from this table as well as the infoprovider to which it belongs. So there is no proper information of database tables where the infocube and its associated tables like the facttable, dimtables are stored together. Same for the ods objects also.
    There are for ods object RSDODSOTABL which give information about ods object and the table name is stored differently <ods_name>_0000. How do i map this table with the DBSTATTORA table, the tablenames doesn't match. Same problem with RSTSODS table which give informaiton about change log table.
    And also for infocubes, there is RSDCUBE which gives information about infocubes but not the associated tables. So does anyone know where all these information is stored in some database tables. It would be of great help.
    Thanks a lot.
    Prab

  • Joining Tables not having any Common Fields

    Dear Gurus,
    I know how to join the tables having common fields through T-CODE: SQVI,  but do not know how to join the tables not having any common fields.
    kindly provide me the step by step procedure to handle this, so that I can generate the Reports.
    Wishes,
    Abhishek

    Check following link. I feel it might of some assistance for you:
    SAP Query - illegal Join condition
    Regards
    J Prakash

  • How to find common fields between two tables

    Hi friends,
    Is there any way to find out common fields between tables and linking the tables based on common fields.
    Thanks and Regards,
    Chitty.

    Hi Chitty,
      Try using joins it will give the fields which are only common to both the fields.
    Here s an example,
    SELECT mara~matnr
           marc~werks
    INTO   TABLE t_material
    FROM   mara AS mara INNER JOIN marc AS marc
    ON     maramatnr = marcmatnr
    WHERE  mara~mtart = p_mtart.
    Much Regards,
    Amuktha.

  • Joining two tables having no common fields using one select query

    Hi Experts,
    How to join two tables which are NOT having any field in common using only one select query?
    Your help will be appreciated.
    Thank you.

    Identify a third table (or more tables) with common fields with your two tables, or change your question either removing JOIN or removing NO COMMON FIELDS, else you wont get many responses and will be left alone in outer space, as suggested by Thomas.
    If you acturally require what you written, better execute two select and merge the two internal tables merging every record from first table with every record of second table, til no more memory is available.
    Regards,
    Raymond

  • Need logic to retrieve common fields in two internal tables

    Hi,
    I need to get the common data from the internnal table IT_BSEG and IT_ZFI_CSHLW_DIRE tables please help me out in sorting out this porblem.
    the fields in IT_BSEG are Account number,Profit center,company code,document type etc.
    where as the fields in IT_CSHFLW_DIRE are Account number from,Account number to,company code from,company code to and profit center.
    so how to check whether a record which is in It_BSEG,exists in IT_CSHFLW_DIRE..?
    Thanks,
    Kumar

    Solution 1.
    LOOP AT ITAB1.
    LOOP AT ITAB2
    WHERE ( ACCOUNT_FROM LE ITAB1-ACCOUNT AND
                   ACCOUNT_TO GE ITAB1-ACCOUNT )
          AND (COMPANY_FROM LE ITAB1-COMPANY AND
                   COMPANY_TO      GE ITAB1-COMPANY
           AND (PROFIT_CENTER  EQ LE ITAB1-PROFIT_CENTER ).
    <Your logic>.
    ENDLOOP.
    ENDLOOP.
    soultions 2.
    RANGES: COMPANY_CODE FOR <Your data dictionary reference>
                    ACCOUNT             FOR <Your data dictionary reference>.
    LOOP AT ITAB2.
    REFRESH: COMPANY_CODE, ACCOUNT.
    CLEAR: COMPANY_CODE, ACCOUNT.
    MOVE: I TO COMPANY_CODE-SIGN,
                I TO ACCOUNT-SIGN.
    MOVE: BT TO COMPANY_CODE-OPTION,
                BT TO ACCOUNT-OPTION.
    MOVE:  ITAB2-COMPANY_FROM   TO COMPANY_CODE-LOW,
                 ITAB2-ACCOUNT_FROM    TO ACCOUNT-LOW.
    MOVE:  ITAB2-COMPANY_TO   TO COMPANY_CODE-HIGH.
                 ITAB2-ACCOUNT_TO    TO ACCOUNT-HIGH.
    APPEND: COMPANY_CODE, ACCOUNT.
    LOOP AT ITAB1 WHERE  ACCOUNT  IN  ACCOUNT         "<----range
                                  AND company      IN company_code    "<----range
                                  AND profit_center eq ITAB2-PROFIT_CENTER.
    *<You code>
    ENDLOOP.
    ENDLOOP.
    Please note both approach have different <b>bussines logic</b>.
    It depends on your bussiness logic which table data you are looking in which table.
    Regards,
    A.Singh

  • Identifying records based on one or more common fields

    Hi all
    This should be easy - but going round in circles. I want to be able to group together records based on whether at least one field is the same as the corresponding field in a different record.
    So:
    Account No Tel No PostCode
    ABC123 17654231 TS24 4ZX
    DEF987 8764573 NE1 1AL
    QWE921 17654321 SR9 8BD
    ASD579 24697615 SR9 8BD
    So in the above example the first, third and fourth record would all form one group because the first links to the third based on Tel No and the third links to the fourth based on PostCode. The second record will be in a group of its own. I want to output the above (into a new table) with an additional field linking relevant records together (a group number).
    My first pass was to simply:
    select the minimum group number from the output table where either the Tel No or Phone No match the current record. If no match then create a new record for this record with the next incremental group number.
    This would give
    Account No Tel No PostCode Group
    ABC123 17654231 TS24 4ZX 1
    DEF987 8764573 NE1 1AL 2
    QWE921 17654321 SR9 8BD 1
    ASD579 24697615 SR9 8BD 1
    On the surface that looks OK. The problem occurs if for instance the PostCode in the second record is 'SR9 8BD'. The output would be identical to the above - but I want them to all share the same group number as now there is some commonality between all four records. I'm sure I need to do something recursively but just can't get my head around it.
    Would really appreciate some help.
    Thanks
    Ian

    Hi, Ian,
    Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002} It contains several tips that can help you get good answers quickly
    976560 wrote:
    Hi all
    This should be easy - but going round in circles.Ironically, the solution below involves NOCYCLE.
    I want to be able to group together records based on whether at least one field is the same as the corresponding field in a different record.
    So:
    Account No Tel No PostCode
    ABC123 17654231 TS24 4ZX
    DEF987 8764573 NE1 1AL
    QWE921 17654321 SR9 8BD
    ASD579 24697615 SR9 8BDWhenever you have a problem, please post CREATE TABLE and INSERT statments for all tables inolved. Since this is your fist message, I'll do it for you:
    DROP TABLE     table_x;
    CREATE TABLE  table_x
    (   Account_No     VARCHAR2 (10)     PRIMARY KEY
    ,   Tel_No      VARCHAR2 (10)
    ,   Post_Code     VARCHAR2 (10)
    INSERT INTO table_x (account_no, tel_no,     post_code)
           VALUES         ('ABC123',       '17654321', 'TS24 4ZX');
    INSERT INTO table_x (account_no, tel_no,     post_code)
           VALUES         ('DEF987',       '8764573',  'NE1 1AL');
    INSERT INTO table_x (account_no, tel_no,     post_code)
           VALUES         ('QWE921',       '17654321', 'SR9 8BD');
    INSERT INTO table_x (account_no, tel_no,     post_code)
           VALUES         ('ASD579',       '24697615', 'SR9 8BD');
    COMMIT;
    So in the above example the first, third and fourth record would all form one group because the first links to the third based on Tel No Be careful! It looks like you made a typo there. I changed the number ending in '231' to '321'.
    and the third links to the fourth based on PostCode. The second record will be in a group of its own. I want to output the above (into a new table) with an additional field linking relevant records together (a group number).
    My first pass was to simply:
    select the minimum group number from the output table where either the Tel No or Phone No match the current record. If no match then create a new record for this record with the next incremental group number.
    This would give
    Account No Tel No PostCode Group
    ABC123 17654231 TS24 4ZX 1
    DEF987 8764573 NE1 1AL 2
    QWE921 17654321 SR9 8BD 1
    ASD579 24697615 SR9 8BD 1
    On the surface that looks OK. The problem occurs if for instance the PostCode in the second record is 'SR9 8BD'. The output would be identical to the above - but I want them to all share the same group number as now there is some commonality between all four records. I'm sure I need to do something recursively but just can't get my head around it.You said it exactly: you need to do something recursively.
    What features of Oracle SQL are recursive? CONNECT BY (as shown below) and, starting in Oracle 11.2, recursive WITH clauses.
    Would really appreciate some help.Here's one way to do that:
    CREATE TABLE     table_y
    AS
    WITH   got_related_account_no      AS
         SELECT  table_x.*
         ,     CONNECT_BY_ROOT account_no     AS related_account_no
         FROM     table_x
         CONNECT BY NOCYCLE  account_no     != PRIOR account_no
              AND   (         tel_no      = PRIOR tel_no
                    OR    post_code      = PRIOR post_code
                 -- OR ...   -- other columns as needed
    SELECT       account_no, tel_no, post_code
    ,       DENSE_RANK () OVER (ORDER BY  MIN (related_account_no))
                         AS grp
    FROM       got_related_account_no
    GROUP BY  account_no, tel_no, post_code
    ;This will work in Oracle 10.1 and up.
    At the end of this, table_y contains:
    ACCOUNT_NO TEL_NO     POST_CODE         GRP
    ABC123     17654321   TS24 4ZX            1
    ASD579     24697615   SR9 8BD             1
    DEF987     8764573    NE1 1AL             2
    QWE921     17654321   SR9 8BD             1

  • Common field between ar and sd billing

    Hi experts,
    What is the common date field between sd billing  and Accounts receivables ?
    Regards,
    Nishuv.

    Hi Aduri,
    Upto now i have joined company code, customer in the infoset. But as per my requirement some more
    mappings are required. Please suggest some more fields that are common between these two.
    And also if we go for custom cubes, 
    Our requirement is,
    To which customer we sold a particular material and what is the Amount pending from the customer.
    For this from Billing Cube i want the fields,
    Material, Company code, Plant, Customer, Material Group
    From AR cube i want the fields:
    Debit/Credit Amount,Item Status,Posting Date,Net due date,Clearing
    Plz suggest me how to create a custom cube based on these two.
    Regards,
    Nishuv.

  • 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

  • Newbie question RE: Select common fields

    I have to select all common jobs from the emp table that are in dept's 10,20,30. Do I need to do a self join? Subquery? Any help will be greatly appreciate.

    I can think of a couple of ways off the top of my head:
    SELECT job_id
    FROM employees e
    WHERE department_id = 10 and
          EXISTS (SELECT 1 FROM employees i
                  WHERE e.job_id = i.job_id and
                        i.department_id = 20) and
          EXISTS (SELECT 1 FROM employees i
                  WHERE e.job_id = i.job_id and
                        i.department_id = 30);
    SELECT job_id FROM employees
    WHERE department_id = 10
    INTERSECT
    SELECT job_id FROM employees
    WHERE department_id = 20
    INTERSECT
    SELECT job_id FROM employees
    WHERE department_id = 30nurhidayat:
    You query will return the jobs that are in the three departments, not the "common jobs" from the three departments.
    Devanand:
    Your query is is incorrect, it will throw:
    ORA-00979: not a GROUP BY expression
    because you do not have department in the select list
    TTFN
    John

  • Apple Mail: Selecting multiple messages with a common field

    Greetings ...
    I'm in the midst of moving from Eudora to Apple Mail (I know, I'm old), and I'm looking through all documentation online and here in Apple Support but can't find if there's a way to do this:
    In Eudora, I used to be able to Option-click on an email header's "From:" column in a mailbox, and instantly all mail in that mailbox with the matching "From:" header would be grouped together and highlighted.
    This enabled me, for instance, to take action (delete, transfer, etc.) on all email from one particular source at one time with a minimum of clicks.
    (This worked for any field, btw -- I could group a thread of emails on the same topic together by option-clicking on the Subject: field.)
    I've tried every key combination I can think of to elicit the same response from Apple Mail. Am I missing something?
    Thanks,
    mlb

    What happens when you type say the sender, or part of subject line in the search field. This should narrow your view to display only those emails matching the criteria entered in the search.
    From: http://support.apple.com/kb/HT2500
    Searching Mail
    Need to find a certain email message or a string of them? You can search for specific text in any message in any mailbox using the Search field in Mail, which is powered by Spotlight technology, to find what you need fast.
    Type the text that you want to search for, like "Grandma" or "New York itinerary", in the Search field in the upper-right corner of the Mail window.
    Mail displays a list of its search results. Click the All Mailboxes button to display results from all mailboxes, or click Inbox to display results from your Inbox only.
    Not exactly the same but perhaps close enough?

  • Fields in DSO

    hi experts,
    I m new to BW,
    i m facing a problem of aggrgating the fields in my DSO.
    i have 2 fields in DSO1 with 100 records.
    i have another 3 fields in DSO2 with 300 records.
    Now i want to unite the records from these two dso into a new dso having 5 fields(2 from DSO1 + 3 from DSO2).

    Hi,
    You can unite 5 fields in your new DSO.
    The 1st and 2nd DSO must have atleast 1 common field to combine the records from 1st DSO and 2nd DSO, so that you can get 300 records.
    Else you will get 2 seperate records from 1st and 2nd DSO totally 400 records, in such case when the data loaded from 1st DSO to new DSO u will get blank fields(ie , you will get blank value in the 2nd DSO fields). when the data loaded from the 2nd DSO to new DSO u will get blank fields(ie, you will get blank value in the 1st DSO fields).
    its upto your requirement... but mostly we must have common field to get single record from both DSO.

Maybe you are looking for

  • Extract Multiple Rows from a Single Table into a Single Row in a New Table

    I have a table in a database that contains contact data like name, address, phone number, etc. The folks who designed the database and wrote the application wrote it so that all contact records are placed in that table, regardless of contact type. In

  • This document cannot be opened as it is not a valid PDF document

    I am trying to get my Amex statement from Amex on my tablet. I have Adobe reader for Andriod and Pdf  to Go. Each time I download and tray to read the document I get this error. Other Pdf files I have downloaded open OK.

  • How do I set up a recurring calender?

    How do I set up a recurring calender that I can export to others for my work. It is a 7 day on, 7 day off roster always starting on Tuesday and ending on Monday. So... to be clear.... Start Days Tuesday 6am to 6pm. repeat for 7 days ending on Monday.

  • Can't logon bpm workspace in BPM suite 11g R1 PS3

    I have a very wire problem, I can't login to bpm workspace using the administrator "weblogic/welcome1", but I can use this logon weblogic console and em. check log find the following, initIgnoreList:Register 'oracle_ias_farm' login page url:/em/faces

  • Account payable

    Hi Experts, WIll any one pleasee xplain what is accounts payable / What is the full life cycle of accounts payable.Would be thankful if u cud explain me the flow BR, KK