Link ap_invoice_distributions_all to a GL Header

Hi,
I am trying to link the invoice_distribution_id to an invoice_id linked to a GL Header. The problem I face is that the invoice_distribution_id is returning multiple lines when joined on invoice_id. My query is below:
select *
from apps.xla_distribution_links l, apps.ap_invoice_distributions_all ad
where l.source_distribution_id_num_1 = ad.invoice_distribution_id
and ad.invoice_id = l.applied_to_source_id_num_1
and l.applied_to_source_id_num_1 = 37109
and l.ae_header_id = 381812
and ad.dist_code_combination_id = 6429 and ad.line_type_lookup_code = 'ITEM';
There should be only 2 records returned that relate to two GL lines in a GL Header ID, but 4 records are returned because the invoice_line number is the same and the ae_line_number is the same too. How can I eliminate these to return the correct match in GL. There is a distribution line number and temp_line_number that is unique in the above query. Do these link elsewhere?
Thanks

Hi,
I have started by linking gl_je_lines with gl_import_references to link with xla_ae_lines via gl_sl_link_id . I have then linked the invoice_id in ap_invoices_all to xla_distribution_links. Everything is fine until this point forward as I need to obtain the accounting_date from ap_invoice_distributions_all to base the date parameters of the GL data on accounting_date.
My query is below:
SELECT c.code_combination_id, h.je_header_id, l.ae_header_id, l.ae_line_num, te.source_id_int_1, te.application_id, te.entity_id,
h.je_source,
h.je_category,
i.gl_date,
s.vendor_name,
s.segment1 as supplier_no,
l.event_class_code as event_class, i.invoice_id, ad.invoice_distribution_id,
i.invoice_num AS transaction_number,
i.invoice_date,
initcap(jl.description) description,
jl.accounted_dr as debit,
jl.accounted_cr as credit,
Nvl(Jl.Accounted_Dr, 0) - Nvl(Jl.Accounted_Cr, 0) Net_Amount
From Apps.Gl_Je_Headers H,
apps.gl_je_lines jl,
Apps.Gl_Code_Combinations C,
apps.gl_import_references r,
apps.xla_ae_lines al,
Apps.Xla_Ae_headers Ah,
apps.xla_distribution_links l,
apps.ap_invoices_all i,
apps.ap_invoice_distributions_all ad,
apps.ap_suppliers s,
apps.xla_events e,
apps.xla_transaction_entities te
where ad.accounting_date between :startdate and :enddate
and c.code_combination_id = 6429
and jl.description != 'GB VAT - STANDARD TAX'
and ad.line_type_lookup_code = 'ITEM'
AND jl.je_header_id = h.je_header_id
AND jl.code_combination_id = c.code_combination_id
and al.gl_sl_link_id = r.gl_sl_link_id
and al.ae_header_id = ah.ae_header_id
and al.application_id = ah.application_id
and ah.application_id = e.application_id
and ah.event_id = e.event_id
and e.application_id = te.application_id(+)
and e.entity_id = te.entity_id(+)
AND r.je_header_id = jl.je_header_id
AND r.je_line_num = jl.je_line_num
AND l.ae_header_id = al.ae_header_id
and l.ae_line_num = al.ae_line_num
and l.applied_to_source_id_num_1 = i.invoice_id
and l.source_distribution_id_num_1 = ad.invoice_distribution_id
and ad.invoice_id = i.invoice_id
and i.vendor_id = s.vendor_id
order by i.gl_date desc
This query results with 4 records, when there should be two. The reason being that ap_invoice_distributions_all contains 3 records where the amounts are split into 3 but total up to the correct amount in the GL header. Also the invoice_line_number is the same, please advise.

