Execute query in mapping and map the result to next field in target

Hi Guys,
Doing file to jdbc Scenario.
source:
root:
  row
       sf1
target:
root:
    row
       target1
       target2
I have requirement as:
I have to map sf1 to target1 ( I do not have any problema in it)
target2 field must populate basing upon query which results. this should run with the input parameter sf1. If the query results then update target2 else update with MESSAGE_DONE.

Hi Swarna,
What kind of query do you mean? In certain cases, it might be worthwhile to consider ABAP mapping, which seems to be the easiest way to do some sequential steps, especially for such a simple message structures.
Hope this helps,
Grzegorz

Similar Messages

  • How to execute a string formula and assign the result to a number field

    How to execute a string formula and assign the result to a number field
    Hi,
    we have a function that returns a string like this:
    '(45+22)*78/23'
    After we should calculate this string and assign the value to a numeric block field
    Example:
    k number(16,3);
    k:=fun1('(45+22)*78/23'); where fun1 execute and translate to number the string.
    Does exist a function like fun1 ??
    How can we do ?
    Regards

    Hello,
    this is the code that does the job:
    SQL> set serveroutput on
    SQL> DECLARE
    2 ch VARCHAR2(20) :='22+10' ;
    3 i NUMBER ;
    4 BEGIN
    5 EXECUTE IMMEDIATE 'select ' || ch || ' from dual' INTO i;
    6 dbms_output.put_line ('i = ' || TO_CHAR(i));
    7 END ;
    8 /
    i = 32
    Procédure PL/SQL terminée avec succès.
    SQL>
    just you have to do is to create a small stored function that take the string to calculate and return the number result
    Francois

  • Convert this query to ABAP and display the results

    Hi Everyone,
    I have a sql query in native sql (oracle). I want execute it in ABAP editor and display the results.
    I need to get this to an internal table and display the results. How do i write the script any help will be great use to me.
    Here is the query:
    <i> select (select decode(extent_management,'LOCAL','*',' ') ||
                   decode(segment_space_management,'AUTO','a ','m ')
              from dba_tablespaces where tablespace_name = b.tablespace_name) || nvl(b.tablespace_name,
                 nvl(a.tablespace_name,'UNKOWN')) name,
           kbytes_alloc kbytes,
           kbytes_alloc-nvl(kbytes_free,0) used,
           nvl(kbytes_free,0) free,
           ((kbytes_alloc-nvl(kbytes_free,0))/
                              kbytes_alloc)*100 pct_used,
           nvl(largest,0) largest,
           nvl(kbytes_max,kbytes_alloc) Max_Size,
           decode( kbytes_max, 0, 0, (kbytes_alloc/kbytes_max)*100) pct_max_used from ( select sum(bytes)/1024 Kbytes_free,
                  max(bytes)/1024 largest,
                  tablespace_name
           from  sys.dba_free_space
           group by tablespace_name ) a,
         ( select sum(bytes)/1024 Kbytes_alloc,
                  sum(maxbytes)/1024 Kbytes_max,
                  tablespace_name
           from sys.dba_data_files
           group by tablespace_name
           union all
          select sum(bytes)/1024 Kbytes_alloc,
                  sum(maxbytes)/1024 Kbytes_max,
                  tablespace_name
           from sys.dba_temp_files
           group by tablespace_name )b
    where a.tablespace_name = b.tablespace_name order by 1;
    </i>
    Thanks,
    Prashant.

    Hi Prashant,
    Native SQL commands in ABAP are placed between EXEC SQL and ENDEXEC. You can place all your statements in between these EXEC SQL and ENDEXEC in a report.
    EXEC SQL [PERFORMING <form>].
      <Native SQL statement>
    ENDEXEC.
    Check this link to know about Native SQL
    http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/frameset.htm
    Thanks,
    Vinay

  • Execute command on UNIX and get the result

    I want to write a Java program, which can execute a shell script in UNIX and get back the result. Any idea?

    Check these two tips:
    How to execute a command from code
    http://www.java-tips.org/java-se-tips/java.lang/how-to-execute-a-command-from-code.html
    How to read output from a Command execution
    http://www.java-tips.org/java-se-tips/java.lang/how-to-read-output-from-a-command-execution.html

  • Query a database a show the results into a form

    Hello!
    I have a general question.
    I have created a form and when the user submit it , it calls a servlet that store the information into a database.
    Now I want to make a new page where you can look for the information that the user stored in to the database (according to an ID ) and that information must be showed to the user again into a form (same form but with two or more empty fields that he can update now).
    What is the best way do that?
    Should I include in the query.jsp a bean and program all in the bean and then come back with the results to the query page?
    Im quite new to jsp, java...so , please I need your opinion about the best way to program that...
    thanks in advance

    As promised, here's a way to execute a SQL command and see the results in a JSP. It'll work with all four CRUD operations, as long as you pass valid SQL:
    <%@ page errorPage="error.jsp" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <form name="sqlQueryTester" method="post" action="sqlQueryTester.jsp">
        <center>
            <h3>SQL Query Tester</h3>
            <table>
                <tr>
                    <th>SQL Query:</th>
                    <td>
                        <textarea name="sqlQuery" rows="10" cols="80"></textarea>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <input type="submit" name="submit" value="Submit"/>
                    </td>
                    <td>
                        <input type="reset"/>
                    </td>
                </tr>
            </table>
            <c:if test="${not empty param.sqlQuery}">
                <sql:query var="queryResult" sql="${param.sqlQuery}"/>
                <hr />
                <h3>Query Results</h3>
                <c:forEach items="${queryResult.rowsByIndex}" var="row" varStatus="status">
                    <c:if test="${status.first}">
                       <table border="1" align="center" width="100%">
                           <tr bgcolor="#ffad00">
                               <c:forEach items="${queryResult.columnNames}" var="col">
                                   <th><c:out value="${col}"/></th>
                               </c:forEach>
                           </tr>
                    </c:if>
                    <tr>
                        <c:forEach items="${row}" var="value">
                            <td><c:out value="${value}"/></td>
                        </c:forEach>
                    </tr>               
                    <c:if test="${status.last}">
                        </table>
                    </c:if>
                </c:forEach>
            </c:if>
        </center>
    </form>I'll leave the web.xml and error.jsp as an exercise for you.
    This will run on Tomcat 4.1.x and JSTL version 1.0.
    %

  • Execute a Query from a report sending it parameters and capture the result

    Hello everybody,
    Greetings from Peru, I want your help, Do you know how to execute a query from a report sending parameteres and capture the result in a internal table?
    The attached imaged has in red square the parameteres I want to send from a report.
    The idea is to have a JOB that executes everyday and parameters like DATE PERIOD will change automatically.
    Thanks for your time.

    Hi Enrique,
    You can call a query from a report by using submit statement.
    Every query has a corresponding program associated with it.
    Execute the query from SQ01. On te selection screen of query, goto SYSTEM  from menu and then click on STATUS, you will get program name (In this case aqzzzent_struct=zmm_ent_struc1). Use this program to call the query from your custom program.
    Also populate the rspar int table as per the selection criteria you want to pass to query.
       DATA: rspar     TYPE TABLE OF rsparams,
        wa_rspar  LIKE LINE OF rspar.
          wa_rspar-selname = 'SP$00001'.
          wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'.
          wa_rspar-option = 'BT'.
          wa_rspar-low  = s_cmp_cd-low.
          wa_rspar-high = s_cmp_cd-high.
          APPEND wa_rspar TO rspar.
       SUBMIT aqzzzent_struct=zmm_ent_struc1 WITH SELECTION-TABLE rspar AND RETURN.
    Thanks,
    Sachin

  • Executing Abap Queries in Abap Code and processing the result

    Hi,
    I want to execute ABAP Queries (designed by sq01) in an abap report and processing the result in an internal table.
    How could it be work?
    Thanks a lot for your responses,
    with kind Regards
    Reinhold Strobl

    Hello,
    GO to SQ01 and select your query. Go to Menu QUERY-->More Functions->Display Report Name.
    You can then take that report name and go to SE38. Copy the code before END-OF_SELECTION and then modify as per your own requirements.
    Regrads
    Saket Sharma

  • Execute a VO '4' times and show the result in single table at once.

    Hi,
    I want to execute single a VO query multiple times with different parameters and show the results together in a Table at once
    In Detail
    I have a table to which is associated with a VO.
    The VO contains SQL whose WhereClauseParameters need to be dynamically binded.say headerId and lineId
    Select ... from ....where headerId = :1 AND lineId = :2
    I have to pass these 4 values and show all the results in a single table
    headerId lineid
    H1 ............... L1
    H1 ............... L2
    H2 ............... L1
    H2 ............... L2
    I understand that i need to bind parameters dynamically and exceute the VO.
    As i have 4 different set of parameters, the view object will be executed 4 times.
    I want to show all the results together in a single table.
    How can I do it.
    thanks,
    Gowtam

    Hi Mani,
    Thanks a lot for the patience and detailed solution.I will try it out and tell you the status.
    Meanwhile, I have 2 questions on this solution(just curious)
    I will give you the snapshot of the table
    Table - ModelInfo
    Model......Tube..... Float....Size......Col5.....Col6.......Col7.......
    M1............T1.......... F1. .....1..........C15......C16.....C17.....
    M1............T1...........F1.......2..........C25......C26.....C27.....
    M1............T2......... .F2.......1..........C35......C36.....C37.....
    M1............T2...........F2.......2..........C45......C46.....C47.....
    M2............T1.......... F1. .....1..........
    M2.............T1..........F1.....2.........Cn5.......Cn6........Cn7
    .<continues...>
    .<till>
    .Mn............Tn..........Fn.......n........Cxy.......Cpq.......Crs....
    Question 1:
    if you notice this data,
    The Columns 5 to 7 are dependent on Combination of Model,Tube,Float and Size.
    Hence will this query work properly(without mixing up data from other Pk combination) and will it be efficient?(I Know this is a stupid qst, still double checking..As your solution assumes that each row is unique for Model only..which is not true)
    Select ...From....Where
    Model in(M1,M2,..Mn) AND Tube in(T1,T2..Tn) AND Float in(F1,F2,....Fn) and Size in(1,2...n).
    In short, will C15,C16 and C17 appear only with M1,T1,F1,1..I believe it will.
    Question 2:
    As I told,
    Third party program will return Array of Objects.
    Each object will have a variable called Flow along with
    Model,Tube,Float and Size.
    Flow is not stored in the database(can not be stored due to functional reasons).I want to show this Flow also along with other columns fetched from the DB for all 100+ rows.
    How can I do it?
    I will give u the scenario(with just 2 rows)...please check(Flow is not stored in DB)
    Third Party object : ObjModel
    Model......Tube..... Float....Size......Flow
    M1............T1.......... F1. .....1..........100
    M1............T1...........F2.......2...........200.
    M1............T2.......... F1.......1..........300
    M1............T2...........F2.......2..........400
    My concern is,
    After the VO executes and shows other 6 columns, it should show Flow appropriately.(associated with each object in the array)
    I understand that I need to have a Transient attribute in VO called[b] Flow.But I don't know how to perform the two tasks simultaneously..
    Task1:Your solution on showing table columns
    Task2:Showing Transient data for each object returned from program.
    thanks,
    Gowtam

  • Using Powershell Script Run simple query in MS Access 2007 and export the results of query to Excel

    Hi Experts,
    I have a Access 2007 DB file and 2 Big tables inside that (bigger than the size that can be easily handled by MS Excel 2007).
    My requirement is automate using powershell scripts the below things.
    1. Create a SQL query in Access DB and save that in access DB
    2. Run the saved query and export the result in excel sheet where I can create the charts and Pivots. Thanks in advance
    Prajesh

    Do you have to use the Access query, couldn't you just recreate the query in Powershell?  Here's a link with good info that references an existing script for querying an Access database:
    http://blogs.technet.com/b/heyscriptingguy/archive/2009/08/13/hey-scripting-guy-can-i-query-a-microsoft-access-database-with-a-windows-powershell-script.aspx
    Once you have your dataset you can pipe it to
    Export-Csv -NoType c:\pathtofile\output.csv

  • Executing Procedure in SQL SERVER and Storing the results in Oracle 10g

    Hello,
    I am trying execute SQL SERVER procedure from Oracle 10g and store the results in a oracle table. When I tried executing the procedure i am getting errors.
    I am using Oracle Heteroeneous Services.
    Steps I followed.
    1. Created ODBC DSN on Oracle Server connecting to SQL SERVER database.
    2. Created Listner entry and TNSNAMES entries.
    3. Created Database link and able to select the data from the SQL SERVER tables.
    Here is the code i tried to execute the procedure.
    BEGIN
    "META"."extract"@abc;
    END;
    "META"."extract"@abc;
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'META.extract@ABC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    Please help me.
    Thank You,
    Seshadri Thope

    Hi thopevs,
    Can you please tell me the right syntax of calling procedures(on sql server) from oracle?
    I am getting following error:
    SQL> execute "GetdateSys"@oratosql;
    begin "GetdateSys"@oratosql; end;
    ORA-06550: line 2, column 7:
    PLS-00201: identifier 'GetdateSys@ORATOSQL' must be declared
    ORA-06550: line 2, column 7:
    PL/SQL: Statement ignored
    SQL>
    Your help will be highly appreciated.
    Thanks & Regards,
    M.U.N.A

  • How to input data from labview to executable application and export the results back to labview

    I have a simple function written in m file under Matlab enviornment,
    function [c]=myadd2(a,b)
    c=a+b;
    I built it into a executable file (.exe), then I want to call it in labview and get the results.
    I followed this tutorial and some other information on line:
    http://digital.ni.com/public.nsf/allkb/5CF9526FF069EA8E862564C400579DBA
    But I didn't see any telling me how to get the Labview array data input to the EXE file and return the results data back to another indicator in labview.
    Any one have some idea?
    I appreciate the help very much.
    Arnold

    You probably need to include some command line arguments on your executable that would be the name of a file to get the data from. You could also include a command line argument telling that exe where to store the results.
    I am not familiar with Matllab to give you advice on how specifically to do that with your exe though.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • I want to combine a bunch of queries and dump the results - spreadsheet

    I have a bunch of SQL queries. I want to run the SQL queries and dump the results into one single spreadsheet in a formatted fashon.
    Assume that one of my queries returns the following:
    Week 10, Door, 15
    Week 10, Window, 20
    Week 10, Stair, 25
    Week 11, Door, 50
    Week 11, Window, 75
    Week 11, Stair, 100
    Week 12, Door, 1
    Week 12, Window, 2
    Week 12, Stair, 3
    I would then want to take all these results and put them into a spreadsheet with a bunch of other results:
    So header would look like:
    Week 1, Week 2, Week 3, ...Week 10, Week 11, Week 12...
    Then, down below there would be three rows which have the following in Col A:
    Door
    Window
    Stair
    So in row "Door", under Col "Week 10", there would be a 15
    Under "Window", under Col "Week 11", there would be a 75
    Under "Stair", under Col "Week 12", there would be a 3
    The column headers would all be in weeks, but I want to basically make a matrix out of my SQL queries. So there would be many rows besides "Door", "Window", and "Stair", but they would all have similar results as supplied by my other queries. Anyone know how to do such mapping?

    Check this link --
    [url http://forums.oracle.com/forums/search.jspa?threadID=&q=pivot&objID=f75&dateRange=last90days&userID=&numResults=15]Pivot Search In Oracle
    Regards.
    Satyaki De.

  • Execute query in background and write it's content in transparent table

    Hi,
    Is there an easy way to execute one query in background and write it's content in transparent table?
    Thanks,

    Hello,
    Yes you can do this in so mamy ways...
    GOTO RSCRM_REPORT -> select your query -> click on the extract button and set the parameters...table or file Execute.
    Create an APD in RSANWB select your query and you can store the result in ODS table...cube...
    Create a reporting agent and store the result.
    Regards,
    Pavan.

  • Call CR XI from C++ routine, need to run the report without display and send the resulting report to the printer

    <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"></tr><tr><td height="1" style="font-size: 1pt"></td></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p>I initiate a CR XI from a C++ routine using  ShellExecute command, the report file is opened and the C++ program continues to execute, this is working fine, now I need the following two things:</p><p>1. When the report is invoked I would like it to run and print the result either to a printer or to a file.</p><p>2. I need to send the report parameters since it will not prompt for it if it runs automatically.</p><p>Thanks in advance for your help.</p></td></tr><tr></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p>&#160;</p></td></tr></tbody></table></blockquote></blockquote>

    Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly

  • Minus and passing the result set

    I have a query in a procedure....let us say "test.prc":
    select A.VALUE from TABLE A
    where A.VALUE_ID = get_rec.VALUE_ID minus
    select B.VALUE from TABLE B
    In the above query, I am passing the "get_rec.VALUE_ID" from a cursor above the query.
    Now is there a way to capture the result set of the above minus operation and pass the result set to the calling sql program (called "call_test.sql")?
    Thanks,
    Chiru
    Message was edited by:
    Megastar_Chiru

    I got what I was trying to do...
    I have 1 more question though....I am printing out my output using dbms package from sql*plus...using the following command
    dbms_output.put_line(nvl('Flex Value set Id : '||get_rec.flex_value_set_id,0)||' values that have no corresponding alias : ' || nvl(v_flex_val,0));
    "get_rec.flex_value_set_id" gets passed in from my cursor above the dbms statement.
    and it looks like below:
    Flex Value set Id : 20118 values that have no corresponding alias : 00
    Flex Value set Id : 20118 values that have no corresponding alias : 10
    Flex Value set Id : 20118 values that have no corresponding alias : 11
    Flex Value set Id : 20118 values that have no corresponding alias : 20
    Flex Value set Id : 20118 values that have no corresponding alias : 30
    Flex Value set Id : 20124 values that have no corresponding alias : Standard
    Is there some way to neatly break when the value set id changes? ...ie., make it print output something like below:
    Flex Value set Id : 20118
    values that have no corresponding alias : 00
    values that have no corresponding alias : 10
    values that have no corresponding alias : 11
    values that have no corresponding alias : 20
    values that have no corresponding alias : 30
    Flex Value set Id : 20124
    values that have no corresponding alias : Standard
    Thanks,
    Chiru

Maybe you are looking for

  • ABAP Report Performance Problem

    Hello Experts, Check the folowing code and suggest me a solution. IF BSIS-BLART = 'KR'. SELECT SINGLE LIFNR  AS LIFNR2   FROM BSAK  INTO CORRESPONDING FIELDS OF ITAB WHERE  BELNR = ITAB-BELNR AND GJAHR = ITAB-GJAHR. SELECT SINGLE NAME1 AS NAME2 FROM

  • #ERROR message in report for date format conversion

    Dear Collegues, Why is it that I get #ERROR message (instead of date value) in my report when I use the formula =ToDate(UserResponse("Enter End Date:");"dd.MM.yyyy")   ?? When I only write UserResponse("Enter End Date:") I get the appropriate date, f

  • Importing a Premiere Pro Sequence into After Effects Crashes After Effects

    Hello, I'm on a Quad Core Mac, 2.8GHZ with 6GB of Ram. I have a Premeire Pro project with varying MOV and MP4 files; from a DSLR and from a Sony EX-1 camera.  This project has lots of media, over 3 TBs, and each and every time I try to import it into

  • ITunes has stopped working: (Aproblem caused the program to stop...

    After I installed the the 64 bit I-Tune for widows 8, iTunes is crashing and I am getting the following message: iTunes has stopped working: (Aproblem caused the program to stop working correctly. Windows will close the program and notify you if a so

  • Installed Adobe Camera Raw 8.7.1 but still can't read raw files from new a7ii

    Have latest update of LR. Just bought new camera A7ii but LR would not recognize raw files. Downloaded and installed Camera Raw 8.7.1 and restarted. Still can't recognize files. What did I do wrong?