Regarding select statement for this requirement

Hi................
good evening
here is a requirement.
i want to retrieve data from the following table.but how to join these table is my dought.
tables  fields
t001w--werks " plant id
t001w--name1 " pl;ant name
t001w--regio " plant address
ekko--ebeln " purchase  order
ekko-erdat : creation date
ekko-ernam "name of the person
ekpo-ebelp " item
ekpo-bstyp "purchase order type
eket-erdat " delivery date
mara-matnr " material number
these are the tables and fields.now we want to retrive data from these tables
how we have to code select statement.
selection-screen is
plant id
order type
delivery date
please provide select statement for this requirement.
thanks and regards.
k.swaminath  reddy.

Is this what you are looking for?
SQL> CREATE OR REPLACE FUNCTION f_team
  2  RETURN VARCHAR2
  3  IS
  4    s_return VARCHAR2(500);
  5  BEGIN
  6    FOR i IN ( select team from t_team order by 1) LOOP
  7      s_return := s_return || i.team || ', ';
  8    END LOOP;
  9   
10    RETURN substr(s_return, 1, length(s_return) - 2);
11  END;
12  /
Function created.
SQL>  SELECT f_team FROM dual;
F_TEAM
Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
SQL>

Similar Messages

  • How to write optimized select statements for this requirement

    I.     G/L Account No. Info: Get all the list of G/L Account no. , company code and the corresponding long description from SKB1 & SKAT tables based on the G/L Account no. and company code values entered in the selection screen.
    II.     No. of transactions posted: For each of the Company code & Posting date or fiscal year/ period combination, select all document numbers from BKPF table into an internal table. For each of the company code, GL Account no combination find out no. of distinct records in the BSEG table (or combination of BSIK, BSAK, BSID, BSAD, BSIS & BSAS tables) to get the No. of transactions posted.
    III.     For Last posting FY/period: for each G/L account, Company code combination, determine the MAX (Doc. No) in BSEG, and look up the corresponding document in BKPF table to get the last posting FY/Period.
    Thanks,
    Prakash.

    I) with a query (sq01/2) and logical database SDF
    or standard abap RFSKVZ00
    II)a) select bkpf
       b) select count( * ) from bsik...
    III) a)select max( belnr ) from bseg...
         b) selec single monat from bkpf
    A.

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • Select statement for this???

    Hi
    I have table t where there are two columns
    it has the data in the following format..some of it is given below
    team_ID               Team
    1                 Australia
    2                 England
    3                 West Indies
    4                 India
    5                 Pakistan
    6                 South Africa
    7                 Zimbabwe
    8                 UAE
    9                 Bangladesh
    10                Kenya
    11                USA
    12
    13...
    14..
    so on
    [pre]
    I want a select statement that will show me the above data in the follwoing format:
    Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
    (note that the team names should always come in the Alphabetical format in the desired output..
    please tell me the query for this..
    regards,
    Asim.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Is this what you are looking for?
    SQL> CREATE OR REPLACE FUNCTION f_team
      2  RETURN VARCHAR2
      3  IS
      4    s_return VARCHAR2(500);
      5  BEGIN
      6    FOR i IN ( select team from t_team order by 1) LOOP
      7      s_return := s_return || i.team || ', ';
      8    END LOOP;
      9   
    10    RETURN substr(s_return, 1, length(s_return) - 2);
    11  END;
    12  /
    Function created.
    SQL>  SELECT f_team FROM dual;
    F_TEAM
    Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
    SQL>

  • Write an sql select statement for this problem?????????????????

    Hi frenz, i m bharath a new bee to oracle,my problem is
    the given table is
    userid billno amount
    1 101 1000
    2 102 2000
    3 103 3000
    4 104 4000
    output table should be:
    userid billno amount total*
    1 101 1000
    2 102 2000 *3000*
    3 103 3000 *6000*
    4 104 4000 *10000*
    I need a select query for the above output.
    i.e,here i calculated total as sum(amount) for each row,i.e,3000 = 1000+2000,6000 = 1000+2000+3000,10000 = 1000+2000+3000+4000 by this way my calculation for total field
    kindly send me a query.

    This is trivial with analytics:
    SQL> select empno, sal, sum(sal) over (order by empno)
      2  from emp
      3  /
         EMPNO        SAL SUM(SAL)OVER(ORDERBYEMPNO)
          7369        800                        800
          7499       1600                       2400
          7521       1250                       3650
          7566       2975                       6625
          7654       1250                       7875
          7698       2850                      10725
          7782       2450                      13175
          7788       3000                      16175
          7839       5000                      21175
          7844       1500                      22675
          7876       1100                      23775
          7900        950                      24725
          7902       3000                      27725
          7934       1300                      29025
    14 rows selected.
    SQL> You might want to get your keyboard checked - the question mark key seems to be stuck.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Select statement for retrieving infotype 1005 values w,r,t payscale

    Hi All,
    could you pls help me for the below requirement
    "select statement for retrieving infotype 1005 values with respect to the pay scale level.
    because pay scale level is having range of values in the infotype"
    Thanks in advance
    Prasad
    Please try it yourself first.
    Edited by: Suresh Datti on Aug 9, 2009 4:52 PM

    Hi,
    Code which you have written is correct when the R_DATE is having LOW and HIGH values, if the R_DATE is having only LOW value then this will be wrong, becuse if the R_DATE is having only LOW then OPTION value is not BT is should be EQ
    Regards
    Sudheer

  • Select statement for summing values in column?

    How to write a select statement for sap standard table which contains data  as given below
    col1        col2
    A     10
    A     20
    A     30
    B     50
    B     60
    C     70
    Need the output of select in  internal table as given below
    A     60
    B     110
    C     70
    Regards,
    Rachel

    Thanks for all the valuable input.
    Below I have used sum in select statement(check case 2"),but i am not getting required o/p.
    Kindly guide me.
    case1 :
    select aebeln aebelp bpackno  bmenge
    into corresponding fields of table itab
    from ( eslh as a inner join esll as b
    on bpackno = apackno )
    where a~ebeln = 6000000100
    and a~ebelp = 00010
    and a~packno = '0000001025'
    order  by aebeln aebelp b~packno .
    O/p for the above .
    ebeln                       ebelp         packno                             menge
    6000000100     00010     0000001025              6.000
    6000000100     00010     0000001025               5.000
    6000000100     00010     0000001025              2.000
    6000000100     00010     0000001025              1.000
    6000000100     00010     0000001025              2.000
    case2:
    select aebeln aebelp bpackno  sum( bmenge )
    into corresponding fields of table itab
    from ( eslh as a inner join esll as b
    on bpackno = apackno )
    where a~ebeln = 6000000100
    and a~ebelp = 00010
    and a~packno = '0000001025'
    group by aebeln aebelp b~packno
    order  by aebeln aebelp b~packno .
    6000000100     00010     0000001025     0.000
    Edited by: Rachel on Nov 25, 2008 11:45 AM
    Edited by: Rachel on Nov 25, 2008 11:46 AM

  • DISTINCT in SELECT statements for  Entities / Views - Oracle JDeveloper 11G

    Hi Steve,
    i have a question about using DISTINCT in SELECT statements for
    Entities / Views. On Oracle JDeveloper 11G ADF / BC4J
    --- This is unique---
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    from "grp_courses" GC
    --- This is NOT unique, but ROWID seems to be mandatory as PrimaryKey---
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    rowid
    from "grp_courses" GC
    How to use this query;
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    from "grp_courses" GC
    and yet still be able to use it in View / Entity without a Primary Key or some equivalent solution.
    Thanks & Regards,

    Hi, OK - I got it to work...
    Some notes:
    1) The View wizard cannot be initiated from the Entity Object.
    2) During the View wizard process - do not associate with Entity
    3) Selected columns must be mapped as expressions
    4) Using non-distinct columns will override the distinct function

  • Equivalent select statement for complex selection

    HI,
    What is the equivalent select statement for below mentioned condition.
    SELECT-OPTIONS : SALEDOCU FOR VBAK-VBELN OBLIGATORY,
                     DATE     FOR VBAK-ERDAT OBLIGATORY,
                     CHANEEL  FOR VBAK-VTWEG,
                     SALETYPE FOR VBAK-AUART OBLIGATORY DEFAULT 'QT'
                     NO INTERVALS NO-EXTENSION.
    Regards,
    John.

    hi,
    you can use following code.
    tables vbak.
    data : begin of t_vbak occurs 0.
             include structure vbak.
    data : end of t_vbak.
    select * from vbak into table t_vbak where
                            vbeln in saledocu and
                            erdat in date and
                            vtweg in chaneel and
                            auart in saletype.
    Hope this helps.
    Regards,
    Shashank

  • "You must specify a value for this required field" in SharePoint list

    HI All,
    I have a couple of taxonomy fields in my content type. When I try to add a new item with my content type and save, I'm getting an error message "You must specify a value for this required field" against each taxonomy field. I'm not sure what am
    I missing. I deleted the content type and added that again to my list but still no luck. Can someone please help me out? Thanks.
    Regards,
    SC Vinod

    hi
    it depends how you updated existing field. We faced with the problem that update of taxonomy site column was not propagated to the lists. In Sharepoint when content type is bound to the list, new hidden content type is created for that list - you may check
    it if will enumerate
    SPList.ContentTypes property. And when you try to update site column changes may not be propagated to these list content types. In order to update it you need to get reference on a field from list content type and update if explicitly.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Could you please suggest me the scenario for this requirement ?

    In module booking process we need the following process
    1.Student select their interested event package via website.
    2.Advisor review the student's event package list.
           2.1 In case of REJECT : student need to revise their list
           2.2 In case of APPROVE : all event package have confirm and run fee calculation.
    The information above is shortly requirement , if any one have suggestion for this requirement please suggest me.

    Vorad,
    I have some suggestions for you:
    1.  Create the module/event booking with 'Manual Conditional' flag.  Then, when the advisor approves a booking, remove the conditional flag.  If the advisor rejects, cancel the booking.  Here, you need to create some kind of UI for the advisor to review and approve/reject the requests.
    OR
    2.  Create the booking using a booking status such as 'pre-booked'.
    OR
    3.  Don't create any bookings from the student side.  Just create a booking plan instead.
    OR
    4. Look at a subtle process change that would let you use more out-of-the-box user interfaces/processes.  Students simply request special booking authorization for the event packages they want.  This automatically sends workflow approval messages to the advisor.  Then, just have a general rule which blocks all bookings that don't have this special authorization.   Once the student has a special booking authorization, he can just go into the course registration self-service and book the approved event packages.
    Michael

  • APP-ALR-04106: Please correct the user-defined SQL statement for this alert

    Hi All,
    I have created an alert for engineering module in R12. It got tested and was working fine. when the user testing it, while trigger the alert getting the error, "APP-ALR-04106: Please correct the user-defined SQL statement for this alert".
    when verified the alert, it got verified and ran also. It parsed the query successfully and when run it fetched few records.
    Need help in resolving the issue.
    Thanks in advance.
    Regards,
    sri
    Edited by: user10939296 on Jan 18, 2010 1:16 AM

    Hi Sri;
    I have already gone through the Note: 948037.1. But this note is related to 11i. The solution provided in the Note is for 11i.
    I am facing this issue in R12. Is this patch applicable to R12?I belive its not. But u can check Solution part 4 for your instance, at least it can give you idea. The other note in metalink related bug and all for R11 too.
    I belive its better way to rise Sr while waiting other forum user response to that thread
    Regard
    Helios

  • Pls give me the solution for this requirement

    Hi experts ,
    pls give me the solution for this requirement
    what we have to do when basis guys are tranported my object to the production without completting . how can we rectiify this .
    thanks in advance

    Hi
    After Transporting a request or released a request you cant do any thing in that so now you have to create a new Transport request for your report continue with that. After completion transport it . It will makes no difference it will just over write already existing report
    Reward alll helpfull answers
    Regards
    Pavan

  • Need Select statement for fetch the details

    Hi
      i want to fetch particular customer wise sales orderds and that sales order No  and  date of sales order was created..  and  that sales order related PO No  and Materials ..
    for this..   how can i write an executable programm.. is it needed to  define seperate  internal tables or single internal table is enough  ?
    what is the select statement for fetching  all these details..
    any help will be appriciated
    Thanks
    Bbau

    custmer master table is KNA1  knb1  knbk
    sales data tables r  VBAK VBAP VBEP
    Material data  MARA, MARAC, MARD
    PO RELATED ekko  ekpo  eket
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:04 PM

  • Please provide the abap code for this requirement

    note : if the below mentioned user exit is not suitable please find the suitable user exit and provide the code for this requirement.
    •     The User-exit MEFLD004 is only to be used at PO level (ME21N/ME22N).
    •     When PO is create or changed (ekko-ebeln) user exit MEFLD004 is triggered which check for the business requirement of the PO check for PO doc types (ekko-bsart) :z4,z6,z11,z12 from the table ekko and Account Assignment Category (knttp) is either N or K then stock process follows.  
    •     When an PO is cancelled, all entries will have to be reversed
    •     The Buffer table for the PO will have the following fields:
    Purchase order Number                     EKKO-EBELN
    Line item number of the PO               EKPO-EBELP
    Vendor Number                                  EKKO-LIFNR
    PO Quantity                                        EKPO-MENGE
    PO Nett Price                                     EKPO-NETPR
    Base Unit of Measure                  EKPO-LMEIN
    Account Assignment Category          EKPO-KNTTP
    PO Doc type                       EKPO-BSART     
    Plant                            EKPO-WERKS     
    Purchase Org                                  EKKO-EKORG
    Purchase Group                    EKKO-EKGRP     
    Company code                                EKPO-WAERS
    Item category                     EKPO-PSTYP
    PO Doc Date                      EKKO-BEDAT
    •     No duplications are allowed for any created, changed or cancelled purchase orders. If such a case occurs, the record will be updated with the latest update time stamp. This custom table will be keyed by purchase order number.

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=763485

Maybe you are looking for