Adding Additional Tables to an Existing Query

Dear All
I have the following tables and relationships:
I have the following query that returns records from the table SENAlert where the StudentID and the TeacherUsername are passed in as parameters.
Also, records are only returned if there isn’t a corresponding record in the SENAlertHistory table (i.e. SENAlertHistorySENAlertID IS NULL).
This query is returning the results that I would expect:
SELECT       
SENAlert.SENAlertID, SENAlertType.SENAlertTypeDescription
FROM           
SENAlertHistory RIGHT OUTER JOIN
Teacher INNER JOIN
Class ON Teacher.TeacherCode = Class.ClassTeacherCode INNER JOIN
ClassMember INNER JOIN
SENAlert INNER JOIN
SENAlertType ON SENAlert.SENAlertType = SENAlertType.SENAlertTypeID INNER JOIN
Student ON SENAlert.SENAlertStudentID = Student.StudentID ON ClassMember.ClassMemberStudentID = Student.StudentID ON
Class.ClassClassCode = ClassMember.ClassMemberClassCode ON SENAlertHistory.SENAlertHistorySENAlertID = SENAlert.SENAlertID AND
SENAlertHistory.SENAlertHistoryTeacherCode = Teacher.TeacherCode
WHERE       
(Student.StudentID = 011763) AND (Teacher.TeacherUsername = 'dsmith') AND (SENAlertHistory.SENAlertHistorySENAlertID IS NULL)
However, I need to extend this query to include additional teachers who may also teach this student. I am trying to add in 3 additional copies of
the Teacher table as Teacher_1, Teacher_3 and Teacher _3 in order to include them in the query also.
However, when I add these tables in I no longer get any results returned.
I have managed to do this on other queries but not this one.
SELECT SENAlert.SENAlertID, SENAlertType.SENAlertTypeDescription
FROM SENAlertHistory INNER JOIN
Teacher ON SENAlertHistory.SENAlertHistoryTeacherCode = Teacher.TeacherCode INNER JOIN
Teacher AS Teacher_1 ON SENAlertHistory.SENAlertHistoryTeacherCode = Teacher_1.TeacherCode INNER JOIN
Teacher AS Teacher_2 ON SENAlertHistory.SENAlertHistoryTeacherCode = Teacher_2.TeacherCode INNER JOIN
Teacher AS Teacher_3 ON SENAlertHistory.SENAlertHistoryTeacherCode = Teacher_3.TeacherCode RIGHT OUTER JOIN
Class INNER JOIN
ClassMember INNER JOIN
SENAlert INNER JOIN
SENAlertType ON SENAlert.SENAlertType = SENAlertType.SENAlertTypeID INNER JOIN
Student ON SENAlert.SENAlertStudentID = Student.StudentID ON ClassMember.ClassMemberStudentID = Student.StudentID ON
Class.ClassClassCode = ClassMember.ClassMemberClassCode ON Teacher_3.TeacherCode = Class.ClassTeacherCode AND
Teacher_2.TeacherCode = Class.ClassTeacherCode AND Teacher_1.TeacherCode = Class.ClassTeacherCode AND
Teacher.TeacherCode = Class.ClassTeacherCode AND SENAlertHistory.SENAlertHistorySENAlertID = SENAlert.SENAlertID
WHERE (Student.StudentID = 011763) AND (SENAlertHistory.SENAlertHistorySENAlertID IS NULL)
AND (Teacher.TeacherUsername = 'admin\dsmith' OR Teacher_1.TeacherUsername = 'admin\dsmith' OR Teacher_2.TeacherUsername = 'admin\dsmith' OR Teacher_3.TeacherUsername = 'admin\dsmith')
No results are returned from this adapted query. I have noticed that by adding the additional tables, it keeps changing the type of joins that I
have between certain tables. I have tried all sorts of combinations but haven't been able to make it work.
I would be really grateful for any advice that you may be able to offer.
Many thanks
Daniel

