How to create Fixed Length Flat File from Open Hub in BI 7.0

My requirement is to produce a Fixed length Flat file by Open Hub destination. My Open Hub has four fields. Now the requirement is to create another extra field in Open Hub which will contain all of the four fields value. In addition to that the fields should be fixed length that means if for any field no value is there and the field length/type is CHAR4 then 4 spaces should be there as the field value. SO, basically the Open Hub output will be single field which will contain information of four fields.
How to get this using End Routine of Transformation (from DSO to Open Hub) ?

Hi,
You can map the four input fields to the new field in the Open Hub, and change rule type to "Routine".
For example, if your source fields are called "first", "second", "third" and "forth", the ABAP routine could be similar to:
DATA: l_t_1  TYPE C LENGTH 4,
      l_t_2  TYPE C LENGTH 4,
      l_t_3  TYPE C LENGTH 4,
      l_t_4  TYPE C LENGTH 4.
IF source_fields-first IS INITIAL.
  l_t_1 = '    '.
else.
  MOVE source_fields-first TO l_t_1.
endif.
IF source_fields-second IS INITIAL.
  l_t_2 = '    '.
else.
  MOVE source_fields-second TO l_t_2.
endif.
IF source_fields-third IS INITIAL.
  l_t_3 = '    '.
else.
  MOVE source_fields-third TO l_t_3.
endif.
IF source_fields-forth IS INITIAL.
  l_t_4 = '    '.
else.
  MOVE source_fields-forth TO l_t_4.
endif.
CONCATENATE l_t_1 l_t_2 l_t_3 l_t_4 into result.
In the example, the program uses four blank spaces if any of the fields has no value. 
Additionally, if non-initial values in input fields could be shorter than 4 characters (if the input fields have no fixed length), you could use STRLEN to evaluate if it is necessary to add blank spaces to complete the fixed length of 4.
I hope this helps you.
Regards,
Maximiliano

