FileAdapter write mode - Dynamic filename, write down simple text structure

Hi,
I tried to use the FileAdapter in a BPEL Process to write down and existing structure as String, comming from Database (CLOB), which has a defined structure.
My first problem is, that I assign an output filename through the output message header variable, but it does not work. Instead always the name from the Filename convention is taken (wizard like po_%SEQ%.txt).
My second problem is, that the FileAdapater destroyes the format during the write procedure. E.g.: The String structure is as follows:
MKKOPF EF585773 07.05.2009 1 XXX Spielapparate u. Restaurant- betriebsgmbH 40031356 Brehmstraße 21 1110 Wien 900000585773 EUR ML
MKMAIL [email protected]
MKEINZ EF4428643 28.06.2009 Test Card Casino XXX Gesamtausgabe Textteil Allgemein Großanzeige 4C 1 ST 1 489,00 489,00 GES
MKPOS. EF4428644 26.07.2009PRVB 948,66 / 10 / +5% WA
a.s.o, . So you can see, its quite a simple format, which has to stay like that!
First I tried to use the opaque mode for the fileoutput format, but I was stopped, because of the '/' characters in the source data. So I used the native builder to create a xml schema (I used deliminated file, multiple records, deliminated by white spaces, tabs and spaces). To identify the multiple records, I have chosen the end of line (eol). Except EOF and EOL there is no other choice, like CRLF,\r,\n!
However, testing my native format, result in writting a file with containing a single line with the original data. So the original line breaks are gone, and therefore the system who should process it further gets an parsing error!
The simple question is, how can I simple write down string data (containing German special chars, like Öäü --> ISO8859-1 and also XML reserved values like /) through the file adapter without destroying its structure?
Second, how can I pass dynamically the filename, as using the output header values does not work?
I hope some specialists are out there.
Thanks & BR,
Peter

Hi James,
here what I am doing.
I read some records from the database throught the database adapter. The returned records representing strings, which should be written, line by line separated by 0xA (\n) to a single file.
Also for the file write we use a Oracle SOA Adapter --> the FileAdapter.
We discussed quiet some time about opaque schema and native builder. So on my understanding only the native builder version works. Otherwise I get an error, because of the contained slashes in the string record.
What I am searching for is an easy way for aggregating this database row strings and append it with 0xA (\n).
With XPath functions, like create-deliminated-string(node, '#xA') I had no success. Adhering to XML the signs #xA should represent 0xA, but it does not work.
Also in using the encodeLineTerminators 
 is not working.
So I had really write a long bpel construct, combined with a Java Code Emeeding to do such a simple thing:
Here is the interessting part (hiden the while loop, index handling and final fileadapter write call details):
<while name="While_1"
condition="($VariableSapBillingJobs > 0) and ($VariableIndex &lt;= $VariableSapBillingJobs)">
<sequence name="Sequence_4">
<sequence name="Sequence_4">
<assign name="Assign">
<copy>
<from expression="concat(bpws:getVariableData('VariableBuffer'), bpws:getVariableData('InvokeSapDataSelection_eBillingSapDB4Select_OutputVariable','eBillingSapDB4SelectOutputCollection','/ns8:eBillingSapDB4SelectOutputCollection/ns8:eBillingSapDB4SelectOutput[$VariableIndex]/ns8:LINE'))"/>
<to variable="VariableBuffer"/>
</copy>
</assign>
*<bpelx:exec name="JavaAppendCRLF" language="java"*
version="1.5">
<![CDATA[String buffer = (String)getVariableData("VariableBuffer");    
buffer += "\n";     
setVariableData("VariableBuffer", buffer);]]>
</bpelx:exec>
<assign name="AggregateStructure">
<copy>
<from expression="$VariableIndex + 1"/>
<to variable="VariableIndex"/>
</copy>
</assign>
</sequence>
</sequence>
</while>
There must be a simpler way like that!
Do you or somebody else a simpler way? Doing it with the FileAdapter native builder, or at least with a XPath function?
Furthermore my next homework is, the inverse operation. I will read a file, this time terminated with 0xD 0xA, and must translate it to XML to use it further in my bpel process.
Also here I have not the idea, where the fileadapter supports me.
Thanks & BR,
Peter

