on 02-29-2012 7:50 AM
Hi Experts,
I am doing FCC to ABAP Proxy Interface. Where I have to pick an text file and process and send to through ABAP Proxy to R3.
My data is in text file .txt , the data is like this :
HEMAHPOD019##012621 30018 09022012600308 48 09022012d019 3110
HEMAHPOD019##012622 30018 09022012600317 120 09022012d019 3110
HEMAHPOD019##012623 30018 09022012603023 24 09022012d019 3110
HEMAHPOD019##012624 30018 09022012600921 30 09022012d019 3110
HEMAHPOD019##012624 --> Here 3 fields are clubbed together and filed separator is tab.
Please tell me how to process this kind of file.
Thanks and regards,
Ahmed.
Edited by: Ayubsajjid on Feb 29, 2012 8:51 AM
Hi Friends,
I have done this....
By using below in Content Conversion Parameters: for given text data
HEMADPOD015##008171 30003 16082011600600 2 16082011d015 3110
HEMADPOD015##008172 30003 16082011600603 48 16082011d015 3110
Row.fieldName Zabc,Zabc,Zabc,ZabcE,INVDT,Zabc,Zabc,abc,Zabc,abc,abc
Row.processConfiguration : FromConfiguration
Row.keyFieldValue : H*
Row.endSeparator : Tab( from notepad i paste the tab here)
Row.fieldFixedLengths : 4,14,4,6,8,24,9,1,8,30,4
Row.comlumnSeparator : tab ( Notepad tab)
Row.lastFieldsOptional : true
I got some input from this link also for given below error :
Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 1 according
to structure 'Row':java.lang.Exception: Consistency error: field(s) missing - specify 'lastFieldsOptional' parameter to
allow this
Thanks a lot for the help to all for providing inputs from your valuable time.
Cheers
Ahmed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How come tab delimiter file first three fields are coming with out space.
first check with your vendor, if they come in that way only.
then here is the solution, pick the three fields into one variable and in mapping divide it into three parts based on the field length and pass it to target three fields.
assume that remaining fields are coming with tab delimiter only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phani,
Thanks for quick replay friend,
I check with my vendor , they told there is no change in format, the file will come like this only.
Can you please tell me how to this, in mapping. If possible can you please send an sample scenario document.
I really thankful to your valuable time for providing solution.
Thanks and Regards,
Ahmed
Hi,
Check this link
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2179
If the first 3 field values are comming as a single value (HEMAHPOD019##012621) without any delimeter then consider this as a single field (in the sender data type also it is one field) then in the mapping by using substring udf map to 3 fields at target side.
a.substring(0,12) map to first field, a.substring(11,2) map to second field and a.substring(13,6) map to third field.
Regards,
Venkata Ramesh
Hi ,
Thanks for your replay and suggestion. It really helps me. But here I want to bug you more my friend.
I have done like this :
HSPLDPOD014##011321 -->(0,4) for HSPL , (4,18) for DPOD014##01132 , (18,19) for 1 ( but here in place of 1 in future i will get 4 char value)
Something it will be like
HSPLDPOD014##011321
HSPLDPOD014##0113299
HSPLDPOD014##01132100
HSPLDPOD014##011321000 . How will have to do this if I get like this.
sample data as :
HEMADPOD015##008199 30003 16082011602413 24 16082011d015 3110
HEMADPOD018##0044928 30480 09022012604097 100 09022012D018 3110
4 14 4 6 8 24 9 1 8 30 4 Char length
A B C D E F G H I J K Filed Names.
This is my first File interface im doing. sorry to bug u more.
And how should parameter in CC of Content conversion Parameters.
for the third field mapping u can use a small udf:
input : a
execution type: single value
(tweak this udf as per ur design)
//write your code here
int len = a.length();
String output="";
if(len>18)
{
output =a.substring(18,len);
}
else
{
output= "third input does not exist";
}
return output;
mapping:
inputudf-field3
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.