How to assign concatenated output to an item on page load

Hi,
I have a table that reads something like this
City Route
NewYork 2
NewYork 4
NewYork 5
London A
London B
Paris X1
I want to assign Routes (concatenated) to an item on page load... as an example for NewYork it should read like this
P2_ROUTE = 2, 4, 5
I am looking to do the above using query, something like this
select (concatenated route)
from Table_A
where
City = :P2_City
any suggestions how to concatenate variables.?

tparvaiz wrote:
I am looking to do the above using query, something like this
select (concatenated route)
from Table_A
where
City = :P2_City
any suggestions how to concatenate variables.?Yes. This is known as string aggregation, and there are many ways to do it. For example:
  Oracle 11.2; list length <= 4000 bytes
SQL> select
  2      l.city
  3    , listagg(d.department_id, ', ')
  4        within group (
  5          order by d.department_id) departments
  6  from
  7      locations l
  8        join departments d
  9          on l.location_id = d.location_id
10  group by
11*      l.city;
CITY                      DEPARTMENTS
Bern                      240
Bombay                      230
Geneva                      90, 100, 110, 120
Hiroshima                 170
London                      40, 260
Munich                      70
Oxford                      80
Seattle                  10, 30, 130, 140, 180, 190, 210, 250
South Brunswick             150, 160
South San Francisco            60
Southlake                 50
Stretford                 270
Tokyo                      220
Toronto                  20
Utrecht                  200
15 rows selected.
  Previous versions or 11.2 list length > 4000 bytes
SQL> select
  2      l.city
  3    , rtrim(
  4          xmlserialize(
  5           content
  6           xmlagg(
  7               xmlparse(content d.department_id || ', ')
  8               order by d.department_id))
  9        , ', ') departments
10  from
11      locations l
12        join departments d
13          on l.location_id = d.location_id
14  group by
15*      l.city;
CITY                      DEPARTMENTS
Bern                      240
Bombay                      230
Geneva                      90, 100, 110, 120
Hiroshima                 170
London                      40, 260
Munich                      70
Oxford                      80
Seattle                  10, 30, 130, 140, 180, 190, 210, 250
South Brunswick             150, 160
South San Francisco            60
Southlake                 50
Stretford                 270
Tokyo                      220
Toronto                  20
Utrecht                  200
15 rows selected.See Re: 4. How do I convert rows to columns? and here for more.