Similar Messages

  • How to write a simple DB2 client?

    hello,
    I'm going to write a simple DB2 client in my new project,which can issue some simple db2 commands and get the result,for example,the "list tables" command. Can JDBC finish this job?
    any help appreciated.

    JDBC can do that and more.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    %

  • How to write a simple query.

    I have a table where I have data shown below. Now, I want to write a simple query which lists me the project and the count of the distinct effective dates for which data is existant there.
    Sample data:
    Project Task Effective Date (xx_proj_task_data)
    101 T1 01-Jan-2008
    101 T1 01-Feb-2008
    101 T1 01-Mar-2008
    101 T2 01-Jan-2008
    101 T2 01-Apr-2008
    101 T3 01-Apr-2008
    102 T1 01-Jan-2008
    102 T1 01-Feb-2008
    102 T2 01-Apr-2008
    103 T1 01-Jan-2008
    103 T1 01-Feb-2008
    103 T1 01-Mar-2008
    103 T1 01-Apr-2008
    103 T2 01-May-2008
    103 T3 01-Jun-2008
    103 T1 01-Jan-2008
    103 T1 01-Aug-2008
    103 T2 01-Apr-2008
    Output Reqd:
    Project Count(Distinct Effective Dates)
    101 4
    102 3
    103 7
    I can write a query that says:
    select project_id, count(1)
    from (select distinct project_id, effective_date
    from xx_proj_task_data) x
    group by project_id;
    But, is there a way I can achieve the same by avoiding the inner Query (x) and just by a simple query ?
    Thanks!

    Try below query:
    select project_id
    , count(distinct effective_date)
    from xx_proj_task_data
    group by project_id;
    --venkata                                                                                                                                                                                                                                                                                       

  • New to Java. Want to write a simple applet for a mobile phone.

    Hello,
    I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
    All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
    All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
    Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
    MIDP 2.0
    CLDC 1.1
    JSR 120 Wireless Messaging API
    JSR 135 Mobile Media API
    Nokia UI API
    (I don't know what any of this means but am a good learner).
    Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
    Many thanks and kind regards,
    Jason

    Actually it is working on my phone now.
    I changed the target platform in the wireless toolkit settings to MIDP 1.0
    Now to create the fields coordinate fields etc. I don't have much of a clue really.
    Current I have:
    import java.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class AtmosMIDlet extends MIDlet implements CommandListener
    Form WelcomeForm = new Form("AtmosMIDlet");
    StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
    TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
    TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
    public AtmosMIDlet()
    try
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    WelcomeForm.append(logo);
    catch (java.io.IOException x)
    throw new RuntimeException ("Image not found");
    WelcomeForm.append(WelcomeMes);
    WelcomeForm.append(Longitude);
    WelcomeForm.append(Lattitude);
    WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
    WelcomeForm.setCommandListener(this);
    public void startApp()
    Display.getDisplay(this).setCurrent(WelcomeForm);
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable s)
    notifyDestroyed();
    I'm trying to get the image logo.png to display at the top but I get the error:
    C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
    symbol : constructor ImageItem(javax.microedition.lcdui.Image)
    location: class javax.microedition.lcdui.ImageItem
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    When I try to build.. Any help would be great.
    Ideally the image would be on a seperate screen for a couple of seconds.

  • Write Down/Depreciation of Material Valuation Class

    Hi,
    We are trying to write down/depreciate specific valuation types of materials which are purely for operational purposes ie not strictly project stock. Has anyone gone thru an exercise where they have performed such an exercise, for specific material valuation classes?
    Thanks

    Hi,
    Its more a 'revaluation' exercise for specific material class' stock by adjusting original purchased values of their to current book value. They are not Assets as such (ie ones that come out of AuC and then are depreciated accordingly) but material that is classed for more operational purposes eg drilling. So trying to get thru an exercise whereby we can discover book value of specific material classes (ie not have to go through each material) and how we can achieve this 'adjustment' in SAP .
    Thanks

  • Asset write down or scrap of assets

    HI
    we have a scenario that we should writup or scrap the asset for one deprecation are , any one can sugest how to proceed
    re

    Creatrez a new transaction type and lilet that to that depreciation area
    scrap TC SPRO:
    Financial Accounting / Asset Accounting / Transactions / Retirements / Define Transaction Types for Retirements
    Asset write down TC SPRO
    Financial Accounting / Asset Accounting / Depreciation / Unplanned Depreciation / Define Transaction Types for Unplanned Depreciation

  • Inventory Write Down FIFO

    Hi
    Our business is in the Fashion Industry and we need to regularly write down the value of our stock. We wish to write down the value of our stock for our year end accounts to 31/12/2014 and then each month using a fixed percentage. We use FIFO as the valuation method for inventory.
    One option that I am aware of is manually doing this using the Inventory Revaluation function. This is not viable as we have thousands of products each with multiple layers as we use the FIFO method of valuation. It would take hours to complete and the risk of error would be high.
    Another option that I am aware of is using the Data Workbench but our providers have advised us that this is very cumbersome and therefore the risk of error is high too.
    So I am looking for a viable solution whereby I can write down our stock value by say 35% for year end 31/12/2014 and then 3% per month after that. The write down at 31/12/2014 should produce the following postings on our TB assuming a pre-adjusted stock level of €1,000,000:
    CR Stock (Bal Sheet)                  €350,000
    DR Stock Revaluation (P&L)       €350,000
    Many thanks in advance for your help
    Richard

    Hi Robert,
    As manual process is not favorable by you so only option left is to build a small add on to fulfill your requirement.
    If in case of add on all you need to do is to open inventory revaluation form everyday and depends on logic set, system with list all the item with new price and you just need to click on add button.
    Regards,
    Chintan

  • I need to find out dollar amount on iTunes "Give any amount" gift cards I purchased, store clerk did not write down the amounts

    I need to find out dollar amount on iTunes "Give any amount" gift cards I purchased at CVS, store clerk did not write down the amounts when I purchased.

    Without scratching them off to get the numbers and redeeming them there is no way for you to do so. You could go back to CVS and see if they can get the data from their computer or see if your receipt helps.

  • End of year accounts/stock write down issue

    Hi all,
    We have had our accounts prepared and looking at the numbers need to do a write down of stock.
    All our inventory valuation is done via FIFO.
    1. We ran a report of old inventory using the inventory audit report upto 30/6/09 (last day of our financial year).
    2. Using this, we have a valuation of say $100k which we want to write down the old stock by.
    3. However, if we go into inventory revaluation report, it shows stock/quantities at current status, and gives a message saying item cost will become negative if we proceed (as a few items have sold between 30/6 and today).
    Since both now and in the future, stock write downs will be made probably a few weeks after the end of the financial year (so P&L etc can be prepared), how do we get around this problem? Ideally we want to be able to revalue the old stock at the 30/6 each year.
    Thanks,
    Rajiv

    Hi Gordon,
    Thanks for the reply. I have been giving this alot more thought. I think in this case the business process may be in question:
    - do most companies out there prepare and do their inventory write downs on the year end day at close of business?
    If so, then the current revaluation system makes sense. If not, then I am not sure what the correct way to revalue inventory is on B1 at the moment, as the built-in method only allows you to revalue stock at hand today rather than stock at posting date specified. From a systems perspective I recognise this makes sense (as otherwise alot of postings regarding profit per item etc would become nonsense!).
    If however, like us, most companies finalise inventory figures for write down a few weeks after year end, then what should we be doing?
    NOTE: "Year end" in the above does not refer to any specific year-end procedures on SAP, literally just the last day of the financial year upto where we do P&L, Balance Sheet, Trial Balance for accounts submission.
    Thanks,
    Rajiv

  • What language to write a simple webcam application

    Hey all,
    I need to write a simple application that will allow me to record video and audio from the computers webcam and mic. I need to be able to upload this to a server with a decent api for this sort of thing. I know webcams work in linux because of Ekiga (i think?) ,skype and etc.. working with it. But what language for linux would give me access to this hardware in a linux environment.
    I have some ruby and python experience, and am not opposed to learning a new language to do this. I would like it to be cross platform or easily portable.
    any suggestions?
    thanks

    fiddlinmacx wrote:Why reinvent the wheel? You can do this with VLC Media Player at the command line and you can even control it by sending commands to a network socket.
    This, i did not know. Thanks very much.
    I do need to wrap this in a simple GUI.
    I would ideally like it to just have a record and upload button. Very simple. Just wondering the best way to pull this off.
    Thanks again, will look at some of the CLI parameters with vlc
    Last edited by skrite (2012-06-12 16:53:28)

  • Dynamic Filename in Fileadapter

    Hi all,
    I like to use the new feature (SP15) of the "Adapter Specific Message Properties" but with out success. I have read Michaels Blog "XI: The same filename from a sender to a receiver file adapter - SP14" but it give me not a clue how to use these properties during the normal receiver configuration and also the manual is not very clear about it. I have set a Variable with "FileName    message:FileName" (I have tried also "message:File_Name") Than I have used this filename Variable in the field "Filename Schema" like %FileName%. But I allways got this error: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'FileName' for variable 'FileName'.
    What have I missed out here?
    Thankx
    Manfred Schmidt-Voigt

    Hi Manfred,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • ABAP mapping split messages and dynamic filename

    Hello,
    i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
    Regards,
    Andreas
    Edited by: Andreas on Feb 26, 2009 9:09 AM

    you cannot do dynamic configuration for message splits. The below is from SAP help.
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    u25CF     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    u25CF     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    u25CF     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

  • Administrators unable to write to a text file created by another Administrator on Windows Server 2008.

    Why are Administrators unable to write to a text file created by another Administrator on Windows Server 2008?
     --- The Administrators already have full control so how do I fix this? ---
    Example:  On a Windows Server 2008 (SP1): user A (who belongs to the Administrators group) logs in and creates a directory C:\foo and creates a file readme.txt in the foo directory.  User B (also a member of the Administrators group) logs in and opens C:\foo\readme.txt in notepad. User B types something and tries to save the file. User B cannot save the file…an option to save as some other file name is presented. The security permissions of C:\foo\readme.txt show that Administrators have full control.  
    Work around 1: Explicitly add user B to have full control over the foo directory. The problem is that all the all other Administrators still need to be added (current and future).
    Work around 2: Change the Users security permission to be full control on the foo directory. (this seems dangerous!)
    It is interesting to not that this same procedure is not a problem in Windows Vista. (Any insight about the difference?)
    Sincerely,
    Ian 

    so there is no way to change this without literally shutting down the UAC?
    I have files that  I need to modify all the time, and it is very annoying to have to save as to my desktop modify and then copy and paste the file again.
    I would also rather not give myself permissions to the entire C:\ Drive even specified Folders or documents, etc......
    You can change these settings without bringing down the UAC
    <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-font-family:Calibri; mso-bidi-font-family:"Times New Roman";} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; mso-ascii-font-family:Calibri; mso-fareast-font-family:Calibri; mso-hansi-font-family:Calibri;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->
    1.    Click Start, type gpedit.msc and press Enter.
    2.    Expand Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options.
    <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-font-family:Calibri; mso-bidi-font-family:"Times New Roman";} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; mso-ascii-font-family:Calibri; mso-fareast-font-family:Calibri; mso-hansi-font-family:Calibri;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->
    3.    Double-click “User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode” on the right pane.
    a.    Choose “Elevate without prompting” and click OK.
    b.    Double-Click “User Account Control: Admin Approval Mode for the Built-in Administrator account”, Click Enable, Apply and then OK
    c.     Double-Click “User Account Control: Run all users, including administrators, as standard users”,Click Enable, Apply and then OK
    Then reboot the Server. You should now have the ability to modify any document, etc....

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

  • Can't write in the text pane of Hotmail. Working on other browsers.

    Can't write in the text pane of Hotmail.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

Maybe you are looking for

  • HT1657 I am having problems with sound in my rental movies

    We rent movies all the time but lately we are having problems with sound for our movie rentals.  We watch the first half hour without a problem than the voice is choppy all the time.  Sometimes it is good for five minutes than noting for a while.  We

  • How can i change a program from Request/Task ?

    Hi everybody I have a main program in some request/task number and some include in other request/task numer; i want to transport them in the same task. How can i change a program/include from one request/task to other ? Thanks Frank

  • Latest iTunes update, what's wrong?

    After I downloaded the iTunes update last night, when I try to sync my iPhone, iTunes crashes during the photo transfer point.

  • Exception in java.io.UnixFileSystem.getBooleanAttributes0

    Hi All, I am seeing this stack trace, when running an application inside JBOSS: at java.io.UnixFileSystem.getBooleanAttributes0(Native Method) at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:221) at java.io.File.isDirectory(File.ja

  • Moving/Exporting Seeburger configurations/objects from QA to Production

    Hi, I need some expert advise in moving Seeburger configuration objects like splitter adapter,AS2 adapter configurations from QA to Prod. Our scenario is like this , in the Seeburger message splitter we have defined the splitter adapter based on the