on 06-08-2009 3:35 PM
Hi,
I've a problem in a sender file adapter.
The file has one header line, multiple body lines and one trailer line. The structure of the flat file is like:
H; 0815; text;
0235;my text; 745;7...
6341;your text; 464;4 ...
2342;another text; 726;2
T; 3; OK
For header and trailer line there is a key field but for body lines there isn't.
My idea:
I take the first field of body lines as key field and define keyFieldValue like 'not(H,T)'.
Is there a way to define keyFieldValues with expressions with 'not' and 'or' ?
Or have anyone a different idea to solve the problem ?
Regards
Christoph
Read your file in Record by creating following structure
MT_target
-
File 0 to unbounded
-
Record...1
Do not Specify key field.
content conversion will include Record as fieldNames and newline as endSeparator
in mapping put a logic to compare 1st character of Record if H, T then map it to Header trailer in target
else it is a data
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is no keyfield for the multiple body lines in your data..The fcc parameters should be sufficient.Use the endSeparator parameter to distinguish between the header ,body and trailer lines..
regards,
Ramya Shenoy
Edited by: Ramya Shenoy on Aug 27, 2009 12:52 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
Did you got any solution to the problem. I have a similar issue with one of my scenario.
Can you please help me with your findings/results?
Thankyou,
Shanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a common structure for header,detail,trailer.You should use AF_Modules/MessageTransformBean instead of FCC.
create a xslt mapping and use the mapping in adapter level.
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken]
Modules look like,
AF_Modules/MessageTransformBean For FCC
AF_Modules/MessageTransformBean for XSLT
Default module.
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make the Source str as
MT_Source
Records ------------1 to unbounded
Data ------------1
In the sender File comm channel select Message protocol FCC and specify the parameters as given below
Document Name:MT_Source
Document namespace:(Specify the namespace)
Recordset structure:Records,*,Data,1
Add more parameters choose +
Name Value
Records.fieldNames Data
Records.fieldSeparator 'nl'
Records.endSeparator 'nl'
Follow this blog and modify java code according to ur requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the simplest would be to handle this in java map, Just pick the records and till you encounter the record with T & put into one segment, if you want i will send the code, without keyfiled you cannot read that using file adapter, else you have to read each line by line from file adapter into one field in MM, then write the logic, again there will be lot of code sitting in UDFs.
if thinking about java map then let me know i can send you details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Any kind of mapping will not help you here, because Mapping takes place later in the PI, when XML document is created by File Adapter.. But maybe this documentation will help you:
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm
Especially this statement: "If you have entered a variable number of substructures under Recordset Structure, that is, you have entered the value * for at least one structure, specify a Key Field Name."
Did you do that?
Regards,
Volker
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.