Dear All
I followed the advice and created the query again from scratch, one table and relationship at a time checking that I am getting the expected result. I have put much of the query back together with the correct output:
SELECT
SENAlert.SENAlertID,
SENAlertType.SENAlertTypeDescription
FROM dbo.SENAlert
INNER JOIN dbo.SENAlertType
ON SENAlert.SENAlertType = SENAlertType.SENAlertTypeID
INNER JOIN dbo.Student
ON SENAlert.SENAlertStudentID = Student.StudentID
INNER JOIN dbo.ClassMember
ON ClassMember.ClassMemberStudentID = Student.StudentID
INNER JOIN dbo.Class
ON ClassMember.ClassMemberClassCode = Class.ClassClassCode
INNER JOIN dbo.Teacher
ON Class.ClassTeacherCode = Teacher.TeacherCode
LEFT OUTER JOIN dbo.Teacher AdditionalTeacher1
ON AdditionalTeacher1.TeacherCode = Class.ClassAdditionalTeacherCode1
LEFT OUTER JOIN dbo.Teacher AdditionalTeacher2
ON AdditionalTeacher2.TeacherCode = Class.ClassAdditionalTeacherCode2
LEFT OUTER JOIN dbo.Teacher AdditionalTeacher3
ON AdditionalTeacher3.TeacherCode = Class.ClassAdditionalTeacherCode3
WHERE Student.StudentID = 011763
AND (Teacher.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher1.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher2.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher3.TeacherUsername = 'admin\dsmith')
The problem arises when I try to add the SENAlertHistory table back in. I only want to show results where a related record does not exist in SENAlertHistory. I have tried every combination of relationship but none have been successful.
I think maybe I need to be using a subquery instead.
Thanks for your help
Daniel
do you mean this?
SELECT
SENAlert.SENAlertID,
SENAlertType.SENAlertTypeDescription
FROM dbo.SENAlert
INNER JOIN dbo.SENAlertType
ON SENAlert.SENAlertType = SENAlertType.SENAlertTypeID
INNER JOIN dbo.Student
ON SENAlert.SENAlertStudentID = Student.StudentID
INNER JOIN dbo.ClassMember
ON ClassMember.ClassMemberStudentID = Student.StudentID
INNER JOIN dbo.Class
ON ClassMember.ClassMemberClassCode = Class.ClassClassCode
INNER JOIN dbo.Teacher
ON Class.ClassTeacherCode = Teacher.TeacherCode
AND NOT EXISTS ( SELECT 1
FROM SENAlertHistory
WHERE SENALertHistoryTeacherCode = Teacher.TeacherCode
AND SENAlertHistorySENAlertID = SENAlert.SENAlertID)LEFT OUTER JOIN dbo.Teacher AdditionalTeacher1
ON AdditionalTeacher1.TeacherCode = Class.ClassAdditionalTeacherCode1
AND NOT EXISTS (SELECT 1
FROM SENAlertHistory
WHERE SENAlertHistoryTeacherCode = AdditionalTeacher1.TeacherCode
AND SENAlertHistorySENAlertID = SENAlert.SENAlertID
LEFT OUTER JOIN dbo.Teacher AdditionalTeacher2
ON AdditionalTeacher2.TeacherCode = Class.ClassAdditionalTeacherCode2
AND NOT EXISTS (SELECT 1
FROM SENAlertHistory
WHERE SENAlertHistoryTeacherCode = AdditionalTeacher2.TeacherCode
AND SENAlertHistorySENAlertID = SENAlert.SENAlertID
LEFT OUTER JOIN dbo.Teacher AdditionalTeacher3
ON AdditionalTeacher3.TeacherCode = Class.ClassAdditionalTeacherCode3
AND NOT EXISTS (SELECT 1
FROM SENAlertHistory
WHERE SENAlertHistoryTeacherCode = AdditionalTeacher3.TeacherCode
AND SENAlertHistorySENAlertID = SENAlert.SENAlertID
WHERE Student.StudentID = 011763
AND (Teacher.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher1.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher2.TeacherUsername = 'admin\dsmith'
OR AdditionalTeacher3.TeacherUsername = 'admin\dsmith')
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Adding additional tables to the extractor configuration

    Hi Experts,
    Can you please help me adding additional tables to the SAP extractor and to configure the field data in the orgstructure to show a flag against the position.
    Luke - I have tried using the option said by you from Application-wide Settings-->Data Centre --> Read SAP Table, it has properly save the added table, but not able to see it from SAP extractor configruation and not able to extract any data. Also, can you please guide me how to use the fields from this table (HRP1010) to write a small piece of logic to show a flag for a particualr position based on data.
    Thanks in advance,
    Purandhar

    Hi Purandhar,
    I have tried using the option said by you from Application-wide Settings-->Data Centre
    --> Read SAP Table, it has properly save the added table, but not able to see it from
    SAP extractor configruation and not able to extract any data.
    This has probably added a data element - I would check in the dataelementconfiguration folder in your build's .delta folder. IF so then you have the first step completed. Now you need to add the necessary configurations to use the data that comes through this data element.
    Go to your orgchart/hierarchy and navigate to Views. Here select your view (or your first view if this needs to be done for more than one view - if so you'll need to repeate these steps but not the step you already did in the Data Centre), and then click the + icon next to Design Details. Here you can add a new linked detail to your view detail. Simply give it a name, select the detail to link it to (usually the top level detail which is in blue), select a link field and then select your data element that was created in the Data Centre.
    Now if you try to add a section to your view inside the Design Details view designer you will see your new detail added. You can then select it and add fields from this detail.
    Also, can you please guide me how to use the fields from this table (HRP1010) to write
    a small piece of logic to show a flag for a particualr position based on data.
    Once you have been able to add the data in the views designer you will probably need to do some XML and XSL editing because you cannot edit XSL files in the AdminConsole and you will need to do this to get your icon/flag to show.
    First of all you need to create a new XSL file and put it into a folder in your .delta\root folder. For example, My_XSL_files. Here you need to write the code to render your flag based on your variable. You can find plenty of examples in all of the pre-existing XSL files. Then you need to copy PresentationResources.xml to .delta\root\XML and add the reference to your new XSL file.
    Go to your build's .delta folder and go to detailconfiguration. Find the detail you just created and open it. You'll find a section in their that you just added with a reference to an XSL file (e.g. if you added a Simple Caption section it will probably be something like SimpleCaptionXSL). Change this to the reference in the PresentationResources.xml.
    Load your build in the AdminConsole and hit Publish. Once done you should see your icon. Sometimes if your XSL is invalid or the code doesn't work you won't see anything. This is not unusual as the whole process can be quite tricky - even for us with lots of experience!
    Good luck!
    Luke

  • Adding a table to an existing table results in wrong link

    This is the code being used to add a table to a report:
    private ISCRTable AddLinkTable(ILinkTable linkTable, string sourceTableAlias, ConnectionInfo connectionInfo)
    { // construct a new Table from its name
    ISCRTable newTable = new Table();
    newTable.ConnectionInfo = connectionInfo.Clone();
    newTable.Name = linkTable.LinkTableName;
    newTable.Alias = linkTable.LinkTableName + "_ThisIsTheLinkTable" + LinkTableId++;
    if (_dataServiceSettings.DataProvider == DataProvider.Oracle11G)
    newTable.QualifiedName = _dataServiceSettings.DatabaseUserName.ToUpper() + "." + newTable.Name.ToUpper();
    else
    newTable.QualifiedName = "dba." + newTable.Name;
    // add a field to this new Table
    newTable.DataFields.Add(AddDbField(linkTable.DataField, newTable.Alias));
    // join this table to another one named sourceTableAlias, using linkFields TableLink
    tableLink = new TableLink();
    tableLink.SourceTableAlias = sourceTableAlias;
    tableLink.TargetTableAlias = newTable.Alias;
    tableLink.JoinType = CrTableJoinTypeEnum.crTableJoinTypeEqualJoin;
    Strings sourceFields = new Strings();
    Strings targetFields = new Strings();
    for (int i = 0; i + 1 < linkTable.LinkFields.Length; i += 2)
    sourceFields.Add(linkTable.LinkFields[i]); targetFields.Add(linkTable.LinkFields[i + 1]);
    tableLink.SourceFieldNames = sourceFields;
    tableLink.TargetFieldNames = targetFields;
    TableLinks tableLinks = new TableLinks();
    tableLinks.Add(tableLink); _report.ReportClientDocument.DatabaseController.AddTable(newTable, tableLinks);
    _report.ReportClientDocument.DatabaseController.VerifyTableConnectivity(newTable);
    //AddFieldToReport("{" + newTable.Alias + "." + linkTable.DataField + "}");
    return newTable;
    This is the resulting query SELECT "Article"."ArtId", "Article"."ArtDescr", "ArticleGroup"."AgDescr1", "Article"."ArtPurchLevel", "Article"."ArtMaximum", "Article"."ArtAbc", "Article"."ArtContext", "Article"."ArtPurchPrice", "Article"."ArtServOutUnt", "ArticleSite"."ArtsSitId", "Article"."ArtRecStatus"
    FROM  (dba.Article "Article" LEFT OUTER JOIN dba.ArticleGroup "ArticleGroup" ON "Article"."ArtAgId"="ArticleGroup"."AgId")
    INNER JOIN "10_78_00"."dba"."ArticleSite" "ArticleSite" ON "Article"."ArtId"="ArticleSite"."ArtsPurch" WHERE  "Article"."ArtContext"=1 AND ("ArticleSite"."ArtsSitId"='63'
    OR "ArticleSite"."ArtsSitId"='64') AND "Article"."ArtRecStatus">=0 ORDER BY "Article"."ArtId"
    the link field artspurch is not the field I declared . It happens to be the first column of the table ArticleSite. This seems to be a bug. has anyone ever experienced anything like this?
    ( Fixed the formatting )
    Message was edited by: Don Williams

    Hi Henk,
    What was the SQL before you added the table?
    I reformatted your code but you may want to confirms it correct or simply copy it into Notepad and then paste into this post.
    I find the easiest way to confirm is ad the table and joins in CR Designer first and then look at what Debug mode returns using this:
    btnReportObjects.Text = "";
    string crJoinOperator = "";
    foreach (CrystalDecisions.ReportAppServer.DataDefModel.TableLink rasTableLink in rptClientDoc.DataDefController.Database.TableLinks)
        //get the link properties
        btnCount.Text = "";
        int y = rptClientDoc.DataDefController.Database.TableLinks.Count;
        btnCount.Text = y.ToString();
        string crJoinType = "";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeAdvance)
            crJoinType = "-> Advanced ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeEqualJoin)
            crJoinType = "-> = ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeGreaterOrEqualJoin)
            crJoinType = "-> >= ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeGreaterThanJoin)
            crJoinType = "-> > ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLeftOuterJoin)
            crJoinType = "-> LOJ ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLessOrEqualJoin)
            crJoinType = "-> <= ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLessThanJoin)
            crJoinType = "-> < ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeNotEqualJoin)
            crJoinType = "-> != ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeOuterJoin)
            crJoinType = "-> OJ ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeRightOuterJoin)
            crJoinType = "-> ROJ ->";
        textBox1 = "Only gets Link type:" + rasTableLink.SourceTableAlias.ToString() + "." + rasTableLink.SourceFieldNames[0].ToString() +
            crJoinOperator + "." + crJoinType + rasTableLink.TargetTableAlias.ToString() + "." + rasTableLink.TargetFieldNames[0].ToString() + "\n";
        btnReportObjects.Text += textBox1;
        btnReportObjects.AppendText(" 'End' \n");
    There are some join types RAS is not capable of.
    Attach the report before and after you manually add the join and I'll see if I can get it to work also.
    Don
    ( PS - use the Advanced option to attach files and rename the reports to *.txt. )

  • Adding additional fields to an Infoset Query

    Hi Experts,
    I have added a couple of additional fields to an infoset query using SQ02.
    I have also written code for filling in the fields.
    I have also added them to some Field Groups.
    Despite this, when I run the query, they are not being displayed in the output list.
    What could be the reason for this?
    Kindly help with your inputs.
    Thanks in advance.
    Regards,
    Keerthi

    goto sq01,
    give the query name...
    goto change.. just below output, you have a drop down for field group and field catalog. select field catalog.
    select the fields you want to show in output

  • Adding a field in already existing query layout

    Hi All,
    I have a requirement where I have to add couple of fields in an already existing query layout.
    Through SQ01 and layout painter I have added the fields to the layout. When I test from query painter it displays the newly added fields. But when I execute the transaction that is designated to run the query its not displaying those fields.
    What am I missing here?
    Thanks in advance.
    Thanks,
    Arun

    Arun,
    As you have done some changes to the query,the internal report generator will generate a new program correspponding to the Query which should be attached to the T-code.
    Currently the t-code might be having the earlier program name ie the program generated by the query before changes were made hence it is not displaying.
    Just check the program name of the Query and the  program name attached to the tcode.
    K.Kiran.

  • Adding threshold values in an existing query

    Hi All,
    I have to update an existing query.
    The original query gives me the value of Debtors to sales ratio for each division (DTR value).
    Now, I want that for each division, there be a threshold value which should be compared with the debtor's value and if found higher than the threshold, the result should be in red.
    The result being in red can be done at the front end, which in my case is Cognos.
    But to store different threshold values for diffrerent divisions and then compare them with the debtor's values of the query, do I need to have a separate cube wherein I should store the divisions and their threshold values?
    Or how can I go about it?
    Thanks and best regards,
    Sharmishtha

    Hi Nagesh,
    I do not have those values in the system but will be getting as external data only.
    Divisions and debtors are separate info objects.
    I have 12 debtors KFs (for 12 months) which get filled by an APD (data source is a query).
    So, my final query has divisions in the rows and 12 debtors in the colm.
    So, now i'll be given some threshold debtor value for each division which I need to bring in the query as a KF which can be compared in the query output.
    So, what you suggested will it work in this requirement?
    Also, can you elaborate on the method I need to follow?
    Thanks a lot,
    Sharmishtha

  • Adding additional fields to an existing Infoset.

    Experts,
    I got a requirement to add additional fields to an existing info set which belongs to different Logical Data base.
    The existing info set is based on PNPCE LDB and the fields are from PD (i.e PCH ldb).
    Please let me know hw to add those fields...
    Thanks,
    Shrini

    Hi Shrini,
    You can add fields from PD infotypes (1000-1999) to a PNPCE infoset if the object has a relationship to a Person.  Example would be Position which has the relationship Holder.  You go to Change the Infoset.  Edit --> Change infotype selection.  Scroll down to the bottom and open Infotypes of Related Objects.  Open Position.  There you will see the possible relationships between a Position and Person.  Select Holder.  There you have the list of infotypes assigned to a Position that you can add by checking each.  You can then add whatever fields are in that infotype to the Infoset. 
    Problem comes in if there is no direct relationship between a Person and the object - such as Job that you want to include in the Infoset.  A Job describes a Position and a Person holds a Position, but a Person does not have the direct relationship to the Job except as a Dislike or Successor.    In this case you would need to create a new PCH Infoset with the root object Position.  Then using the relationships between Position and Job and Position and Person, you can access the infotypes from PA as well as PD.
    Paul

  • Common Table Expersion - inside existing query - How to add it in?

    I need to add somethint like the below query to an existing query. How do I do that?
    with emp_att_t
    as
    select empid,
           count(*) over(partition by empid order by 1) total_cnt,
           sum(decode(present_yn, 'N',1,0)) over(partition by empid order by 1) abs_cnt
      from emp_att
    select eh.empid, eh.name
      from emp eh
      join emp_att_t ed
        on eh.empid = ed.empid
    where ed.total_cnt > 100
       and ed.abs_cnt > 5thanks for looking.
    Edited by: GMoney on Mar 7, 2013 2:00 PM

    Please disregard the query it's self - it has nothing to do with my question really.
    The below is from a question you answered for me in this thread: Re: MAX Value for multiple fields in same Query
    WITH     got_rn          AS
         SELECT     ck.circuit_design_id
         ,     sr.document_number
         ,     ck.product_id
         ,     sr.activity_ind
         ,     sr.order_compl_dt
         ,     ROW_NUMBER () OVER ( PARTITION BY  ck.circuit_design_id
                                   ORDER BY          sr.document_number     -- or sr.order_compl_dt
                                       DESC
                           ) AS rn
         FROM    ck
         JOIN     src     ON     ck.circuit_design_id     = src.circuit_design_id
         JOIN     sr     ON     src.document_number     = sr.document_number
    --     WHERE     ...     -- If you need other filtering, put it here
    SELECT       circuit_design_id
    ,       document_number
    ,       product_id
    ,       activity_ind
    ,       order_compl_dt
    FROM       got_rn
    WHERE       rn     = 1
    ORDER BY  circuit_design_id     -- if wantedAll I am really asking is how to do an INNER JOIN on one or more other queries.
    Example
    select *
    from (
    Select abc, def
    from t1, t2
    where t1.abc = t2.abc) result1
    inner join
    WITH     got_rn          AS
         SELECT     ck.circuit_design_id
         ,     sr.document_number
         ,     ck.product_id
         ,     sr.activity_ind
         ,     sr.order_compl_dt
         ,     ROW_NUMBER () OVER ( PARTITION BY  ck.circuit_design_id
                                   ORDER BY          sr.document_number     -- or sr.order_compl_dt
                                       DESC
                           ) AS rn
         FROM    ck
         JOIN     src     ON     ck.circuit_design_id     = src.circuit_design_id
         JOIN     sr     ON     src.document_number     = sr.document_number
    --     WHERE     ...     -- If you need other filtering, put it here
    SELECT       circuit_design_id
    ,       document_number
    ,       product_id
    ,       activity_ind
    ,       order_compl_dt
    FROM       got_rn
    WHERE       rn     = 1
    result2
    ON result1.abc = result2.activity_indEdited by: GMoney on Mar 7, 2013 2:23 PM

  • Adding New table to the existing page

    Hi,
    i have a task i.e i have to create a new UI(consista table structure) and add to the existing page.How can do this one.If any one knows please respond asap.
    This is urgent requirement.
    Thanks in advance.
    Bye
    Palakondaiah

    Hi,
    i have a task i.e i have to create a new UI(consista table structure) and add to the existing page.How can do this one.If any one knows please respond asap.
    This is urgent requirement.
    Thanks in advance.
    Bye
    Palakondaiah

  • Adding a Table to an Existing Subview

    I can create a new populated subview by selecting tables and performing "Create Subview from selected" but how do I add another table to this Subview?
    Edited by: John Gilmore on 24-Nov-2011 15:18

    Yeah I see that way but I was hoping for a different way. The reason I don't like using the tree view is because the tables are not listed in alphabetic order by schema name. So it makes it extremely are to find a table when you got 20 plus schema's.

  • Adding additional fields to Existing query

    Hi all,
    There is an existing query in our system and now the requirement is to add and insert few fields to the existing fields of output of that query.
    Please let me know step by step procedure to achieve this.
    Thanks in advance-

    It depends upon the type of Query you have.   Is it a Quick View, an ABAP Query, or are you trying to make changes to an ABAP Report?

  • While adding KONA table in query(sq02), relevant billing doc not displayed

    Hi experts,
    When I am changing an existing query through sq02( I am joining table KONA with already existing tables VBRK & VBRP and adding fields , Agreement number & Validity date from & Valid till) , after execution , query displays 3 additional columns of Agreement number, Validity from & Validiy to, but it ceases to display records of those documents in which rebate is accrued. It only displays those documents where rebate basis is present in condition records of billing item data, but zero rebate is accrued.
    Any suggestion are highly welcome.
    Best Regards
    Vimal

    Hi Vimal,
    Unfortunately, it is not possible to find out the list of invoices which have accrued to a rebate agreement. This is true not just for rebate for also for credit management as an example. If you want the list of sales orders which have resulted in the open order value in FD 32 for the credit customer, it is not possible.
    This is true for every other functionality which uses the Infostructure update instead of normal table update. It is because infostructure update is always cumulative and table update is always record specific. When infostructure update gets a new value, the old value is erased. Hence it is not possible to find out the entire list of entries which contributed to the total value and we can only see the total value.
    To sum it up, it is not possible to find out all the invoices which have resulted in the accrual value of a particular rebate agreement. Also it is not possible to find out all the sales orders, which resulted in the open order value of a credit customer in his credit master data in FD32. If this has to be done, it has to be done manually by using a complex logic.
    If you want to find out the invoices relevant for rebate agreement, you need to find out all the invoices created within a timespan, find out all the partners, material etc. Then find out all agreements relevant for this period (or involving this period) involving the customer (payer/sold to party) and the material. Then match both the entries to get what you want. That is lot of work and even after that, accuracy of data is in question.

  • SAP Query PNPCE LDB with additional table.

    Hi ABAP Gurus,
    I am developing a SAP Query.
    I have created an infoset with the custom infotype 9050 and added the table ZPA9050 into the Infoset.
    The fields of ZPA9050 is not available as selection fields when I try to Query through SQ01.
    (How do I input values to the ZPA9050 fields? A checkbox for making a Selection field is not available in the Query (SQ01).
    For every pa9050 entry there exist multiple records of ZPA9050. I need to display the pa9050 fields in the 1st row and the corresponding zpa9050 fields in the subsequent rows.
    What needs to be done in order to get them as Selection fields (Input Fields)
    A quick reply is highly appreciated.
    Useful answers will be rewarded.
    Thanks
    Pradeep

    Hello,
    at the time of cretaing INFOSET using transaction SQ02. You can click on the Extra button nad than on the selection tab to add some fields on the selection screen.
    Reward if useful
    Mohit

  • Need to Add a Table in Existing Query(SQVI)

    Hello All,
    I have a query zqry (in T-Code SQVI) using 2 tables mkpf & mseg, with some List Fields(Result) & some selection Fields(Select options).
    I need to add a new table makt into this existing query.
    Help is highly appriciated.
    Regards
    Arun.

    Hi Arun,
    look here:<a href="http://help.sap.com/saphelp_47x200/helpdata/en/b7/26dde8b1f311d295f40000e82de14a/frameset.htm">QuickViewer</a>
    and note: ...
    "Whenever you define a QuickView, you can specify its data source explicitly. Tables, database views, table joins, logical databases, and even InfoSets, can all serve as data sources for a QuickView. <b>You can only use additional tables and additional fields if you use an InfoSet</b> as a data source."...
    regards Andreas

  • Screen error while adding  table control to existing tab in BP screen

    Hi experts,
    Requirement: Add new section with table control in existing tab in BP screen. Purpose of creating table control is to add or delete multiple entries etc.
    To fill this requirement, we have created custom transaction with table control facility. When we run this transaction from SAP easy screen, we are able to add, delete and create multiple records to database.
    We have configured this custom program and screen in BDT (views) and saved.
    When we call BP transaction we are getting following error message.
    "Screen ZMOD_TEST1 0100 must be an Include screen (screen error)".
    We are not sure, the approach we have chosen is correct. Incase, any one of you come across this type of problem, please guide us to rectify.
    Thanks in advance.
    Venky

    Venky,
    If you are on CRM 4.0 or even 5.0, my approach to adding a table to business partner attributes would have been the following:
    - Use EEWB to generate the table extension
    - Modify the generated code/screens if what was generated did not meet you complete requirements
    However going back to your original question, if you add new screens for the BDT, then they must be "subscreens".  The screens you create for the BDT tool are always subscreens placed in a container by the BDT program.
    So your options are one:
    1.  Convert your screen to a subscreen and if you have coded all the BDT event function modules correctly it should work
    2.  Use EEWB to generate a new extension and make adjustments as necessary.
    Good luck,
    Stephen

Maybe you are looking for

  • Mac Pro - 50% of the time, it does not turn on properly.

    Hello all, I got my 8-core Mac Pro in september - very new - very happy - and all the rest of it! Two days ago however, my Mac starts playing up... It now boots with a car-like rev and roughly 50%-70% of the time I switch on the Mac it thinks for abo

  • Problem with ALV and user defined selection screen. please help!

    Hi Experts,        I have program which has a user defined selection screen 9001. On executing the selection screen i call a ALV using resuse_alv_grid function module. What problem I am facing is that when I press back button from ALV page it goes to

  • How to connect the Kinect up to a Crio

    I am on a FIRST robotics team, and I was wondering how you would connect a Kinect to a Crio.

  • 0SD_C04 Dates

    I discovered in BWQ that a date key figure was wrongly defined , instead of DATS in the data type , it was defined as DEC and because of that , the results are showing numbers instead in date format. I went into BWD to change this , but for some reas

  • License query

    Hi, I have a query about licensing. This should be the realm of the suppliers, but I'm finding it hard to get an answer without going off and having a meeting wherein we commit to a purchase. I know most vendors with an "educational" license, allow t