Similar Messages

  • How to assign an output type to a document via ABAP

    Hello Guru's
    I have an interface with a 3rd party system to send information from deliveries. When a delivery is created, we trigger output with 'Post goods issue' and output triggers the interface.
    We need to also trigger output with 'reverse goods issue' and here is the problem. When GI is cancelled I don't know how to trigger the interface having the control from Sales not from MM.
    I'm thinking to use the same approach assigning an output to the delivery in a user-exit of GI cancellation process. But I don't know how to assign this output to a delivery document using ABAP. I have looked for BAPI's or Functions but no successful.
    - Do you know how to assign outputs to documents via ABAP?
    - Do you have any other idea to trigger the interface when GI is cancelled?
    Thank you in advance,
    Manuel

    Hi,
    Guess u need to maintain it in SPAD transaction.
    Cheers
    VJ

  • How to assign an output type to an Output Device?

    How to assign an output type to an Output Device?
    I'm using SSF_GET_DEVICE_TYPE to get the device type. But for that device type there is no output device configured. How to do that one. I'm getting the output type as PDF1.
    Please help me.

    Hi,
    Guess u need to maintain it in SPAD transaction.
    Cheers
    VJ

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • How to assign the output of a function to a text area: a PLSQL challenge

    I have a function that returns a PLSQL table of varchar4(4000)
    Here is its signature in a package:
    create or replace package researcher_request_pk
    is
    TYPE query_table_type is table of varchar2(4000) index by binary_integer;
    FUNCTION RequestSQL(P_RRQ_ID in number) return query_table_type;
    end;
    I use this to get around the 32k limit on clobs and varchar2 variables
    I want to assign the output of the function to a text area. I've tried the following PLSQL in a dynamic action and also as the source attribute of the Text Area but it doesn't populate the text area.
    Here is the code i'm using
    declare
    v_table researcher_request_pk.query_table_type;
    begin
    v_table:=researcher_request_pk.RequestSQL(:P64_RRQ_ID);
    for i in 1..v_table.count loop
    htp.prn(v_table(i));
    end loop;
    end;
    Any ideas on the correct syntax to do this?
    thanks in advance
    PaulP

    Thanks for your reply
    The function does populate the PLSQL table with data. e.g. If I place that exact code in a PLSQL region it generates the output on the screen with no problems. The problem is just generating the output into the text area.
    I want the text area to display the output of the PLSQL table (-a dynamic select SQL statement) which I then plan to execute to return records.( i.e. I've build my own runtime query builder)
    My plan is to allow the user to edit the SQL output first before sending the statement for execution.
    Funnily enough I do get the very first word of the first cell appearing, namely 'SELECT' but nothing else. Maybe the "||" that follows has something to do with the rest of it not appearing?? hmmm... will experiment more.
    thanks
    PaulP

  • How to assign repairs procedure to the item category relevant for repairs ?

    I would like to know the steps to set up the following in the Customizing.
    Thanks for your input.
    "The repairs procedure has Set of rules according to which actions are generated in the repair order.
    It is assigned in Customizing to the item categories that are relevant for repairs processing and is adopted in the repair request item in the repair order. "

    Question answered

  • How to fix the time to refresh page items on Page load

    Hi all,
    When my pages load, some page items hidden are shown and when page load they are hidden again. Is there any way to keep it hidden without this time to refresh?
    Thanks
    Bsalvador

    bsalvador wrote:
    fac586,
    I tryed with:
    #P32_DATA_FINAL, label[for="#P32_DATA_FINAL"] {  
      display: none;  
    And only Page item was hidden. Label is still showing...could you help me?
    Thanks
    bsalvador
    Sorry, the "#" shouldn't appear in the attribute selector. There's probably a theme CSS rule with a higher specificity on the labels, so add an !important directive to the rule:
    #P32_DATA_FINAL, label[for="P32_DATA_FINAL"] {  
      display: none !important;  
    Always state which theme and template(s) you are using in a question about visual formatting or layout. Theme HTML/CSS is not always—historically never—consistent, so we need to know this information in order to determine which selectors to use.

  • How to Set icon/image programatically in ADF before page loads

    This is my UI:
    Depends on the condition i want to set icon/image programatically in my java code.Before page load im calling this method.
    So i couldnt take binding value also,it throws null pointer exception.Then i tried setting icon/image programatically.
    <af:commandImageLink text="settings" icon="#{bean.iconsettings}" binding="#{bean.bind}"> </af:commandImageLink>
    My bean:
    private RichIcon iconsettings;(its getters and setters)
    private void method(){                         // method
    if(cond){
    this.iconsettings="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else
    this.iconsettings="/images/19.jpg";
    Could any one tell me how can i set icon/image in java code.Before page loads im performing all above said tasks.Please help.

    Well, you set the icon property to a bean method, which you have done. The bean method however need to have the signature
    public String getIconsetting()
    // your code returning hte path to the icon
    if(cond){
         return ="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else {
         return ="/images/19.jpg";
    The bindproperty is not needed, remove it and remove the RichIcon Iconsettings too´as it's not needed to and is the wrong type anyway.
    Timo

  • How to assign batch to BOM line item when creating PO

    Hi Experts,
                  Programmatically i am creating PO using BAPI_PO_CREATE, for the line item  material of PO their is BOM, i am able to get the BOM for each material, but  struggling to find where can i assign Batch to the BOM line item material.
    Thanks in advance
    Thanks,
    Nitesh

    Even though the ORDCHG message contains all three line items, it should also contain qualifiers that tell you Supplier whether the line is new, changed, deleted etc. If your Supplier has SAP, it should just work.
    Cheers, Paul.

  • How to assign Surround output to stereo track

    Question says it. Does anyone know how to do this?

    Right, it doesn't change in the Inspector as well.
    Here's what I did. I had just installed Logic for the first time yesterday. I have an 828MKIII as my i/o. That was already set under Core Audio output. I created a new project and chose the empty project from templates. I then chose 1 audio track from the next dialog. I tried from there to choose a surround output, but it would only let me choose from a set of stereo outputs, i.e., Output 9-10 which is the 828's Main Out 1-2. So I chose that.
    At that point, I tried to change it from both the fader and the inspector, to no avail.
    EDITED: Spoke too soon. I recreated the project from scratch and I must have done something different the first time, because this time, from the inspector, I was able to choose surround.
    So thanks, guys

  • How to assign a iview to more than one page at a same time

    Hi Experts,
    I have created 40 pages. I have to assign ivews to these pages. One of the iviews is common to all the pages. Going to each page and assigning the iview to that page will take alot of time. Is there a way in which i can add an iview to more than one page at the same time?
    Thanks in advance,
    Prisford Pereira.

    Hi
    You can do that using XML Content and Actions.
    You can write XML in specified format and upload it to portal, that will automatically create the content for you in PCD. You can create iviews, pages, assign iviews to pages etc.
    More details are available at the how to guide.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207a2141-c870-2910-e080-90c920b24f47|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207a2141-c870-2910-e080-90c920b24f47]
    Hope this helps.
    Best regards,
    Ritesh Chopra

  • How do i alphabetize a list of items in pages

    I need to alphabetize a list of item sin pages

    Best to ask in the Pages forum!
    https://discussions.apple.com/community/iwork/pages

  • Need to hide an Item at page load

    Hi,
    Can anyone help me to hide an item when the page is loaded. I want to display the Item when i click the GO button.
    Thanks in Advance.
    Edited by: [email protected] on Apr 15, 2009 10:25 PM

    Hi Pratap,
    processRequest is working correctly.
    In processFormRequest
    oambean.setRendered(true); is not working.
    In the page i get developer mode exception Error.
    Error - (This developer mode error is thrown instead of being registered due to the lack of the page context object.) The OA passivation framework coding standard has been violated. Web bean properties cannot be modified in the controller processFormData or processFormRequest method. Web bean properties should be modified in the processRequest method only. An attempt to modify a web bean has been made in the following call stack: java.lang.Throwable at oracle.apps.fnd.framework.OACommonUtils.getCallStack(OACommonUtils.java:785) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setAttributeValue(OAWebBeanHelper.java:1707) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setAttributeValue(OAWebBeanHelper.java:1725) at oracle.apps.fnd.framework.webui.OAWebBeanFormElementHelper.setAttributeValue(OAWebBeanFormElementHelper.java:1983) at oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean.setAttributeValue(OAMessageTextInputBean.java:287) at oracle.cabo.ui.BaseMutableUINode.setRendered(Unknown Source) at oracle.cabo.ui.beans.BaseWebBean.setRendered(Unknown Source) at oracle.apps.ak.search.webui.SearchCO.processFormRequest(SearchCO.java:54) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384) at OA.jspService(OA.jsp:40) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803) at java.lang.Thread.run(Thread.java:534)

  • How can I time the speed at which a page loads?

    Hi,
    I've tested my internet connection speed with a download test from CNET, but I was wondering if there was a stopwatch, that would record the time it took to open a page. Anybody heard of such a thing?
    Thanks,
    Rob

    Hi
    View Menu>Status Bar, select it.
    You'll see the page load on the left, time load on the right.
    Message was edited by: Hawaiian_Starman
    Opps - now I'm too fast!
    With Firefox open, enter http://fasterfox.mozdev.org/installation.html in the URL window. This will install this add-on to the browser providing the time load indicator.

  • How to assign output type and trigger printing in ABAP

    hi all,
    i have create invoice by using BAPI_BILLINGDOC_CREATEMULTIPLE and create header/item text with CREATE_TEXT.
    please advise how to assign the output type and trigger immediate printing after this.
    thanks.

    Hi Reetha ,
    This is a functional setting  , and should be done by some functional guy. The setting can be done by NACE.
    Just follow the path : NACE - > Select V3 for Billing - > Press Output type Button Just above - > Assign Output Type and
    then Assign Output program and form in PROCESSING ROUTINE comes into left. Set this output type for immediate print.
    Whenever You create a billing document by BAPI with this document type , the print out will be fired immediately.
    Hope it will solve your problem.
    Thanks.

Maybe you are looking for

  • SO_OBJECT_SEND??

    HI I want to know that what exactly is the purpose of the function module --> SO_OBJECT_SEND. And how can I test this FM in my server? Also where to check the e-mails of a person in SAP? Thanks

  • Best way to scan multiple images

    Hi there, I am new tp Photoshop and have a project already that I want to do with Ps, but am unsure of the best way to go abut ahceivng what I want... I want to scan all my older photo's, crop & straighten them for later use in a slide project done i

  • Spry Tabbed Panel 2.0 Suggestions/Questions

    I've been starting to play around with the Widget Browser on CS4 & CS5 and I am just noticing a few things that I think need to be looked at. 1. I am starting to understand your process for the UI (I actually never realized that was there at first, b

  • Solaris10 Installation inside VirtualBox 2.1.0

    Hi: I posted this question in the wrong forum ... Environment: Host OS: Windows XP Virtual Box: Ver 2.1.0 Current Status: 1) Solaris Vol1 (CD1) is installed and works fine. Problem: 1) Installing the rest of the vol's after initial installation? 2) H

  • Exchange 2010 DB maintenance

    Hello, Environment : Exchange 2010 sp3 ru3 in DAG We have a exchange database which is having about 300GB of whitespace. The database is having about 200 mailboxes and the avaerage mailbox size is 1GB. We ensured that online maintenance was run compl