Similar Messages

  • Creating link to other Portlet's Header links

    I would like to have a link, in a HTML Portlet or someplace, to the 'Customize' or delete ('x') on a portlet's header. This way the user can click my link directly instead of searching for the portlet and clicking the Customize link there.
    I can do it by copying the shortcut for the Customize and pasting it into my HTML Portlet, but this will only work for me, because it has my IDs in the URL.
    How can I find the link to use for the other Portlet's headers that any user can use?
    Thanks,
    Gary

    The user identity is not included in the portlet customization URL (it comes from somewhere else). The approach you describe works just fine.

  • Html link not visible as table header in jsp

    Hi,
    I am not sure if this question belongs to JSP forum, since it's happening in JSP page I am posting it here.
    I am seeing this strange problem, in my JSP page all the link are looking fine except some links in Table header. Here is the code snippet:
    <th align="left" width="30%"><html:link action="/myAction.do?sortBy=org&all=${param.all}">Organization Name</html:link></th>
    ENV is struts, jstl, html.
    Now the problem is the text Organization Name is not visible, although it's there and I can click it. If I click and drag mouse over it I can see it.
    Also if I put this link anywhere else e.g. <TD> I can see it.
    I am not sure why it's happening.
    Please help me.
    Abhishek

    Sounds like a style issue - is it the same colour as the background for some reason?
    What styles have you got applied to your <th> columns? The text in them?
    Are you using css?

  • Personalize link not visible in mast head

    Hi ,
    The personalize link is not visible in mast head.
    Can anyone guide me on this .
    Best Regards
    Sid

    Hi
    Go to Content administration -> Portal content-> Content provided by sap -> End user content->Standard portal users -> Worksets-> Portal personalization to the role of the user
    You can also assign eu_role role to that user to enable the personalize link in masthead but this brings iviews too in the content area.
    Regards,
    Ganesh N

  • How to link AP_INVOICE_DISTRIBUTIONS_ALL to AP_INVOICE_LINES_ALL?

    hello!
    i am confused between too many fields linking these 2 tables. we have:
    AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER
    AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID
    AP_INVOICE_LINES_ALL.AIL_INVOICE_ID2
    AP_INVOICE_LINES_ALL.AIL_DISTRIBUTION_LINE_NUMBER
    AP_INVOICE_LINES_ALL.AIL_INVOICE_ID3
    AP_INVOICE_LINES_ALL.AIL_DISTRIBUTION_LINE_NUMBER2
    AP_INVOICE_LINES_ALL.AIL_INVOICE_ID4
    AP_INVOICE_LINES_ALL.AIL_DISTRIBUTION_LINE_NUMBER3
    which field to use?

    Welcome to the forums !
    Pl post EBS related questions in the EBS forums at http://forums.oracle.com/forums/category.jspa?categoryID=3
    Pl access the EBS ERD diagrams at http://etrm.oracle.com to understand the relationships between these tables. You will need a valid Metalink login
    HTH
    Srini

  • How to add Column field in the custom Query Link search page as a header

    Hi,
    I have created a Query page link in web layout editor. Now, I want to customise the view of the result. I see an option to change the "Text1" and "text2", but how do I add other fields as a colum in the search result ?
    The only column I see by default Id, Title, release date and author. I want to see some of the custom metadata in the search result. I don't wan't to apply user specific custom search page.
    Overall, I want a common search view across all the user such that each user doesn't have to create a custom search view.
    Please help.
    Thanks

    hi
    By adding context node, you will not be able to fetch value. To fetch value in BTSubject, you need to have following nodes in your context node.
    Node          Relation                  Higher level node
    BTAdminH
    BTBOSSet  BTHeaderBOSSet   BTAdminH
    BTSubjectSet BTSubjectSet_A BTBOSSet
    BTSubject BTSubjectAll  BTSubjectSet_A
    Right now you dont have BTBOSSet and BTSubjectSet in your view. That is why component is unable to pull data in BTSubject.
    My suggestion would be to create cuco with above nodes
    Bind BTAdminH with BTAdminH of Component controller
    and bind BTSubject of details view with BTSubject of your Cuco.
    If you want code code gp catalog as it comes in complaint then there is seperate procedure for that.
    Best regards
    Pankaj Kumar

  • Linked Lists, Hashing, and sore heads.

    I am working with a team on a java program as part of an algorithms assignment. We have completed the program however I'm convinced its not working. The program is supposed to carry out a defined number of searches, additionions and deletions to a linked list and time it. We have been supplied with a number of ext files with random numbers for testing purposes.
    The text files are different sizes. We are finding that our results are the same regardless which file we use and which arguments are passed into the program. I would be greatful if someone could cast their eye over the work and let us know what you think.
    All files are at
    http://students.odl.qmul.ac.uk/~dm07/algorithms/.
    IntSet.java is the program we have completed from a skeleton code.
    Evaluator.java is the wrapper provided. data.zip is a full file of the
    different test text files although there are two on here for quick download.
    Any direction or feedback would be really appreciated.
    Dermot.

    Here is the result for the 50 random numbers text file :
    D:\Coursework\Algorithms>java Evaluator size-50-random.txt 10000
    Setting up, please wait ...
    Finished setting up.
    Start searches
    It took 0.010 seconds for 10000 searches
    It took 0.020 seconds for 10000 additions
    It took 0.010 seconds for 10000 deletions
    And here is the result for hte 50000 random numbers text file :
    D:\Coursework\Algorithms>java Evaluator size-50000-random.txt 10000
    Setting up, please wait ...
    Finished setting up.
    Start searches
    It took 0.010 seconds for 10000 searches
    It took 0.020 seconds for 10000 additions
    It took 0.000 seconds for 10000 deletions
    As you can see they are virtually identical. Even after running a number of times and working out averages they are the same. I thought that the results should be exponential but they are not. I understand that results should change from pc setup to pc setup, depending on processor etc but we are not getting this.
    Dermot.

  • Problems using a formatted search to link order lines to order header

    Hi,
    I'm having a nightmare trying to get the main lines table to populate the header within a sales order using a formatted search.
    I have created a UDF on the header for total value, and where items entered onto the order are of a certain type I need the header UDF to be sumated.
    Basically I have three parts for packaging (PACK1, PACK2 and PACK3), and the header has a UDF called U_TotPack
    Someone did sugest the following query, but this doesn't appear to work either:
    select sum(t0.linetotal) from rdr1 t0 inner join ordr t1 on t0.docentry = t1.docentry
    where t1.docnum = $[ORDR.DocNum] and t0.itemcode in ('PACK1', 'PACK2', 'PACK3')
    If it is a problem for me to use the line total field (as it is a variable calculation) I am happy to total the quantities for the items found, but I just can't seem to build any form of relationship between the header and lines.
    Hope someone out there is able to help as this one has really got me stumped.
    Cheers,
    J

    Hi Julian,
    I'm assuming you are trying to populate the header UDF before the Order is added to the system? If yes then it is not possible to achieve this via a formatted search, only SDK. A header FS cannot properly access line information, it only works the other way around - header info to line level.
    I presume the reasoning is that which line should your header FS take a value from? The FS syntax also doesn't allow you to loop throught all lines.
    The SQL that someone else suggested would only work for a sales order already added to the database. Hope this helps.
    Regards,
    Andrew.

  • How to Link column header only in classic Report in APEX 4.1

    Hello Everybody,
    Probably there is a simpler way to do this, but I am not sure. I want a link on column header in Report on a specific column. The link will take me to new region or a page.
    How to achieve this in APEX 4.1
    Theme : Blue 2
    Database 11g
    I see there is a column link opiton, but that creates link for every row in that column on a specific icon, I just want link on a title of the column in Classic Report.
    For Example,
    if there are two columns Name and Client ID, which has 10 records to display on a classic report. I wan the link on Client ID on header only not on the records.
    Can anybody provide some simple solution for this.
    Thanks,
    --CP
    Edited by: cpora007 on Jun 22, 2012 10:38 AM

    Hello,
    I didn't understand, what do you mean by default it is going to sort popup. I have a classic report based on SQL, which generates a report with static header, there is no sort or any other link on that.
    I added a link in column header name with an anchor. It works and takes to the new page.
    But it is not a proper solution. A solution based on Jquery dynamic action is preferable. Also the preferred option is that the link opens a hidden region of the same page at the same location of the report and the report gets hidden. after the procession on the form region and submitting the update/ insert process. the report region shows up with the change data.
    Moving on to new page is 2nd option, if the first do not work.
    In the JavaScript, put: apex.submit("GO_TO_MY_OTHER_PAGE");
    On the page, create a Branch to the Second page. Set the condition to Request=Expression 1. Set the request to "GO_TO_MY_OTHER_PAGE"
    On which page I need to create a branch?, Is it on the report page or the form page.
    Thanks a lot for the response. I appreciate your kind efforts in this regard.
    --CP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Make header links in PPR report region

    I have a tabular form, and for several headers, I created a popup help page, and call the popup with a javascript function in the header. The html for my headers in the Report Attributes is as follows: <p>
    &#60;a title="Click for RAC Explanation" href="javascript:RAChelp();"&#62;RAC&#60;/a&#62;<p>
    However, when I hover over the link, the following shows up on the info bar at the bottom of the browser:<p>
    javascript:html_PPR_Report_page(this,'R3784527397717439',javascript:RAChelp();')<p>
    So when I click the header, I get this error message:<p>
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/htmldb/f HTTP-400 Missing '=' in query string or post form<p>
    What the heck is going on? Is there a way to get around this or do I need to abandon using a PPR Report region for this tabular form?<p>
    thanks!

    PPR or not, the standard UI convention for clicking on a report heading is to sort by that column!
    Besides, unless you have enabled column header sorting by checking the Sort checkbox under Report Attributes, the column header is not even a clickable link, so I dont see how it would show that html_PPR... link.
    If you have enabled column header sorting, the #COLUMN_HEADER# substitution string in the report template automatically embeds the sorting link markup around the column header you specify. So, you cannot specify a A tag as your column header since that would nest A tags (not allowed)
    Note this has nothing to do with PPR, it is a (undesirable) interaction between column header sorting and your wanting to have column headers show your own help window.
    Simple solution: Just turn off column header sorting for those columns and you should be fine.
    Hope this helps.

  • Item billing plans are not linked to Header billing plan

    Hi Experts,
    Now I am working on SAP CRM 7.0.
    Here we want to link Item Billing Plans to Header Billing Plan.
    When i am trying to attach Item Billing Plans to Header Billing Plan through Item level --> Item Billing Plan tab the option (Header Billing Plan check box) is disabled.
    Any one Could guide me how can we maitain the Header Billing Plan check box?
    Points will be added.
    Thanks,
    Regards,
    Babu

    plz let us know how it is done !

  • Portlet header title as a link

    Is it possible to make portlet headers title as a link and would be defined with my chosen URL?
    I've noticed that linking (whwn editing region) is used only for Customize, Help, About, Collapse/Restore...

    You can achieve this if you create portlets programmatically. When you draw the portlet header you can specify what links are available from that header (i.e. details/title, customize, help, and about).

  • Object Links fields grey for Production Order,BOM header,BOm item

    Hello Friends,
    1) In DMS Object links tab ,for objects BOM header,BOM item,Production order fields are grey even though necessary settings are done. Is this standard or I am missing some config.
    I did the similar settings for other objects like material master,vendor master,claim etc and I am able to assign these objects in Object links tab.
    2) In Production order I can assign the existing document but can't create document from Production order.I maintain value 1 in img Maintain screen for object link --> Auth.
    Define doc type --> Define object links --> create document = 2 ( Use Transaction to Create Document)
    I can create a document from other objects like Material Master,Claim,PO,PR with similar settings.
    Kindly help me in this regard
    Regards
    Abhijit A. Pachgade

    As u right said this is a standard.
    generally a document can be attched from the function T-code or from the DMS T-code cvo1n, through the object link tab page. * BOTH WAYS POSSIBLE*
    but for BOM, production order it is only one way, u can attach at the function T-code level like co01....ect  ONLY ONE WAY
    especially for PP transation, its one way
    REGARDS
    SURYA

  • Personalize link in Mast head

    Hi ,
    Can anyone guide me how to hide the User mapping tab from the user profile page of personalize link available in the mast head.
    When the user cliscks on the link personalize in the mast head , he can see the user profile page . I want to hide the user mapping tab from this page .
    Best Regards
    Sid

    Hi Siddhart,
    The Personalize option is a workset and linked to the Standard User Role.
    So just open the standard user role and select the User Profile page which is linked to the Personalize workset.
    The "User Profile" object is a Web Dynpro Application. So to customize it you can just press the preview button and in the preview page hold the "Control" key and right click on top of the "User Mapping" tab. You will find the option to hide the tab.
    To do this you need to have administrative access.
    Since you are changing SAP delivered role, I would recommend copying the role and making the changes to the copied (as delta link) role. You can then assign this role to the end users.
    This method is applicable to EP 7.0 and NW 2004s.
    Regards,
    Abhishek

  • How to put the header in excel file in GUI_DOWNLOAD

    Hi,
    I have a requirement , Which I m downloading the contents of internal table using the GUI_DOWNLOAD  in excel format, I need to keep the first line of the excel sheet as a header, Can any one suggest how to go for this,

    Hello,
    You can have the data in the data tab & field name in the field tab. And so you can download both the field name and the value for the same using the FM u2013 GUI_DOWNLOAD (File type should be u2018ASCu2019).
    Hope, you need additional information to be added as the header.
    One option: You can call the GUI_UPLOAD twice.
    First one with the header in the data tab.
    Second one with the option append = u2018Xu2019 with the actual data and header and pass the same above file name as input.
    Also, there is a solved forum already exists but with a different solution. You can go through the below link also:
    Re: GUI_DOWNLOAD with Header
    Regards,
    Selva K.

Maybe you are looking for