Display a value from PLSQL code to screen

How to display a value from PLSQL code to screen without loading or refreshing the page?
im using ajax to call the javascript to run the PLSQL code. i desire to view some value in the screen when i run the PLSQL code
skud.

anything that you print from the PLSQL code(using htp.p, htp.prn etc) with will available in Javascript as the server response. You can parse that string it in javascript and display it on screen or modify page items or create dynamic items/elements using those values.
A minimal example
Ondemand PLSQL process : TEST_PROCESS
begin
  htp.prn('hello world');
end;Javascript Code
var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=TEST_PROCESS',0);
ajaxResult = ajaxRequest.get();
alert(ajaxResult);Will display an alert message "hello world"
You can construct the string in JSON/XML format in PLSQL to pass complex data structures(or multiple values) or even HTML code, then do the required processing in Javascript, for example extract out item values from it and set items, convert the JSON array to a select list item in the page or put the HTML code with a div element in the page.

Similar Messages

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • Passing message from plsql code to page

    Hello Everybody,
    I am trying to pass a 'success message' from plsql code which runs on page processing to the page. This plsql is a insert statement and if statement runs successfully (on submit) then I want to show a success message on the page after summit.
    Your comment and help would be appreciated.
    Thanks,
    Raj.

    Thank you Tony.
    Stored Procedure which I am calling on the page is running in database. So if this procedure runs successfully(or vice versa), how I would know?? Is there a way to pass value from database stored procedure to it's calling page?
    Following is procedure:
    procedure load_stateday_result(key_loc ATM_STATE_DAY_INSP.KEY_LOCATION%type) is
    temp_key_insp ATM_INSPECTION.KEY_ATM_INSPECTION%type;
    temp_key_location number(8);
    temp_dte_schedule date;
    begin
    temp_key_location := key_loc;
    select key_atm_inspection,dte_schedule into temp_key_insp, temp_dte_schedule
    from atm_inspection where
    key_location = temp_key_location and exam_type = 'D' and exam_yr = to_char(sysdate,'yyyy');
    insert into atm_state_day_insp(key_atm_state_day_insp,key_location,key_atm_insp,scheduled_dte)
    values(state_day_insp_seq.nextval,key_loc,temp_key_insp,temp_dte_schedule);
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error :'|| SQLCODE||':'||SQLERRM);
    --ROLLBACK;
    RAISE;
    end load_stateday_result;
    Will appreciate your reply.
    Thanks,
    Raj, NY

  • Global Value in PLSQL Code

    How to take value of Total Compenations- >Basic -> Global Value in PLSQL Code.
    Thanks

    The Global values are stored in the table FF_GLOBALS_F, write a cursor in plsql to get the value from this table.
    Regards,
    Senthil

  • How system picks value from Tax Code

    Dear Experts,
    I have one scenario,
    In our pricing procedure there are tax condition types for which there are no condition records maintained. But the values are maintained in Tax Code.
    My doubt is, do we have to add these tax condition types in pricing procedure as they are already in Tax Code ?? Because I observed few condition types are not there in pricing procedure but the same are in Tax Code.
    Second, how the system comes to know that there is no condition record and the value is in Tax code. How does it determine and pick the value from Tax code.
    Thanks in advance
    Sagar

    Sagar,
    Let me try to clear your confusion :
    For Total determination of pricing we have two things
    Pricing Procedure and Tax Procedure.
    Pricing Procedure tell system about the what and how the price to calculated for material in Sale Order.
    In this pricing procedure the conditions JIN1 JIN2 etc ares pertaining to tax applicable on the Sale order Price.
    These conditions display the tax.
    Now the tax is calculated based on tax procedure.
    And a Tax procedure acts as a master and there is one tax procedure for one country.
    for that particular tax procedure there are tax codes defined.
    These Tax codes allows the using the same tax procedure but changing value of various conditions and removing which we dont require.
    Lets take an example : AS TAXINN is tax procedure for India. Based in this procedure many tax codes are defined for 12% vat, 6% vat , no vat etc.
    So what kind of tax will be applicable on the Sale order is governed by tax code which is mentioned in customer master.
    Based on this tax code taxes are calculated on Sales order net value and then the tax amount is displayed in pricing procedure
    You assign the tax condition types to Pricing procedure so that it will display the taxes in the sales order.
    I hope it will clear some of your doubts. Please let me know if you need further assistance.
    Thanks,
    Raja

  • How to display the values from the table in the screen

    Hi,
    I have created a screen where i will enter the values for the field treshold amount and desc and if i press update button  .it will update the new values by overriting the existing values .
    Now i have got requirement i need to create a button show which will display the existing value from the table. always there will be only one entry...in this table
    Please can one give me idea...to do this
    or sample code...thanks in advance
    regards
    paveeeeee

    Define a function code 'SHOW' for your button. In your PAI module, when you check for various sy-ucomms, check for 'SHOW' also.
    Your code will be like this:
    Case sy-ucomm.
      when 'SHOW'.
         perform show_details.
    endcase.
    In the perform, you can fetch the data from the table and put it in global variables. In the PBO, move the data from the global variables to the screen fields so that they get displayed on the screen.
    Hope this helps. Reward points for useful answers.
    Regards
    Nithya

  • Poplist and displaying corresponding values from the database table

    Hi
    I have a poplist in a control block, the values of which are populated using a procedure. This is called in when-new-form-instance.
    This part works fine and values are filled in the poplist when form is opened..
    The datablock is based on a view. 3 columns from the view are selected to be displayed.
    Also the databock is filled with all values (for selected columns)
    Now when the poplist value is changed, I need the values in the datablock to be changed as well, but this is not happening.
    In my when-list-changed trigger, I have:
    go_block('datablock');
    execute_query;Please tell , where and what should I add to display the datablock values as per the poplist value.
    i.e, something like,
    select col1,col2,col3 from <view> where col4 =:control.col4
    Note:I tried in the where clause property of the block, but then nothing is displayed in the datablock
    Thanks

    This does not work , either..
    Before, when I changed the values from the list, it was still displaying same data on datablock always(all records)
    Now when I give this code,data is displayed in datablock only once(first time when the form opens)
    I have defined the Query data source type property on data block as "Table" but infact this datablock is based on a view..is this correct?
    Anything else I could try?

  • Display multiple feild from search help into screen feild

    Dear Expert,
    I create a search help which have 2 parameters.
    The 1st parameter is as like as ztable field.
    but 2nd parameter is not a data base field. It display only the value from value table.
    Now I want to use it on a ztable when insert data from zreport.
    I also take a text field to display the 2nd parameter which is not in DDIC.
    how can I display 2nd parameter on the screen text field ?
    pls help me.
    Thanks
    rayhan

    not proper answer

  • Get distinct values from plsql array

    Hi,
    I have declared a variable as below in plsql proc.
    type t_itemid is table of varchar2(10);
    inserted set of items in to this using a program
    now i want distinct values from that array how can i get it.

    I am using 9i so i cannot use set operator and more over my problem is that i am declaring the variable inside the plsql block . when i tried i am getting the below errors:
    SQL> r
    1 declare
    2 type t_type is table of varchar2(10);
    3 v_type t_type;
    4 begin
    5 v_type := t_type('toys','story','good','good','toys','story','dupe','dupe');
    6 for i in (select column_value from table(v_type)) loop
    7 dbms_output.put_line(i.column_value);
    8 end loop;
    9* end;
    for i in (select column_value from table(v_type)) loop
    ERROR at line 6:
    ORA-06550: line 6, column 41:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 6, column 35:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 10:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 7, column 22:
    PLS-00364: loop index variable 'I' use is invalid
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored

  • Display last value from a row or column?

    I'm using Numbers 09 and want to display the last value entered in a column in another table.
    For example in Table A I have columns set up by date with simple sums at the bottom of each column. I add new sums every day depending on the values from that day. What I'd like to do is get the last daily total and enter that value into another table called Table B. Is there a formula that will do that?
    If I'm not being clear enough please let me know what additional information you need and I will be happy to provide it.
    Thanks,
    rkaufmann87

    rkaufmann87 wrote:
    Hi Barry,
    Thanks for posting the example, not quite though. In your sample Table A is transferring all the totals to Table B. What I'd like is as I enter the data in the columns in Table A Table B then picks up the latest update in a single cell. For example lets say Table A's Column A is May 1 and the total is 45, let's say that sum is placed in A15. Table B automatically picks up A15 from Table A and makes a duplicate in Table B cell A1, then the next day Table A's Column B is May 2 and the total is 90 (cell B15), then Table B senses the latest total is 90 and enters that in cell A1 again. Is this possible?
    Here's another go.
    Table 1 has a second Header row added (row 2) Cells in this row contain the formula
    =IF(A1=MAX($1:1),COLUMN(),"")
    Which returns the column number of the cell in row 1 containing the latest date. (4) This number is used by Table 2 to determine the column from which to return the total in the bottom (footer) row. (see below)
    A1 in Table 2 and Table 3 contain the same formula:
    =MAX(Table 1 :: $1:1)
    This returns the latest date from row 1 of Table 1.
    A2 in Table 2 and Table 3 contain formulas that return the value in the bottom cell of the column containing the latest date in row 1.
    Table 2:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,MAX(Table 1 :: $2:2)-1)
    Table 3:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,COUNT(Table 1 :: $1:1)-1)
    Both use the same base ($A$1) and the same row offset (ROWS('May 1, 2010')-1) to reach the bottom row of Table 1.
    Table 2 uses the maximum (and only) numerical value in row 2 of Table 1 ( MAX(Table 1 :: $2:2) ), then subtracts 1 to reach the fourth column of table 1.
    Table 3 uses the same means to determine the row offset, but counts the number of dates entered into row 1 of Table 1 ( COUNT(Table 1 :: $1:1) ), then subtracts 1 to reach the same cell.
    I prefer the method in Table 3 because it avoids the need for the second Header row and the possibility of overwriting the formulas in that row. (Row 2 of Table 1 may be deleted without affecting Table 3.) It does require that there be no empty cells in Row 1 from Column A to the column containing the latest date.
    Regards,
    Barry

  • How to pass the value from z-program to screen

    Hi,
    I have created a Z-report which is displaying the data according to the selection screen,but while going to click on 1 pushbutton,it should call z-transaction.
    My problem is how i will pass the selected data to my screen.suppose i have selected 1 material no.,i want to pass the material no. to my matnr field in my screen(which is already present in my screen)

    HI.
    Create SET PF-STATUS 'STATUS'.like as follows.
    1 .double click on  'STATUS1' create pushbutton by appilcation tool bar.
    2 .In fuction attributs ,In fuction code give your t-code.
    3.In Fucntion type give T.
    Eg:
    module STATUS_1001 output.
      SET PF-STATUS 'STATUS1'.
      SET TITLEBAR 'TITLE1'.
    endmodule.                 " STATUS_1001  OUTPU
    It will helpfull u.
    Regards.
    Jay

  • Get parameter value from PLSQL portal Item

    Hi,
    i have some page link like :
    http://server:7777/portal/page?...&myparameter=test
    I don't know how to get myparameter. I want to access this parameter value in a PlSql portal Item in this page
    can somenone help me ?
    is there an API to get those parameters?
    thanks in advance
    Joao

    If do you want to get a parameter value from an item, you'll need to construct a procedure that receive your parameter value and configure your item to call this procedure.
    But If you want to get a parameter from a portal page, first you need to configure the parameter in page properties, construct a portlet and configure "function describe_parameters" to get the parameter and work your parameter in "procedure show".

  • Passing value from plsql back to UNIX

    I have a shell script which calls out to a plsql program using sqlplus command, but how do I return the values from the plsql program (a simple SELECT statement) back to the Unix script? Thanks.
    James

    Create one UNIX script
    eg :- C2_ATG_Insert.sh
    #!/usr/bin/ksh
    #Variables to store the values
    count=0
    Count_ILX_EXCH=0
    Count_ILX_CBOE_SERIES=0
    Count_ILX_UNDLY_INST=0
    Count_STOCK_TIPS=0
    Count_TIPSSUM=0
    # Block to check whether date is passed as a parameter
    if (($# != 1))
    then
    echo "Usage: C2_ATG_Insert.sh dd-mon-yy"
    exit 1
    fi
    # Assign the trade date to a variable
    Temp_Date=$1
    # Call the sql, Count_Temp.sql with date as parameter
    sqlplus usernam/password@Database_Name @Counts_Temp.sql $Temp_Date
    # remove the blank lines
    sed '/^$/d' Counts_Temp.lst > Counts_C2ATG.lst
    # Store variables from the spooled file which gets generated in Count_Temp.sql into variables defined
    while read myline
    do
    count=$(($count + 1))
    case $count in
    1) Count_ILX_EXCH=$myline ;;
    2) Count_ILX_CBOE_SERIES=$myline ;;
    3) Count_ILX_UNDLY_INST=$myline ;;
    4) Count_STOCK_TIPS=$myline ;;
    5) Count_TIPSSUM=$myline ;;
    esac
    done < Counts_C2ATG.lst
    echo "ILX_EXCH Count $Count_ILX_EXCH"
    echo "ILX_CBOE_SERIES Count $Count_ILX_CBOE_SERIES"
    echo "LX_UNDLY_INST Count $Count_ILX_UNDLY_INST"
    echo "STOCK_TIPS Count $Count_STOCK_TIPS"
    echo "TIPSSUM Count $Count_TIPSSUM"
    if [ $Count_ILX_EXCH -eq 0 ] || [ $Count_ILX_CBOE_SERIES -eq 0 ] || [ $Count_ILX_UNDLY_INST -eq 0 ] || [ $Count_STOCK_TIPS -eq 0 ] || [ $Count_TIPSSUM -eq 0 ]
    then
         echo "*********** Count in one of the tables is Zero *****************"
         exit 1
    fi
    Create the SQL File eg Count_Temp.sql
    SET heading off
    SET VERIFY OFF
    SET PAUSE OFF
    SET ECHO OFF
    SET TIMING OFF
    spool Counts_Temp.lst;
    select count(*) from ILX_EXCH where trade_date= '&&1'
    UNION ALL
    select count(*) from ILX_NONCBOE_SERIES where trade_date= '&&1'
    UNION ALL
    select count(*) from ILX_UNDLY_INST where trade_date = '&&1'
    UNION ALL
    select count(*) from STOCK_TIPS where trade_date = '&&1'
    UNION ALL
    select count(*) from TIPSSUM where trade_date ='&&1
    spool off;
    exit;
    Do reply in case you are unable to undertand any part of the scripts

  • How to get the Open Order Qty value from Transaction Code RWBE?

    Hello,
    Recently I have a program that needs to extract the value of Open Order Qty value from RWBE.
    My specific steps are as follows:
    - I go to tcode <b>RWBE</b>
    - I select the <b>material and plant</b>
    - I tick the checbox for <b>"Also select special stocks"</b> and <b>"Also select stock commitments"</b>
    - I execute the program double click one of the rows for the <b>Unrestricted Use coulmn</b> and view the <b>Open Order Qty</b>.
    My question is how is this particlar variable attained? I tried Ekbe and the ELIKZ feild from EKPO and I still cant seem to get the right value.
    Hope to hear from you soon.
    Thank you and good day.

    check with FM :
    CALL FUNCTION 'MB_ADD_PURCHASE_ORDER_QUANTITY'
           EXPORTING
              x_matnr = t_matnr-matnr         " TGA/4.6 Erw. Lot
              x_meins = t_matnr-basme         " TGA/4.6 Erw. Lot
                x_matnr = prt_matnr-matnr  " TGA/4.6 Erw. Lot
                x_meins = prt_matnr-basme  " TGA/4.6 Erw. Lot
                x_elikz = space
                x_loekz = space
           TABLES
                xtab    = xtab
                xwerks  = r_werks.
    above fm will get open order qty for given material in po

  • Reading value from bar code reader into JSP

    Hi all,
    I am designing a web-site which can read the barcode value from the barcode scanner.Please let me know how to do that.
    Awaiting Reply.
    Thanks
    Gowrishankar

    1) I don't think there's a <input type="barcode-reader"/> form element in HTML - whether it was generated from a JSP or not doesn't matter.
    2) You could use an applet. But only if the user has all necessary means installed to let Java use the barcode reader.
    3) The applet needs to be signed, of course.
    4) If the user doesn't have the stuff installed, you could theoretically make the applet install it, if it knows where to get the resources and if the access restrictions allow it.
    So there's a purely theoretical possibility at best.

Maybe you are looking for