Creating a flat file in the IDOC format
Hi everybody,
Need help.....urgently. Can somebody please tell me how to create a flat file in the IDOC format? I am creating a bill of lading/Documentary payments (EDI 858) and can't figure out a way to write the data generate through the report in a flat file in IDOC format. My deadline is right around the corner and I need help.
Thanks,
M
Hi Minal,
I still don't understand your question.
So, you have a report which selects data and puts it into an internal table. This part looks fine.
You want to create a flat file? Ok, to create a flat file on the application server then use the commands OPEN DATASET, TRANSFER, and CLOSE DATASET. To create a flat file on the presentation server then use the FM GUI_DOWNLOAD (or the GUI class, I forgets its name for the moment).
In both cases you should build up an internal table which has the exact structure required for your (EDIFACT?) EDI message, and then use the appropriate method to write the file.
If the following steps are manual then there is nothing more for you to do.
I don't see any need to use Idoc technology, or make any reference to it in your solution.
I hope that helps. If not, please be more specific when asking your questions.
Brad
Similar Messages
-
How we create a flat file on the application server
hi,
how we create a flat file on the application servere,this file have the header data and corresponding item data also.
i.e. how we use the AT NEW and ATEND. statement in this file creation.
pls send me some code related to this.
thanks,
vipinHi Grafl,
Chk this link
Folder creation in AL11 using ABAP program
try this code.This works on UNIX servers
data: unixcom like rlgrap-filename.
data: begin of tabl occurs 500,
line(400),
end of tabl.
dir = unixcom = 'mkdir mydir'. "command to create dir
"to execute the unix command
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
<b>Reward Points if Useful</b>
Regards
Gokul -
FM to create a flat file in given IDOC type format
Hi,
I need to create a flat file having IDOC format.
I have data in some other source file.
Which function module can be used for the same?
Could you pls provide some sample code?
Appreciate the help.
Thanks.
-ShreyasMy Exact requirement is:
I have some data in a source file.
Now I want to create a flat file while which should be in a standard IDOC format(WMMBID02) so that I can process it later using IDOC processing say EDI_DATA_INCOMING or any appropriate FM which will process IDOC later.
I dont want IDOC to be created in the system right now. I just need to reformat my source file into a standard IDOC format flat file. -
Mapping a flat file to the iDoc OILLDD
Hi.
<b>I have a file with this structure after I got it from the fileadapter.:</b>
B Dataxxxxxxxxx
C Datayyyyyy
D Datazzzzzz
D Datazzzzzz
C Datayyyyyy
C Datayyyyyy
D Datazzzzzz
C Datayyyyyy
C Datayyyyyy
E Dataxxxxxxxxx
B
E
B
E
etc.
<b>I want to map this structure to the Idoc OILLDD which have this structure.:</b>
OILLDD01
IDOC
E1OILT1
E1OILT2
E1OILT3
E1OILT4
each B-Recor shall produce a new iDoc.
each C-Record shall make an E1OILT1-segment
each D-Record shall make an E1OILT3-segment(if the D-record exist)
My problem is.:
How can I make an new iDoc for each B-Records in the file.
I got the file tthrough the filadapter.
Hope someone can help me.
Thanks.The file from the file adapter have to be parsed using the File Content Conversion.
Now this converted XML will have the fields with value "A", "B","C" etc.
This can be then mapped according to ur requirements. U need to export the IDOC as XSD , change the occurrence and then reimport it in the external definitions.
Regards,
Prateek -
Online program to create a flat file on Unix
Hi All,
Good day.
I got one requirement, where I need to write a Online program that will create a flat file on Unix. The probable Unix file will be send from the selection screen, where the user selects that with a fixed length & format.
Do I need to do it with the Datasets? or is it possible to go with Upload function modules?
Please, send one example program of such kind.
Thanks,
Kal ChandHi,
You are going to create a flat file in the Unix Operating system which is nothing but the application server.
There are no standard function modules to write the file in the application server, so you need to use the DATA SET concept only.
1. Open Data Set file name
2. Transfer Data Set file name
3. close Data set file name
I believe this will help you to finish your requirement.
Thanks,
Mahesh. -
Different formats of the flat file for the same target
In our deployment, we use plugin code to extract the csv files in the required format. The customers are on same version of datamart, but they are on different versions of source database - from 3.x to 4.5 depending on which version of application they are using. In 4.0, we introduced a new column email in the user table in the source database. Accordingly, plugin will add the field in the csv file. But not all the customers will get the upgraded version of plugin at the same time. So ETL code needs to decide which data flow to process depending on the format of the csv file to load data to the same target table. I made the email field in the target table nullable but it still expects the same format of the csv file with delimiter for null value.
Need help to achieve this. Can I read the structure of the flat file in DS or get the count of delimiters so that I can use a conditional to use different data flow based on the format of the flat files.
Can I make the email column in the flat file optional?
Thanks much in advance.You can add an email column that maps to null in a query transform for the source that does not contain this column.
Or else you can define two different file formats that map to the same file. One with the column and one without -
HOw to create a text file in the given path and delete it after the use?
Hi all,
I am trying to create a text file at the given path and delete the created file after the use.
I am using following code.:
import java.io.*;
// write binary data as characters
public class RanIO {
public static void main(String f[])
// First illustrate append
String lineSep = "\n";
try {
File temp= new File("C:/Ash","cute.txt");
boolean ch=temp.createNewFile();
if(ch)
System.out.println("file created");
else
System.out.println("file Not created");
//writing to file
/* PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
p.print("Emp NO");
p.close();*/
// Open fileWriter in append mode
FileWriter fos = new FileWriter(temp, true);
BufferedWriter bw = new BufferedWriter(fos);
PrintWriter pw = new PrintWriter(fos);
double d=550;
// lineSep = System.getProperty("line.separator");
pw.print("Hello");
//pw.print( lineSep );
pw.print( d );
pw.close();
boolean det=temp.delete();
if(det)
System.out.println("File deleted");
else
System.out.println("File not deleted");
} catch (IOException ioe)
System.out.println( "Append IO error:" + ioe );
My problem:
1)
I am not able to write to the file. I want to know, where i am going wrong.
It is giving error message like
"Canot resolve Symbol: temp,"
But, FileWriter Constructor should accept a File type parameter.
here temp is a file parameter.
If i am not using file=new file();
i can't delete the file after the use. i.e if i use
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
how can i delete cute.txt after the use?
2)
I am not able to write to the text file. file is created but, a blank file.
"Hello" is not written into the text file.
can anyone help me in this regard
Thanks in advance
AshviniThank you Ram,
But, i want to create a text file in Append mode.
for that i used
FileWriter fos = new FileWriter(temp,true); But, it is not accepting FileWriter constructor in
this format. if i use
FileWriter fos = new
FileWriter("c:/ash/cute.txt",true); it works fine. !!!!!Here's the javadoc
public FileWriter(File file,
boolean append)
throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
Parameters:
file - a File object to write to
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Since:
1.4
Are you using jdk.13 or lower ?
>
ONe more doubt, Does flush method deletes a file?
if not, then i need to use
File temp=new File("c:/ash/cute.txt");
FileWriter fos = new FileWriter(temp,true); //which
is again a problem
if(temp.delete())
out.println("File is deleted");
}I don't know whether i am taking it wrong ! or
anything wrong with my coding ! but, after creating
and writing data into a text file. I must delete it
as it contains confidential informations.
Regards,
Thanks.'flush' writes to a file immediately. Else you should explicitly call 'flush' to write contents from buffer to underlying source.
javadoc again
PrintWriter
public PrintWriter(Writer out,
boolean autoFlush)Create a new PrintWriter.
Parameters:
out - A character-output stream
autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
cheers,
ram.
Question; What do you gain by opening a file, writing to it and deleting it in the same program ? -
Error while loading Flat file to the table (ORA-00936: missing expression)
lat file Hi Gurus
Receiving the following error while trying to load of flat file to the database :
ODI-1228: Task test_file_load (Integration) fails on the target ORACLE connection DEMO_STAGE.
Caused By: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1079)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3937)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1535)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)
The file which I have tried to load is : SRC_SALES_PERSON and teh table structure is
CREATE table "TRG_SALES_PERSON"(
"SALES_PERSON_ID" NUMBER(8,0) NOT NULL,
"FIRST_NAME" VARCHAR2(80),
"LAST_NAME" VARCHAR2(80),
"DATE_HIRED" VARCHAR2(80),
"DATE_UPDATED" DATE NOT NULL)
Knowledge module used are
LKM File to SQL
IKM SQL Incremental Update
We rae using ODI 11g R2 ...
Thanks and reallty appreciate any help in thsi regard.HI there,
I am facing the same issue while loading data from SRC_SALES_PERSON(flat file) to TRG_CUSTOMER.
I dont see any errors in the steps however the data is not laoded finally. Here are the sql commands
**On source**
select ID C11_ID,
LASTNAME C9_LASTNAME
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=SRC_SALES_PERSONSNP$CRLOAD_FILE=D:\Pratima\Softwares\ODI\ofm_odi_companion_generic_11.1.1.5.1_disk1_1of1[1]\demo\oracledi-demo\oracledi\demo\file/SRC_SALES_PERSON.txtSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=IDSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLINE_OFFSET=1SNP$CRLENGTH=11SNP$CRPRECISION=11SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=FIRSTNAMESNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=12SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=LASTNAMESNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=62SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=DATE1SNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=112SNP$CRLENGTH=20SNP$CRPRECISION=20SNP$CR$$SNPS_END_KEY*/
On Target
insert into STAGING.C$_0TRG_CUSTOMER
C11_ID,
C9_LASTNAME
values
:C11_ID,
:C9_LASTNAME
The actual code at source fails however the step is in green.
Thanks in Advance,
Pratima -
Create a flat file with multiple characters for enclosures
Hello,
we use OWB 11g2 (11.2.02).
Now we try to create a flat file with multiple characters for enclosures. The manual wrote:
"Enclosures (Left and Right): Some delimited files contain enclosures that denote text strings within a field. If the file contains enclosures, enter an enclosure character in the text box or select one from the list. The list displays commonenclosures. However, you may enter any character. The default for both the left and right enclosure is the double quotation mark ("). You can specify multiple characters and hexadecimal characters as field enclosures."
But it will not work. The OWB use the first character from the left enclosure definition as left enclosure and the second one as right enclosure !?!
Did anyone know this behavior? Is there a solution for this problem?
Thanks and regards
NorbertHI Raghu,
Use the function module 'GUI_UPLOAD'.
In that you have to specify the field_separator value = 'X' in export section.
Regards,
S.C.K -
Create a Flat File like text_io in forms6i
Hello,
how i create a flat file (to download or in files system) via apex, like I did in oracle forms using text_io, for example
employees.txt
Name Last Name Salary
Fernando Medina 5000.00
thanks in advance
regard
Edited by: Fdomedina on Mar 11, 2010 5:00 AMNow you have to do it from the database using the UTL_FILE package.
Or (if it is a report) download it as CSV file, so you can open it in Excel. -
Attaching a flat file to the Document Number
Hi,
I want to attach a flat file to the Document Number generated .
Please follow the steps :
1) Goto transaction FB03.
2) Enter into it by giving a document number.
3) At the Document overview screen you will find the 'Services for Object' button(Left side upper part of the screen)
4) When you click it you will find Create-> Create attachment will be there where you can browse and upload a flat file that tags tagged to the Document number.
Is there any FM to do this activity.
Thanks in AdvanceHi Raja,
I have used the function module
'BDS_BUSINESSDOCUMENT_CREATEF' with the following parameters .
Export:
LOGICAL_SYSTEM = 'LS_TSX100'
CLASSNAME = 'BUS6035'
CLASSTYPE = 'BO'
CLIENT = '100'
OBJECT_KEY = 'SE1201000000012006'
Tables:
Files-directory = 'C:\'
files-filename = 'POSTING.TXT'.
After that I have committed it .
The file doesn't get attached . I went into the FB02 and entered the accounting number(100000001) and checked but it has not got attached .
Please help me . -
Create new text file in UTF-8 format by default
I'm working a lot with UTF-8 text files and mainly in this format. It's becoming annoying when I have to manually save every text file as UTF-8. After several trial-and-errors, I've made up a procedure that I've put in a blog. I think I could share
it here for those who need it. Hope it helps.
http://instrumenti-meliora.blogspot.com/2014/04/create-new-text-file-in-utf-8-format-by.htmlYou've made a procedure?
Are you sure you didn't :
Didn't what?
https://www.google.com/#q=change+notepad+default+encoding
Well, I'm not sure what you want me to see, but your search keywords do
NOT make sense. You do note change *Notepad* default encoding. What you can change is a
TEXT file's default encoding.
Well, of course, if you have access to Notepad source code and you're able to change it and re-compile again, then you could really say you change Notepad's "default encoding", which I suppose would mean "default encoding every time we save".
Why wouldn't you just provide a link (or some attribution) to the top result
http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/default-utf-8-encoding-for-new-notepad-documents/525f0ae7-121e-4eac-a6c2-cfe6b498712c
or a link to watch this done on youtube?
http://www.youtube.com/watch?v=GnL6smxQE9k
The title of that forum post and Youtube video is a non-sense. New
"Notepad" document? Come on! That's apparently how a newbie think what it is and it's very likely he has not a clue what it is and what he is doing. And what if I don't use Notepad to create such file? If I
use UltraEdit, then mine should be "UltraEdit" document and that should be different from Notepad document, correct? LOL
The fact that you're able to find this video would also mean you're thinking like him in that the file is really called Notepad document LOL
For your information, that's called a text file (or document if you prefer this prettier term). It's also called plain text file.
Now, let's see the content of both links:
First of all, why did they tell people to create a new text file somewhere and then
COPY it to template folder? That's really so dumb
LOL Isn't it more intelligent to create such file directly INSIDE the folder?
Secondly, their procedures are not foolproof. What if the Windows directory is not c:\windows? They should tell people to open %Systemroot%\ShellNew instead. I suppose they don't even know how this folder is called because
nowhere is the term "template folder" ever mentioned.
Thirdly, what if that folder doesn't work for unknown reason (which might happen in XP)? Did they give any hint to a "failover" folder? No, they didn't. But I do in my procedure.
Fourthly, they are saying as if the file name has to be "TXTUTF-8.txt", but actually we can call it whatever we like. But smart people would have figured this out at the end.
5 (I'd stop saying fifthly and so on LOL) I'm not sure it's necessary (or recommended) to change "fSavePageSettings" & "fSaveWindowPositions" DWORD values for Notepad as "advised" in that answer.
As a side-note, I don't know what
http://www.pc1news.com/saving-changes-to-notepad-configuration-1216.html is supposed to give but when I open this, I got some uTorrent warning. Really seems like some malware webpage which tries to deceive people!
I actually searched how a (generic) new file is created and started from there.
So, maybe next time when you want to criticize or discredit somebody else, try to be more expert first? ;) -
Create a flat-file upload for a BO XAI Inbound Service?
Hello all,
If we don't have a schema defined for a BO XAI Inbound Service, how can we create the XSL and the flat-file upload schema file for it.
Any advice?
Regards,
KerrI don't have problem to create the XSLT mapping.
But because it is to create a flat-file upload for a Business Object XAI Inbound Service, it doesn't have a schema on the server as to the thread Create Schema for Business Object to use for XAI Inbound Service?
And I can't create that flat-file upload without a schema on the server.
Or I can use the BO XAI Inbound Service WSDL instead to create the mapping for the flat-file upload.
Regards,
Kerr -
How to create a flat files and how i used this
hi Guys and gals,
I am david. I want to know how to create a flat files. I don't know about it also. pls explain it and also pls help me to create a flat files. If u have any program for creating pls send me.
I want to know about retrive the datas from flat files and also insert a record into it.
pls guide me
i need this immediately
davidvoid newMethod() throws Exception {
// Reading from a flat file
String data;
BufferedReader br = new BufferedReader(new FileReader("c:\filename1.txt"));
while ((data = br.readLine()) != null) {
System.out.println(data);
// Writing to a flat file
BufferedWriter bw = new BufferedWriter(new FileWriter("c:\filename2.txt"));
bw.write("sample data");
// After writing the data close the file
bw.close();
} -
Create a flat file source in Designer in DIM
I am trying to create a flat file source in Designer in DIM from Workflow Manager, select Tools > Designer.However , I am unable to see the Planning folder therein to open. Can anyone help me in this respect.Plz help - very urgent.
Thanks in advance
ManishaHello,
http://help.sap.com/saphelp_nw70/helpdata/en/43/01ed2fe3811a77e10000000a422035/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a6581e07211d2acb80000e829fbfe/frameset.htm
steps:
create source system file (if you haven't)
- create ods
- create update rules for ods and activate
- create infosource
- assign infosource with datasource (source system file)
- maintain transfer rules - maintain infoobject in sequence as flat file to transfer structure. map infoobject in transfer rules. activate transfer rules
- create update rules ods-infosource and activate
- create infopackage, specify external data path (recommended file put in application server)
hope this helps.
Regards,
Maybe you are looking for
-
Index: 0, Size: 0 on iPad
Hi Pro's, I get the error: 'Index: 0, Size: 0' when connecting to the server on an iPad with an user's id (SAP Authentication) I can open the list of dashboards and dashboard with an Administrator account on the iPad. I then double checked the user's
-
File-SOAP-File Async/Sync Bridge : Null Pointer Exception
Hi All, I have a File-SOAP-File scenario (Async/Sync Bridge). This scenario was working fine in PI 7.0. However since the time we have upgraded to PI 7.1, this scenario has been failing. I do receive a response for web service, however the sender Fil
-
I'm having multiple issues with my iPhone 5. Issue one-it will not sync playlists anymore. Issue two-when connected to Windows 8 computer, it deletes half of the apps. Issue three-when connected to the computer, it cannot find certain apps. I've tri
-
Issue customer master data idoc
Hai gurus, the scenario is that ours is a sender system and other is receiving system. customer master data is sent form our system and other receives it. what happened here is idoc is sent to the other system and data went to other system
-
I am planning to buy an ipad mini, please suggest me whether its the right choice to go for or not ? Hows the display?