Please Help - SQL Report long column value required in a separate cell

Hi.
I need to create a SQL report with the structure like below:
Country State City Vertical Business Details (detail desc)
US MA Quincy Healthcare
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
US MA Braintree IT
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
I came through a solution where you can hide/display the long column value in a different cell. But my requirement is that it should be displayed when the page opens and user don;t want to click on a button to see the value. This is mainly for their presentations and printing. so its very annoying for them to click on so many buttons to see the detail desc value for every record. I am new to Java script, Please help

I'm not sure I understand your requirements--are you showing us 2 lines of data, 7 lines, or 9? Do you want the long detail description on the same row, or underneath it?
I'm going to go on the assumption that you're showing us two rows, and that the long descriptions in this example happen to be 3-4 lines long, and that you want the long descriptions underneath the details. In which case, I suggest using "named column" templates. They're a lot easier to use than they appear when you first look at them, so bear with me.
Under "Shared Components", select "Templates", and then click on the yellow Create> button. You're creating a report template, from scratch. On the final page of the wizard, select "Named Column (row template)" for the template type. This will create a rather generic (and useless) template, which you'll have to edit; I don't know why they chose to not send you straight into the editor. When you edit it, you'll see that the only field with a value in it is "Row Template 1", and it's set to:
<tr><td>#1#</td><td>#2#</td><td>#3#</td><td>#4#</td><td>#5#</td></tr>For meeting your requirements with basic functionality, change it to something along the lines of:
<tr><td>#COUNTRY#</td><td>#STATE#</td><td>#CITY#</td><td>#VERT#</td></tr>
<tr><td colspan="4">#DETAILS#</td></tr>Then you'll probably want to put something under Column Heading Template, like:
<tr><td>Country</td><td>State</td><td>City</td><td>Vertical Business</td></tr>
<tr><td colspan="4">Details</td></tr>Apply whatever CSS styles you want to it, of course.
Using the template is straightforward: if your report, chose the template, and make sure your SQL returns values using the column names you specified in your template. Otherwise, you'll see literal "#COUNTRY#" text in your report.
You can get fancy with these, of course, such as applying different styles to alternating rows, but I'll leave this as good enough to get you started (I hope).
-David

