Variable Substitution for IDOC-XML-Flat File
Hello
I have a scenario where I need to populate the Idoc number into my file name. the Source is an Idoc and the Target is XML but the target is then converted to an Flatfile via a module in the processing sequence. When I try to use the variable sub method it errors out as the final target structure is a flat file and not the XML structure that I hav used in the graphical mapping. Any help on how I can go abut doing this will be greatly appreciate.
Thanks
Lavanya
IF I remove my adapter that converts the XML file to Flat file from the module sequence this works perfectly. So is there a way for me to now read the xml file for the target file name in variable sub. but still have the Flat file structure derived for the processing seq.
Similar Messages
-
Hello All,
I've gone through the 'How To Convert Between IDoc XML Structures and Flat Files in XI 3.0' guide. What I am having trouble wrapping my head around is the creation of the interface mapping, in particular the 'Target Message' interface. Obviously the 'Source Message' interface would be the incoming IDoc but what is the 'Target Message' interface that is used?
Looking forward to seeing the light,
MikeHi Mike,
your target message will be a XML structure which will be written to your output file.
The Structure will somewhat be of this type:
<root>
<Sub structure>
<Data/>
</Sub structure>
</root>
And you need to configure the Receiver File Adapter to see your output, also you can use File Content Conversion to change the output to<i> text.</i>
For that please go through this weblog by Mr. Arpit Seth:
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
I hope it helps,
Thanks & Regards,
Varun Joshi -
Hi,
Can Anyone provide an Example for IDOC to Flat File Conversion using Java Mapping.. Thanks in Advance.Hi Sudeep,
See the IDOC to File Scenario
https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e07dcaa0-a92b-2a10-3a96-b3d942bd1539
Modify the receiver with FCC by using below links...
File content conversion links...
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
Please see the below links for file content conversion..
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
Thanks,
Sriram
Edited by: Sri Ram Devarapalli on Sep 1, 2009 1:25 PM -
Conversion of multiple xml idocs to flat file
Hi,
I did ABAP mapping to convert xml idoc to flat file by using the reference how to do abap mapping in xi3.0.pdf
It is working for only one idoc at a time.
If I have multiple idocs in a single xml file, the above code is not working.
Please let me know what cchange to be done to work out for this.
Hope am clear.
Regards,
Anil.Look For the Occurances of target Field node...It should be 1 to unbounded
-
IDOC to flat file without XML conversion
Hi,
I want to implement a scenario like this:
IDOC --> XI --> flat file
The flat file has to have the IDOC structure as you have when you write an IDOC to the R/3 file port. But we want to have this process running through XI.
When you use the IDOC Adapter the IDOC is converted to XML first, which is time consuming. So this I want to skip this step.
So is it possible to receive the IDOC directly in XI without converting it to XML? How should this process be designed.
RonRon
Looks like you need IDOC tunneling. It is possible by making a configuration parameter.
You can find more information in http://help.sap.com/saphelp_nw04/helpdata/en/ab/bdb13b00ae793be10000000a11402f/content.htm
While you try it, I will try to simulate this requirement in our system and let you know the result.
KK -
Variable substitution: (delete leading zeros from file name)
Hi All,
I am configuring an IDOC to FILE (fcc scenario) with a requirement of using the IDOC number in the output file name.
Using variable substitution, I manged to get the IDOC number from incoming Idoc-control record but it comes in its entitre length with a few leading zeroes like '00000001234'.
So my output file name looks like 'Output_000000001234.txt' . I want it to be like 'Output_1234.txt'.
Is it possible to achieve it ?
Thanks
ShirinHi Shirin,
First supress the leading zeros of IDOC number by using the following code:
Create a user defined funciton zerosuppress and take the cache as value and take one argument input. Then put the code below:
//write your code here
String output = input.replaceFirst("^0+","");
return output;
Then use variable substitution for generating ur IDOC number in the out put file name.
Regards,
Vinod. -
Doubts in SAP(Idoc)-XI-Flat file scenario
Dear All,
I am sending Delivery Idoc from R/3 and I am able to view the Idoc in XI in transaction IDX5. Also i m able to see the XML structure with the data of the idoc in SXMB_MONI.
Now as per my scenario I have to download this to a flat file from XI.
My question is, should I have to do the creation of Data types, message types, mapping interface & interface mapping in IR or should I directly do the designing in the ID.
waiting for your reply.
Warm regards,
N.JainHi,
DT, MT, MI : you will create these things for receiver flat file only.
First create
In Integration Repository :
1. Import structure of IDOC in your scenario, In imported objects  IDOCs
a. In Interface Objects
1. Create Data type for your flat file
2. Create Message Type
3. Create Message Interface (inbound Asy.)
b. In Mapping Objects
1. Message Mapping : IDOC to Message Type of Flat File.
2. Create Interface Mapping : IDOC to Flat file by using Message Mapping which you have created.
Make activate all these things.
In Integration Directory :
1. Create Communication channel for File Receiver.
2. Sender Communication channel is not required.
3. Create Receiver Agreement.
4. Sender Agreement is not required.
5. Interface Determination
6. Receiver Determination
At sender side you will take your IDoc and at receiver side you will take your flat file.
It can help you,
Regards,
Sandeep Kaushik -
Idoc to flat file mapping using XSLT
Hi,
i am using XSLT mapping. my requirement is mapping between idoc and flat file(xml to text). as i do not want to use FCC, i have opted for xslt mapping. please let me know any article which would be helpful for this.
regards,
MeenakshiHi Meenakshi,
Two things:
1. Achieving this functionality using XSLT is very difficult.
2. Secondly you may not be able to find a direct document to convert IDoc-XML to flat file using XSLT in sdn. Try google.
I found one link like that may be you can get some idea from there
http://www.stylusstudio.com/SSDN/default.asp?action=9&read=6453&fid=48
Also if you have a XSLT editor like XMLSPY or stylus studio then creating your specific XSLT will b much more simpler
Regards
Suraj -
How to convert IDOC to flat file in XI
Hello SDNers
I have a scenario IDOC --> XI --> Flat file. My question is how to conver IDOC to flat file. At least there are two ways to do that:
1) Define a flat structure in PI that reflects the IDOC structure, then using content conversion to convert the flat structure to flat file in hte receiver communication channel.
2) There is a [document |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a] talking about using a generic ABAP mapping to map any IDOC to flat file.
For the option 1, I don't want that way, because I would need to define a flat structure in PI for each IDOC which is too much effort. (I would have dozens of IDOC scenarios)
The second one is very attractive. However the document is not complete to follow. Basically it does not explain how the inbound flat structure looks like. I guess the generic ABAP mapping is used to map any IDOC_XML structure to a flat structure, then in the file receiver communication channel to convert the flat structure to flat file format. But the document does not mention how the flat structure looks like. Has somebody tried this scenario? If yes, can you please let me know the steps to do in ESR (IR) and ID? Basically what structure the IDOC_XML should be mapped to using the generic ABAP mapping class?
Or somebody has other ideas on how to convert IDOC to flat file?
Thank you so much
Eric> 1) You are saying that for Java mapping and abap mapping, the target data type (messag type) is just a dummy one, the real (XML) message the receiver will recieve is the one (stream) produced by the java or abap mapping. Is that correct?
Definitely yes!
>
> 2) For the abap mapping option, I would define a dummy target data type. Do I need to do any content conversion in the receiver adapter (communication channel)?
None wat so ever.The output of your Java Mapping will be the Native Idoc Format.
>
> 3) I tried with a dummy target data type as mentioned in my second post, can you see any clue in the error message what is wrong?
Dats one thing I cant help much. Just make sure that the ABAP report is valid and take the help of a ABAP'er to debug what is going wrong. Not much of a ABAP guy, can read ABAP code, but cant write one myself
Try to test the program standalone to see how it works. Maybe take some Idoc XML file as input and then dump the output to a .txt file and so on.
Regards
Bhavesh
PS : All this is from what I have read of this guide. I have not convert Idoc XML to Native Idoc but have used this guide to convert Native Idoc to Idoc XML . -
Hi friends,
I need help do develop a new interface using IDOC -> FLAT FILE scenario.
Please send exemples and links.
In found only XML file formats, i need FLAT FILE.
Thanks,
Marconew interface using IDOC -> FLAT FILE scenario.
idoc to flat file scenario is very simple but you have to provide FCC Parameters in Receiver File Communication channel based on target structure and remain ecvery thing is same what was you found idoc to xml scenario.
ex for Fcc Parameters in Receiver File Communication channel :
http://www.riyaz.net/sap/xipi-file-content-conversion-for-complex-structures/79/ -
IDoc - SFTP (Flat File) file name
Dear Experts,
Thanks for helping me so far, please find below my new request :
We have IDoc - SFTP (flat file) scenario in which I have did ESR by pass scenario and used standard module to convert IDoc xml to flat file.
But now user is asking to have the naming convention of the receiver flat file as SHPMNT05_<IDoc number>_<Reference number>.idoc.
Could you please let me know how this can be approachable. Many thanks in advance for your valuable inputs. Awaiting your replies.
Thanks
Ravi..Thank you very much Botha,
In the thread Idoc to file problem with DynamicConfiguration please find below my doubts.
1. I am using receiver SFTP adapter and IDoc to flat file module configuration as key 1, so how it will works.
2. What are the Parameter name and Paremeter value for the module mentioned in the blog :
Module Configurations:
1 key.0 write http://sap.com/xi/XI/System/File FileName
1 value.0 message.interface
Which is the parameter and which is the value in the above blog.
Waiting for your response.
Thanks
Ravi -
Variable Substitution for Source Directory
Hello,
I have seen several threads about using a UDF and variable substitution for dynamically determining the Target Directory.
Is anyone familiar with (or had to implement) a solution where the Source Directory is dynamically determined.
My challenge is to connect to a different Source Directory name (sy-datum format, ex: 20070920 ) each day on an ftp site and download all the files in the folder to a know target directory. I am doing a simple file-to-file transfer, so no mapping is involved.
Your comments, suggestions and feedback is greatly welcomed.
Thanks,
RalphHello Carme,
I have not found a solution for this type of event.
I was attempting this because the FTP site I was connecting to would DELETE a file the moment XI touched it. So when XI (using FTP Transfer protocol) configured with a DELETE or ARCHIVE (Processing Mode), it would error off because the file was no longer on the FTP site. I contacted the site but they refused to deactivate their script to auto-delete files. Using TEST processing mode is not recommended per SAP in a server pool environment. You would think SAP XI would provide a fourth option in which a DELETE command is not issued back to the FTP site.
The FTP site did have sub-directories in which copies of the original files were stored, but I could not figure out how to dynamically change the XI Source Directory as the current date changed.
I settled on using File NFS (Transfer Protocol) and running the FTP commands from a .bat (batch file). I put the command I run down at the bottom of the XI page with a 60 second timeout.
I still do not change to each folder dynamically because the standard FTP (GET and MGET) commands do not attempt a Delete after file retrieval.
Perhaps using a batch file is an option you may want to consider using.
Cheers,
Ralph -
IDoc to Flat File in SAP PI 7.11
Hi Experts,
I am working on PI 7.11 and I have scenario from Idoc to Flat File.
Idoc is posted from source side R/3 system.My requirement is "With out Converting the Idoc structure to XML Structure i want to send the data to Target system i.e. File system.
But the structure of the target structure is different from source structure.
My questions are:
1). Is it Possible to send the data to Target system without converting Idoc structure in to xml format through our PI 7.11 ?
2). If possible please provide me the way that executes in the Interface is?
Could you please provide the Inputs.
Best regards,
satya.T
Edited by: satyatanuku on May 24, 2010 3:26 PM
<Moved from Trial, Preview~ forum>
Edited by: Prateek Raj Srivastava on May 25, 2010 1:02 PMHello Folks ,
I am also facing the same scenario please provide me any options to achieve this scenario .
I am searched in Forums of SDN but no inputs or blogs available.
Let me know i am having one solution is it right or wrong ?
we have to achieve this IDOC Tunneling .... is it right friends ?
Still inputs required....
Regards,
Ravi. -
IDOC to flat File----Problem in File Content Conversion at receiver
hi experts,
I am doing a IDOC to flat file secnario.
My requirment is IDOCXI-Flat file
Format of flat file is like:--
Every segment in the IDOC will be converted into a single line of file(without any delimiter). So number of lines in flat file will be equal to number of segments in IDOC.
I am facing problem in File Content conversion.
Please help me out..
Thanks
JaideepCheck this doc...
[How To...Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0 |https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a] -
Idoc to flat file using Integration process does not show up at all
Hello All,
I created a scenario IDOC to Flat File using Integration Process and one without IntegrationProcess. I am able to execute the one without Integration Process easily.
However when I send the IDOC from SAP then the Integration Process scenario just does not work.
I Checked SXMB_MONI There is no entry for the Integration Process.I can see entry for other without Integration Process.
SXI_CACHE : I can see my Integration Process active
SWEQADM : I have activated the Event Queue and Background job
SWF_XI_ADM_BPE : ALL BPE is showing green status.
All syntax check on IP are fine.
There is no Basis Help for me so there could be some additional basis steps which need to be configured. Has anyone faced such an issue with Integration Process?
Regards
PrashantaHope this might help you. when u configure an IDoc as Sender with BPM this is how you proceed.
<b>1<b>. let us split the scenario into two</b>.</b>
a. <b>Sender to BPM</b> ( Integration Process).
b. <b>BPM to Receiver</b>.
<b>2. First let us configure the first Sender to BPM.</b>
a. Sender Agreement( <b>Not required</b> ).
b. Receiver Agreement( <b>NOT Required</b>).
c. Receiver Determination( Sender Service, Outbound Interface, Receiver Service(<b>Integration Process</b>).
d. Interface Determination( Inbound Interface(Sender Abstract Interface), Message Mapping(NOT Required if your using transformation stepin Integration Process)).
<b>3. Now let us configure the Second BPM to Receiver.</b>
a. Sender Agreement( <b>NOT Required</b>)
b. Receiver Agreement( Sender Service(<b>Integration process</b>), Receiver Abstarct Interface,Receiver service, Inbound Interface).
c. Receiver Determination( Sender Service(Integration Process), Receiver Abstarct Interface,Receiver Service).
d. Interface Determination( Inbound Interface, Message Mapping(<b>NOT Required</b>)).
So Finally we have <b>One Receiver Agreement</b>, <b>Two Receiver Determinations</b>, <b>Two Interface Determinations</b>.
Please let me know if you have any more queries.
Regards
Gopi
Maybe you are looking for
-
Hello, I have a macbook pro retina-2013. About Mavericks I could set my 4K monitor via HDMI on 2560x1440. This I can not get through at Yosemite. Can someone help me there?
-
Moving back my iPhoto library from an external drive to my computers drive
Hi! I moved my iPhoto library file to my external NAS but when I then opened the file I couldn't see previews of the photos, they were just empty with "frames" around them. I had to click each picture to see what they looked like, I guess there isn't
-
"Runtime Error! Program: ...Adobe\Photoshop Elements 7.0\PhotoshopElementsEditor.exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." It has worked grea
-
Cannot open gh2 rw2 files after 10.7.4 update
I'm having trouble opening Panasonic GH2 raw (.rw2) files after 10.7.4 update. I cannot view them in quick view or open them in Preview. I verfied on a another Mac running 10.7.3 - works fine; and then immediately after 10.7.4 update it does not work
-
Why won't my iphone 4 and mac with mountain lion sync my messages?
I am trying to continue a conversation from my iphone to my mac. It doesn't work like icloud pushing my e-mails and songs from one to the other. That works just about perfectly. But for imessages I can't get it to work. I even turned my caller ID to