JDBC -Multiple records

hi sap XI gurus
          I designed the scenario like this.. <b>idoc--> XI --> JDBC...</b>
1. I have deployed the drivers for jdbc(MS SQL 2000)
        drivers are like mssql.jar..msutil.jar...mssqlser...etc..
2. then now i need to know the settings for Sender SAP R/3 to XI settings.. what are to be done..
<u>        SAP R3  </u>                            <u>        SAP NW XI</u>
1. Define Logical system - BD54      1. Define Logical system - BD54
        MATLOGR3                                           MATLOGR3
         MATLOGXI                                            MATLOGXI
2. Assign logical System to Client      2. Assign logical System to Client - SCC4
Here assign both the logical system       Here assign both the logical system
are assigned to client 800                     are assigned to client 100
        MATLOGR3                                         MATLOGR3
         MATLOGXI                                           MATLOGXI
3. Create RFC destination of type ‘3’ for SAP XI system using transaction – SM59:
           RFC Destination : MATLOGXI          RFC Destination : MATLOGR3
           Connection Type : 3                         Connection Type : 3
           Target Host : ECCSERVER          Target Host : ECCSERVER
           System Number :01                       System Number : 00
upto this i did successfully.. i need to import MATMAS05 idoc... then i will create the material that to be posted in MSSQL.. please help me..Is there any other settings to be done in <b>SAP R3-XI side....</b>
Then after creating material in SAP R/3 side how to trigger that idoc.. Please put your eyes on this blog and send some of your valuable tips to me..I will give the points..surely.. if its helpful or its answered..
Advance thanks..
Kumar

HI KRISH..
    How you will update multiple idocs in JDBC.. as i know we need to write the stored procedure for that.. is it correct...If it yes.. can you send me the coding for MS SQL...
another question like.. i created in SAP R/3 side two logical systems and assigned to client 800 and then i created .. tRFC port.. also.. now i want to create partner profile for that i created partner no: MATLOGXI.. and partner type is Ls.. then what else i need to do in inbound and outbound parameters.. whether i need to do outbound or inbound.. may i have some idea fro that... Please help me yar...

