Displaying BLOB value

Hello,
Working on Oracle 10G R2/Windows
There is a way to display BLOB value from SQL*PLUS or other tools?
Thank for your help

from sql*plus you can only display first 32767 character from the blob ,however you can write to file using pl/sql and read that file.
DECLARE
l_file UTL_FILE.FILE_TYPE;
l_buffer RAW(32767);
l_amount BINARY_INTEGER := 32767;
l_pos INTEGER := 1;
l_blob BLOB;
l_blob_len INTEGER;
cursor c1 is SELECT RAWCONTENT FROM BLOCK;
BEGIN
-- Get LOB locator
-- Open the destination file.
l_file := UTL_FILE.fopen('BLOBS','Myfile.lst','w', 32767);
open c1;
loop
fetch c1 into l_blob;
exit when c1%notfound;
l_blob_len := DBMS_LOB.getlength(l_blob);
-- Read chunks of the BLOB and write them to the file
-- until complete.
WHILE l_pos < l_blob_len LOOP
DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
UTL_FILE.put_raw(l_file, l_buffer, TRUE);
l_pos := l_pos + l_amount;
END LOOP;
end loop;
-- Close the file.
UTL_FILE.fclose(l_file);
EXCEPTION
WHEN OTHERS THEN
-- Close the file if something goes wrong.
IF UTL_FILE.is_open(l_file) THEN
UTL_FILE.fclose(l_file);
END IF;
RAISE;
END;
/

