Using nested Joins in abap prog

Hi All,
please help me  out in using nested joins in abap progrmaming. I dont know about joins in abap.specially in case of outer join.
  I have 5 internal tables.. mara ,marc, mvke,mbew,ampl. am using  a  select query with certain fields from all these tables.
  I need to disply  all the materials  of  a mara for  a particular date irrespective of  the values in fields of  other tables.
        Even if that materail is not present in other table for certain condtion ,that material  should get displyed with all other fields  showing null value..

Hi RK,
the  code am using is of the same way...but my problem was with the joins..in the  select query  am using nested join combining inner  and outer join.. but i could  not able to display all the materials  of mara of a particular date..
The code looks like this..
SELECT <some fields.......>
INTO  TABLE i_materials
      FROM  ( marc AS b
      INNER JOIN mara AS a ON amatnr = bmatnr
      INNER JOIN mvke AS c ON cmatnr = amatnr
      INNER JOIN ampl AS g ON gbmatn = amatnr
      LEFT OUTER JOIN mbew AS d ON dmatnr = bmatnr
                               AND dbwkey = bwerks )
  WHERE a~matnr  IN s_matnr AND .................
Else
SELECT <some fields.......>
INTO  TABLE i_materials
      FROM  ( marc AS b
      INNER JOIN mara AS a ON amatnr = bmatnr
      INNER JOIN mvke AS c ON cmatnr = amatnr
      INNER JOIN ampl AS g ON gbmatn = amatnr
      LEFT OUTER JOIN mbew AS d ON dmatnr = bmatnr
                               AND dbwkey = bwerks )
   FOR ALL ENTRIES IN i_mara
     WHERE a~matnr = i_mara-matnr AND ............

