cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion in receiver file adapter.

Former Member
0 Kudos

Hi ,

I need to generate a txt file from receiver file channel using FCC.

file format is quite tricky. please let me know if it is possible with FCC or not?

File format is given below: values inside ** are hard coded(constant) and "value"s are coming from data type fields.

*Start of report*

*XXXXX File status report sent to xxxx*


*Date:* value
*Company code:* value
*Time send:* value

*Summary:*

*Total number of xxxx:* value
*Number accepted:* value
*Number rejected:* value

*Accepted Details:*

*Date             Nbr                             XXXXXXXX       XXXXXXXX*

value             value                            value             value

*Rejected Details:*

value

*end of report*

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

you can do it with FCC, its not problem at all, but a far as i can see you will need to handle a xml with deeply nested xml structure because you will convert also the values:  *Start of report* and  *XXXXX File status report sent to xxxx*, "end of report", etc.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/02/28/simplest-way-to-convert-flat-file...

BTW is not clear for me ¿the example provided above is the expected? if YES could you provide an example if the input file to be converted?

Regards

Message was edited by: Rodrigo Alejandro Pertierra

Former Member
0 Kudos

yes, this is the expected text file i need to generate.

the input is a xml file from which i have to calculate all the "value"s and provide them in the txt file

anupam_ghosh2
Active Contributor
0 Kudos

Hi Navneet,

                 Could you please kindly post a sample input xml and the target file which needs to be generated. This will help forum members suggest you solution for the problem.

Regards

Anupam

Answers (3)

Answers (3)

Former Member
0 Kudos

This issue is resolved.

I have done graphical mapping to generate all the "value"s fields and then written a java mapping program to build the txt files in the desired format.

This will be easy to understand and good for future enhancements.

With FCC it would have been very complex..

Thanks everyone for help.

Navneet

Former Member
0 Kudos

Hi,

Create your message type as below.

Create a field for each line in the file and do the required mapping for each field in the MM.

In FCC, use new line as field separator.

Regards,

Veerendra.

vedrankubelka
Explorer
0 Kudos

You can but it is very complicated. First you must have structure with all data and constants and then handle nested structure. Adding rows with constant will be problem.

If you have proxy to file scenario, you can use simple

<items>

  <row> *Start of report*</row>

  <row> *Date:* value</row>

<row> *Summary:* </row>

  <row> *Date Nbr XXXXXXXX       XXXXXXXX*</row>

  <row> value value value value</row>

</items>

structure and ask your ABAP team to prepare data. In ABAP is not problem to do this. On the end you can handle this easly

---

Other way is make new structure with one new element for each row with only constants (Eq. for *Start of report*, ...) . Then make mapping and concatenate constants to values. Now you will have all data and go to FCC

Regards

  Vedran