on 05-02-2014 11:07 AM
hi,
i have sender and received side -file content conversion.
in sender communication channel -
Recordset structure is -> Header,1,Detail,*
Message type structure is
MT1 has 2 subnodes Header and Detail.
In my message type,there is no field identical in Header and Details. All fields are different.
(1) Is Key Field Name mandatory in this case ? If I am not giving Key field name,sender channel gives error. How to resolve it ?
(2) Input file comes from customer and in the input file there is no specific data to identify header and detail. 1st line shud be header and other lines shud be Detail ,they say. If no identification coming in incoming data,how can we set the key field name ?
rgds
(1) Is Key Field Name mandatory in this case ? If I am not giving Key field name,sender channel gives error. How to resolve it ?
It's already confirmed by Anshu.
(2) Input file comes from customer and in the input file there is no specific data to identify header and detail. 1st line shud be header and other lines shud be Detail ,they say. If no identification coming in incoming data,how can we set the key field name ?
Is that a CSV? fixed length???
If it is feasible then treat entire file as details for the content conversion part but in the mapping you can read the fist line to get the header values..
content conversion -> detail,*
during the mapping ->copy value[0] will return header value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like it's a fixed length file.
if the content conversion parameters(lengths for header n detail) remains same for first line and other lines then as i suggested configure the recordset strcture as detail,*
change your source data type to just have Details segment.. remove Header...
content conversion something like-
Detail.fieldName - field1,field2
Detail.fieldFixedLenths - 10,10
Hi ,
If you check the file the second field of the data record seems to be in some sequence(60042) .As well as header is having filename or something as such(string TESTDATA)
So you can specify key values easily .It can be achieved by message mapping .
Check with the functional consultant if the actual data is going to be same as this
Give key value for header ->file name i.e Test Data
Give key value for record ->second field name with value 600.
Thanks
Hi SAP PI,
Why don't you use JavaMapping?
Regards,
Gavaksh Saxena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any Java code to add H prefix in first header line and D prefix in item lines.. Can you pls share d java code to do so..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try what i suggested earlier?
Read entire line into a string and use substring function to do the content conversion in the graphical mapping.
Else below blog for your reference on Java mapping -
Java Mapping Sample Code - Process Integration - SCN Wiki
You don't need to add "H"/ "D" .. based on the line number you can check weather it is header or details in java mapping..
Hi SAP PI,
For this moment try this.
Let the file content is like this
03456451 TESTDATABC 7645649 8746464
12344 60042
45678 60043
You try reading the file like this
<MT_S>
<RECORDSET>
<ROW>
<field1>03456451</field1>
<field2>TESTDATABC 7645649 8746464</field1>
</ROW>
<ROW>
<field1>03456451</field1>
<field2>TESTDATABC 7645649 8746464</field1>
</ROW>
<ROW>
<field1>03456451</field1>
<field2>TESTDATABC 7645649 8746464</field1>
</ROW>
</RECORDSET>
</MT_S>
FCC is like this
Document Name : MT_S
Document Namespace: "put name space here"
Recordset Name: RECORDSET
Recordset Structure: ROW,*
ROW.fieldNames field1,field2
ROW.endSeparator 'nl'
ROW.fieldSeparator 0x20
Once you get this in mapping use a simple UDF to ignore the first ROW values and read the rest.
Populate the target structure from the output of UDF for each field value.
Please let me know if you need the uDF and further mapping for this.
Regards
Anupam
(1) Is Key Field Name mandatory in this case ? If I am not giving Key field name,sender channel gives error. How to resolve it ?
Yes.Key field is mandatory to be specified .
(2) Input file comes from customer and in the input file there is no specific data to identify header and detail. 1st line shud be header and other lines shud be Detail ,they say. If no identification coming in incoming data,how can we set the key field name ?
This can be done by writing java code in mapping or adapter module .Their can be an easier way also to handle it in message mapping too.Please attach the sample file structure .
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.