Similar Messages

  • Multiple records as a single transaction in JDBC Receiver Adapter

    Hi,
    I am sending multiple records in a single message to a JDBC receiver adapter to get updated to the database. How to make all the insert a single transaction. Like all the records has to be inserted else all has to be rolled back.
    For eg for table Employee two fields EMPNO and EMPNAME
    EMPNO  EMPNAME
    1            Jay
    2            Christie
    These two records are in the same message and has to be updated
    if one fails the other has to be rolled back.
    How can i achieve it using a JDBC Receiver Adapter.
    Thanks
    Sebin

    Hi Rolf Micus,
    My xml structure to insert 2 tables are as follow:-
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_PODB xmlns:ns0="http://abeam.com/xi/fer_filejdbc_scenarios1">
    ..   <STATEMENT_HEADER>
    ....      <ROW action="INSERT">
    ......         <TABLE>ZPO_HEADER</TABLE>
    ......        <access>
    ........            <PONUMBER>001</PONUMBER>
    ........            <PODATE>20070801</PODATE>
    ........            <POAMOUNT>200.99</POAMOUNT>
    ....         </access>
    ....      </ROW>
    ..   </STATEMENT_HEADER>
    ..   <STATEMENT_DETAIL>
    ....      <ROW action="INSERT">
    ......         <TABLE>ZPODETAIL</TABLE>
    ......         <access>
    ........            <PONUMBER>001</PONUMBER>
    ........            <PONO>1</PONO>
    ........            <POITEMCODE>A12345</POITEMCODE>
    ........            <POITEMDESC>Testing A</POITEMDESC>
    ........            <POITEMAMOUNT>2990.00</POITEMAMOUNT>
    ........            <POITEMQTY>55</POITEMQTY>
    ......         </access>
    ....      </ROW>
    ..   </STATEMENT_DETAIL>
    </ns0:MT_PODB>
    Fro the structure that you have declared..there is only contained 1 statement, try to admend your MT to have 2 statements.
    If you wish to insert multiple records, just create a loop/multiple of access tag inside STATEMENT tag. For example, multiple records insert into Header should have multiple access tag in Header STATEMENT. Same goes for muliple records insert into Details STATEMENT should have multiple access tag in Details STATEMENT.
    With this structure, whenever any records insert/update/delete failed...it will rollback all the transactions together, ie. Header and Details.
    PS: For different table, please create different STATEMENT.
    Hope it helps.
    Message was edited by: Pua Ming Fei

  • RFC to JDBC Scenario: Multiple Records insertion

    Hi All,
    I am working with RFC->XI->JDBC to update a single table on an Oracle db.
    When I import RFC I get multiple Records.
    Here is the sender XML Structure:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_I2_SAP2MDM_VM xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    + <I_LFA1>
      </I_LFA1>
      <T_XLFAT />
    - <T_XWYT3>
    - <item>
      <MANDT>800</MANDT>
      <LIFNR>0000009962</LIFNR>
      <EKORG>1000</EKORG>
      <LTSNR />
      <WERKS />
      <PARVW>LF</PARVW>
      <PARZA>000</PARZA>
      <ERNAM>ARUCHI</ERNAM>
      <ERDAT>2006-05-26</ERDAT>
      <LIFN2>0000009962</LIFN2>
      <DEFPA />
      <PERNR>00000000</PERNR>
      <PARNR>0000000000</PARNR>
      <KZ>I</KZ>
      </item>
    - <item>
      <MANDT>800</MANDT>
      <LIFNR>0000009962</LIFNR>
      <EKORG>1000</EKORG>
      <LTSNR />
      <WERKS />
      <PARVW>RS</PARVW>
      <PARZA>001</PARZA>
      <ERNAM>ARUCHI</ERNAM>
      <ERDAT>2006-05-26</ERDAT>
      <LIFN2>0000009962</LIFN2>
      <DEFPA />
      <PERNR>00000000</PERNR>
      <PARNR>0000000000</PARNR>
      <KZ>I</KZ>
      </item>
      </T_XWYT3>
      </rfc:Z_I2_SAP2MDM_VM>
    It takes only the first <item> record. How do i take the second record and insert in the oracel DB.
    Seems to me this should be a pretty simple process.
    Regards,
    Ruchi

    Hi ,
    You need to handle  this with the occurence of the Target Structure of the JDBC Adapter..
    Check this help-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    DB Datatype structure ?
    Hope this helps,
    Regards,
    Moorthy

  • Multi-mapping ... multiple records works, one record doesn't

    I'm using JDBC to select rows from an external Oracle database, XI receives the message, splits it into multiple messages (one for each record returned) and, using RFC/BAPI, takes each record and writes it to an SAP table on an SAP system.  I'm using the RB_SPLIT option in my Interface Determination and in my Interface Mapping I'm using Source occurrences = 1, Target occurrences = 0..unbounded. 
    This works GREAT ... as long as there is more than one record returned from the select statement in the JDBC setup.  If the select statement only returns one record, nothing gets transferred.  If it's any amount of records more than 1, it works perfectly.
    Why won't it process one record?  What can I do to get it to process one record, without messing up the great job it does for more than one record?
    Thanks!

    Hi Michael -
    I have a similar setup (at least on the sender side) and whether I have multiple records returned or just one, I'm getting my expected result.  FYI, I'm using a file receiver.
    I would first take a closer look at your mapping.  Get the one record XML that is sent to the Integration Server and test your message mapping in the IR.  Remember to put it in between the tags below:
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
       </ns0:Message1>
    </ns0:Messages>
    Regards,
    Jin

  • Stored procedure returning multiple records without using SYS_REFCURSOR

    Hello,
    I am new to oracle stored procedures, have done stored procs in SQL server in past. I am trying to write single stored proc which will return multiple records. I have the stored proc as below and that is compiled without any errors.
    We don't want to use SYS_REFCURSOR as output param b'coz the place from which this proc is gonna call, that system doesn't support SYS_REFCURSOR param.
    create or replace
    PROCEDURE p_get5500DATA_MB (
    IN_plan_ID IN T_5500DATA_QWP.Plan_ID%TYPE,
    IN_plan_ID_col OUT T_5500DATA_QWP.Plan_ID%TYPE,
    p_SEQNUM OUT T_5500DATA_QWP.SEQNUM%TYPE,
    p_HEADER_CD OUT T_5500DATA_QWP.HEADER_CD%TYPE,
    p_VALUE1 OUT T_5500DATA_QWP.VALUE1%TYPE,
    p_VALUE2 OUT T_5500DATA_QWP.VALUE2%TYPE
    ) AS
    BEGIN
    SELECT
    Plan_ID,
    SEQNUM,
    HEADER_CD,
    VALUE1,
    VALUE2
    INTO
    IN_plan_ID_col,
    p_SEQNUM,
    p_HEADER_CD,
    p_VALUE1,
    p_VALUE2
    FROM TRS1DBO.T_5500DATA_QWP
    WHERE Plan_ID = IN_plan_ID
    ORDER BY SeqNum;
    -- EXCEPTION
    -- WHEN OTHERS THEN
    -- RAISE_APPLICATION_ERROR(-210001, 'Error in fetching data from T_5500DATA_QWP....');
    END;
    Error:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "TRS1DBO.P_GET5500DATA_MB", line 10
    ORA-06512: at line 11
    My questions is:
    - What would be the best practice for this type of simple stored procedures?
    - Is there any alternate or is there anything i can fix in above stored proc which return multiple records?
    Thank you,
    Vimal

    Just out of curiosity, what are you using for API or driver that doesn't support a ref cursor? Ref cursors are pretty much the defacto standard for passing multiple records out of an Oracle procedure. Oracle's ODP.NET, OLEDB, ODBC, JDBC, OCI, all support ref cursors. Chances are that if the driver you're using doesn't support something as basic/fundamental as a ref cursor, it's probably also not going to support something else either.
    You'll most likely want to check with the driver/api vendor on their recommended approach.

  • Calling multiple records from SP

    Hi,
    I tried to use a CallabaleStatement to call an SP that would return multiple records but wasn't successful.
    The Problem is the 'cstmt.executeQuery()' statement returns NULL. How to solve this?
    I have tested the SP and it works fine. Pls help! And thanks. (Btw, I am using JDBC:ODBC driver and accessing Oracle database.)
    Below are the methods that I used to set the IN parameters and the methods I used to register OUT parameters:-
    ResultSet rs = null;
    //call to the SP.
    CallableStatement cstmt = con.prepareCall("{ call artmovby_date (?,?,?,?,?,?) }");
    //based on the SP, the following set methods are used.
    cstmt.setInt (1, pLanguage);
    cstmt.setString (2, pCustomerCode);
    cstmt.setString (3, pStartDate);
    cstmt.setString (4, pEndDate);
    //based on the SP, the following are the JDBC
    // types registered for OUT parameters
    cstmt.registerOutParameter(5, java.sql.Types.NUMERIC, 0);
    cstmt.registerOutParameter(6, java.sql.Types.OTHER);
    //using executeQuery since the SP
    //contains 'select' statement only.
    try { rs = cstmt.executeQuery(); } catch (Exception e) { e.printStackTrace(); }
    Below is the information of the package and SP created in the database:-
    CREATE OR REPLACE PACKAGE FetchData is
    -- The purpose of the package is just define the recordset.
    Define Record Types
    TYPE ArtMoveOneRecTyp is RECORD
    ( Article SDGPOS.ARTNR%TYPE,
    Shipment_No SDGPOS.SDGNR%TYPE,
    Customer_Ref SDGPOS.KUNDENREF%TYPE,
    Shipment_Date SDG.BELDATUM%TYPE,
    In_Or_Out SDGPOS.FUNKTION%TYPE,
    Quantity1 SDGPOSMG.MENGE%TYPE,
    Quantity2 SDGPOSMG.MENGE%TYPE,
    LineNr SDGPOS.NR%TYPE,
    UnitLoad1 SDGPOSMG.RANG%TYPE,
    UnitLoad2 SDGPOSMG.RANG%TYPE);
    -- Define PL/SQL Table --
    TYPE ArtMoveRecTyp IS TABLE OF ArtMoveOneRecTyp
    INDEX BY BINARY_INTEGER;
    END FetchData;
    create or replace procedure artmovby_date
    language IN number,
    customerid IN varchar2,
    startdate IN varchar2,
    enddate IN varchar2,
    p_size out number,
    p_array out FetchData.ArtMoveRecTyp
    ) is
    cursor get_art_mov_by_date
    (p_language number,
    p_customerid varchar,
    p_startdate varchar,
    p_enddate varchar) is
    SELECT P.ARTNR, P.SDGNR, P.KUNDENREF, SDG.BELDATUM, P.FUNKTION,
    M1.MENGE, M2.MENGE, P.NR, M1.RANG, M2.RANG
    FROM
    SDG,
    SDGPOS P,
    SDGPOSSTATUS S,
    STATI_TEXTE ST,
    ARTIKEL A,
    LHM,
    LHMTEXTE L,
    MONITURENST MO, MONITURENTEXTE MOT,
    SDGPOSMG M1, ARTMENGENEINH AE1, EINHEITENTEXTE E1,
    SDGPOSMG M2, ARTMENGENEINH AE2, EINHEITENTEXTE E2
    WHERE
    P.KUNDENNR = S.KUNDENNR(+)
    AND P.FUNKTION = S.FUNKTION(+)
    AND P.SDGNR = S.SDGNR(+)
    AND P.NR = S.SDGPOSNR(+)
    AND 'J' = S.AKTIV(+)
    AND 'SDGPOS' = ST.TYP(+)
    AND p_language = ST.SPRACHE(+)
    AND S.STATUS = ST.STATUS(+)
    AND S.FUNKTION = ST.FUNKTION(+)
    AND P.KUNDENNR = A.KUNDENNR(+)
    AND P.ARTNR = A.NR(+)
    AND P.LHMNR = LHM.NR(+)
    AND P.LHM = L.NR(+)
    AND p_language = L.SPRACHE(+)
    AND P.MONITUR = MO.NR(+)
    AND MO.NR = MOT.NR(+)
    AND p_language = MOT.SPRACHE(+)
    AND P.KUNDENNR = M1.KUNDENNR(+)
    AND P.FUNKTION = M1.FUNKTION(+)
    AND P.SDGNR = M1.SDGNR(+)
    AND P.NR = M1.SDGPOSNR(+)
    AND 1 = M1.RANG(+)
    AND P.KUNDENNR = AE1.KUNDENNR(+)
    AND P.ARTNR = AE1.ARTNR(+)
    AND 1 = AE1.RANG(+)
    AND AE1.MGEHNR = E1.NR(+)
    AND p_language = E1.SPRACHE(+)
    AND P.KUNDENNR = M2.KUNDENNR(+)
    AND P.FUNKTION = M2.FUNKTION(+)
    AND P.SDGNR = M2.SDGNR(+)
    AND P.NR = M2.SDGPOSNR(+)
    AND 2 = M2.RANG(+)
    AND P.KUNDENNR = AE2.KUNDENNR(+)
    AND P.ARTNR = AE2.ARTNR(+)
    AND 2 = AE2.RANG(+)
    AND AE2.MGEHNR = E2.NR(+)
    AND p_language = E2.SPRACHE(+)
    AND SDG.NR = P.SDGNR(+)
    AND SDG.KUNDENNR = P.KUNDENNR(+)
    AND SDG.FUNKTION = P.FUNKTION
    AND ( P.KUNDENNR = p_customerid )
    AND ( SDG.BELDATUM BETWEEN TO_DATE( p_startdate ,'DD/MM/YYYY' )
    AND TO_DATE( p_enddate , 'DD/MM/YYYY' ))
    AND S.STATUS >= 35
    ORDER BY P.ARTNR ASC, SDG.BELDATUM ASC;
    begin
    p_size :=0;
    open get_art_mov_by_date (language, customerid, startdate, enddate);
    loop
    fetch get_art_mov_by_date into p_array(p_size);
    exit when get_art_mov_by_date%NOTFOUND;
    p_size := p_size +1;
    end loop;
    close get_art_mov_by_date;
    end;
    /

    like for other structure we set occurence as 0 to unbound if we wanna send multiple messages ...
    If you want to send multiple records u r occurence must be 0 to unbound in RFC also..
    check that for your RFC ?
    Regards
    Rao
    Edited by: PT Rao on Jun 12, 2008 5:13 PM
    Edited by: PT Rao on Jun 12, 2008 5:17 PM

  • Multiple Records to RFC !

    Hi,
    Our scenario --> JBDC -- XI -- RFC.
    1) Here Sender JDBC Selects the multiple records from the Oracle DB.
    2) These bunch of records are sent to the RFC for processing and reponse messages are expected.
    3) But while in production  due to huge amount of records from the Oracle Database the RFC takes more time to reponse back.
    Now is it a pass each record once into RFC to process to make the response back soon.
    So each and every record has to be passed one after the other.
    Can any one say how RFC is gettings executed if it sent as set of file (0.. unbound)
    any views for incresing the performance. because we suspect for time out problems
    thxs in advance
    rgds
    srini

    Hi
    Thanks for reply.
    Is there any way where in can process each record of Outbound Interface.
    Ex  Order
             1a)Key01
             2a) Item01
             3a) Item02
             1b)Key02
             2b) Item01
             3b) Item02
    Above is the Outbound Interface structure after Select done by Sender JBDC.
    Now instead of sending entire records of 1a and 1b into (0 .. unbound) of my RFC import.
    Can first pass 1a to RFC process it for response and then sent 1b.??
    thx
    rgds
    srini

  • Http-xi-RFC synchronous call - multiple records ?

    Hi Gurus,
    Can we have multiple records processing in RFC synchronous call ? for ex, BAPI_COMPANY_GET_DETAIL. I want to feed multiple company ids and get the responses in browser.
    I have changed cardinality in message mapping and interface mapping as <b>o to unbounded.</b> Tested the same which works fine.
    But, <b>when I activated the interface mapping, I get an error</b> which says I can not use multi mapping in synchronous RFC call.
    what is the alternative ? please help.

    HI,
    It is better to use the RFC lookup in mapping and get the multiple records , i men each one for one lookup , so that in your mapping use UDF for RFC lookup.
    see the below link
    Lookup - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Also read thru this to get more idea on lookups - http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0
    Lookup’s in XI made simpler - /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
    Lookups - /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    Lookups - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Lookups with XSLT - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Regards
    Chilla

  • Multiple Records in XI

    Hi Folks ,
    Can you guide me in
    1. Handling multiple records from source and posting one at a time into JDBC .
    2. Fetching single records from JDBC and sending as a batch.
    Regards,

    Hi santosh
    refer the below links
    http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    DB Datatype structure ?
    Multiple Records insertion
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Sending Multiple records   
    http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ae/fd773f12f14a18e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    just have a look may be  help you

  • Multiple records from PL/SQL

    Hi,
    Can anybody give me an example of returning multiple records selected from PL/SQL procedure to a Java program .
    It will be very good if i can get PL/SQL procedure code and Java program code.
    Thanx.

    Use the SampleCode link at the top of the page. Look under JDBC samples for REF CURSOR.

  • How to pass multiple records to stored procedure??

    Hi,
    Can a web application call stored procedure (could be JDBC call)with resultset as it's input parameter? I'm sure there has to be some way to deal with this and I will appreciate your feedback. The web page has multiple records in tabular format and submit should save each record. Is it possible to pass all the records at once through resultset instead of calling stored procedure for each one?
    I'm thinking to use cursor variable as a input parameter of a stored procedure. But I'm not sure whether stored procedure can open/fetch this cursor variable into record structure. Here's the sample example of cursor variable definition.
    TYPE EmpRecTyp IS RECORD (
    emp_id NUMBER(4),
    emp_name VARCHAR2(10),
    job_title VARCHAR2(9),
    dept_name VARCHAR2(14),
    dept_loc VARCHAR2(13));
    TYPE EmpCurTyp IS REF CURSOR RETURN EmpRecTyp;
    PROCEDURE save_staff (emp_cv IN EmpCurTyp);
    Thanks for your help.
    Hemal

    You can't pass in a result set, but you can make each parameter a PL/SQL table.
    Since you also can't pass in a PL/SQL table of records, I typically create a parameter for each "field", with each parameter containing one or more elements. You can then use bulk binding to process the tables in one statement.

  • Combining multiple records into a single record (View)

    Okay so here is my scenerio:
    There is a table I have made that details SQL jobs and the various details about them. What i wan't to do is make a view with specific logic implemented. Fields that will be taken across to this view will be: LastRunDate, LastRunTime and Step_Status.
    JobName will also be used to define the logic but will not be a column in itself.
    What i wan't is an additional column using this logic, called 'DataSet'. For each Dataset there are multiple jobs that are unique to it, so there are multiple records being brought over from the table to view for one particular dataset. For example,
    for 'ExampleDataSet' there are three jobs, i wan't it so these jobs are combined and named as 'ExampleDataSet' under a calculated column called 'Dataset'. For the following fields i would like it so that LastRunDate and LastRunTime are the time in whichever
    job was last to be intitiated is the date and time set. For Step_Status, there are three possible results, 'Running', 'Failed' or 'Succeeded'. If any of the three jobs are 'Running', then 'Running'. If neither are running yet one has failed then 'Failed'.
    Only when all three have succeeded should it then be set to 'Succeeded'.
    I hope i have made that clear enough, please feel free to ask any questions if not. I am relatively new to SQL but i thought to at least try least try (I knew it wouldn't work) and it didn't work. But it may give you a better idea of
    what i wan't:
    CREATE VIEW [dbo].[vw_DataAvailabilityAnalysts] AS
    SELECT CASE
    WHEN JobName in ('Job1','Job2','Job3') and step_status='Running' THEN 'Running'
    WHEN JobName in ('Job1','Job2','Job3') and step_status='Failed' THEN 'Failed'
    WHEN JobName in ('Job1','Job2','Job3) and step_status='Succeeded' THEN 'Succeeded'
    END as StatusCheck,
    CASE WHEN JobName in ('Job1','Job2','Job3') THEN 'ExampleDataSet'
    END as DATASET,
    LastRunDate,
    lastruntime,
    step_status,
    FROM [CDS_Common].[dbo].[DataAvailability]
    Many Thanks,
    Plain_Clueless
    Plain_Clueless

    Okay so here is what my table looks like (Simplified). There are four columns and the data within is extracted via a Stored Procedure.
    JobName
    LastRunDate
    LastRunTime
    Step_Status
    Job1
    11/06/2014
    09:30:00
    Succeeded
    Job1
    10/06/2014
    09:37:20
    Succeeded
    Job2
    11/06/2014
    04:05:00
    Succeeded
    Job1
    09/06/2014
    02:17:41
    Succeeded
    As you can see there are 3 jobs which are all 'Job1'. This jobs are obviously different within the table however this represents that they are jobs which all update the same DataSet within our local warehouse. Whereas Job2 updates a different dataset alltogether.
    I wan't to create a view which will alagmate the jobs that are of the same DataSet, which will disclude the column JobName but would create a whole new column that looks like this:
    DataSet
    LastRunDate
    LastRunTime
    Step_Status
    DataSet2
    11/06/2014
    04:05:00
    Succeeded
    DataSet1
    11/06/2014
    09:30:00
    Succeeded
    Bascically what this shows you is all the Job 1's combined so they are one record, Amaglamated. The last time any of these jobs were run is the LastRunDate & LastRunTime, which was the first record in the first table provided. Again for Step_Status,
    there are three possible results, 'Running', 'Failed' or 'Succeeded'. If any of the three jobs are 'Running', then 'Running' (Absolute). If none of the three jobs are running yet one has failed then 'Failed'. If one has failed yet another is also running then
    'Running'.Only when all three have succeeded should it then be set to 'Succeeded'. (This last bit isn't as important).
    Hope this clears it up a bit,
    Plain_Clueless
    Plain_Clueless

  • Add Multiple records to G/L account group.

    Dear ABAP Experts,
    i have requirement that is using  BDC recording file  the Functional People wants to add records to the G/L Account group. The FI consultant gave the recording file, based on the recording file i developed a BDC program. This BDC program will work for single record. After creating single record system will ask for transport request .
    REPORT  ZDP_ACC_GRP.
    TYPES: BEGIN OF TY_TAB,
            KTOPL TYPE KTOPL,
            KTOKS TYPE KTOKS,
            TXT30 TYPE TXT30,
            VONNR TYPE VONNR,
            BISNR TYPE BISNR,
           TRKORR TYPE TRKORR,
       END OF TY_TAB.
    data: lt_tab type table of ty_tab,
           wa_tab type ty_tab.
    data: begin of record,
    * data element: KTOPL
             KTOPL_01_001(004),
    * data element: KTOKS
             KTOKS_01_002(004),
    * data element: TXT30_077T
             TXT30_01_003(030),
    * data element: VONNR_077S
             VONNR_01_004(010),
    * data element: BISNR_077S
             BISNR_01_005(010),
    * data element: TRKORR
             TRKORR_006(020),
           end of record.
    *       Batchinputdata of single transaction
    DATA:   BDCDATA type table of BDCDATA  WITH HEADER LINE.
    *       messages of call transaction
    DATA:   MESSTAB type table of BDCMSGCOLL  WITH HEADER LINE.
    *       error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
    *       message texts
    TABLES: T100.
    data:lv_file type string.
    parameters: p_fname type IBIPPARMS-PATH.
    at selection-screen on value-request for p_fname.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = 'P_FNAME'
      IMPORTING
        FILE_NAME           = p_fname .
    start-of-selection.
    lv_file = p_fname.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = LV_FILE
    *   FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
       TABLES
         DATA_TAB                      = LT_TAB
      EXCEPTIONS
        FILE_OPEN_ERROR               = 1
        FILE_READ_ERROR               = 2
        NO_BATCH                      = 3
        GUI_REFUSE_FILETRANSFER       = 4
        INVALID_TYPE                  = 5
        NO_AUTHORITY                  = 6
        UNKNOWN_ERROR                 = 7
        BAD_DATA_FORMAT               = 8
        HEADER_NOT_ALLOWED            = 9
        SEPARATOR_NOT_ALLOWED         = 10
        HEADER_TOO_LONG               = 11
        UNKNOWN_DP_ERROR              = 12
        ACCESS_DENIED                 = 13
        DP_OUT_OF_MEMORY              = 14
        DISK_FULL                     = 15
        DP_TIMEOUT                    = 16
        OTHERS                        = 17  .
    LOop at  lt_tab into wa_tab.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-TXT30(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=NEWL'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-BISNR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=SAVE'.
    perform bdc_field       using 'V_T077S-KTOPL(01)'
                                   WA_TAB-KTOPL."record-KTOPL_01_001.
    perform bdc_field       using 'V_T077S-KTOKS(01)'
                                   WA_TAB-KTOKS."record-KTOKS_01_002.
    perform bdc_field       using 'V_T077S-TXT30(01)'
                                   WA_TAB-TXT30."record-TXT30_01_003.
    perform bdc_field       using 'V_T077S-VONNR(01)'
                                   WA_TAB-VONNR."record-VONNR_01_004.
    perform bdc_field       using 'V_T077S-BISNR(01)'
                                   WA_TAB-BISNR."record-BISNR_01_005.
    perform bdc_dynpro      using 'SAPLSTRD' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'KO008-TRKORR'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=LOCK'.
    perform bdc_field       using 'KO008-TRKORR'
                                   WA_TAB-TRKORR."record-TRKORR_006.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_dynpro      using 'SAPL0F09' '0020'.
    perform bdc_field       using 'BDC_CURSOR'
                                   'V_T077S-KTOPL(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=BACK'.
    perform bdc_transaction using 'OBD4'.
    ENDLOOP.
    FORM BDC_TRANSACTION USING TCODE.
       DATA: L_MSTRING(480).
       DATA: L_SUBRC LIKE SY-SUBRC.
    * batch input session
    * call transaction using
         REFRESH MESSTAB.
         CALL TRANSACTION 'OBD4' USING BDCDATA
                          MODE  'A'" CTUMODE
                          UPDATE 'S'"CUPDATE
                          MESSAGES INTO MESSTAB.
         L_SUBRC = SY-SUBRC.
           LOOP AT MESSTAB.
             SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                       AND   ARBGB = MESSTAB-MSGID
                                       AND   MSGNR = MESSTAB-MSGNR.
             IF SY-SUBRC = 0.
               L_MSTRING = T100-TEXT.
               IF L_MSTRING CS '&1'.
                 REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ELSE.
                 REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                 REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
               ENDIF.
               CONDENSE L_MSTRING.
               WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
             ELSE.
               WRITE: / MESSTAB.
             ENDIF.
           ENDLOOP.
       REFRESH BDCDATA.
    ENDFORM.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR BDCDATA.
       BDCDATA-PROGRAM  = PROGRAM.
       BDCDATA-DYNPRO   = DYNPRO.
       BDCDATA-DYNBEGIN = 'X'.
       APPEND BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
         CLEAR BDCDATA.
         BDCDATA-FNAM = FNAM.
         BDCDATA-FVAL = FVAL.
         APPEND BDCDATA.
    ENDFORM.
    But the FI consultant wants to add multiple records to 'G/L account group'.After adding records before saving the system need to ask transport request at the last.
    How can I write code ...??
    Please help me.

    Hi Srikanth,
    Thanks for reply,
    You  are right we need to load hierarchy for G/L then we can see all the G/L's for all G/L groups.
    I have one more question when I check in RSA3 for the G/L account numbers, I could not find them.
    I am using the datasource fi_gl_4 and in rsa3 I can see 1000 records data and when I put filter on G/L account and search for the G/L number I needed I cant see it, but it is there in the functional transaction(f.01)?
    How to check for the required G/L's in rsa3 ?
    Thx

  • How to store multiple records for one master reocrd using sequnce

    dear,
    my question is in one form i have master block f and detail block.
    my question is i created one sequence and assign to master table. but i dont know how to assign that sequence to multiple record in detail table for that particular master record. i got lots of answer previously but i m not getting exactly.pls tell me full procedure otherwise gv me one demo application
    NOTe: the sequnce is created after master record commiting to database.
    PLS pls help me
    Thanks
    damby

    i did not get answer pls help me.

  • How to concatenate multiple records into one

    Hi everybody:
    I want to know if exist some way to concat multiple records into one without using cursors. For example, I have a table named "Authors" like this:
    Lan|Author
    English|Ernest Hemingway
    Spanish|Octavio Paz
    Spanish|Mario Vargas Llosa
    English|Sinclair Lewis
    Spanish|Gabriel García Márquez
    And I want to get this:
    Author
    Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
    I have worked with SQL Server and I can do something like this:
    CREATE FUNCTION dbo.MyConcat (@lan varchar(10))
    RETURNS varchar(5000) AS
    BEGIN
    declare @retvalue varchar(5000)
    set @retvalue=''
    select @retvalue = @retvalue + Author +',' from Authors where lan = @lan
    return substring(@retvalue,1,len(@retvalue)-1)
    END
    ie, do not use cursors to concatenate records. However, with ORACLE, I have to do someting like this.
    FUNCTION MyConcat(P_Lan IN VARCHAR2) RETURN VARCHAR2 IS
    v_ret VARCHAR2(4000);
    v_element VARCHAR2(4000);
    v_cursor sys_refcursor;
    BEGIN
    OPEN v_cursor FOR SELECT Author FROM Authors where Lan = P_Lan
    LOOP
    FETCH v_cursor INTO v_elemento;
    EXIT WHEN v_cursor%NOTFOUND;
    IF v_ret IS NULL THEN
    v_ret := v_element;
    ELSE
    v_ret := v_ret || ', ' || v_element;
    END IF;
    END LOOP;
    RETURN v_ret;
    END;
    Exist some other way to do this?
    Best Regards
    Jack

    Tks both for answer... I forgot to mention that I am using Oracle 10g. I read about LISTAGG() but this function is available for Oracle 11g release 2.
    I wil read about the other techniques than Hoek mention
    Best Regards.
    Jack

Maybe you are looking for

  • Is it better to store the image in the database or to use BFile

    Hi all, I've a doubt regarding the handling of the image. For example i've the images of the persons amounting to 50,000(the number will be increased in future). So i just want to know which is the better menthod. is it better to store all the images

  • How to find the local system name in remote desktop through oracle

    Hi all, i am useing oralce 9i,D2K (Forms 6i) ,Presently i had a small problem when ever i am useing the application through the remote desktop i can not able to find the local system name .If i am accessing from the local system name then i can get t

  • TS3212 i tunes wont install correctly

    ive tried to download itunes three times to my windows laptop, the system runs and everything seems to work but when i then try to open it up it says the entry point wasnt found and then the itunes wasnt installed correctly. this is extremely annoyin

  • ORA-28000: The account is locked

    hi, all I've tried to connect to db as sys more then 10 times and now I am banned^). But I tried this to know how much time it will take: SELECT * FROM DBA_PROFILES WHERE profile = 'DEFAULT' AND resource_name = 'PASSWORD_LOCK_TIME' UNLIMITED What sho

  • [iPhone SQLite] how to download database file updates

    hi everyone, I want to build an application that show some info stored in SQLite db, but have an issue: the user should be able to upgrade periodically the database file, to get new entries etc, can i do that with iPhone? thanks, bye s.g.