Similar Messages

  • Inner join in ABAP and exporting the data

    Hi,
    I want to use inner join in ABAP for retrieving data from 2 tables and export that data.How will i do it?

    Hi,
    Refer following code
    *--Select query to pick the data from table VBRK
    VBRP and VBPA using inner join
      SELECT a~vbeln                            "Billing document
             a~fkdat                            "Billing date
             a~fktyp                            "Billing category
             a~fkart                            "Billing type
             a~vtweg                            "Distribution channel
             a~knumv                            "Number of doc condition
             b~posnr                            "Billing item
             b~matnr                            "Material Number
             b~werks                            "Plant
             b~vgbel                            "Referance
             b~netwr                            "Net value of billing item
             b~wavwr                            "Cost in document currency
             c~kunnr                            "Partner function
             FROM vbrk AS a
             INNER JOIN vbrp AS b
             ON avbeln EQ bvbeln
             INNER JOIN vbpa AS c
             ON  bvbeln EQ cvbeln
            AND bposnr EQ cposnr
             INTO CORRESPONDING FIELDS OF TABLE it_vbrp
             WHERE fkdat IN s_erdat
             AND   parvw EQ 'ZS'.
      IF sy-subrc EQ 0.
    *--Sort table by
        SORT it_vbrp BY vgbel1.
      ENDIF.
    Regards,
    Prashant

  • Generally when does optimizer use nested loop and Hash joins  ?

    Version: 11.2.0.3, 10.2
    Lets say I have a table called ORDER and ORDER_DETAIL.
    ORDER_DETAIL is the child table of ORDERS .
    This is what I understand about Nested Loop:
    When we join ORDER AND ORDER_DETAIL tables oracle will form a 'nested loop' in which for each order_ID in ORDER table (outer loop), oracle will look for corresponding multiple ORDER_IDs in the ORDER_DETAIL table.
    Is nested loop used when the driving table (ORDER in this case) is smaller than the child table (ORDER_DETAIL) ?
    Is nested loop more likely to use Indexes in general ?
    How will these two tables be joined using Hash joins ?
    When is it ideal to use hash joins  ?

    Your description of a nested loop is correct.
    The overall rule is that Oracle will use the plan that it calculates to be, in general, fastest. That mostly means fewest I/O's, but there are various factors that adjust its calculation - e.g. it expects index blocks to be cached, multiple reads entries in an index may reference the same block, full scans get multiple blocks per I/O. It also has CPU cost calculations, but they generally only become significant with function / package calls or domain indexes (spatial, text, ...).
    Nested loop with an index will require one indexed read of the child table per outer table row, so its I/O cost is roughly twice the number of rows expected to match the where clause conditions on the outer table.
    A hash join reads the of the smaller table into a hash table then matches the rows from the larger table against the hash table, so its I/O cost is the cost of a full scan of each table (unless the smaller table is too big to fit in a single in-memory hash table). Hash joins generally don't use indexes - it doesn't use the index to look up each result. It can use an index as a data source, as a narrow version of the table or a way to identify the rows satisfying the other where clause conditions.
    If you are processing the whole of both tables, Oracle is likely to use a hash join, and be very fast and efficient about it.
    If your where clause restricts it to a just few rows from the parent table and a few corresponding rows from the child table, and you have an index Oracle is likely to use a nested loops solution.
    If the tables are very small, either plan is efficient - you may be surprised by its choice.
    Don't be worry about plans with full scans and hash joins - they are usually very fast and efficient. Often bad performance comes from having to do nested loop lookups for lots of rows.

  • About inner join in abap

    hi
        i am new to sap , i dont no about inner join in abap coding
    plz send me some notes or coding.
                            thank u.
                                                              your regrads
                                                                    divya.

    hi
    use this links
    INNER JOIN  and OUTER JOINhttp://help.sap.com/erp2005_ehp_03/helpdata/EN/cf/21ec77446011d189700000e8322d00/frameset.htm
    JOINED TABLES
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/0f/49bd6a5d5049edba7b3afe6c7956e3/frameset.htm
    u will find all thins related to joins with example and how to use it
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 25, 2008 9:45 AM

  • Joins in abap programming

    hi
       i am a fresher and i have a question. how many joins can program have.

    Hi Jaya,
    ABAP has two Joins.
    INNER  JOIN  and  OUTER JOIN.
    Check out the post :
    JOINS and Matchcodes
    IF you press F1 on JOIN statement ,it has explained really good.I am pasting the same for you.
    ... FROM tabref1 [INNER] JOIN tabref2 ON cond
    Effect
    The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary.
    In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON>cond.
    Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same:
    Table 1 Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
    Inner Join
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    1
    e1
    f1
    g1
    h1
    a4
    b4
    c4
    3
    3
    e2
    f2
    g2
    h2
    |--||||||||--|
    Example
    Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
    Note
    In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
    Example
    Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID
    WHERE FCONNID = PCONNID
    AND P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    Note
    Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
    Only a table or view may appear to the right of the JOIN operator, not another join expression.
    Only AND is possible in the ON condition as a logical operator.
    Each comparison in the ON condition must contain a field from the right-hand table.
    If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
    Note
    In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
    Variant 3
    ... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond
    Effect
    Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
    In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1 Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
    Left Outer Join
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    1
    e1
    f1
    g1
    h1
    a3
    b3
    c3
    2
    NULL
    NULL
    NULL
    NULL
    NULL
    a4
    b4
    c4
    3
    3
    e2
    f2
    g2
    h2
    |--||||||||--|
    Example
    Output a list of all custimers with their bookings for October 15th, 2001:
    DATA: CUSTOMER TYPE SCUSTOM,
    BOOKING TYPE SBOOK.
    SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
    SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
    INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID)
    FROM SCUSTOM LEFT OUTER JOIN SBOOK
    ON SCUSTOMID = SBOOKCUSTOMID AND
    SBOOK~FLDATE = '20011015'
    ORDER BY SCUSTOMNAME SBOOKFLDATE.
    WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or using an alias.
    Note
    For the resulting set of a SELECT command with a left outer join in the FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Since not all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outer join, the syntax has been restricted to those cases that return the same solution in all database systems:
    Only a table or view may come after the JOIN operator, not another join statement.
    The only logical operator allowed in the ON condition is AND.
    Each comparison in the ON condition must contain a field from the right-hand table.
    Comparisons in the WHERE condition must not contain a field from the right-hand table.
    The ON condition must contain at least one "real" JOIN condition (a condition in which a field from tabref1 as well as from tabref2 occurs).
    Note
    In some cases, '*' may be specivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the llen in der FROM clause, according to the structure of each table work area. There can be gaps between the table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, as in the following example (not simply by counting the total number of fields).
    Example
    Example of a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001 where there are available places, and display the name of the airline.
    DATA: BEGIN OF WA,
    FLIGHT TYPE SFLIGHT,
    PFLI TYPE SPFLI,
    CARR TYPE SCARR,
    END OF WA.
    SELECT * INTO WA
    FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID )
    INNER JOIN SCARR AS C
    ON FCARRID = CCARRID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID,
    WA-FLIGHT-CONNID.
    ENDSELECT.
    Regards,
    Priyanka.

  • Sample code and senarios to use outer join?

    We know the ABAP4 syntax for inner join, but never tried outer join and we even don't know if there is any outer join syntax in ABAP4 or not.  Would be very appreciated if some ABAP expert here let us know if there is any outer join and list the difference between inner join and outer join with detailed senarios or when we would use outer join or when to use inner join?  Also give a sample code on the outer join if there is any in ABAP?
    Thanks and we will give you reward points!

    Hye..
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1                      Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
        Left Outer Join
        |--||||||||--|
        | A  | B  | C  | D  | D  | E  | F  | G  | H  |
        |--||||||||--|
        | a1 | b1 | c1 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a2 | b2 | c2 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a3 | b3 | c3 | 2  |NULL|NULL|NULL|NULL|NULL|
        | a4 | b4 | c4 | 3  | 3  | e2 | f2 | g2 | h2 |
        |--||||||||--|
    Example
    Output a list of all custimers with their bookings for October 15th, 2001:
    DATA: CUSTOMER TYPE SCUSTOM,
          BOOKING  TYPE SBOOK.
    SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
           SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
           INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
                 BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
                 BOOKING-BOOKID)
           FROM SCUSTOM LEFT OUTER JOIN SBOOK
             ON SCUSTOMID = SBOOKCUSTOMID AND
                SBOOK~FLDATE = '20011015'
           ORDER BY SCUSTOMNAME SBOOKFLDATE.
      WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
               BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
               BOOKING-BOOKID.
    ENDSELECT.
    Reward if helpful.
    Thanks.
    Imran.

  • How to force Oracle using HASH JOIN

    Hi,
    I have performance issue with our SQL queries. If I use hint /*+ordered use_hash(table_name)*/ the queries run very fast as they use HASH JOIN instead of NESTED LOOPS. I have several thousands of such queries and cannot modify them in order to force Oracle to use HASH JOIN.
    I have tried to change parameters in init.ora and re-analyze the database. But the queries still use NESTED LOOPS.
    Here are some parameters in my database:
    hash_area_size=256M
    pga_aggregate_target=6G
    pgamax_size=1953125K
    pga_aggregate_target=6G
    My servers has 16G of RAM each. We are using RAC with 2 nodes.
    Please advice.
    Thx

    I donot have an answer (apart from the only answer to change each and every query to have an hint) but I have one question.
    Per session Hash area size of 256M? Is it really required? It could be a data warehouse but 256M is a bit too much for me (may be I have not worked yet on such a big environment).

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Using BAPI's in ABAP code

    Hi bapi Guru's,
    I am asked to use bapi's(Instead of BDC's) for data upload .I am not getting good documentation on 'USING BAPI's IN ABAP',Like Defining structures, and what are the FM's to be called like bapi_commit.
    Any Info is Appriciated.
    Regards
    satish

    Sorry Satish,
    Maybe this is going off topic a little, bit perhaps also its relevant as you have been asked to move from BDC's to BAPIs.
    Juan,
    When I talk about debugging, there are two levels to this:
    <b>1. Debugging by the programmer</b>
    In this case, how can it be easier to debug an error from a BAPI than from the screen?  For a sales order, for example, when you enter a delivery date of 01.01.2000 for an item, via BDC you will get an error message as the item is entered (something along the lines of delivery date is in the past), and you will see exactly the date you have entered, and if you don't understand the error, you can click on F1 and it will give you the long description of the error.  Via a BAPI, you would get the error message, and you MIGHT get the item number and the date in question.  But if you don't understand the error what do you do then?  Debug the BAPI itself?  You could, but isn't this a rather lengthy way to get to the root of the problem?  In general, any errors you get calling BAPIs/BDCs are errors with your master data, or breaking business rules, you shouldn't have to debug standard code to tell you whats going wrong, the application can tell you.
    <b>2. Debugging by the end user</b>
    When you implement a BAPI/BDC this will be related to an interface/automated transaction etc.  When its in production you will occassionally get errors (due to bad master data, not fully capturing all the business logic in your custom coding [it happens], technical issues etc.)  What do you do then?  In the case of BDC you can do nothing.  The error is recorded, and you can get end users to process the errors by stepping through the screens (which they already know how to use) and make corrections as required.  In the case of BAPIs, you have to record the error in a table or a file, then develop some kind of interface to display the errors, then develop some kind of process for re-processing the errors.  If the data used to call the BAPI is not correct then you also need to provide a facility for changing the data before reprocessing.  Normally you do none of this because its too much work and you end up having all errors coming back to the SAP team who have to debug and change table entries etc. to get it all to work.  I would not say that this makes BAPIs easier to debug.
    Oops, just realised my pasta is burning!!!
    Anyway, think I got my point across.  Not personal but feel quite strongly about this topic.  To me BDC's are still a relevant tool despite the push for Idocs/BAPIs.
    Cheers,
    Brad

  • Order Query in SQ01 using Table Joins in CRM

    Hello Experts,
    I am trying to create a query using table joins in SQ01 in CRM because I need a report that will give me all transactions for a selected Business Partner.  I am unable to display any results when running my query.  I have found other threads which give a list of possible tables to join together, but the fields used in the joins were not described. 
    The tables I have joined in my query are as follows:
    CRMD_ORDERADM_H
    CRMD_ORDER_INDEX
    CRMD_PARTNER
    BUT_000
    I have used SE16 to try to search for additional tables to use for linking the Business Partner with a transaction, but I have been unsuccessful.
    Would anyone please give advice as how to proceed? 
    Reward points are available!
    Thank you in advance,
    David

    David
    The link with be the GUID.
    CRMD_ORDERADM_H = Document Header Table
    CRMD_ORDERADM_I = Document Line item Table
    CRMD_LINK = Lists various ‘link’ GUIDs, to
    access order Information
    The Table CRMD_ORDERADM_H will contain you transactions , once you find the GUID of your sales transaction in the table CRMD_ORDERADM_H.
    You then need to check the table CRMD_LINK.
    In this table you will then find a number in 11 = sales. This refers to the table CRMD_SALES. There are also links to many other tables ie Shipping, pricing, org etc.
    CRMM_BUT_SET0140 - for Sales Group, Sales Office, District
    CRMM_BUT_LNK0141 - for Sales Area data
    Transaction CRMD_BUS2000115 allows you to see all sales transactions for a BP. CRMD_BUS2000126 shows you activities for selected BP.
    Regards
    M

  • How to use nested tables in adobe form

    Hi All,
    I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
    EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
    item--materialdescription-ordered qty--delivered qty--delivery date-price  
    xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
    10----
    xxxxxxxxxx
    10----
    xxxxxxxxxx
    yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy 
    xxxxxx is table 1 and will have multiple lines
    yyyyyy is table 2 and will have only 1 entry for item xxx
    and this group will be repeate as per no of items. table 1 can have any no of lines per item.
    I am currently able to display 1 line for table 1 and 1 line for table 2.
    But how to show multiple lines for table 1 and 1 line for table 2.

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • How to use RTRIM function in ABAP

    Hey,
    I have a question on using trim function in ABAP. According to all documents, I should be able to use rtrim as
    shorttext = rtrim('abcde-xx', '-xx').
    But when I do that, it gives me an error message "Comma without preceding colon (after shorttest?)"
    Anyone can tell me why is this happening? how should I use this trim function? And for me to cut off variable's last few character, what else method can I use? 
    Thank you very much.

    DATA : T1    TYPE STRING VALUE 'abcde-xx',
                T2    TYPE STRING  VALUE '-xx'.
    REPLACE T2 INTO T1 WITH SPACE.
    WRITE :/, T1.
    result output is :    'abcde'.
    regards
    Guna

  • Use of macros in abap- HR

    Hi Gurus,
           What is the exact use of macros in abap-hr.Because in normal abap also these macros are existing , but we will not use these in normal abap programming.So is there any specific reason for using macros in ABAP-HR.
    Thanks in advance..
    Regards,
    Rakesh.

    This is similar to Logical Database usage. We use LDBs in HR more than in other module. SAP has created many macros that can be used in HR. Ex: you have some macros to make use of when using PNP LDB in your program. Similarly SAP provided macros to read text from PCL1 cluster table. Same thing with reading payroll results. In addition you also can define your own macros in the program and use them in the code.

  • In which condition Table valued function should prefer over SP except use in joins?

    Hi, 
    My requirements is:
    Entity framework needs to call DB object (TVF or SP), which will provide some data to them and they'll work on it at app level.
    DB object would be simple, one result set, it will join 5 tables and get around 30 columns to them. it would be parameterized query so can't use view.
    Now my question is what DB object would be best to use, table valued function or store procedure. and why?
    I google on it, I find some interesting links (example http://technet.microsoft.com/en-us/library/ms187650(v=sql.105).aspx)
    they mentioned conditions to convert SP to TVF but not mentioned the reason, why I should convert?
    Both have same cache plans strategy. SP has so many advantages over TVF, but I don't see any technical advantage of TVF over SP except it can be use in joins or so. 
    so In short my question is, why I can't use SP in all cases, why I would use TVF?, and which Table valued or multi-valued?
    would appreciate your time and response.

    According to a few recent blogs you should be able to use TVP or stored procedure with EF 6.1.2 with ease. In our application we haven't switched yet to 6.1.2 (we're using 6.0.0) and there is no support for stored procedures or functions so we use StoreQuery.
    I am wondering if you can share your experience of using EF with SP or TVP (and document the steps).
    I am also wondering as how exactly it's working behind the scenes and where the full query is taking place. Say, in our case we may want to add some extra conditions after retrieving a set using, say, SP. Would the final query execute on the client (e.g.
    SP executed on the server, result returned and then extra conditions executed on the "client")?
    As I said, right now we're using StoreQuery which means that our extra conditions must be case - sensitive as opposed to SQL Server case insensitive. So, if someone already tried that scenario and can tell me how exactly it works, I would appreciate it.
    Another question about EF - I defined a property as  
     [Column(TypeName = "varchar")]
            public string PhoneNumber { get; set; } // area code + phone
    and in the LINQ query as 
    var query = db.Accounts.Select(a => new AccountsList
    AcctName = a.AcctName,
    Contact = a.Contact,
    FullName = a.FullName,
    AreaCode = a.AreaCode,
    Phone = a.Phone,
    Hidden = a.Hide,
    Hide = a.Hide,
    PhoneNumber = a.AreaCode.Trim() + a.Phone.Trim(),
    AcctTypeId = a.AcctTypeId
    and I see that it's translated into CASE AreaCode IS NULL THEN N'' ELSE RTRIM(LTRIM(areaCode)) END + ... 
    My question is - why EF does it if there is no mentioning at all in the class as how NULL is supposed to be treated. Is it a bug?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

Maybe you are looking for

  • Foeign Trade Tab in purchase order (ME21N)

    Hello, How can I make sure that i always have a Foreign Trade Tab in my purchase order. This means; Even if the order is from a BE vendor to a BE plant? Thanks, Oktay

  • I was confused

    Hi to all the java programmer here! You guys are great! Im a college student of **I College, I start programming with java on 2003 when I take my computer programming 3. At first I hate java coz it takes a lot of code to perform a specific tasks comp

  • Add date on Calendar

    I try to create the code below. today is 7/2/07, but when I -2 days it shows 6/31/07. but there is no such a date. what do I do to make it go to 6/30/07? Calendar now = Calendar.getInstance(); Calendar calendar; calendar = (Calendar) now.clone(); //d

  • ISight Built in Camera on iMovie09 and speed problem. Please Help

    Hello, I recently installed imovie09 after using imovie06 for quite sometime. I am getting two problems for now. First, when my videos from iPhoto got imported to iMovie, the audio is working fine but the actual clip is skipping. Is this normal? For

  • General error when trying to export as a QT movie

    Everytime I try to export as a .mov from the timeline (FCP 4.1) I get a general error code. I can export as an .avi file, open in QT Pro and then to a .mov file. I am having the same issue on two different machines, one is a Quicksilver and the other