Similar Messages

  • Display BLOB (image) column in (interactive) report

    Hi,
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query. if possible, i would like to control the size of the picture rendered within the report like say 40*50.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    in my query.
    The above also makes the report column as of type "number". is this expected?
    Any help would be much appreciated.
    Regards,
    Ramakrishnan

    You haven't actually said what the problem is?
    >
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    >
    Something like:
    select
              name
            , description
            , dbms_lob.getlength(picture) picture
    from
              details
    if possible, i would like to control the size of the picture rendered within the report like say 40*50.For images close to this size it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
    .apexir_WORKSHEET_DATA td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }where the <tt>PICTURE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, scaling large images in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.

  • Display blob content as pdf file

    Dear Expert,
    Currently i'm using oracle apex 3.0.1.
    I'm having a problem on displaying blob content (from database table) as pdf file on oracle application express but i'm able to save to download the pdf.
    Below is the procedure that i used to display blob content,
    PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc BLOB;
    BEGIN
    begin
    selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
    into lob_loc,l_length
    from ord_img
    where oi_tno= pv_image
    and oi_ti='PDF'
    and oi_idx=pv_index;
    exception
    when others then
    null;
    end;
    OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
    HTP.p ('Content-length: ' || l_length);
    OWA_UTIL.http_header_close;
    WPG_DOCLOAD.download_file (lob_loc);
    END lf_html_pdf;
    I get the error message as below when i execute the procedure above;
    Error report:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 356
    ORA-06512: at "SYS.OWA_UTIL", line 415
    ORA-06512: at "HCLABPRO.PKG_PDF", line 220
    ORA-06512: at line 2
    *06502. 00000 - "PL/SQL: numeric or value error%s"*
    I'm appreciated if expert can have me on the problem above?
    Thanks
    From junior

    *Always post code wrapped in <a href=http://wikis.sun.com/display/Forums/Forums+FAQ#ForumsFAQ-Arethereanyusefulformattingoptionsnotshownonthesidebar?"><tt>\...\</tt> tags</a>:*
      PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
         l_mime        VARCHAR2 (255);
         l_length      NUMBER;
         l_file_name   VARCHAR2 (2000);
         lob_loc       BLOB;
      BEGIN
          begin
            selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
            into lob_loc,l_length
            from ord_img
            where  oi_tno= pv_image
              and oi_ti='PDF'
              and oi_idx=pv_index;
          exception
                when others then
                null;
            end;
         OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
         HTP.p ('Content-length: ' || l_length);
         OWA_UTIL.http_header_close;
         WPG_DOCLOAD.download_file (lob_loc);
      END lf_html_pdf; Start by getting rid of:
          exception
                when others then
                null;and never using it anywhere ever again.
    If you're not actually going to use the <tt>l_mime</tt> and <tt>l_file_name</tt> variables then remove these as well. (Although I really think you should set a filename.)
    >
    Error report:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 356
    ORA-06512: at "SYS.OWA_UTIL", line 415
    ORA-06512: at "HCLABPRO.PKG_PDF", line 220
    ORA-06512: at line 2
    06502. 00000 - "PL/SQL: numeric or value error%s"
    >
    The error stack indicates that the exception is being raised in <tt>HCLABPRO.PKG_PDF</tt>: what is <tt>HCLABPRO.PKG_PDF</tt>? Does this actually have anything to do with the procedure above?
    I get the error message as below when i execute the procedure above;How do you execute it?
    What happens when it's executed without the <tt>when others...</tt> built-in bug?

  • Displaying BLOB of type word doc in XML Publisher pdf output

    Hi all,
    Please guide me relating the Displaying BLOB of type word doc in XML Publisher pdf output with links or pointers.In the following xml column TRADE_LICENSE_COPY is BLOB when queried from toad and if clicked on the ouput word doc is being opened directly.How to show the column value word doc as attachment in pdf output?
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Generated by Oracle Reports version 10.1.2.3.0 -->
    <XXTDIC_SUP_REG>
    <LIST_G_BASIC_QUSNRY>
    <G_BASIC_QUSNRY>
    <RESPONSE_ID>194</RESPONSE_ID>
    <UAE_REGISTRATION>Yes</UAE_REGISTRATION>
    <TRADE_LICENSE_COPY>PK</TRADE_LICENSE_COPY>
    <WEBSITE_DETAILS>com</WEBSITE_DETAILS>
    <AMERICA_2009_2010>Between 81 and 90 %</AMERICA_2009_2010>
    </G_BASIC_QUSNRY>
    </LIST_G_BASIC_QUSNRY>
    <LIST_G_CONTACTS>
    <G_CONTACTS>
    <CONTACT_PERSON>MR.NTF1 NTL1</CONTACT_PERSON>
    <PHONE_NUMBER>0</PHONE_NUMBER>
    <EMAIL_ID>na</EMAIL_ID>
    <FAX_NUMBER>0</FAX_NUMBER>
    </G_CONTACTS>
    <G_CONTACTS>
    <CONTACT_PERSON>MR.NTF1 NTL1</CONTACT_PERSON>
    <PHONE_NUMBER>0</PHONE_NUMBER>
    <EMAIL_ID>na</EMAIL_ID>
    <FAX_NUMBER>-</FAX_NUMBER>
    </G_CONTACTS>
    </LIST_G_CONTACTS>
    <LIST_G_SC_QUSNRY>
    <G_SC_QUSNRY>
    <RESPONSE_ID1>113</RESPONSE_ID1>
    <FY3_PROJTYPE_COMMERCIAL>Between 21 and 30 %</FY3_PROJTYPE_COMMERCIAL>
    <ENG_INSTALL_CAPABILITY></ENG_INSTALL_CAPABILITY>
    <SCM_EXPERIENCE_PARTNERING>Have you had experience of &quot;Partnering&quot;?(i.e with major contracts / employers If so list them.Also please provide details</SCM_EXPERIENCE_PARTNERING>
    </G_SC_QUSNRY>
    </LIST_G_SC_QUSNRY>
    <LIST_G_ADDRESS>
    <G_ADDRESS>
    <OFFICE_ADDRESS>Addres1</OFFICE_ADDRESS>
    <ADDRESS_LINE1>Addre line1</ADDRESS_LINE1>
    <ADDRESS_LINE2>Addre line2</ADDRESS_LINE2>
    <ADDRESS_LINE3>Addre line3</ADDRESS_LINE3>
    <CITY>City1</CITY>
    <STATE>State1</STATE>
    <COUNTRY>US</COUNTRY>
    </G_ADDRESS>
    <G_ADDRESS>
    <OFFICE_ADDRESS>Addres2</OFFICE_ADDRESS>
    <ADDRESS_LINE1>Addre line1</ADDRESS_LINE1>
    <ADDRESS_LINE2>Addre line2</ADDRESS_LINE2>
    <ADDRESS_LINE3>Addre line3</ADDRESS_LINE3>
    <CITY>City2</CITY>
    <STATE>State2</STATE>
    <COUNTRY>IN</COUNTRY>
    </G_ADDRESS>
    </LIST_G_ADDRESS>
    <LIST_G_DSN_QUSNRY>
    </LIST_G_DSN_QUSNRY>
    <LIST_G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>060.42</PROD_SUB_CODE>
    <PROD_SUB_DESC>Automotive Maintenance Items and Repair/Replacement Parts.Filters: Air, Fuel, Oil, Power Steering, Transmission and Water, and PCV Valves</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>060.60</PROD_SUB_CODE>
    <PROD_SUB_DESC>Automotive Maintenance Items and Repair/Replacement Parts.Hose and Hose Fittings: Brake, Heater, Radiator, Vacuum, Washer, Wiper, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>207.37</PROD_SUB_CODE>
    <PROD_SUB_DESC>Computer Accessories and Supplies.CRT Holders, Cases, Glare Screens, Locks, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>207.60</PROD_SUB_CODE>
    <PROD_SUB_DESC>Computer Accessories and Supplies.Keyboard Dust Covers, Key Top Covers, Keyboard Drawers, Wrist Supports, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    </LIST_G_PROD_SUB_CODE>
    <LIST_G_CONT_QUSNRY>
    </LIST_G_CONT_QUSNRY>
    <LIST_G_BUSS_CLASS>
    <G_BUSS_CLASS>
    <BUSS_CLASS>SUPPLY_CHAIN</BUSS_CLASS>
    </G_BUSS_CLASS>
    </LIST_G_BUSS_CLASS>
    <CF_SUPPLIER_NAME>N1</CF_SUPPLIER_NAME>
    <CF_REG_STATUS>Draft</CF_REG_STATUS>
    <CF_BUS_CLASS></CF_BUS_CLASS>
    <CF_PROD_SUBCODE>060.36</CF_PROD_SUBCODE>
    <CF_PROD_SUBCODE_MEAN>Automotive Maintenance Items and Repair/Replacement Parts.Electrical Accessories: Alternators, Ammeters, Coils, Distributors, Generators, Regulators, Starters, etc.</CF_PROD_SUBCODE_MEAN>
    <CF_COUNTRY>India</CF_COUNTRY>
    </XXTDIC_SUP_REG>
    Thanks in advance.
    Best Regards,
    Mahi

    Mahi,
    you can't do that yet.

  • Display BLOBS

    I am trying to display BLOBS in HTMLDB using Report. I am not able to display images, PDF or Docs.
    I am using the following procedure DISPLAY_IMAGE
    create or replace procedure "DISPLAY_IMAGE"
    (p_image_id IN NUMBER)
    is
    l_mime varchar2(255);                
    l_length number;
    l_file_name varchar2(2000);
    lob_loc BLOB;
    begin
    select mime_type,image_data, file_name, dbms_lob.getlength(image_data)
    into l_mime, lob_loc, l_file_name, l_length
    from image_table where image_id = p_image_id;
                                       owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );      
    htp.p('Content-length: ' || l_length);
    htp.p('Content-Disposition: filename="' || l_file_name || '"');
    owa_util.http_header_close;
    wpg_docload.download_file( Lob_loc );
    end;
    I tried building with the following region source in the Report
    select
    '<iframe src="#OWNER#.display_image?p_image_id=&i.image_id." width=300> </iframe>' img, image_id, file_name, mime_type from image_table i
    Any ideas???

    Does accessing #OWNER#.display_image?p_image_id=&i.image_id. directly via your browser work if you replace &image_id. and #OWNER# with valid values (i.e. is a popup window displayed asking you to save or open the file)? If this works then...
    The HTTP header output by the following line tells a browser to popup the "Save to disk" dialog.
    htp.p('Content-Disposition: filename="' || l_file_name || '"');
    If you are wanting to just display the content of the file (e.g. image, pdf etc.) in the browser you will want to remove that line.
    [ BTW, I am not sure if you can set the src attribute of the IFRAME tag to be an image. PDFs should work though I think ]

  • Displaying the value of an variable on the stage

    I have managed to display the values contained in string variables on stage, and I am happy with that, however when I wish to display the value of an int and convert it to a string as one is supposed to do the output to the stage just calls it [class int] and does not give its value. any suggestions?
    My rogram contains a stage at frame 1 which displays a word. The user must input a word. Frame 30 then displays the word which was displayed and the word input by the user. That all works fine. But the value of the variable NumberRight, which has been assigned to that variable will only display as [class int] without showing its value. (even though I have converet it to a string using the .to string function you see below).
    My code is as follows;
    trace( "The number correct was" + NumberRight); //This works fine in the output window and shows the value of the variable as NumberRight [class int]1 (showing the value to be 1)
    outputText.appendText("in/"+textAtIN); //this works fine displaying the word presented and word input by user as in/in
    outputText.appendText( NumberRight.toString(     )); //here lies the problem as it just displays [class int] and nothing else.
    Yes I have managed to overcome that problem it was some code on the first frame, please excuse, however, now, is there any way to remove the [class int] bit from the displays, I wish to have the results as a clear copy of the results so that they can be printed out, without [class int] all over the place?

    Hi Ned thanks for that. Yes I had accidently created blank spaces in the String() argument. (wanted to check if there was a subsequent difference in display and forgot to return them to normal ...Sorted )
    Your next suggestion has eliminated the [class int] but I get a value now of 0.
    My code on the first frame for a correct response for example is;
    function keyPressedIN(event:KeyboardEvent):void
              if (event.keyCode == 13)/*Normally,this will move straight on to the next frame-
              recording a correct response and all that that implies in terms of scores etc. But now I have re directed it to Frame 30 to check are the variables working properly*/
                        //insert code for correct responses vowels etc.
                        VowelI = VowelI+1;
                        NumberRight = NumberRight +1;
                        stage.focus = stage;
                        //There is no need to display the text box as this is a correct response.
                        pupilsResponseIN.visible = false;
                        mainText.visible = false;
                        gotoAndPlay(30);//at the moment this takes me to the display frame to check if all is ok
    On the first frame when the user say hits the Return key my code assigns the value of +1 to the variable; eg
    NumberRight=NumberRight+1;
    and the value of +1 to the value of VowelI
    VowelI=VowelI+1
    At Frame 30 the code is as follows;
    stop();
    trace( "The number correct was"+ NumberRight);
    outputText.appendText("in/"+textAtIN);
    outputText.appendText( "\n");
    outputText.appendText("Vowels Correct ="+(int(VowelI).toString()));
    outputText.appendText( "\n");
    outputText.appendText("TotalCorrect="+(int(NumberRight).toString()));
    //outputText.appendText( VowelI.toString());
    Now what I am getting  is
    in/in
    Vowels Correct = O
    Total Correct = O
    Yet the trace (output box) records the Number correct as [class int]1 
    many years ago I wrote this same program in Authorware using similar code. I am trying to re write it in FlashCS5 using ActionScript 3 and It take days to solve small problems. I notice also that If for example the user of the program makes an error and I record the error as NumberRight =NumberRight -1 the program records it as Total Correct = NaN .
    I gave up on this a few months back but I am trying again. I think there must be a better way to do this. Variables do not seem to add up or subtract for me at present. no doubt its me thats got it wrong.

  • Form displays NULL values

    A page is using PL/SQL script to display data. There are 2 display variables. Instead of bringing initial set of data, it displays NULL values. It "fixes" itself after changing variable values from a drop down menu. Why is that and how to fix it?

    If you plan on performing all of the work under the Click event, then you won't need to worry about assigning a Script scope to the variables, but if you are planning on using those variables outside of the Event, then David's answer is the way to go.
    Another option is to use a hash table as it also works around the issue with variable scope in a UI Event.
    #Define at beginning of script
    $hashtable = @{}
    $OKButton.Add_Click({$hashtable.SelectedTemplate=$Something})
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.

    I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.
    I don't want it to be an EEM Event, I just want to run it from the (tcl)# prompt.
    So I guess I'm asking if you can use cli_exec and other commands in the "namespace import ::cisco::eem::*" in a normal non-EEM script - can I do that?
    This is the error I get:
    OTN.159(tcl)#source flash:TCL_SNMP_Remote_Read.tcl
    invalid command name "::cisco::eem::event_register_none"             ^
    % Invalid input detected at '^' marker.
    What am I missing?
    =================  TCL_SNMP_Remote_Read.tcl  ==============================
    ::cisco::eem::event_register_none
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    if [catch {cli_open} RESULT]
        { error $RESULT $errorInfo }
        else { array set cli1 $RESULT }
    if [catch {cli_exec $cli1(fd) "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0" } RESULT]
           { error $RESULT $errorInfo  }
           else { set SnmpSysDesc $RESULT }
    if [catch {cli_close $cli1(fd) $cli1(tty_id)} RESULT] {
                error $RESULT $errorInfo
    puts $SnmpSysDesc
    =========================================================================
    In the sho-run config I have:
    event manager directory user policy "flash:/"
    event manager session cli username "cisco"
    Any help to get me started would be greatly appreciated!
    Tim

    If you don't want an EEM policy, then don't use any of the EEM constructs.  Instead, all you need is this:
    set output [exec "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0"]puts $output

  • Displaying default value for a field in ALV table

    Hai all,
         I am having an ALV table in which I want to display Requisition number by default using a value which i generated randomly and it is stored in a variable.
    While displaying ALV table my req number field should display that value by default when ever user is inserting a row( all the coloumns n my alv are editable.
    Is it possible?? 
    Kindly give some suggestions.
    Thanks in Advance,
    Nalla.B

    Hai Kris,
        I took help from ur link and i declared a global attribute request_number.
    and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
    FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
      DATA bill_details TYPE REF TO zdom_bill_detail.
      LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
        bill_details ?= <wa_row>-r_value.
        IF bill_details->REQ_NUMBER IS INITIAL.
      DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
      DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
      DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
    navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
      lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
    lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
          lo_el_bill_detail->set_attribute(
            EXPORTING
              name  = 'REQ_NUMBER'
              value = wd_comp_controller->request_number
    Wen am  setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
    lo_el_bill_detail->set_attribute(
        name =  `REQ_NUMBER`
        value = wd_comp_controller->request_number ).
    Pls give some suggestions,
    Thanks in Advance,
    Nalla.B

  • How to display the values stored in the database in the combobox on load?

    I am develping one application where in
    I wanted to display the values in the combobox which I am taking from the database and in the same form passing that value in same form after selecting it,My program is running fine for the first time but next time it is giving me NullPointerException.
    So can anyone tell me please how I should develop the this application to avoid this exception?
    Thank You
    Praddy

    Thanx a lot for showing interest in answering my query.I am pasting my code for ur reference.Please try to reply ASAP.
    Thank You,
    Praddy.
    CODE:
    ======
    <html>
    <head>
         <script language="javascript">
              function submitthisform(thisForm)
                   thisForm.submit();                    
         </script>
    </head>
    <body>
    <form method=post name=samepgm>
    Select City:     <select name=city onChange='submitthisform(samepgm)'><br><br><br>
    <option value=''></option>
    <option value='All'>All</option>
    <%@ page language="java" import="java.sql.*" %>
    <%
              String scity = request.getParameter("city");
              System.out.println(scity);
              Connection con = null;
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              con = DriverManager.getConnection("jdbc:odbc:property","","");
              Statement st = con.createStatement();          
              ResultSet rs1 = st.executeQuery("select distinct hcity from housefinance");
              while(rs1.next())
                   //String ohname = rs1.getString("hname");     
                   String     ocity = rs1.getString("hcity");     
                   //out.println(ohname +"<br>");
                   out.println(ocity +"<br>");
    %>
    <br><br><br><option value='<%=ocity%>'><%=ocity%></option><br>
    <%               }
                   rs1.close();
              if(scity.equals("All"))
              ResultSet rs2 = st.executeQuery("select * from housefinance");      
              while(rs2.next())
                   String     ohname = rs2.getString("hname");     
                   String     ohadd1 = rs2.getString("hadd1");
                   //String ohadd2 = rs2.getString("hadd2");
                   String     ohcity = rs2.getString("hcity");
                   String     ohpcode = rs2.getString("hpcode");
                   String     ohtelno = rs2.getString("htelno");
                   String     ohfaxno = rs2.getString("hfaxno");
                   String     ohemail = rs2.getString("hemail");
                   String     ohmobile = rs2.getString("hmobile");     
    %>
    <pre>
    <tr>
    <td><p>Company          :     <%=ohname%> </p></td>
    <td><p>Address          :     <%=ohadd1%></p></td>
    <td><p>City          :     <%=ohcity%> </p></td>
    <td><p>Pin          :     <%=ohpcode%></p></td>
    <td><p>Telphone          :     <%=ohtelno%></p></td>
    <td><p>Fax No:          :     <%=ohfaxno%></p></td>
    <td><p>Email          :     <%=ohemail%></p></td>
    <td><p>Mobile No.     :     <%=ohmobile%></p></td>
    </tr>
    </pre>
    <%
              else
    ResultSet rs = st.executeQuery("select * from housefinance where hcity like '%"+scity+"%'");
              while(rs.next())
                   String     ohname = rs.getString("hname");     
                   String     ohadd1 = rs.getString("hadd1");
                   //String ohadd2 = rs.getString("hadd2");
                   String     ohcity = rs.getString("hcity");
                   String     ohpcode = rs.getString("hpcode");
                   String     ohtelno = rs.getString("htelno");
                   String     ohfaxno = rs.getString("hfaxno");
                   String     ohemail = rs.getString("hemail");
                   String     ohmobile = rs.getString("hmobile");     
    %>
    <tr>
    <td><p>Company          :     <%=ohname%> </p></td>
    <td><p>Address          :     <%=ohadd1%></p></td>
    <td><p>City          :     <%=ohcity%> </p></td>
    <td><p>Pin          :     <%=ohpcode%></p></td>
    <td><p>Telphone          :     <%=ohtelno%></p></td>
    <td><p>Fax No:          :     <%=ohfaxno%></p></td>
    <td><p>Email          :     <%=ohemail%></p></td>
    <td><p>Mobile No.     :     <%=ohmobile%></p></td>
    </tr>
    <hr>
    <%               }
    %>
    </select>
    </form>
    </body>
    </html>

  • How can I display the value of the Target Currency variable in my query

    We have a query which has a key figure set to prompt for a Target Currency at runtime.  Because the user did not want the currency displayed in each cell they used the NODIM function to remove it. They do however want to display the Target Currency in a cell within the report.  Using Report Designer, I've tried to set up a Text Box to display this value, however, it is not in the list when looking at Constants, Filters or Variables or trying to display it in a Text box.  Has anyone found a way to be able to do this?

    Hi and thanks for the reply.  I should have stated that because this was a validated query, we'd like to do this without modifying the query and thus having to go through another lengthy validation process. That's why we did not go the route of adding Unit to the query but we may have to.  Another thing we can do is use a text variable in the headers that displays the currency. That works but, again, it's a query change whereas finding it in Report Designer will not require a query modification.

  • How to display the values in JSpinner in format  day:HH:mm

    Hi All,
    I want to know how can I display the values inside a JSpinner in the format day:HH:mm. Here the value of 'day' can be anything say from 0 to 365 and HH stand for hour and mm stands for minutes.
    I tried to implement it using
    mSpinner.setEditor(new JSpinner.DateEditor(mSpinner, "DD:HH:mm"));
    but here the values of day was not proper. Please let me know if there is any standard format or how can I configure my own editor.
    Thanks,
    Rohit.

    Hi,
    It worked well for 112 as 112 comes under April month.. i.e. it will work properly for the range 91 to 120 as the current month is April and if we start counting from january 01 then for April month , the number of day will fall under range 91 to 120.
    See, it will allow you to change the values beyond the limit (i.e. less than 91 or more than 120) but the real problem is that I used this spinner in the table and when I will try to save the value of spinner , then if the value of day in beyond the limit 91 to 120 then it will automatically changing in the range between 91 to 120.
    I tried to use format DD:HH:mm ...... do I need to use any other format..
    Hi All,
    I want to know how can I display the values inside
    de a JSpinner in the format day:HH:mm. Here thevalue
    of 'day' can be anything say from 0 to 365 and HH
    stand for hour and mm stands for minutes.
    I tried to implement it using
    mSpinner.setEditor(newJSpinner.DateEditor(mSpinner,
    , "DD:HH:mm"));
    but here the values of day was not proper. Define "not proper". I just tried it and it displayed
    day 112 for today which seems correct.

  • How to display field value only once in REUSE_ALV_GRID_DISPLAY

    hi experts,
                   i am using REUSE_ALV_GRID_DISPLAY, for alv outpur display.but i want one of the field in output ,not to display the value which is of same, it have to be displayed only once, I mean i have a number which contains multiple line items corresponding, here i want to display the field value only once when it is repeating , for the same header number, how can i achieve it

    Hi,
    check the sample code,
    REPORT  Z_ALV.
    Database table declaration
    TABLES:
      sflight.
    Typepool declaration
    TYPE-POOLS:
      slis.
    Selection screen elements
    SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS:
      s_carrid FOR sflight-carrid.
    SELECTION-SCREEN END OF BLOCK blk_1.
    Field string to hold sflight data
    DATA:
      BEGIN OF fs_sflight ,
        carrid   TYPE sflight-carrid,      " Carrier Id
        connid   TYPE sflight-connid,      " Connection No
        fldate   TYPE sflight-fldate,      " Flight date
        seatsmax TYPE sflight-seatsmax,    " Maximum seats
        seatsocc TYPE sflight-seatsocc,    " Occupied seats
      END OF fs_sflight.
    Internal table to hold sflight data
    DATA:
      t_sflight LIKE
       STANDARD TABLE
             OF fs_sflight .
    Work variables
    DATA:
      t_fieldcat TYPE  slis_t_fieldcat_alv,
      fs_fieldcat LIKE
             LINE OF t_fieldcat.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM get_data_sflight.            " Getting data for display
      PERFORM create_field_cat.            " Create field catalog
      PERFORM alv_display.
    *&      Form  create_field_cat
          Subroutine to create field catalog
          There is no interface paramete
    FORM create_field_cat .
      PERFORM fill_fieldcat USING   'Carrier Id'    'CARRID'   '2'.
      PERFORM fill_fieldcat USING   'Connection No' 'CONNID'   '1'.
      PERFORM fill_fieldcat USING   'Flight Date'   'FLDATE'   '3'.
      PERFORM fill_fieldcat USING   'Maxm.Seats'    'SEATSMAX' '4'.
      PERFORM fill_fieldcat USING   'Seats Occ'     'SEATSOCC' '5'.
    ENDFORM.                                    "create_field_cat
    *&      Form  fill_fieldcat
          Subroutine to fill data to field column
         -->p_seltext      Column label
         -->p_fieldname    Fieldname of database table
         -->p_col_pos      Column position
    FORM fill_fieldcat  USING
                        p_seltext    LIKE fs_fieldcat-seltext_m
                        p_fieldname  LIKE fs_fieldcat-fieldname
                        p_col_pos    LIKE fs_fieldcat-col_pos.
      fs_fieldcat-seltext_m  = p_seltext.
      fs_fieldcat-fieldname  = p_fieldname.
      fs_fieldcat-col_pos    = p_col_pos.
      APPEND fs_fieldcat TO t_fieldcat.
      CLEAR fs_fieldcat.
    ENDFORM.                    " fill_fieldcat
    *&      Form  get_data_sflight
          Subroutine to fetch data from database table
          There is no interface parameter
    FORM get_data_sflight .
      SELECT carrid
             connid
             fldate
             seatsmax
             seatsocc
        FROM sflight
        INTO TABLE t_sflight
       WHERE carrid IN s_carrid.
    ENDFORM.                    " get_data_sflight
    *&      Form  alv_display
          Subroutine for ALV display
          There is no interface parameter
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = t_fieldcat
        TABLES
          t_outtab      = t_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " alv_display
    End of code

  • How To Display Minus value in SAP SCript

    Hello Guys.
    I am working on a Script. My Problem is that For a fields BSAD-DMBTR.
    I have to show this fields value as minus or plus as per condition with fields
    <b>bsad-shkzg</b>. In my Internal table it's update as minus but when  I am calling  Write form with loop.  the value is not display with minus sign.
    How can I display value with minus sign in SAP script.
    Regards
    Swati,,

    Hello Guys..
    Thanks for Reply. But I am doing that thing already. My Internal table is updated with minus value. My Problem is not That.
    let's suppose.
    itab-name  =  'xyz'.
    itab-value   =   100.
    append itab.
    itab-name  =  'xyz1'.
    itab-value   =   -1 * 100.
    append itab.
    loop at itab.
    CALL FUNCTION 'WRITE_FORM'
        EXPORTING
            element                  = 'LINE'
            function                 = 'SET'
            type                     = 'BODY'
            window                   = 'MAIN'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    endloop.
    Now when value is printed in SAP Script both value is display as plus .I want to display secound value as minus.
    Please reply it's urgent.
    Thanks
    Swati....

Maybe you are looking for

  • Regarding receiver category in sales order.

    hi Gurus,              I am facing a problem in making Sales Order, the problem is as follows: - I have enter the all input to make SO, like sold-to-party, division, qty, etc. But, by cliking enter i got a massage " receiver category is not allowed b

  • New Company Code

    We created a new company code in our R/3 development system. I expected this to come through to CRM and be automatically created because when I look in CRM for previous company codes that have all been created by user ALEREMOTE ab BP's with role CRM0

  • Networking on Ubuntu VM stopped functioning after latest VMWare tools upgrade

    when configuring the latest VMWare tools, I receive the following error: "The vmxnet driver is no longer supported on kernels 3.3 and greater. Please  upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)" I have followed instructions on a few di

  • How to fetch screen field in HR abap

    hi friend,   I need to fetch a screen field q0128-tdline. And the field should be included in payslip. Is there any user exit to proceed with this.Please reply ASAP. Thanks and Regards K.karthikeyan.

  • How do I update to Gingerbread

    My fascinate never got the push for the update.  Now, its no longer available or at least my phone doesn't detect it. One Verizon rep said my signal and reception would be improved if I updated because I am having trouble accessing the towers and get