How to display data as separate clumns when db data is as different rows

Hi,
I think i have been confusing the group with UI details.
The basic requirement is " To display the data as columns which is present as rows in the table"
For example : For customer 1 ,there are 4 accounts. This info is available in the db table as 4 rows.
But the OAF display has to be like customer <<account 1 name>><<account 2  name>><<account 3 name>><<account 4 name>>
Also these needs to be advanced table in advanced table in the same feature.
Also all the account name columns are dynamic. There can be 3 accounts for one case and 4 for other and hence needs to be built in CO and cant be defined.
Please advise how do i code different row data as columnar data in a table or advanced table in oaf.
Does this description help you to help me .
Thanks,
Rma

Hi Rma,
Please try something like this:
drop table t_;
create table t_ (
nm Varchar2(20),
pr Char ( 7),
vl Number
insert into t_ values ('company 1','2003-06', 10);
insert into t_ values ('company 1','2003-07', 29);
insert into t_ values ('company 1','2003-08', 39);
insert into t_ values ('company 1','2003-09', 41);
insert into t_ values ('company 1','2003-10', 22);
insert into t_ values ('company 2','2003-06', 13);
insert into t_ values ('company 2','2003-07', 17);
insert into t_ values ('company 2','2003-08', 61);
insert into t_ values ('company 2','2003-09', 55);
insert into t_ values ('company 2','2003-10', 71);
insert into t_ values ('company 3','2003-06', 33);
insert into t_ values ('company 3','2003-07', 18);
insert into t_ values ('company 3','2003-08', 27);
insert into t_ values ('company 3','2003-09', 5);
insert into t_ values ('company 3','2003-10', 32);
select
nm,
jul,
aug,
sep,
jul+aug+sep "Total"
from (
select
nm,
max(case when pr='2003-07' then vl else null end) jul,
max(case when pr='2003-08' then vl else null end) aug,
max(case when pr='2003-09' then vl else null end) sep
from
t_
group by
nm);
This query returns:
NM JUL AUG SEP Total
company 1 29 39 41 109
company 2 17 61 55 133
company 3 18 27 5 50
I took this from http://www.adp-gmbh.ch/ora/sql/examples/pivot.html
Regards,
Reetesh Sharma

Similar Messages

  • How to display data from 2 different groups in a single table

    Hi,
    Following is the requirement:
    The XML Content is below
    ListOf_ssAssetMgmtAsset>
    -<ssAssetMgmtAsset>
    <ssAccountName>1-1D09-83031</ssAccountName>
    <ssAccountPrimaryCountry>USA</ssAccountPrimaryCountry>
    <ssAssetNumber>13111027</ssAssetNumber>
    <ssNaiAssetNumber>123</ssNaiAssetNumber>
    <ssNaiGrantNumber>ABC</ssNaiGrantNumber>
    <ssNaiProductType>System Security Software</ssNaiProductType>
    <ssNaiSuperceded>123</ssNaiSuperceded>
    <ssProductDescription>Upgrade extract local DB</ssProductDescription>
    <ssProductName>1-1M5H-296</ssProductName>
    <ssStatus>ABC</ssStatus>
    <ssId>1X-ZY</ssId>
    <ssCreated>01/01/1980</ssCreated>
    <ssUpdated>01/01/1980</ssUpdated>
    <ssCreatedBy>1X-ZY</ssCreatedBy>
    <ssUpdatedBy>1X-ZY</ssUpdatedBy>
    -<ListOf_ssAgreementEntitlement>
    -<ssAgreementEntitlement>
    <ssEntitlementEndDate>16/12/2009</ssEntitlementEndDate>
    <ssEntitlementStartDate>16/11/2009</ssEntitlementStartDate>
    <ssEntitlementType>Services</ssEntitlementType>
    <ssNaiQuantity>2</ssNaiQuantity>
    </ssAgreementEntitlement>
    </ListOf_ssAgreementEntitlement>
    -<ListOf_ssAgreementEntitlement>
    -<ssAgreementEntitlement>
    <ssEntitlementEndDate>10/12/2009</ssEntitlementEndDate>
    <ssEntitlementStartDate>10/11/2009</ssEntitlementStartDate>
    <ssEntitlementType>ServicePortal</ssEntitlementType>
    <ssNaiQuantity>1</ssNaiQuantity>
    </ssAgreementEntitlement>
    </ListOf_ssAgreementEntitlement>
    </ssAssetMgmtAsset>
    </ListOf_ssAssetMgmtAsset>
    The data needs to be displayed in the below manner where first grouping is by Account Country, then by Account Name. Then the table with 9 columns where in the first 5 columns are from first group and the next 4 are from second group.
    Account Country
    Account Name
         ProductType     Grant #     Asset #     Product SKU Product Name Entitlement Type Quantity /Nodes     EntitlementStart Date     Entitlement EndDate
    I have the coding as
    first for loop: <?for-each-group:ssAssetMgmtAsset;./ssAccountPrimaryCountry?>
    second for loop: <?for-each-group:current-group();./ssAccountName?>
    third which is for the table : <?for-each:current-group()?>
    I close the above grp after product description.
    One table with the first 5 columns and below second table is placed adjacent to the first to display the 4 columns with the grp <?for-each:ssAgreementEntitlement?>
    how do I get all the 9 columns in a single row in a single table.
    Any help is appreciated.
    thanks

    What is the lnk between the two
    ssAssetMgmtAsset and ssAgreementEntitlement ?
    you want to display all the ssAgreementEntitlement for every ssAssetMgmtAsset group ?
    there shud be a link between them, you have link them and display.

  • How to display data in the same row

    Hi i have a data like this
    sales_order_no shipped_amount aggregate_source_order_num
    1 10000 sao/1
    1 10000 sao/2
    2 10000 sao/4
    2 10000 sao/5
    2 10000 sao/6
    now i want to disply like this:
    sales_order_no shipped_amount aggregate_source_order_num
    1 10000 sao/1,sao/2
    2 10000 sao/4,sao/5,sao/6
    can anybody help me how to do it??
    i really appreciate your help.

    or
    SQL> set linesize 120;
    SQL> with sales_order as
      2   (select 1 sales_order_no, 10000 shipped_amount, 'sao/1' aggregate_source_order_num from dual union all
      3    select 1 sales_order_no, 10000 shipped_amount, 'sao/2' aggregate_source_order_num from dual union all
      4    select 2 sales_order_no, 10000 shipped_amount, 'sao/4' aggregate_source_order_num from dual union all
      5    select 2 sales_order_no, 10000 shipped_amount, 'sao/5' aggregate_source_order_num from dual union all
      6    select 2 sales_order_no, 10000 shipped_amount, 'sao/6' aggregate_source_order_num from dual)
      7  select so.sales_order_no,
      8         so.shipped_amount,
      9         substr(max(substr(sys_connect_by_path(so.aggregate_source_order_num,','),2)),1,60) aggregate_source_order_num
    10    from (select sales_order_no,
    11                 shipped_amount,
    12                 aggregate_source_order_num,
    13                 row_number() over (partition by sales_order_no, shipped_amount
    14                                    order by sales_order_no, shipped_amount) rn
    15            from sales_order) so
    16  start with so.rn = 1
    17  connect by so.rn = prior so.rn + 1
    18  and prior so.sales_order_no = so.sales_order_no
    19  group by so.sales_order_no,
    20           so.shipped_amount;
    SALES_ORDER_NO SHIPPED_AMOUNT AGGREGATE_SOURCE_ORDER_NUM
                 1          10000 sao/1,sao/2
                 2          10000 sao/4,sao/5,sao/6
    SQL>

  • How to display data in ComboBox when click on DataGrid Row.

    Hi!
         I am new to Adobe Flex. I am building one Project that was related to Comapny and Customer. First I created Company Master. Then I create Customer Master successfully and My Backkend is SQLite Database.
         My Problem is I have two files one is CustomerMaster and second one is CustomerForm.
         In CustomerMaster I have a datagrid in that data was displaying thru Array Collection. When ever we doublick on datagrid row it's displayed a CompanyForm. CompanyForm  contains TextFiled and ComboBox. TextFiled populating data but Combobox doesnot. It display always prompt message.
          Please help.
    Thanks,
    Sree Kumar

    Hi! Vibhuti Gosavi,
                          First of all thanks for your quick reply. Already I saw that link.
    Actually, In CustomerForm successfully store the information into the database. While retrieving the data problem cames. Sample Code:
    CustomerMaster:
    private function createItem():void
                                            openTab(new Object());
                                  public function openTab(customer:Object):void
                                            var children:Array = tn.getChildren();
                                            var length:int = children.length;
                                            for (var i:int = 0; i<length; i++)
                                                      if (children[i].customer.customerId == customer.customerId)
                                                                tn.selectedIndex = i;
                                                                return;
                                            var form:CustomerForm = new CustomerForm();
                                            tn.addChild(form);
                                            form.customer = customer;
                                            form.dao = dao;
                                            form.addEventListener(CustomerEvent.CREATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.UPDATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.DELETE, customerChangeHandler),
                                                      tn.selectedChild = form;
                                  private function customerChangeHandler(event:CustomerEvent):void
                                            customerArrayList = dao.findByCustomerAll();
                                            if (event.type == CustomerEvent.DELETE)
                                                      tn.removeChild(event.target as CustomerForm);
                        ]]>
              </fx:Script>
              <mx:Canvas id="container" left="12" right="12" top="12" bottom="12">
                        <mx:Canvas left="0" top="2" right="0" height="33">
                                  <mx:Button id="AddCustomer" x="1" width="108" height="32" click="createItem()"
                                                         icon="@Embed('assets/icon_plus.png')" label="Add Customer" toolTip="Add Customer"
                                                         verticalCenter="-1"/>
                        </mx:Canvas>
                        <code:SuperTabNavigator id="tn" x="0" y="39" width="681" height="197"/>
                        <mx:DataGrid id="customerList" x="1" y="262" width="680" height="231"
                                                       dataProvider="{customerArrayList}"
                                                       doubleClick="openTab(customerList.selectedItem)" doubleClickEnabled="true">
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="customerId" headerText="Id"/>
                                            <mx:DataGridColumn dataField="customerName" headerText="Name" />
                                            <mx:DataGridColumn dataField="companyName" headerText="companyName" />
                                  </mx:columns>
                        </mx:DataGrid>
              </mx:Canvas>
    CustomerForm:
    public function set customer(customer:Object):void
                                            this._customer = customer;
                                  public function get customer():Object
                                            return this._customer;
                                  private function saveCustomer():void
                                            if (Validator.validateAll(customerValidators).length>0)
                                                      return;
                                            _customer.customerName = customerName.text;
                                             _customer.companyName = companyName.text;
                                            if (_customer.customerId > 0)
                                                      updateCustomer();
                                            else
                                                      insertCustomer();
                                  private function insertCustomer():void
                                            try
                                                      Alert.show(_customer.normalPkts);
                                                      dao.insertCustomer(_customer);
                                                      customerId.text = _customer.customerId;
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.CREATE, _customer, true));
                                                      var alertText:String="Company Created Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorCreate:String="Company not Created...";
                                                      Alert.show(alertErrorCreate+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function updateCustomer():void
                                            try
                                                      dao.updateCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.UPDATE, _customer, true));
                                                      var alertText:String="Company Updated Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorText:String="Company not Updated...";
                                                      Alert.show(alertErrorText+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function deleteItem():void
                                            try
                                                      dao.deleteCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.DELETE, _customer, true));
                                            catch (error:SQLError)
                                                      Alert.show(error.details, "Error");
                        ]]>
              </mx:Script>
       <mx:Grid x="10" y="10" width="665" height="130" verticalAlign="middle">
                        <mx:GridRow width="665" height="100%">
                                  <mx:GridItem width="85" height="100%">
                                            <mx:Label width="85" text="Customer Id:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="115" height="100%">
                                            <mx:TextInput id="customerId" text="{_customer.customerId}" editable="false" width="115"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="102" height="100%">
                                            <mx:Label width="102" text="Company Name:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="100" height="100%">
                                            <mx:ComboBox id="companyName" dataProvider="{companyIdList}" labelField="companyName"
                                                                           prompt="Select..." text="{_customer.companyName}" width="100"/>
                                  </mx:GridItem>
                          <mx:GridItem width="230" height="100%" horizontalAlign="center" verticalAlign="middle">
                                            <mx:Button label="Save" click="saveCustomer()"/>
                                            <mx:Button label="Delete" click="deleteItem()"/>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
    =====================================================================
    I have two ArrayCollections 1) companyIdList (CustomerForm)
                                              2) customerArrayList(CustomerMaster)
    please go through the bold text. Please focus on two dataProviders. These dataproviders are binding for One Combo Field.
    Thanks,
    Sree Kumar
    Message was edited by: sreekumar1976

  • How to display data from a recordset based on data from another recordset

    How to display data from a recordset based on data from
    another recordset.
    What I would like to do is as follows:
    I have a fantasy hockey league website. For each team I have
    a team page (clubhouse) which is generated using PHP/MySQL. The one
    area I would like to clean up is the displaying of the divisional
    standings on the right side. As of right now, I use a URL variable
    (division = id2) to grab the needed data, which works ok. What I
    want to do is clean up the url abit.
    So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
    I want is clubhouse.php?team=Wings.
    I have a separate table, that has the teams entire
    information (full team name, short team, abbreviation, conference,
    division, etc. so I was thinking if I could somehow do this:
    Recordset Team Info is filtered using URL variable team
    (short team). Based on what team equals, it would then insert this
    variable into the Divisional Standings recordset.
    So example: If I type in clubhouse.php?team=Wings, the Team
    Info recordset would bring up the Pacific division. Then 'Pacific'
    would be inserted into the Divisional Standings recordset to
    display the Pacific Division Standings.
    Basically I want this
    SELECT *
    FROM standings
    WHERE division = <teaminfo.division>
    ORDER BY pts DESC
    Could someone help me, thank you.

    Assuming two tables- teamtable and standings:
    teamtable - which has entire info about the team and has a
    field called
    "div" which has the division name say "pacific" and you want
    to use this
    name to get corresponding details from the other table.
    standings - which has a field called "division" which you
    want to use to
    give the standings
    SELECT * FROM standings AS st, teamtable AS t
    WHERE st.division = t.div
    ORDER BY pts DESC
    Instead of * you could be specific on what fields you want to
    select ..
    something like
    SELECT st.id AS id, st.position AS position, st.teamname AS
    team
    You cannot lose until you give up !!!
    "Leburn98" <[email protected]> wrote in
    message
    news:[email protected]...
    > How to display data from a recordset based on data from
    another recordset.
    >
    > What I would like to do is as follows:
    >
    > I have a fantasy hockey league website. For each team I
    have a team page
    > (clubhouse) which is generated using PHP/MySQL. The one
    area I would like
    > to
    > clean up is the displaying of the divisional standings
    on the right side.
    > As of
    > right now, I use a URL variable (division = id2) to grab
    the needed data,
    > which
    > works ok. What I want to do is clean up the url abit.
    >
    > So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
    > all
    > I want is clubhouse.php?team=Wings.
    >
    > I have a separate table, that has the teams entire
    information (full team
    > name, short team, abbreviation, conference, division,
    etc. so I was
    > thinking if
    > I could somehow do this:
    >
    > Recordset Team Info is filtered using URL variable team
    (short team).
    > Based on
    > what team equals, it would then insert this variable
    into the Divisional
    > Standings recordset.
    >
    > So example: If I type in clubhouse.php?team=Wings, the
    Team Info recordset
    > would bring up the Pacific division. Then 'Pacific'
    would be inserted into
    > the
    > Divisional Standings recordset to display the Pacific
    Division Standings.
    >
    > Basically I want this
    >
    > SELECT *
    > FROM standings
    > WHERE division = <teaminfo.division>
    > ORDER BY pts DESC
    >
    > Could someone help me, thank you.
    >

  • How to display data in table

    Hi all,
    can any one tell me how to display data in a table when user click on a button. i have created a node with a set of fields from different tables now how to write the logic to display data in that table.
    Thanks & Regards,
    Naveen

    DATA lo_nd_professionaltable TYPE REF TO if_wd_context_node.
      DATA lo_el_professionaltable TYPE REF TO if_wd_context_element.
      DATA ls_professionaltable TYPE wd_this->ElementS_professionaltable. "internaltable
    TYPES: BEGIN OF TY_PFTAB,
           RATEGROUP TYPE /BIC/OIWRATEGRP,
           LEVEL TYPE /BIC/OIWPCSLEVEL,
           FROMDATE TYPE /BI0/OIDATEFROM,
           FROMTO TYPE /BI0/OIDATETO,
           STANDARD TYPE /BIC/OIWSTRATE,
           OVERHEAD1 TYPE /BIC/OIWOHRTE1,
           OVERHEAD2 TYPE /BIC/OIWOHRTE2,
           OVERHEAD3 TYPE /BIC/OIWOHRTE3,
           EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
           END OF TY_PFTAB.
    DATA : IT_PFTABLE TYPE STANDARD TABLE OF TY_PFTAB,
           WA_PFTAB TYPE TY_PFTAB.
    SELECT /BIC/WRATEGRP /BIC/WPCSLEVEL DATEFROM DATETO /BIC/WSTRATE /BIC/WOHRTE1 /BIC/WOHRTE2 /BIC/WOHRTE3
    FROM /BIC/AGLDCPRTS00 INTO TABLE IT_PFTABLE.
    *TYPES : BEGIN OF TY_EXCEPTION,
           EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
           END OF TY_EXCEPTION.
    *DATA : IT_EXTABLE TYPE STANDARD TABLE OF TY_EXCEPTION,
          WA_EXTABLE TYPE IT_EXTABLE.
    *SELECT /BIC/MSECFILER FROM /BIC/AGLDCLMLT00 INTO TABLE IT_EXTABLE.
    navigate from <CONTEXT> to <PROFESSIONALTABLE> via lead selection
      lo_nd_professionaltable = wd_context->get_child_node( name = wd_this->wdctx_professionaltable ).
    get element via lead selection
      lo_el_professionaltable = lo_nd_professionaltable->get_element( ).
    @TODO handle not set lead selection
    IF lo_el_professionaltable IS INITIAL.
    ENDIF.
    get all declared attributes
    lo_el_professionaltable->get_static_attributes(
       IMPORTING
         static_attributes = ls_professionaltable ).
    lo_nd_professionaltable->bind_table( new_items = IT_PFTABLE set_initial_elements = abap_false ).

  • How to display data depend upon ListBox value?

    Hi Experts and Particularly Hema,
    As I asked before how to display data in the ListBox, I got an very good response from you all(particularly Hema) .
    Now what my doubt is asked with sample scenario below:
    In Screen Painter -
    Two fields namely : One List Box and other is I/O used only for displaying purpose i.e., only for output, not for input purpose.
    List Box is filled by primary key field(C1) value from one table(T1) when the screen load.(i.e., such code is written in PBO).
    Now what I need is :
    If the user select any one value in the List Box then it automatically display the corresponding C2 value from T1 in the I/O field.
    I think you may all understand what I am trying to ask.Please let me know the solution.
    Thanks in advance,
    Regards,
    Raghu

    Simply attached a function code for the listbox... when the user changes the value, you will be able to pick this up in the PAI and loop back to the PBO and redisplay the corresponding output field.
    Jonathan

  • How to display subtotals in separate column in alv report?

    hi,
    I am displayed the subtotals  for QUantity field BDMNG in Reuse_alv_grid_display  in the same column.
    but I want to display subtotal in separate column.
    How to display subtotals in separate column in alv report?
    thanks&regards.
    samba.k

    Hi
    As far as i know you can't do this,the option you have is to create one more column (subtotal) and populate it by manual calculation at every subtotal (not alv subtotal but yours) .
    Best Regards
    Yossi

  • How to display data elements in the tempalte header

    Hello friends
    i've this date_from and date_to parameters which are date parameters that user enters..
    based on these date parameters I want to display them in the header as
    day of date_from(for example if the date_from is 13-nov-2010.then I should display 13)and for date_to it should dispaly as 15 if for example the user enters
    16-nov-2010.(date-1's day)
    so it should break down to
    date_from-13-nov-2010, 13
    date_to- 16-nov-2010, 15
    I want these two values to be displayed in the header of the template how to do this
    pls help
    also let me know how to display data elements in the template header
    Edited by: erp on Dec 22, 2010 12:44 AM

    Hi Ananth..Thanks for ur timely reply
    Can I use it with <? substring(':date_from',1,2)?>
    where date_from is an input parameter which user enters at the run time of the report.
    I've to capture the date entered by the user and print it in the header..
    Pls reply

  • How to display Date Calendar in Oracle BI Answers Prompts (parameter)

    I'm still new to OBIEE.
    How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
    Thanks.

    Hi,
    While creating Dash Board prompt choose the control to 'Calendar'.
    I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
    It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
    Go to: Column Properties --> Data Format
    Choose override default data format to view the available options in the drop down list.
    I would be very happy if anybody acknowledge me that I am wrong.
    -Vency

  • How to display date and time on jsf page

    Hi,
    how to display date and time on jsf page
    we are using 11.2.0.0 jdeveloper on windows.
    thanks
    Edited by: user12187801 on 26-Jul-2012 01:42

    Your question is certainly lacking some information.
    If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
    If you meant something else, then it's back to you to explain.

  • How to display data with the same text and key in the drop down list?

    Hi All,
    Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    REPORT ZTESTING.
    TYPE-POOLS: VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST,
          c(20) type c.
    *      c = 'select any'.
    data:begin of itab occurs 0,
          kunnr like kna1-kunnr,
          name1 like kna1-name1,
         end of itab.
    data:begin of jtab occurs 0,
          kunnr like kna1-kunnr,
          land1 like kna1-land1,
         end of jtab.
    PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
                              default 'SELECT'.
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'p_list'.
    VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    APPEND VALUE TO LIST.
    VALUE-KEY = '2'.
    VALUE-TEXT = 'Country'.
    APPEND VALUE TO LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    start-of-selection.
    select kunnr name1 up to 20 rows from kna1 into table itab.
    select kunnr land1 up to 20 rows from kna1 into table jtab.
    case p_list.
    when '1'.
    loop at itab.
    write:/ itab-kunnr,itab-name1.
    endloop.
    when '2'.
    loop at jtab.
    write:/ jtab-kunnr,jtab-land1.
    endloop.
    endcase.
    <Added code tags>
    Moderator Message: Please use the "code" tags to format your code snippet.
    Edited by: Suhas Saha on Nov 17, 2011 11:19 AM

    shawnTan wrote:
    Hi All,
    >
    > Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    >
    >
    REPORT ZTESTING.
    >
    > TYPE-POOLS: VRM.
    >
    > DATA: NAME  TYPE VRM_ID,
    >       LIST  TYPE VRM_VALUES,
    >       VALUE LIKE LINE OF LIST,
    >       c(20) type c.
    >
    > *      c = 'select any'.
    >
    > data:begin of itab occurs 0,
    >       kunnr like kna1-kunnr,
    >       name1 like kna1-name1,
    >      end of itab.
    >
    > data:begin of jtab occurs 0,
    >       kunnr like kna1-kunnr,
    >       land1 like kna1-land1,
    >      end of jtab.
    >
    > PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
    >                           default 'SELECT'.
    >
    > AT SELECTION-SCREEN OUTPUT.
    >
    > NAME = 'p_list'.
    >
    > VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    > VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    > APPEND VALUE TO LIST.
    >
    > VALUE-KEY = '2'.
    > VALUE-TEXT = 'Country'.
    > APPEND VALUE TO LIST.
    >
    > CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    >
    > start-of-selection.
    > select kunnr name1 up to 20 rows from kna1 into table itab.
    > select kunnr land1 up to 20 rows from kna1 into table jtab.
    >
    > case p_list.
    > when '1'.
    > loop at itab.
    > write:/ itab-kunnr,itab-name1.
    > endloop.
    >
    > when '2'.
    > loop at jtab.
    > write:/ jtab-kunnr,jtab-land1.
    > endloop.
    > endcase.
    >
    > <Added code tags>
    >
    > Moderator Message: Please use the "code" tags to format your code snippet.
    >
    > Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
    This surely seems to be a bug to me(if not by design),  did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
    -Rajesh.

  • How to display dates in half-months?

    How can I display dates in half-months from dim_date table? like shown below:
    Assume that 8/14/2012 is current date..
    07/15 - 07/30 - no. of opties created between those dates
    07/01 - 07/14 - no. of opties created
    06/15 - 06/30 - ...
    06/01- 06/14 - ...
    How can display the dates in those buckets? Any ideas appreciated.
    Thanks in adv.

    Try to build the same in RPD using the below sql.
    I've created a Flag based on W_DAY_D."DAY_OF_MONTH" <= 14 then 'F' else 'S' end
    in answers I've got min and max based on exp: min(Time."Row Wid" by Time.Flag)
    WITH
    SAWITH0 AS (select distinct T31328."PER_NAME_MONTH" as c1,
    case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end as c2
    from
    "W_DAY_D" T31328 /* Dim_W_DAY_D_Common */
    where ( T31328."PER_NAME_YEAR" = '2012' ) ),
    SAWITH1 AS (select min(T31328."ROW_WID") as c1,
    max(T31328."ROW_WID") as c2,
    case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end as c3
    from
    "W_DAY_D" T31328 /* Dim_W_DAY_D_Common */
    where ( T31328."PER_NAME_YEAR" = '2012' )
    group by case when T31328."DAY_OF_MONTH" <= 14 then 'F' else 'S' end )
    select distinct SAWITH0.c1 as c1,
    case when SAWITH0.c2 is not null then SAWITH0.c2 when SAWITH1.c3 is not null then SAWITH1.c3 end as c2,
    SAWITH1.c1 as c3,
    SAWITH1.c2 as c4
    from
    SAWITH0 full outer join SAWITH1 On SAWITH0.c2 = SAWITH1.c3
    Hope this helps, pls mark

  • How to display data horizontally

    Hi,
    I have to display data the following format.
    sales order item description 01/09/2010 02/09/2010 03/09/2010
    100              1         test         3                     4                6
    in currently i am displaying the following format.
    sales order  date1 date2 date3
    item
    description
    1.how to fill field catelog.
    2. i have written code like below,
    wa_lvc_cat-fieldname = 'COLUMNTEXT'.
      wa_lvc_cat-ref_table = 'LVC_S_DETA'.
      APPEND wa_lvc_cat TO lt_lvc_cat.
      wa_fieldcat-fieldname = 'COLUMNTEXT'.
      wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
      wa_fieldcat-key  = 'X'.
      APPEND wa_fieldcat TO lt_fieldcat.
      DESCRIBE TABLE i_final.
      DO sy-tfill TIMES.
      For each line, a column 'VALUEx' is created in the fieldcatalog
      Build Fieldcatalog
        WRITE sy-index TO wa_lvc_cat-fieldname LEFT-JUSTIFIED.
        CONCATENATE 'VALUE' wa_lvc_cat-fieldname
               INTO wa_lvc_cat-fieldname.
        wa_lvc_cat-ref_field = 'VALUE'.
        wa_lvc_cat-ref_table = 'LVC_S_DETA'.
        APPEND wa_lvc_cat TO lt_lvc_cat.
      Build Fieldcatalog
        CLEAR wa_fieldcat.
        wa_fieldcat-fieldname = wa_lvc_cat-fieldname.
        wa_fieldcat-ref_fieldname = 'VALUE'.
        wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
        APPEND wa_fieldcat TO lt_fieldcat.
      ENDDO.
    create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
                it_fieldcatalog = lt_lvc_cat
        IMPORTING
          ep_table        = l_dyntable.
      ASSIGN l_dyntable->* TO <dynamictable>.
    create structure as structure of the internal table
      CREATE DATA l_structure LIKE LINE OF <dynamictable>.
      ASSIGN l_structure->* TO <header>.
    create structure = structure of the internal table
      CREATE DATA l_structure LIKE i_final.
      ASSIGN l_structure->* TO <ls_table>.
    create field catalog from our table structure
    wa_fieldcat-fieldname = 'DATE'.
    wa_fieldcat-tabname = 'I_FINAL'.
    APPEND wa_fieldcat TO lt_fieldcatalogue.
    wa_fieldcat-fieldname = 'CNT'.
    wa_fieldcat-tabname = 'I_FINAL'.
    APPEND wa_fieldcat TO lt_fieldcatalogue.
    wa_fieldcat-fieldname = 'FUNCT'.
    wa_fieldcat-tabname = 'I_FINAL'.
    APPEND wa_fieldcat TO lt_fieldcatalogue.
      wa_fieldcat-fieldname = 'ITEM'.
      wa_fieldcat-tabname = 'I_FINAL'.
      APPEND wa_fieldcat TO lt_fieldcatalogue.
      wa_fieldcat-fieldname = 'TRANS'.
      wa_fieldcat-tabname = 'I_FINAL'.
      APPEND wa_fieldcat TO lt_fieldcatalogue.
    *call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
       i_structure_name       = <LS_TABLE>
    changing
       ct_fieldcat            = lt_fieldcatalogue
    exceptions
       inconsistent_interface = 1
       program_error          = 2
       others                 = 3.
    *IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *ENDIF.
      DESCRIBE TABLE lt_fieldcatalogue.
    fill the internal to display <dynamictable>
      DO sy-tfill TIMES.
        IF sy-index = 1.
          READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX 1.
        ENDIF.
      For each field of it_table
        ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <dynheader>.
        IF sy-subrc NE 0. EXIT .ENDIF.
        READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX sy-index.
      Fill 1st column
        <dynheader> = wa_fieldcat-seltext_m.
        IF <dynheader> IS INITIAL.
          <dynheader> = wa_fieldcat-fieldname.
        ENDIF.
    *filling the other columns
        LOOP AT i_final INTO  <ls_table>.
          l_col = sy-tabix + 1.
          ASSIGN COMPONENT sy-index OF STRUCTURE <ls_table> TO <dyndata>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          ASSIGN COMPONENT l_col OF STRUCTURE <header> TO
          <dynheader>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          WRITE <dyndata> TO <dynheader> LEFT-JUSTIFIED.
        ENDLOOP.
        APPEND <header> TO <dynamictable>.
      ENDDO.
    *layout for alv output
      lt_layout-zebra = 'X'.
      lt_layout-no_colhead = 'X'..
      lt_layout-colwidth_optimize ='X'.
      lt_layout-window_titlebar = 'ALV GRID TRANSPOSED'.
    *alv grid output for display
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = lt_layout
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = <dynamictable>.
    Plz correct me code.

    here's a sample to prepare a alv-fieldcatalog with many similar value-fields:
    *get metadata of itab
    DESCRIBE FIELD itab INTO td.
      LOOP AT td-types INTO watypes.
        READ TABLE td-names INTO wanames INDEX  watypes-idx_name.
        CHECK sy-subrc = 0.
        MOVE wanames-name TO fld-name.
        READ TABLE td-names INTO wanames INDEX  watypes-idx_help_id .
        MOVE wanames-name TO fld-def.
        WHILE wanames-continue = '*'.
          hindex = watypes-idx_help_id + 1.
          READ TABLE td-names INTO wanames INDEX  hindex.
          CONCATENATE fld-def  wanames-name INTO fld-def.
        ENDWHILE.
        APPEND fld.
      ENDLOOP.
    *build fieldcatalog
      LOOP AT fld.
        CLEAR katalog.
        katalog-fieldname = fld-name.
        IF fld-name = 'RCOMP'
         OR fld-name ='GSBER'
         OR fld-name ='ITEM'
         OR fld-name ='FUNKTION'.
          katalog-key = 'X'.
        ENDIF.
        SPLIT fld-def AT '-' INTO t f.
        SELECT SINGLE scrtext_m leng
               FROM  dd03m INTO: (katalog-reptext_ddic, katalog-outputlen)
               WHERE  tabname     = t
               AND    fieldname   = f
               AND    ddlanguage  = sy-langu.
        IF sy-subrc <> 0.
          katalog-reptext_ddic = fld-name.
        ENDIF.
        IF fld-name = 'TXT'.
          katalog-outputlen = 30.
        ELSEIF fld-name = 'GSBER'.
          katalog-outputlen = 4.
        ELSE.
          katalog-tabname = t.
        ENDIF.
    *here: different value-fields
        IF fld-name BETWEEN 'KSL00' AND 'KSL99'.
          IF fld-name <> 'KSL99'.
            CONCATENATE 'Periode' fld-name+3(2) '/' jahr INTO
                         katalog-reptext_ddic SEPARATED BY space.
    *hide fields
            IF NOT fld-name+3(2)  IN buper.
              katalog-no_out = 'X'.
            ENDIF.
          ELSE.
            katalog-outputlen = 19.
            IF ohnevj = 'X'.
              katalog-reptext_ddic = 'Summe'.
            ELSE.
    *previous year
              CONCATENATE 'Periode' buper-low '/' vorjahr INTO
                           katalog-reptext_ddic SEPARATED BY space.
            ENDIF.
          ENDIF.
          katalog-currency = 'EUR'.
          katalog-do_sum = 'X'.
          katalog-inttype  = 'P'.
          katalog-datatype = 'CURR'.
        ENDIF.
    *hide more fields
        CASE fld-name.
          WHEN 'GSBER'.
            MOVE x_gebe TO katalog-no_out.
            katalog-reptext_ddic = 'Gsbr'.
          WHEN 'ITEM'.
            MOVE x_item TO katalog-no_out.
          WHEN 'FUNKTION'.
            MOVE x_func TO katalog-no_out.
          WHEN 'TXT'.
            MOVE x_text TO katalog-no_out.
        ENDCASE.
        APPEND katalog TO cat.
      ENDLOOP.
    grx
    A.

  • How to display data in a table on the screen

    Dear members,
    I have to display data from the database in a table on my screen when the page loads.
    I have created the VO and the AM and made the mappings for the columns i want to display but the table on my screen is not fed when the page loads.
    I have created my "table" region with the columns to display but i don't know the code to implement in the processRequest of the AM and the VO to display thes results of the VO query when the page loads.
    Thanks in advance for your answers.

    Hi,
    In CO Process Req:
    import xxx.oracle.apps.pa.setup.server.ApplicationModuleAMImpl ;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ApplicationModuleAMImpl AM=(ApplicationModuleAMImpl )pageContext.getApplicationModule(webBean);
    AM.init();
    In AM:
    public void init()
    searchVOImpl Searchvo=getsearchVO1();
    Searchvo.executeQuery();
    Note:
    This is simple execute query.
    Regards
    Meher Irk

Maybe you are looking for

  • I am unable to sign in to my wi fi network on my ipod because the keyboard wont come up. what do i do?

    i am unable to sign in to my wi fi network on my ipod because the keyboard wont come up. what do i do? please help me out

  • Flash Player audio problem

    The video portion of my  flash player is working fine however i can't increase the volume.  My volume is working fine on my computer except for certain flash player videos.  I need to turn the volume on maximum and then i can barely hear what is bein

  • English in Korean Itunes store?

    How can I set up my Itunes account to display in English? I am working in Korea and to purchase from Itunes I have to give a valid address, which is in Korea. This changes all my settings to Korean which I don't read! Apple seems to think that everyo

  • Small doubt

    hi friends, how can i update in a flat file like ( abc.txt). i would like to search a string in file and replace something in the row and update in the same position. how to do that. with regards.

  • Divided by zero error

    All, I am having trouble with one of the reports in EBS. When I run the two underlying sql of the report in toad I get the data. But, when I ran the report from the application I was getting some oracle error. So, I ran the report directly from the r