Similar Messages

  • Problem while writing to fixed length flat file from xml

    Hi,
    I have a problem in writing data into a flat file of fixed length...
    My input is a xml file and i want the output as a flat file. I am successful in converting the xml into flat file... But the main problem is, i am unable to insert spaces in between my fields in the flat file.
    The data in the flat file comes without spaces... Any suggestions on writing the schema...
    Regards
    Surya.

    Have a look at this doc
    http://otndnld.oracle.co.jp/document/products/as10g/101310/doc_cd/integrate.1013/b28994/nfb.htm#BGBBAJFD
    your element should be something like this, it pads with a space using the paddedBy expression
    <xsd:element name="C1" type="xsd:string" nxsd:style="fixedLength" nxsd:length="4" nxsd:paddedBy=" " nxsd:padStyle="tail" />if having trouble post what you want the file to look like, and the xsd you are using.
    cheers
    James

  • Fixed Length Flat File

    I am working on creating a fixed length flat file with data from multiple files.
    This flat file will have 4 different record formats.
    My idea is to create a table for each one of these record formats, populate it in my PL/SQL program and utilize the [DUMP_CSV|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:95212348059] procedure to then select from each of these tables. My idea is that if the record format changes it could be as simple as altering the table, and recompiling the program. Suggestions/comments on my approach?
    Thanks

    Use External Tables. By that you can even skip the PL/SQL code that you may need to write if you use normal table to load them.

  • Conversion of fixed length flat files to oracle table

    hello friends
    Please help me getting the code for conversion of fixed length flat files to oracle table
    Should the tables be pre-defined ?????
    In this case the de-limiters are variable length spaces and not commas.Please help me with the same
    Regards,
    -Mahesh

    You can use SQL*Loader to load fixed-width files into Oracle. Instructions on writing appropriate control files are in the Oracle Utilities manual
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch03.htm#1004687
    You can also use external tables, assuming you're using 9i or later (the syntax for external table definitions is nearly identical to the syntax for SQL*Loader control files).
    You'll need to create a table definition in Oracle. You can either create a "normal" table and use SQL*Loader to populate it or you can create an external table definition.
    Justin

  • Java value objects to fixed-length flat file?

    I am searching for framework or third party API, which can convert a java bean to fixed length record.
    I want to automate this solution, using some mapping files. (Like hibernate API for java <----> xml conversions)
    if anybody can give me any url or suggest ways, i would appreciate that...
    thanks
    ashish

    But as business requirements change or new
    integration happens.. it is possible, You can count on it.
    java beans get
    more data elements.. so i want solution which is
    flexible easy to change or experiment ..during
    development and after being deployed. I would create two classes for representing the copybook layout. One for the whole thing and another for each element. Each field will have the length type and any special formatting rules. i.e. you will have mutiple types of field classes implementing the Field interface. Then put these in a LinkedHashMap and as you are adding them set another field which will be the offset from the beiginning of the record. The Record class will hold these Fields and other Records.
    Then create a schema text file format and load that in on startup. Then you buld the data like a you would a DOM model in your application.
    I wish someone had done that in our code instead of copying, pasting and editing this:
    int length = 10;
    int offset = 500;a bazillion times. That's real fun when you want to add fields. The damn methods aren't even in consecutive order.

  • How to create a data load file from Excel !!!

    Hi All,
    I'm new to HFM and would like to load data into an HFM application. As I have an Excel file with all the data. When I'm directly loading the data it throws an error saying "No section has been specified to determine if this is data, description or line item detail". How can I convert this excel file into proper format (.dat) file understandable by HFM ?

    There are several ways to get this data into HFM.
    1) FDM - best option if you have it
    2) Webforms/Data Grids
    3) HsSetValue formulas in Excel
    4) DAT file loads
    5) JVs, etc
    If you wish to use DAT files created via Excel, you will likely want to use Excel VBA macros to create your DAT file to load. We do this on occasion for special projects and it works quite well. What you can do is set up an Excel file with your data inputs to look however you want, then link your POV members and amounts to another tab (we commonly call this the Export tab and it is set up in an HFM-friendly format).
    Create a macro to write a DAT file to a specified location using data from the Export tab. The DAT file will need to be formatted as below. For a specific sample, you can extract data from your HFM app and see the format.
    !Data
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Brush up on Replace, Merge, or Accumulate load options in the HFM Admin and User Guides, then upload your new DAT file.

  • How to create security for flat files under a Webserver Directory?

    Hello,
    I have an Application where I need to show a Flat Excel File (with open/save option) from a URL from Portal.
    This works fine.
    But a user can view this file without login to Portal.
    Though we restricted the directory, file access is uncontrolled.
    What should we do?
    Thanks
    Madhav

    I mean, how to enforce Login to Portal on flat files in the Web Server Directory(if the users are accessing directly from URL), they should be accessible as long as they logged into Oracle Portal. But right now, they can access by typing the URL for this flat file directly into browser.
    Thanks for your time
    Madhav

  • Require script to load fixed  length flat file

    Hi
    Can anyone provide me a script to load a flat file into database ? A sample script would be ok
    thanks in advance
    Siva

    You can use SQL*Loader to do this, or external tables in 9i or higher. These methods are well-documented in the Utilities Guide.
    Cheers, APC

  • How do I disable auto-recovery files from opening every time I open Photoshop?

    Hi! I have read several forums about how to disable the auto-recovery feature. However, I don't want to disable the auto-recovery because I like that it saves my work in case of crash. It's just annoying that everytime I open photoshop all those previous files auto open. Is there anyway to make it stop? I read that there is a file that you delete, but will that stop the auto-recovery feature? Thanks in advance for your help!
    Oh! It's Photoshop CS 6 and the os is Mountain Lion. Thanks!

    On Windows, if Photoshop crashes, the autorecovery files are not cleared. On next launch, Photoshop sees those autorecovery files and reopens them.
    When Photoshop closes successfully, it deletes these autorecovery files, and thus on the next launch no recovery files should be opened.
    So if your files are continually opening, then Photoshop is in essence crashing every time you close it (assuming you are trying to close Photoshop each time).
    May need to look at doing things like recreating the preference files or running Photoshop in a new user.

  • How to create custom Ringtones (m4r files) from Songs in iTunes

    Jakarta, 14 June 2013
    On Mac OS : 10.7.5 (Lion)
    On iTunes : 11.0.4
    Difficulty : intermediate - hard
    Assuming you know basic Ctrl+Click and Option+Drag...
    Full correct steps should be like this :
    1) Select a favourite song in iTunes program to be made into Ringtone...
    2) "Get Info" on that song name and make any 0:30 seconds portion of that song....
    (specify "Start" & "Stop" time - under "Options" – to any 30-seconds duration and click OK)
    3) Right-click or Ctrl-Click again on same song name and select "Create AAC Version" to create an .m4a file...
    (when done iTunes will create a Chime)
    4) to locate the created .m4a file easily, Ctrl-Click again on same song name and select "Show in Finder" from the pop-up list...
    (iTunes will automatically point the folder location of the original .mp3 & the newly created .m4a files... keep this window open for later...)
    5) change the .m4a file to .m4r as suggested...
    (rename to whatever you like but you must change the extension to .m4r)
    6) At this point, the m4r(original) file isn't a "Ringtone" file yet... which we'll need to change now...)
    (check under "Get Info" > "Kind" :  it's still "Apple MPEG-4 Audio")
    ...1st by dragging that newly changed .m4r(ori) file to somewhere out of that same default folder it was created by iTunes...
    { this is where most confusions occur, take note here, it gets rather complicated }
    7) Once it's outside of that folder, Double Click the m4r(ori) file and iTunes will play...
    (u can stop it immediately...) this is just to let iTunes automatically convert that m4r(ori) file into a new duplicate & places it inside the initial default folder where the original .mp3 file is kept... we kept the window open previously, remember?
    8) Locate that duplicate .m4r(new & true) file, in that same .mp3 folder and now DUPLICATE-Drag (press Option while dragging to get the "+" sign) it to the "TONES" folder in your default apple folder structure. (check under "Get Info", this .m4r(new) File's "Kind" should be "Ringtone")
    //to get to that "TONES" Folder : First Locate your iTunes default Music Folder in your Mac --> usually it's in your Default "MUSIC" folder --> Navigate to "iTunes Media"  --> Navigate to "Tones". !! Keep this window open to make the transfer manually !!
    9) Once your duplicate is placed inside the "Tones" folder, double-click on that duplicate .m4r(true) file and let iTunes play, it should automatically place that ringtone file into the "Ringtone" sidebar List in the iTunes program... (check program to see)
    Somehow u needed both duplicates : 1 – inside the default initial .mp3 folder & 1 – inside the Tones Folder which we Duplicate+Drag into... and both must be "Ringtone" – Kind... for this to work.
    10) There you go. Now you can Sync / Delete / Add the whole Ringtone contents to your iPhone as you wish.
    //Don't forget to set SYNC ON under the iphone  "Tones" tab in your iTunes - iPhone screen... and click big SYNC button at the bottom of iTunes program & wait for the magic.
    ( Finally you can check inside your iPhone "Sounds" settings and hopefully if all steps done correctly, the bloodycomplicatedringtone selection will be there. Enjoy!

    Hi --
    I'm using iTunes 11.0.4 on OSX 10.8.4 and am having a hard time following your instructions to create a ringtone from a snippet of a .mp3 file using iTunes:
    1) Select a favourite song in iTunes program to be made into Ringtone... CHECK!
    2) "Get Info" on that song name and make any 0:30 seconds portion of that song.... CHECK !
    3) Right-click or Ctrl-Click again on same song name and select "Create AAC Version" to create an .m4a file... PROBLEM!
    It's when I hit Step 3 that I have a problem -- my "right click menu" at that point looks like this:
    There's no option to "create AAC version." Nor does this option appear anywhere in iTunes that I can find.
    It really shouldn't be this confusing to create a freaking ringtone. HELP PLEASE!

  • How to create a target flat file in a mapping?

    Hi,
    I defined a Target location tar_loc (D:\target), a file modul and a file with location tar_loc and file name target_file.
    In a mapping I try to use this file as a target.
    After validating I get the message: VLD-2357: The name of the target file for target_file is missing.
    What to do?
    Thanks
    Andreas

    Hi Andreas
    Set the target data file name when you configure the mapping on the file ooperator, see;
    http://blogs.oracle.com/warehousebuilder/2007/06/some_tips_and_hints_about_xml.html
    Also this one is interesting for dynamic file names;
    http://blogs.oracle.com/warehousebuilder/2007/07/dynamically_generating_target.html
    Cheers
    David

  • How do you stop the last file from opening on launch?

    InDesign CS5 insists on re-opening the last file I had open everytime I launch the app. I have tried making sure that all documents are closed before quitting ID with no success. I have looked through the prefs but can't seem to locate anything that changes this. I am on a Mac running Lion (10.7.4) and have looked for an OS level solution but haven't found anything and no other app is behaving like this. I did search in these forums and haven't found an answer.
    Anyone out there have any idea or is this an isolated occurrence? Thanks.
    Mike

    Nevermind. Found the answer -

  • Create an outbound flat file .txt file from SAP to UAPM.

    How to Create an outbound flat file .txt file from SAP to UAPM (Unicenter Asset Portfolio Management).

    What do u want in flat file and what is your doubt please let me know as iam working i can help u

  • Creating Fixed Length from Database Records

    Hello Folks,
    I need to take records from a table and write a fixed length
    text file. What is the general procedure for doing this? Any
    special packages I need?
    TIA.
    Alex Wolff.

    The mechanisms for creating the text file are either to spool a query result from SQL*Plus or to use the UTL_FILE package to write from a PL/SQL procedure.
    To write fixed length records you would do well to convert every column to text. A sample select clause might be ...
    select to_char(my_number,'99999990.000')||
    to_char(my_date,'DD-MM-YYYY')||
    rpad(my_text,30) as fixed_output
    from ...
    I hope this covers your question.

  • How do I move all my files from one User Profile (account) into another? I needed to create a new account and want all of my files accessible in the new one.

    How do I move all my files from one User Profile (account) into another?
    I needed to create a new account and want all of my files accessible in the new one.

    ok, what you're learning right now is 101 unix, which is good. Unix is a good thing
    now: the way unix works, and macos (which uses unix underneath) the files and folders work like a hierarchy.
    the start of that tree is /
    so, if you were to do:
    cd /
    (cd means change directory)
    it will bring you at the highest branch of the file system.
    cd /Users
    will bring you to where all the users are.
    to see whats in /Users you can use your friend ls command
    ls means list files/directories
    so:
    cd /Users
    ls -la
    (the -la here means show all (even hidden) and long format (very verbose))  this flag is very optional.
    you will see
    fred
    user2
    for example.
    if you want to see the desktop of user2 you would change directory to it then list the files.
    for example:
    cd /Users/user2/Desktop
    Note that the files and directory are case sensitive, so, desktop is NOT the same as Desktop, or DESKTOP
    ls -la
    you should then be able to see everything in users2 desktop
    you could have done as well the same thing in smaller steps, for example:
    cd /
    cd Users
    cd user2
    cd Desktop
    this is the equivalent of cd /Users/user2/Desktop
    So, for your file, i don't know where it was, but know that if you log in as user2, it will directly put you in
    /Users/user2
    which most likely the file you had created from the other user was in /Users/user1
    if you copied all the files from /Users/original_user to /Users/secondUser
    most likely yes, all your mail, bookmarks etc would be copied over.
    so in your case.
    sudo chown -R seconduser:staff /Users/secondUser
    should work
    Remember that if you start a path with the character /  it means start from the root of the file system, at the highest top you can ever get.
    so
    cd /Users/fred
    is not the same as
    cd Users/fred
    unless you were in / already
    i know it may be confusing at first but it's actually very logical if you play with it.
    to simplify, think of it that / means C:\  on windows
    you can't go any higher than C:\  (in a way)
    if you're unsure which directory you're currently in, you can always type:
    pwd
    it will tell you where you are.
    for example:
    cd /
    pwd
    this shows  /
    cd Users
    pwd
    this now shows /Users
    cd /System/Library
    pwd will show /System/Library
    cd /
    cd /Users
    cd fred
    cd Library
    pwd will show /Users/fred/Library
    unix can look very scary but it's actually vital and very necessary to do tasks sometimes that would take for ever to do via the windows. This is good learning.
    so for the myfile you had created, i can't tell you where it is, at the time you created, if you can do a pwd command you'll know the path,
    ls -la  (this shows all the files where you are)
    if you see myfile in the list
    do a pwd
    whatever is return, the real location of the file would be:
    whatever pwd returned / myfile
    I hope that makes sense.

Maybe you are looking for