on 05-02-2016 4:15 PM
Hi Experts,
I am currently new to BCM Swift integrated with PI.My Requirement is to get a tag file from BCM and need to do FCC with tab delimiter.
OUTPUT FILE details (Below is the sample data which i need to conevert):
SAAL | 0311 | 032132055020 | USD | 20150531 | 28000,00 | 20150531 | 03110012015161 | 1-61343 |
7000,00 | SA9150000000032048815917 | ROBERT SMITH | SAAL | 3500,00 | 1500,00 | 3000,00 | 1000,00 | 2029864994 |
-
After the end of the file it should be with - and also i want to achieve last 2 digits with , ex: 3500,00
How can i achieve this with FCC in SAP PI .
Need urgent help
Regards,
Shaik
Hello Shaik,
you can add - with the use of endSeparator,by assigning value as - to the endSeparator.
And for adding last 2 digits,you should handle it in the mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shaik,
Can you paste the sender file example also here??
If you are getting decimal separator as '.' in the sender file then you can use java mapping to replace dot with comma and append '-' character at the end of the string without doing FCC configurations in sender and receiver file communication channels.
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput)
throws StreamTransformationException {
try{
InputStream inputStream = transformationInput.getInputPayload().getInputStream();
OutputStream outputStream = transformationOutput.getOutputPayload().getOutputStream();
byte[] buf = new byte[inputStream.available()];
inputStream.read(buf);
String inputPayloadString = new String(buf,"UTF-8");
inputPayloadString = inputPayloadString.replaceAll("\\.", ",").concat("-");
outputStream.write(inputPayloadString.getBytes());
}catch(Exception e){
throw new StreamTransformationException(e.getMessage());
}
}
Note: Make sure you are not receiving dot character in any of the other fields.
Regards,
Praveen.
Hello Shaik.
If your getting Flat file yes you need to FCC at both the side.
For Sender FCC paramters check the below link
Converting Text Format in the Sender File/FTP Adapter to XML - Advanced Adapter Engine - SAP Library
For receiver already link shared.
Check the below link for an example
XI/PI: File Content Conversion for Complex Structures
In mapping how to achieve the logic by using string ?
You wish to add 00 at the end right?use formatnumber function or concat '00' with the string.
Standard FormatNum as far I know has no restriction. It is based on DecimalFormat (Java Platform SE 7 )
For your requirement: ########,## should do the trick.
This will make sure that last 2 numbers have a , irrespective of length.
Did you try it?
Regards
Bhavesh
Just tried this. I have given #,## as my input to FormatNum,
Basically, the Format Number formats the numbers to the hundreds digits. There is no dependency on the Input Number length.
Now if the requirement is to have only last 2 digits with a "," as 1,23 or 1234,56 or 12,34 then the format number will not work but to me it doesnt make sense to have the separator just for the last 2 digits. You either use it everywhere or nowhere else the number itself does nt make sense.
Do note in European SAP System 1234,56 is 1234.56. Europeans nations denote a decimal place with a ",". If the requirement is to denote decimal notations as "," then Format number with #,## with decimal separator as "," will also work.
Regards
Bhavesh
Hi Praveen,
This is my requirement can you help ..
source file MT 100 Payroll payment sample file
RequestType#mt100-payroll
Housebank#USDDXXXX
TransactionCounter#00001
USDD0XXX
100
USDD0XXX
MOL#74603-01
:20:1857000810
:32A:151006USD1,00
:50:STREAM COMP
:52A:USDD0XXX
:53B:/3231649009940
:57A:USDD
:SAL:0.00
:HRA:0.00
:OTH:1.00
:DED:0.00
:ID:2353361070
:59:/SA6320000001010171949940
ALEXANDER JOSEPH MARTINA
SA - TEXAS
:70:No.53000/
Target File is Tabdelimiter
Header Info
First Row 2 items we have to hardcode it(AAL 0247 Values).
AAAL 0247 032401361054 USD 20150528 100,00(this value is increasing if there are 2 cusotmers then 200,00) 02470012015148 1-123310
Footer
Netamnt Employee account Emp Name Bankcode Typ paymnt Basic HRA OTH Deduct Emp ID Txn Refrnumb Txnstats TxnDate
100,00 SA5655000000025931400134 ALEXANDER JOSPEH DSFR Salary 50,00 50,00 0,00 0,00 2212746529 SRE1515110700001 Success 20150601
Please let me know how to achieve this in mapping. I have to increment the number with simple UDF when ever the values changes?
Netamnt i can concatenate it with salary,HRA ....
Regard,
Shaik
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.