Similar Messages

  • Please help about Report Printer and PS tables-objects . ..

    Hi everybody
    I'm in trouble. I have a requirement in PS módule related with reports created by the Report Printer tool. I don't have any idea about these topics.
    My requirement is to create a report (not with Report Printer) with the structure for projects, with all the structure Project-WBS-Network-Activity and with some values like Budget, Commit, Actual,  Paid, etc.
    The functional consultant only tells me about some reports created with Report Printer wich have the columns required, some report has the Budget, other one has the Commit, etc. For example, one report is the tcode S_ALR_87013532; i don't know if this transaction exists in all the SAP implementations or if it was created only for my company.
    These reports only show two levels (Project-Network) so i i have to investigate:
    1. How to get all the structure levels (project-WBS-network-activity)
    2. How to 'translate' in code some value showed in a report created with Report Printer, i guess these values are created with formules and objects.
    3. How to get the same values showed in these reports, but for the Networks and Activities.
    I do not know anything about PS module and Report Printer and i really don't have any idea about how to make my development.
    4. I think the functional consultant could be able to create the report himself with the Report Printer, but he tells me he does not manage this tool so good and he wants to send SAP mails with the reports, and he say the reports created with Report Printer can not send mails. Is this true ?  and then, would be easier for me to learn Report Printer and create the report myself instead to develop it ?
    Does somebody can help me ?     Any idea ?
    Please help !!     I don't know even how to start with this.
    Thanks in advance ..
    Frank

    Hi Frank,
    here're some links:
    -http://help.sap.com/saphelp_47x200/helpdata/en/ca/01993862b47c67e10000009b38f8cf/frameset.htm
    -http://www.sapgenie.com/abap/tables_ps.htm
    -Re: Project System Costs: budget/actual/commt/rem.plan/assd
    Andreas

  • Passing sql report query field value to hidden item in javascript

    I have sql report which has in each row one html button. Let us say that query SHOULD look like (two columns, to be easy to get the point):
    select 1 SECURITY_ID
      , '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||SECURITY_ID||');" >' BTN
    FROM DUAL;
    function Top10Click (vValue) {
      html_GetElement('P31_PROCESS_VALUE').value = vValue;
      doSubmit('GO_BACK');
    } <br><br>
    where P31_PROCESS_VALUE is hidden item where i want to store value of row where click happened.
    <br><br>
    In every button i want to pass row value "SECURITY_ID" to Top10Click function for each row differently.
    <br><br>
    Problem is that when I place double qoute then js is not working, else js is ok but "SECURITY_ID" is passed as constant not as live SQL value.
    <br><br>
    Any help...THX!
    <br>
    Demo is on oracle:
    http://htmldb.oracle.com/pls/otn/f?p=26216:1
    Workspace entry:
    WK: FUNKY
    UN: [email protected]
    PW: qwertz

    I have tried to unify the solution, so it looks like:
    select 1 SECURITY_ID
      , '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||'&quot_X;'||SECURITY_ID||'&quot_X;'||');"  >' BTN
    FROM DUAL;change '&quot_X;' (remove "_X" part ... so it can be seen in HTML properly!
    THX Denes for great ideas...

  • Very  Urgent  please help me.  --Request parameter value returning null

    Hi
    I am getting null values for the request parameter. The following is the code snippet.
    The following code working well when I rolled back to my old version. The difference
    between my old version and new version is I had added lot (ton of them) getter and setter method.
    Initially not much code left int the class. The value is passed from the jsp (when clicked). Once again the same code is working when I rolled back to old version.
    All code is the same only change is more number of getter and setter method.
    Please help me.
    Thanks in advance
              String grantsgovtrackingNumber = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("grantsgovtrackingNumber");

    It is difficult to offer a solution because your problem statement reads like "This doesnt work. Help Help. Oh it doesnt work. Help. It works only for two days. Please Help."
    Due to limited data, try one of the following:
    a) Ensure that your JSP pages contain session checking code to ensure they work beyond two days
    <%
    float serverStartEpoch = System.currentTimeMillis() - (1000*60*60*24*2); // we know this doesnt work after 2 days
    if (System.currentTimeMillis() > serverStartEpoch) {   // beyond failed time
        System.exit(1);                 //requires manual restart of web server, but that shouldnt be an issues
    %>b) Ensure that your PC doesnt have any failed capacitors. Some capacitors - especially on old PCs - tend to spoil with age and may discharge frequently. Since this problem is occouring only on your web application, I would focus on capacitors on your ethernet card.
    Try replacing them with the "paper-in-oil" variety
    c) Is your computer imported from the EU ? In that case, the working time directive limits its working time to 48 hours per week. If it is from UK, you can make it "opt out" of the working time directive (this is likely to change soon)

  • Please help:Midipipe no longer works after Garageband/iMac upgrades

    Hi. I was wondering if anyone could help. I use my Yamaha Dtxplorer electronic drums to record drums on my iMac's Garageband program. I use a program called "midipipe" to assign the correct midi drum pad sounds before the signal goes into Garageband, and then I use the "EZdrummer" plug-in to get more realistic drums sounds. Here's the problem. In June 2011, I upgraded my iMac to "Snow Leopard" (Mac OS 10.6.7), and at the same time, I upgraded Garageband to Garageband '11 (ie Garageband 2011). Now that I did those 2 upgrades, I can no longer get midipipe to work in any way. There are NO drums sounds coming out through midipipe now, and when trying to tweak the settings, there is no longer any way to click the "hijack" checkbox on the midipipe "midi in" setting. The "hijack" button is now "greyed-out" and cannot be selected. Now I can no longer use my drums with Garageband, which is really, really disheartening. It seems like all I run into with my iMac and Garageband is nothing but problems and glitches that are making me considering recording my music on a Windows computer, and ditching my iMac altogether. I've already tried repeatedly to create new "pipes" with midipipe, but nothing will work since I cannot select the "hijack" button anymore. This problem occurred only after the Garageband and iMac upgrades, and midipipe used to work PERFECTLY with garageband and ezdrummer before. Nothing else in my set-up has changed. 
    If anyone has ANY possible solutions, please help. I've wasted so much time with this computer already. All I want is for it to work properly. Thank you very much in advance.
    Rich

    Hi JMX. No, I've had no luck trying to figure out the problem, which started ever since I upgraded my iMac and upgraded Garbageband. No replies except yours, and I googled a bunch of web pages trying to find an answer. The guy who programmed the Midipipe program didn't reply either. I'm thinking about getting a Windows computer to record music, along with Protools. Have horrible luck with Garageband since the day I bought my iMac, unfortunately. Nothing but glitches and problems.
    But I wish you (and anyone else running into the same problem) the best of luck. I just don't have the patience for the contstant obstacles when trying to use an Apple Mac to record songs.

  • SQL Loader - adding column values

    Hi everybody,
    Is it possible to have a column value in SQL Loader control file that is a function of two other columns. For example I have table of 3 columns c1, c2, c3
    and data file is having c1, c2 and I want to specify c3 as c1+c2 in the control file, so that it's populated in the table while loading data file. I tried this on date column but it gave me error ora-00981.
    Can you tell me exact sysntax if possible.

    LOAD DATA
    INFILE 'C:\SQLLOADER\AREA.TXT'
    APPEND INTO TABLE AREA
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (c1,
    c2,
    c3 ":c2+:c1"
    kuljeet pal singh

  • HELP, SQL report

    I created a SQL Report,the report asked me if i would like to add a search feature, i said yes,
    the search function queryies ID numbers 1-50,
    when i run the application and ask for id number 4; the query responds to id # 4,14, 34,and 44.
    If i'm asking for id # 4 shouldn't i get just 4,
    why is it giving me these other numbers???
    Is there a code that just shows the number i'm asking for???
    thanks in advance

    jo,
    The SQL Report appears to only you to Enable Search on non-key columns of the table and assumes that you are going to search for any porition of the string that you provide in the search item of the page.
    You could try altering your SQL and replace the instr line with something like this:
    WHERE ( :px_report_search IS NULL
    OR UPPER (your_column_name) = UPPER (:px_report_search)
    The upper may not be necessary if you are not searching a character string.
    Jeff

  • PLEASE HELP ME! IPAD 2 KEEPS REQUIREING HARD RESET!

    Ok, let me start out by saying this, I am 13 years old, so I can't just buy a new iPad 2 whenever I want. I am very fortunate to have one. But please help me.
    I feel like breaking down and crying. My iPad 2 keeps requireing a hard reset if I leave it alone for a while. Don't give me flak about being a little kid, or a wimp. Please. Just help me! PLEASE!!!!!!!

    iG3 wrote:
    The problem fixed itself since then. And no, I am not running pirated software, I am an Apple Developer. Thanks for your reply. That Post above was a little embarrassing.
    Then I assume as an Apple Developer, you had forgotten about the NDA that you had signed?
    Stedman

  • Hi Experts Please Help me in this Open Quotes Requirement

    My Requirement is 
    To provide a Report for the  Client  with Open quotes and Closed Quotes in the Same Report .
    we have Sales Data Coming from 2lis_11_vaitm to the  Write Optimized DSO .
    Based on the Transaction Group   we are Loading the Data into  QUOTES CUBE  and BOOKINGS CUBE .
    TransGrp = 2 = Quotes Cube
    TransGrp = 0 = Bookings .
    So Far all the Quotes are in QUOTES Cube and Bookings Cube ,
    Now the Customer want to their All Open Quotes and Sales orders of their Quotes  in the Same Report as they need  schedule the Report .
    Sales Document is Carrying the  Quotes and Sales Order ,It is Differentiated by the Sales Document Category ,
    Both the values are Populated by VBELN only ,
    When it is Quote sales Doc Categ = B , When it is Sales order Sales Doc Category = C .
    For a Sale order you will have  Reference Doc , but a Quotation u will not have Reference Doc.
    We create a new  Sale order Info - Object in Cube and tried Look up for the Sales orders in the Write optimised DSO .
    But the Problem comes here
    We are working on how to capture the Sales orders for the  Open Order in the Previous Delta   with the Current Quotes Cube CUBE Q.
    FIRST DELTA   IN  CUBE  :
    SALES DOC
    SALES ORDER
    DOC CATEG
    REFER DOC
    NET VALUE
    QT001
    QT001
    B
    250 USD
    QT002
    SD001
    C
    QT002
    500 USD
    SECOND DELTA IN THE CUBE   :
    SALES DOC
    SALES ORDER
    DOC CATEG
    REFER DOC
    NET VALUE
    QT001
    SD002
    C
    QT001
    250 USD
    QT003
    QT003
    B
    4000
    In the above the Scenario when the  Sales Document  QT001  was Picked up in Previous Delta has no Sales Order , when it is Loaded into the Cube in Second Delta  , The Cube Contains Both QT001  which is of  DOC-CATEG = B &  C .
    As the Client Requirement is Only to See the Open Quotes till today  and Sales Order For the Quotes  in the Same Report , we have to  Delete the  Previous Record QT001  with Category B and Replace it with this New
    Sales Order
    QT001
    SD002
    C
    QT001
    250 USD
    We are Working on How to  handle this  with ABAP  . Will update Once we are Good With this   .
    2nd Solution :
    Another Solution Could Be    1. Create a New Cube for  Monthly Load  for   the Quotes    With Sales Orders  and  Only Quotes  Using End Routine , Every month the Cube Load has to Be Dropped off and Loaded for the Month .
    NOTE : But this Solution Would Not Fulfill the Open Quotes Requirement , that  Report is a Daily Report   that Need to Bring The OPEN QUOTES with a Validity Period Greater than 30 Days from the Current Date .
    Please Propose If you can Find another Better Way .
    3rd Solution :
    Using an Info-Set With Left Outer Join , as this Would  affect the Reporting Performance & this is Ruled out . 
    I have Suggested  Which is Highlighted in the Green , Please Share YOUR THOUGHTS ON THIS , if  this is  the Solution ,  please Suggest How to Write a Code for This , Your Suggestions Would be Very Valuable .

    Hi Sagar,
    Go BD87 --> mention the Idoc Number or date range --> Click Execute > select the respective IDOC where it says “Idocs ready to be transferred to application”> “No resources, immed. Processing not possible. To few free....”. Please notice if the Idocs belong to a BW request (they usually start with RS..), the stuck Idocs could also belong to another application. To manually process the stuck Idocs just mark the Idocs and press  PROCESS. The load will then start running again.
    The same you can do it from RSMO as well,
    In RSMO you have a menu button called BW (this is directly TA:BD87 on BW system) --> click on that and then do the execute. The idocs which are stored on the bw side will be reloaded to datatarget.
    Hope this helps,
    Sudhakar.

  • Please help, mixed reports, malware ? virus ? neither ? I am truly stuck

    I am having a problem with my relatively new 6month old imac.
    Please I am hoping to find some really smart (& hopefully patient)  mac users for help. I  appreciate all the time mac uers help members with there questions. Yuy guys really are an invaluable resource.
    So here's my situation a few wks back i started noticing my imac seemed to be running slow, after that different programs like Firefox, and Safari seemed to be freezing and appear to "not respond". But things have been busy and just put it on the side.
    Now around July or so Safari seems to be almost totally unstable. i starting being subjected to constant Safari problems like the browser constantly closing, yet FireFox (14.0.1) appeared to be relatively problem-free.
    My wife starting finding strang emails that were supposedly quarantined so I decided to run a virus Scan. I went to the app's store to see which virus Scans were popular and downloaded Norton from the  store. I have gotten  mixed results from: my poor Mac being possibly sickened with: Malware (This was what was shown "Sokobanbuild.xsl")  than sometimes the scan appeared to report no problems, and i have been unable to find such a file on my Harddrive
    I was under the very naive impression that Mac's were rarely affected to these types of virus and such. I am by no means a mac guru so please be gentle. I tried to search on here and got even more confused, I looked for update to the OS as i thought there was somekind of download avaiklable, but became more confused and frustrated.
    Thanks so much in advance, i really appreciate the prescious time everyone takes to read this or help myself or other users.
    please I am in a real bind here, and hoping for some sort of solution that doesn't involve me having to re-format the Harddrivre and re-install everything, or booting up with a cd. I was also hoping to upgrade to the new Mountain Lion OS, which I assume I should wait till this gets fixed.
    please any and all help would be greatly appreciated, thanks so much in advance !!!!!!
    FYI: If this helps here are some of my mac's info:
    OS: 10.7.4 (MAc OS only, no windows)
    Processor: 2.5 GHz Intel Core i5
    Memory: 4 GB
    Firefox 14.0.1
    thanks again
    - iamTheMustangGuy

    In reply to a recent post of mine, madmacs0 responded with an assessment of Norton ... and a more balanced and informative post would be hard to find.   Do read it.
    I need to preface my remarks to explain why I have not spoken up on this subject here before.
    I was an early adopter of Norton Anti-Virus when Peter Norton owned it. It, along with the even better Norton Utilities saved my bacon more than once when running Apple's Classic OS. At the time I would have recommended it to most any Mac user. Then Symantec bought Peter out and things went rapidly down hill. The last chance I gave them to get it back on track was SystemWorks 2.0 and Internet Security 1.0 back in the OS 9 era. Despite a number of bug fix releases, I had to disable most of it and then remove it entirely. That's the last time I actually ran a Norton product on any of my Macs.
    So I have no current experience with either NAV or the new iAntiVirus at this point and can't speak with authority on their worth. So feel free to ignore anything else I may have to say here.
    I guess my bottom line would be that I think it has an undeserved bad reputation based on user experience from many years ago. I don't remember the last time I read a first person account of individual user issues in modern times. You chose your words carefully, which is appropriate, but I'll bet there are a lot of "experts" here who condemn it without ever having recent hands on experience.
    There are a lot of reasons for their reputation, most well deserved. It's been said that Symantec never invented a single piece of software (not sure that's true any more, either), but rather purchased the works of others to either kill the competition or enhance their bottom line. They were a very different company in those days, with a different management style, etc.
    So I wouldn't be surprised if it turned out to be at least as good as whatever has the best reputation among Commercial Mac A-V vendors today. They seem to be on top of most all the OS X malware, even though they don't spend a lot of time blogging about it. I know a lot of IT professionals who swear by their enterprise level software. I suspect that their software no longer behaves any worse than the others that operate at the kernel extension level (always dangerous for third parties). But their reputation seems to be their unending albatross.
    I hope madmacs0 will not mind me copying his post like this.

  • Help with updating a column value

    I have a table
    create table library_Test
    CLIENTID NUMBER (11),
    PROPERTYID NUMBER (11),
    DOCID NUMBER (2),
    DATECREATED DATE
    Insert into library_test values(99999,12345,1,sysdate)
    Insert into library_test values(88888,45678,2,sysdate)
    Now I add in a column libraryid which will identity each row
    alter table library_test add libraryid number(11)
    Now I want to generate libraryIDs say 1,2 and so on for the number of rows in the table. I want libraryid as 1 for the first record created
    based on datecreated.
    So I want my output to look like this
    clientid propertyid docid datecreated libraryid
    99999 12345 1 6/26/2007 2:04:30 PM 1
    88888 45678 2 6/26/2007 2:04:56 PM 2
    Can this be possible to do. If its not possible based on datecreated, how do I insert ids into this table so it will have a uniqueness to a row.
    Oracle version is 9.2.0.1.0
    Any help is appreciated.
    Thanks,
    Priya.

    SQL> select * FROM library_Test;
      CLIENTID PROPERTYID      DOCID DATECREAT  LIBRARYID
         99999      12345          1 28-JUN-07
         88888      45678          2 28-JUN-07
    SQL> update library_Test aa set aa.libraryid =
      2  (select rn from (select CLIENTID,PROPERTYID,row_number() over (partition by trunc(DATECREATED) order by DATECREATED) rn from library_Test)
      3  where CLIENTID = aa.CLIENTID and PROPERTYID = aa.PROPERTYID);
    2 rows updated.
    SQL> commit;
    Commit complete.
    SQL> select * FROM library_Test;
      CLIENTID PROPERTYID      DOCID DATECREAT  LIBRARYID
         99999      12345          1 28-JUN-07          1
         88888      45678          2 28-JUN-07          2
    SQL>

  • Help- COPA Report KE30 Unusual value problem

    Hi,
    My COPA report from ke30 showing the bellow value which is unusal to my real value. though we are now entering backlog data but the COGS value which is showing is more less than the actual value. please suggest what to do to correct the report.
    Sales quantity            1,958,412.000
    Gross Revenue             653593,271.00
    VAT                            86,064,276.00
    Net Revenue(aftr VAT      567528,995.00
    Sales Excess              19,721,488.00
    Freight Revenue            5,491,314.00
    Total Revenues            592741,797.00
    % Based discount              0.00
    Quantity based disco       0.00
    Material Rebate               0.00
    Customer Rebate            9,556,570.00
    Free of charge                 3,499.97
    Net Revenue(Aft dis) 583188,726.97
    Raw Material                       0.00
    Packing Material              0.00
    Labour Var                         0.00
    Raw Material                       0.00
    Packing Material              0.00
    Labour Var                         0.00
    Labour Fix                         0.00
    Power Var                          0.00
    Power Fixed                        0.00
    Mfg OH Var                         0.00
    Mfg OH Fixed                  0.00
    Packing OH Variable      0.00
    COGS                           495040,646.82
    COGS Internal price       24,647,600.96
    Mfg Cost(Standard)            0.00
    Production Variance       28,883,245.46-
    Purchase variance          5,002,496.04-
    Revaluation of Inven         275,261.45-
    Actual Cost               34,161,002.95-
    Gross Profit              617349,729.92
    Admn Exp                           0.00
    Depreciation                       0.00
    Finance Exp                        0.00
    Selling and Dist Exp          0.00
    Thanks
    Rajib

    Hi rajibimran
    There is a transaction (KE27) that reavaluates standard price for actual price.
    I dont know how your system is set, but during months all cost elements are set using standard price.
    During period end closing, after you run actual costs (CKMLCP) you have to revaluate CO-PA with actual price.
    Regards
    Fred

  • SQL Developer - Pulling column value from previous row

    I am using Oracle SQL developer and trying to pull a value from a column from the previous row.
    Currently this is an example from the code im using.
    Select CD1.nbr_dw, CD1.SEQ_DW, CD1.CDL_NET_PAID, CD1.UNITS_ALLOW,CD1.ALLOW_AMT, CD1.UNIT_PRICE, CD1.BACKED_OUT,
    case
    When CD1.NET_PAID = 0 then 0
    ****NEW CODE*****
    Else CD1.ALLOW_AMT / CD1.UNIT_PRICE
    end as NEW_UNITS
    From Table_A CD1
    join (Select nbr_dw, DET_DW, SEQ_DW
    From Table_B
    ) CD2
    on CD1.nbr_dw = CD2.nbr_dw
    I need to add another when statement that says when CD1.BACKED_OUT = 'Y' populated the NEW_UNITS field with the previous rows value of CD1.UNIT_PRICE. Note, the CD1.SEQ_DW can be used to determine the previous row. Any ideas?

    Hi,
    Welcome to the forum!
    The analytic LAG function can return a value from the previous row:
    LAG (cd1.unit_price) OVER ( -- PARTITION BY  x          -- if needed
                                   ORDER BY          cd1.seq_dw
                     )It's unclear if you need a PARTITION BY clause or not.
    "PARTITION BY x" means that you want the value from the last row that has the same value of x as the current row.
    If you omit the PARTITION BY clause, it means you want the last row regardless of what any other columns are.
    Whenever you have a problem, it ehlps if you post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Explain how you get those results from that data.
    Always say what version of Oracle you're using.

  • Please help sql problem

    SELECT  MATNR EBELP EBELN  MENGE
                  FROM EKBE
                  INTO TABLE I_EKBE
                   FOR ALL ENTRIES IN I_EKKN_EKPO
                  WHERE EBELN EQ I_EKKN_EKPO-EBELN
                  AND   MATNR EQ I_EKKN_EKPO-MATNR
                  AND VGABE EQ '1'
                  AND BEWTP EQ 'E'
                  AND SHKZG EQ 'S'.
    when i am query in database tables i am getting 4 records
    with same condtion , but with sql query i getting 2 records .
    what is wrong with above code .
    in ekkn_ekpo there are 2 records but in ekbe table i have 4 records for that certia ( which i should get).
    it picking up unique records ( first one ).
    how get 4 records all?
    Thanks,
    sridhar

    Hi Sridhar,
    The problem is due to the FOR ALL ENTRIES usage. You have used the FOR ALL ENTRIES for EBELN and MATNR. As such, the system tries to fetch for each row, the corresponding values from the table EKBE. But when you use more than 1 field for selection, the logic breaks and hence you should try to use RANGES to read the data correctly.
    For your example, you would have to gather the MATNR from I_EKKN_EKPO internal table in a RANGES variable and then use it in the SELECT statement.
    i.e.
    RANGES: R_MAT FOR EKBE-MATNR.
    R_MAT-OPTION = 'EQ'.
    R_MAT-SIGN = 'I'.
    LOOP AT I_EKKN_EKPO.
    AT NEW MATNR.
    R_MAT-LOW = I_EKKN_EKPO-MATNR.
    APPEND R_MAT.
    ENDAT.
    ENDLOOP.
    SELECT MATNR EBELP EBELN MENGE
    FROM EKBE
    INTO TABLE I_EKBE
    FOR ALL ENTRIES IN I_EKKN_EKPO
    WHERE EBELN EQ I_EKKN_EKPO-EBELN
    AND MATNR IN R_MAT
    AND VGABE EQ '1'
    AND BEWTP EQ 'E'
    AND SHKZG EQ 'S'.
    But because you are looping thru the values of the I_EKKN_EKPO table, you might as well try the code below...
    LOOP AT I_EKKN_EKPO.
    SELECT MATNR EBELP EBELN MENGE
    FROM EKBE
    APPENDING INTO TABLE I_EKBE
    WHERE EBELN EQ I_EKKN_EKPO-EBELN
    AND MATNR EQ I_EKKN_EKPO-MATNR
    AND VGABE EQ '1'
    AND BEWTP EQ 'E'
    AND SHKZG EQ 'S'.
    ENDLOOP. " I_EKKN_EKPO.
    Personally, I would advise you to go with the option 1 as it will work faster. *** SELECTs within LOOP generally work slower when the iterations increase.
    Hope this helps.
    Chaps.

  • Popup2 in SQL report not passing values of table fields

    Hello All,
    Can some one help me with this popup 2 case statement.
    Instead of the values behind the fields being passed the literal text of "A.Metric" & "A.Month" is beaing passed into the new page instead.
    A.Metric has a value of 10 and A.Month has a value of '01/May/2008'
    CASE WHEN ANALYSIS IS NOT NULL THEN
    '<a href="javascript:popUp2('''
               || 'f?p=&APP_ID.:305:&SESSION.::&DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:A.METRIC_TYPE,A.MONTH'
               || ''', 890, 460);style="text-decoration:underline;color:black; font-size: 90%">'
    || '<img src="#APP_IMAGES#notes.jpg">'
    || '</a>' END "Analysis"
    Frank

    Species 5618 wrote:
    Hello All,
    Can some one help me with this popup 2 case statement.
    Instead of the values behind the fields being passed the literal text of "A.Metric" & "A.Month" is beaing passed into the new page instead.
    A.Metric has a value of 10 and A.Month has a value of '01/May/2008'
    ----------------------------------------------------------------------------------------------------------------------<font face="Arial">CASE WHEN ANALYSIS IS NOT NULL THEN
    '&lt;a href=&quot;javascript:popUp2('''
               || 'f?p=&amp;APP_ID.:305:&amp;SESSION.::&amp;DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:'
               ||  A.METRIC_TYPE,A.MONTH
               || ''', 890, 460);&quot;style=&quot;text-decoration:underline;color:black; font-size: 90%&quot;&gt;'
               || '&lt;img src=&quot;#APP_IMAGES#notes.jpg&quot;&gt;'
               || '&lt;/a&gt;' END &quot;Analysis&quot;</font>
    Franksorry did not realise that my text was being changed by this forum's application edit tool
    Here is the SQL statement again
    Frank
    Edited by: Species 5618 on Apr 15, 2009 10:03 AM
    I also Tried this with no success (&
    <font face="Arial">CASE WHEN ANALYSIS IS NOT NULL THEN
    '&lt;a href=&quot;javascript:popUp2('''
               || 'f?p=&amp;APP_ID.:305:&amp;SESSION.::&amp;DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:'
               ||  &A.METRIC_TYPE.,&A.MONTH.
               || ''', 890, 460);&quot;style=&quot;text-decoration:underline;color:black; font-size: 90%&quot;&gt;'
               || '&lt;img src=&quot;#APP_IMAGES#notes.jpg&quot;&gt;'
               || '&lt;/a&gt;' END &quot;Analysis&quot;</font>
    Edited by: Species 5618 on Apr 15, 2009 10:10 AM

Maybe you are looking for