on 03-03-2009 2:55 PM
Hi Experts,
I am collecting IDOCs and generating IDOC-XML(for IDOCS) file and sending it to PI 7.0 using sender file adapter.
This is File to File scenario.
IDOC-XML file picked by sender file adapter gets transformed using XSL mapping in to .dat(text) file.
Sample Output of .dat file (target file)
STR SE 2008-10-3011:13:00$SEQ
EIH21148862 D2008102820081127SEK000000894800000000894800000000000000 0000XYZ co Ltd KL25533781 2114886209 335592 2508867
EIL21148862 0000000000000000100000000000020081021 335592 20081010KILLL899 Operating System
Now I want output file name to be: ABC_DEF_cc_yyyymmdd_segno.dat
ABC_DEF is constant
cc - means country code, in this case it should be "SE", which is marked in bold immediately after STR.
yyyymmdd - date format
segno - which means no of records like number of lines in text file, (say three records: STR, EIH, EIL)
Please feel free for any clarifications required.
I hope I am able to explain scenario.
I would really appreciate if you can help me with your valuable inouts.
Thanks,
Divyesh
hi,
just put one more mapping as the last mapping in your interface mapping
it can be abap or java mapping
then as per this blog fill out Filename attribute which will set the file name
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
you can parse the whole IDOC structure in tthose mappings to get all the data you need for the filename
this is the easiest way I'd say
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may place a message mapping with same source and target structure and use dynamic configuration there to set the receiver filename. It could take input as country code name as well as the occurrence of records (to find the number of record lines). Then simply proceed with your xsl mapping.
Regards,
Prateek
Yours is a file to file scenario.
Your XSL mapping will generate the output flat file.
After the XSL use a java mapping which will set the filename using dynamic configuration. Regarding the payload just get the file as an inputstream and pass it out as an outputstream.
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
Hi Shabarish,
Thanks Michal, Shabarish for your prompt replies.
It is almost done, just small query :
With Java mapping , File name is generated properly.
File name is reflected under DynamicConfiguraion under Response step on SXMB_MONI screen.
What shoulld I give File name in receiver communication channel, as it is mandatory.
Thanks,
Divyesh
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.