JDBC to File scenario issue

we are creating a scenario from JDBC table to text file. payload seems ok to us but at the time of writing file it's creating empty file.

Hi there
We are reading directly from SQL table and trying to populate a TXT file, with the following structure:
AccountNumber
CoverStartDate
Status
IDNumber
Title
FirstName
Surname
Gender
DOB
ResidentialAddress1
ResidentialAddress2
ResidentialAddress3
ResidentialAddress4
ResidentialAddress5
PostalCode1
PostalAddress1
PostalAddress2
PostalAddress3
PostalAddress4
PostalAddress5
PostalCode2
Email
HomeTel
WorkTel
Cell
MarketingFlag
Thye Content Conversion parameters are as follows:
Recordset Structure : row
row.fieldSeparator: ,
row.endSeparator: 'nl'
Please let me know if you need any additional info?
Thanks
J

Similar Messages

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • Help with jdbc to file scenario

    Hi guys,
    I want to do a JDBC to file scenario. I need to do a SELECT * query from my table.
    An external application does the updation into my tables. I needed XI to connect to my JDBC system whenever there is an update in the tables and post it as a file.
    Please guide me on this guys
    Varun

    as pointed out have a indicator in ur table that is updated by the external system for setting that the record is read when the jdbc is polled. this would be help for avoiding reading the same records again and again whioch results in duplication. u can follow this blog (reve engg    )
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

  • File - to - JDBC- to - File  Scenario using Stored Procedure

    Hi,
      I want to do File - to - JDBC - to - File  scenario, because I'm getting data in a file format and that data i want to load in a database. Database level i have a stored procedure. if any exceptions. my stored procedure will give the Response. so, now i want to store that resposne in a file..
    for this. what are the steps we have to use. is this scenario will comes in Synch ronous or Asynchronous  ? and  I have searched the web blogs also. al the blogs are related to Http or Soap  with JDBC . so, please give me some input  help about this...
    how many data types we have to create... any body having step step procedure for this...
    regards
    Jain

    Hi,
    You will need a BPM in your design as Sender File adapter does not support Synchronous messaging. Refer my answer in this thread (page 2) and have your design accordingly....instead of RFC you will have a file adapter as the ultimate receiver.
    Re: BPM FILE--> JDBC--> RFC
    Just take care of below things:
    1) JDBC message format is as per the guidelines
    [Message format for sending req to JDBC|http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm]
    2) check for the format of your source and target file format (if it is a Flat-file with a xml structure that XI can parse then no need of FCC but if it is a CSV file then you will need FCC)
    Regards,
    Abhishek
    Edited by: abhishek salvi on Apr 14, 2009 7:32 PM

  • File to JDBC to File Scenario

    Dear Bhavesh,
    I am doing a File to JDBC to File Scenario from your reference blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken] This scenario is same as File to RFC to File scenario I believe. The only change I found is in Message Interface.
    The Message Interface used here are:
    1.     OB File Request
    2.     OB Abs File Request
    3.     IB File Response
    4.     IB Abs File Response
    5.     Abs Syn File Request File Response
    6.     Abs Syn JDBC Request JDBC Response.
    I am able to get the response from JDBC but while mapping to file I am getting mapping error. In fact I have followed ur Blog as it is.
    The IP steps are:
    Receive Step , Syn Send (Abs Syn File Request File Response) Step , Send Step.
    Could you please help me out, if you have time .
    Thanks in advance.
    Shaik

    Hi ,
    Sorry for pointing you the thread.
    I have created the IR as it is in File RFC File Scenario, but I have created Abs Syn Message Interface for JDBC request and Response.
    I have two Abs sync Message Interface and two mapping programs, namely
    Source Interface:
    Abs Sync Message Interface
       File Request
       File Response
    Target Interface:
    Abs Sync Message Interface
      JDBC Request
      JDBC Response
    Mapping Interface:
    File Request to JDBC Request
    JDBC Response to File Response.

  • JDBC to File Scenario

    Hey Experts,
    I have a scenario from JDBC to File (xml) scenario.
    The problem is that the data is being picked up from the data base and is sent through the sender JDBC channel to the receiver file adapter channel where the file content conversion is done. But when I check the output text file, it is empty. When I go to SXMB_MONI to check if there is any error, every thing is fine with a checkered flag on the message. My sender and the receiver data types are the same.
    Here is the scenario:
    DT_sender and DT_receiver ---> row
                                                          NAME
                                                          ID
                                                          GRADE
    payload from the sender channel is:
    <MT_DB2FILE_SENDER>
    < row>
    <NAME>CNCN</NAME>
    <ID>222</ID>
    <GRADE>A</GRADE>
    </MT_DB2FILE_SENDER>
    When the content conversion is done with the parameters :
    Recordset structure : row,1
    row.fieldNames : NAME,ID,GRADE
    row.fieldSeparator : \t
    row.endSeparator: 'nl'
    The text file that is generated is empty. I have tried out all the posts that are related to this topic. But I could not find the suitable answer. ANy help would be greatly appreciated.
    Regards.

    Hey
    I m a little confused here
    In your earlier reply,you posted
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MT_DB2FILE_RECEIVER xmlns:ns0="http://jdbc2jdbc" />
    and now you are posting this
    <?xml version="1.0" encoding="utf-8" ?>
    - <MT_DB2FILE_SENDER>
    - <row>
    <NAME>CHAD</NAME>
    <ID>204</ID>
    <GRADE>A</GRADE>
    </row>
    - <row>
    <NAME>TYLER</NAME>
    <ID>204</ID>
    <GRADE>A</GRADE>
    </row>
    - <row>
    <NAME>AMER</NAME>
    <ID>204</ID>
    <GRADE>A</GRADE>
    </row>
    - <row>
    <NAME>BASHIR</NAME>
    <ID>204</ID>
    <GRADE>A</GRADE>
    </row>
    - <row>
    <NAME>WENBIN</NAME>
    <ID>206</ID>
    <GRADE>A</GRADE>
    </row>
    - <row>
    <NAME>lilian</NAME>
    <ID>139</ID>
    <GRADE>A</GRADE>
    </row>
    </MT_DB2FILE_SENDER>
    The above looks like a sender structure to me.
    Could you please confirm this is exactly the payload you are getting in sxmb_moni under Technical routing .
    Thanks
    Aamir

  • Jdbc to file scenario - base mapping error

    hello all,
    i am facing a similar issue discussed in this thread,
    Re: JDBC to FILE scenatio: How to map the resultSet?
    1. i changed the document name and namespace
    2. i checked for the occurence of the filed elements
    3. i tried using the documentname and namespce both from the MONI and MAPPING TEST TAB...but still the same base mapping runtime exception error.
    Please advice.
    Thanks
    i have been following the

    Aarthi,
    Can you give us the following details,
    1. select query that you are using in your JDBC sender adapter
    2.the Document Name and namespace that you have given in the JDBC adapter
    3. the source datatype that you have created for your JDBC side along with the occurence of each element.
    This will help us nail the causwe for your problem.
    Regards,
    bhavesh

  • Proxy to file scenario issue

    Hi,
    I am trying to configure a Proxy to file scenario.
    My sender service is ERP system and the my receiver is PI file system.
    These are the steps I followed:
    1. Created a sender business system for Web AS abap (my ERP system)
    2. Created a receiver business system for third party (my PI system)
    3. I created all the interface objects(datatype, message type, message interface etc) in Integration repository.
    4. In the ERP system , I configured http connection of type h to PI system and also configured lcrsaprfc, sapsldapi connections of type t. I followed this blog: How do you activate ABAP Proxies?
    5. I also configured the ERP system as local integration engine, by setting the role to application system in sxmb_adm (followed the above blog).
    5. Now I generated proxy in sproxy transaction for the outbound interface.
    6. Then I created the communication channel, receiver agreement, interface determination and receiver determination in Integration directory.
    7. I created a abap program to call the execute_asynchronous method.
    Now the issue is, when I execute my report, nothing happens. I can see the success xml message in sxmb_moni in ERP system. No message is seen on the PI's sxmb_moni. The file is not written either to ERP or PI systems.
    Since I am new to PI, I am not sure where to begin with.
    If anybody can help that would be great.
    Thanks
    MLS

    Hi
    Check the following
    1. RFC connection between R/3 and PI
    2. You said Business system of type third party (PI) is receiving it. Try Business system standalone Java. If PI system is already defined in Landscape as Integration server. It will not show any message output.
    3. message is shown in sxmb_moni in your ERP that measn proxy is able to receive all objects and passed it from there.
    4. Check in SMQ2 outbound queue of ERP as well as inbound queue for PI if message exist.
    5. While configuring in ID you dont need a sender agreement. Did you created one.
    Thanks
    Gaurav

  • Reg:JDBC to FILE Scenario

    Hi All,
    My scenario is JDBC to File.
    In receiver file communication channel I will be using  the  Conversion Agent tool and the file name should reflect either the value of the Field say <NAME>TEST</NAME> ,then my output file name will be TEST.CSV or the Busines Service name ie BS_TEST ,then it should be BS_TEST.CSV
    Please suggest me on this.
    Thanks in Advance,
    Lavanya.B

    Hi,
    Check this blog for using the Busines Service name as your file name:
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    the same you can use the Variables from Payload to get the field name as file name check [this|http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm] link and go to variable subsitution section second option  If the variable refers to an element in XML schema, add the prefix payload:
    Sachin

  • JDBC to file scenario - Time limit exceeded

    Hi All,
    I am getting timelimit exceeded error in the inbound queues when I am processing the interface JDBC-XI-file. I have tried many options like registering the queues, changed the integration engine configuraion parameters for timeout , checked the memory space. When less data is being sent like 50kb then it is executing successfully. With large data the messages are getting stuck in the queues and then giving the timeout error.
    Also when I  am checking in sm50 it showing that some rfc is going on hold.
    Please suggest .
    Thanks,
    Aparna

    Thanks for the reply Pragati.
    What will be the UDF code for RFC lookup in case of passing the data in Queue. I am currently using the below code for gettng single value.
    Also is it possible to get multiple output values which can be mapped to different target fields. Currently I am using different rfc lookups for different target fields. So if I can combine them into single rfc lookup them this may effect the performance.
       //write your code here
    String content = "";
    MappingTrace importanttrace;
    importanttrace = container.getTrace();
    // Create document builder to create DOM XML document
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    factory.setNamespaceAware(false);
    factory.setValidating(false);
    try {
            // Create XML document using document builder
            builder = factory.newDocumentBuilder();
    } catch (Exception e) {
           importanttrace.addWarning("Error creating DocumentBuilder - " + e.getMessage());
            return null;
    // filling the string with our RFC-XML (with values)
    String m ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns1:ZFI_GET_COCODE xmlns:ns1=\"urn:sap-com:document:sap:rfc:functions\"><COMPANYID>" + a + "</COMPANYID></ns1:ZFI_GET_COCODE>";
    RfcAccessor accessor = null;
    ByteArrayOutputStream out = null;
    Payload result = null;
    try
    // 1. Determine a channel (Business system, Communication channel)
    Channel channel = LookupService.getChannel("BS_SAP_DEC210","CC_RECEIVER_RFC_test");
    // 2. Get a RFC accessor for a channel.
    accessor = LookupService.getRfcAccessor(channel);
    // 3. Create a xml input stream representing the function module request message.
    InputStream inputStream = new ByteArrayInputStream(m.getBytes());
    // 4. Create xml payload
    XmlPayload payload = LookupService.getXmlPayload(inputStream);
    // 5. Execute lookup
    result = accessor.call(payload);
    /*InputStream in = result.getContent();
    out = new ByteArrayOutputStream(1024);
    byte[] buffer = new byte[1024];
    for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
    out.write(buffer, 0, read);
    content = out.toString();
    if (result == null) {
                    importanttrace.addWarning("result of RFC call is null");
    catch(LookupException e)
    importanttrace.addWarning("Error while lookup " + e.getMessage() );
    Document docResponse = null;
    InputStream in = result.getContent();
    String res = "";
    try {
            docResponse = builder.parse(in);
            if (docResponse == null) {
                    importanttrace.addWarning("docResponse is null");
    res =  docResponse.getElementsByTagName("COMPANY_CODE").item(0).getFirstChild().getNodeValue();
    if (res == null) {
                    importanttrace.addWarning("res is null");
    catch (Exception e) {
          importanttrace.addWarning("Error when parsing RFC Response - " + e.getMessage());
    try {
            // Free resources, close the accessor..
            if (accessor != null) {
                    try {
                            accessor.close();
                    } catch (LookupException e) {
                            importanttrace.addWarning( "Error while closing accessor " + e.getMessage());
    } catch (Exception e) {
            importanttrace.addWarning("Result value not found in DOM - " + e);
    // return the result obtained above
    return res;
    Thanks.

  • How to pass values at runtime in JDBC - XI - File scenario

    Hi friends,
    In my scenario, data is coming from R/3 and i need to filter records from oracle database based on this data. There are 4 database tables that need to be queried using 2 select statements. The resultset after the execution of query will be mapped to the target flat file structure.
    here are my queries:
    1) Can I avoid BPM as data needs to be collected from the two database calls which involves two sender JDBC adapter instances with only one target structure?
    2) Can I use stored procedure in this scenario? If yes, than how to pass values to stored procedure at runtime via sender JDBC adapter.
    Thanks and regards,
    Nitin aggarwal.

    Hi Nitin,
    "..So i want to know if i can write multiple select statements in the stored procedure.."
    Read the below line that is mentioned in the SAP help documentation fro Sender JDBC adapter:-
    <i>Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.</i>
    I dont think it can be achieved...but there must be some workaround for this. You can probably use a join statement.
    Read this, again from the documentation:-
    <i>The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.</i>
    Regards,
    Sushumna

  • JDBC- XI- File Scenario

    Hi ,
    I have this scenario where i need to pick the records from an Oracle staging table and i should insert the same header and item records in to a Flatfile which will be used to create records in SAP. The records in the oracle table would be of header and item records with an identifier for each of these header and items.
    can any one throw some light on how to progress on this scenario, like what wud be the structure my source data type to hold the item and data records & the select statement to be written in the JDBC adapter communication channel etc....
    Thanks in Advance,
    Kittu.

    Hi,
    To access any Database from XI, you will have to install the corresponding Driver on your XI server.
    To install oracle driver, just check this link,
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
    The details that have to be entered while adapter configuration,
    jdbc:oracle:thin:@<IP adress>:<listener port>:<instance name (database name)>
    Driver oracle.jdbc.driver.OracleDriver
    Meannwhile, you have to give a Select statement for your Sender JDBC adapter. This is used to seelct the rows from the table.
    You also have an update statement. This is used to update the rows that have been selected. Just check this link for the info,
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    Bhavesh

  • File to file scenario issue

    Hi all,
    In file to file to scenario in sender channel
    Qualty of service     Processing mode         observation
    Exactly once               Delete                 Input file not or                                                         getting deleted
    Exactly once in order    Delete               reaching output
                                                            folder after fewhours
    For best effort              Delete             Input file not
                                                            getting deleted
    Can anybody tell the reason for the above please.
    Regards,
    Venkat

    No error appeared. But for best effort file is moving to output folder at the same time it is not getting removed from input folder.
    For exactly once or exactly once in order file movement is taking few hours and also the input file is not removed from input folder.
    Hope i am clear
    Regards,
    Venkat

  • JDBC-XI-FILE scenario. How to extract data from multiple tables

    Hi,
    At this moment I didn't have the access for XI system. So here I have some silly question. Could you please clarify the same ??
    If I got to extract data from single table using JDBC adapter I can put the below query in communication channel
    SELECT *FROM orders WHERE new='true'.
    But if I got to extract data from multiple tables, logic to be used should be like as shown below. ( from previous thread------prabhu).
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    union
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    But my query is ........how to put the above entire code in one line. (i.e in Qery place of communication channel ) ??
    Thanks
    Kumar

    Hi Palnati,
        You either use a select query with join or a stored procedure which will contain the logic to extract the data from multiple tables. But, the limitation in case of stored procedure is u can hv only one selct query in it.
    You write ur actual query provided in the parameter 'Query SQL Statement". u can also wrt a stored procedure in it. Also, u can provide a update statement in it which will update a certain flag so tht u don selct the data again.
    Check the following link
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>
    Regards,
    Akshay
    Message was edited by:
            Akshay Salunke

  • DESADV.DELVRY 03(IDOC) - File Scenario .Issue with Mapping

    Hi All,
    we have used DESADV.DELVRY 03 as Source. we need to generate an XML file.
    Condition : we have segment :u2022E1ADRM1 : Central Address Segment Group, Main .this is Unbounded (0 ...99)
    The Segments has field:     PARTNER_Q  . The IDOC can have PARTNER_Q(Qualifier) as -> WE, SP, OSO.
    The condition is if PARTNER_Q =WE , then the data of SHIP TO PARTy should be transfered to file
    Same time, If Partner_Q =AG , Data of Sold to Party " should be transfered.
    Note :1.I DOC generated can have  PARTNER_Q= SP, AG , OSP , ZM etc.
             2. The adress are unique . Sold to Praty id , Sales ORG address are not same .. its different.
    I have develeoped  interface with Ship to party , sold to party , sales org fields , but I am little confused how to match all fields  of Qualifier : SP, WE, OSP  a once to -> file.
    I can't duplicate segment: E1ADRM1 structure as it is Source
    Please provide your input .
    Edited by: Varalakshmi SB on Jan 14, 2011 1:27 PM
    Edited by: Varalakshmi SB on Jan 14, 2011 1:29 PM

    Hi,
    this kind of conditions will be common during handling of idoc structures...
    All you need to do handle the context of the segment E1ADRM1 to the parent node..so that data of all qualifiers will be in single context and checks for the condition you provide
    i.e if E1EDRM1/PARTNER-Q Equals WE then pass the target value to the target field..
    if you like to gain confidence of your mapping once mapping is done put some test data and right click your mapping conditions and click queue to see the output and how the values are passed to the conditions..
    HTH
    Rajesh

Maybe you are looking for

  • External Hard drive wont show up in Finder

    Hi, After Mountain Update, the external hard drive icon wont show up in Finder sidebar, Desktop and in Disk Utility. Is there anything which needs to be set in System Preference ?? I have the External Hard Disk checkbox checked in Finder Preference,

  • Enhancement Request: Actions for JAVA Sources (compile to CLASS)

    Hi All, I would like to change my JAVA Source in the DATABASE and compile it again. At the moment I can see only the code but have no actions to compile and generate it to classes. Is this planned for a future release? AS a LAYOUT idea ... if classes

  • Rename of Domain Controller

    Hi, We want to upgrade our Domain Controller from  windows 2003 server to windows 2008 server. And our SAP servers are Local Domains(member servers) on windows 2003 server and we do not want to upgrade Operating System of the SAP servers.  The SAP se

  • HT5281 Update to Lion 10.7.4 and Security update 02/2012 upped Ruby load to the ceiling

    After updating our home Mac mini server to Lion 10.7.4 and Security update 02/2012, with the machine now just sitting idle, no user logged-in, network cable unplugged, Ruby is generating 96% load on the CPU at all times, with processor temperature ru

  • Capital One and portfolio recovery

    hi all I recieved a letter from capital one stating that my charged off cc account was sold to portfolio recovery. Portfolio recovery has not contacted me yet and they havent reported to the cra, so should i make the first move and contact them? Is i