cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Side: File Content Conversion

Former Member
0 Kudos

I have a text file, with following values.

AAA056070144AEA056070144AACTESTPO271+(.......sequence continues)

Length of TAG (Like AAA, AEA,AAC etc) is fixed (i.e.3 ). Length of the Values coming after TAG are not fixed. Field Separator is '+'.

Source structure is

DT_OrdersFromECHO

|_ ECHO_SO

|_ Value

My requirement is after FCC, I sud get

ECHO_SO

|_ Value : AAA056070144

ECHO_SO

|_ Value : AEA056070144

ECHO_SO

|_ Value : AACTESTPO271

If I mention field Separator and filed Names ,it gives an error

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 1 according to structure 'ECHO_SO':java.lang.Exception: ERROR in configuration / structure 'ECHO_SO.': More elements in file csv structure than field names specified!

How can i achieve it?

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> AAA056070144AEA056070144AACTESTPO271+(.......sequence continues)

>

> Length of TAG (Like AAA, AEA,AAC etc) is fixed (i.e.3 ). Length of the Values coming after TAG are not fixed. Field Separator is '+'.

When I understand this correct, you do not have a fixed structure, that means you cannot use FCC as this requires a fixed file format.

Could you let me know, what you want to do with that data? What is the target interface? How should the fields of target interface be populated from source file structure?

Former Member
0 Kudos

Hi Stefan

Requirement is that ...AAA is ECHO sales order creation

BAA is Retail Price

CAA is Price maint

Values coming after TAGs will denote which customer to update with what value.(Handled in ABAP)

Now, which adapter sud I use to get XML version of the message? XSLT or Java mappings are done at mapping level. But I need to read the data first.

How do i read the data and make it usable at PI.

stefan_grube
Active Contributor
0 Kudos

You need a data structure where all possible tags are maintained. Check if the tags are hierarchical or repeating, that you have to model in the data type the same way.

The file adapter reads the data without FCC. The first mapping step is a java program which creates the XML structure corresponding to your data type. (XST won't work, as XSLT can only be used for XML files)

A second mapping step creates the target strucure (IDoc?) from data type, so you can use graphical mapping here.

This is not an easy task. The development and testing of the Java program will need much effort.

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi Snehal,

Looks like the input file have more values than the number of field names specified

try using NameA.additionalLastFields = ignore as one of the parameter ans see whether you are getting any error messages

http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I tried with ur solution it does not give any error but it is doing it line by line. Means It takes first field. Rest of the line is ignored. Then it goes to next line and again selects first field and ignores rest of the line.

former_member187339
Active Contributor
0 Kudos

Hi Snehal,

Can you paste here the parameters you mentioned in the sender file communication channel?

Regards

Suraj

Former Member
0 Kudos

Hi

After performing FCC, I think the source structure will contain "Recordsetname", that you doent specify in your source structure.

use ignoreRecordsetName = true in the FCC and try.

Regards

Ramg

Former Member
0 Kudos

Hi

Even though I mention a field separator and end separator, FCC only converts first record.

It does not got to further records.

If I give new line in input file, it works perfectly.

Why this happens even after mentioning field and end separators?

Former Member
0 Kudos

Hi,

It seems your input file will have all datas in one line. (A00B001..........)

Try like this,


ECHO_SO.fieldNames      I_VALUE
ECHO_SO.fieldSeparator   '+'
ECHO_SO.endSeparator   +
ignoreRecordsetName       true 

Regards

Ramg

former_member187339
Active Contributor
0 Kudos

Hi Snehal,

As i mentioned earlier can you paste here the parameters you have given in FCC channel. Also paste an example of the input file.

Regards

Suraj

Former Member
0 Kudos

Input file structure is

AAA1234AEA12345BAA3456BAD345678CAA9876+CAD13445

Let me know how can i achieve the result as

TAG : AAA

Value: 1234

TAG : AEA

Value: 12345

TAG : BAA

Value: 3456

AND SO ON....

I have tried so many things so i m not able to paste a structure here .

The result which i get is only first filed is converted. It ignores rest of the fields.

former_member187339
Active Contributor
0 Kudos

Hi Snehal,

>AAA1234AEA12345BAA3456BAD345678CAA9876+CAD13445

So you will have only one line in the input file which have all the records separated by + sign. Right?

If this is the case then you cannot use FCC of the sender file channel. because at a time the fields or the values are not fixed..

So I will suggest you to read the file into PI (without FCC) and then break it into

TAG : AAA

Value: 1234

TAG : AEA

Value: 12345

TAG : BAA

Value: 3456

either using XSLT of java mapping.. So your interface mapping will have this mapping as 1st and your normal (source to targte conversion) mapping as 2nd

Regards

Suraj

Former Member
0 Kudos

U r rite Suraj. The data comes in one line.

XSLT or Java mappings r bit complex. SO I thought there may be some other way.

Thanks.

former_member187339
Active Contributor
0 Kudos

Hi Snehal,

>>XSLT or Java mappings r bit complex

XSLT might be , but java mapping is very simple (in this case), its just a end of line loop, and for each + you need to put the string into an array.

Later for each array value, you ned to break it into a non-number and number field. if you have some java knowledge then you will be able to write the code. Also check this wiki page on how to make java mapping..

http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API

Regards

Suraj