on 10-06-2015 3:42 PM
Hello Experts,
I have a requirement to convert the MT100 into XML file. Please find below the requirement and let me know how we can convert it using FCC or is there any idea to convert it.
Please note one payment ranges from tag 20 to tag 70 and the file can contain 'N' number of payments and each payments must be picked up and put into the XML field as mentioned below in the XML structure.
From ECC end, they can add some characters to mark the start and end of the payment. For example below. Here ampersand (&) and Apostrophe (') has been used as identifier, like this we can use any characters as identifiers
& ----------------> Character informing about start of the payment
20:123456789
:32A:150805SAR1000,
:50:/0107002268360010
ANB
P.O.BOX 1111,
City1- 11492
Country 1
:52A:compcode
:57A:compcode
:59:/10700500032323
Test Vendor
1-44,Test street
SA - 21485
' --------------------------------> Character informing about end of the payment
& ----------------> Character informing about start of the payment
:70:No.TEST1/5.8.2015
:20:1500000123
:32A:150805SAR3000,
:50:/0107002268360010
Bank
P.O.BOX 8524,
City- 11492
Country 2
:52A:compcode
:54A:/0107002268360010
compcode
:57A:compcode
:59:/10700500032323
Test vendor 2
SA -
:70:No.TEST3/5.8.2015
' --------------------------------> Character informing about end of the payment
The above mentioned txt structure must be converted into the below format of XML -
<PaymentMessage>
:20:1234567894 :32A:150805SAR1000, :50:/0107002268360010 ANB P.O.BOX 1111, City1- 11492 Country 1 :52A:compcode :57A:compcode :59:/10700500032323 Test Vendor 1-44,Test street SA - 21485 :70:No.TEST1/5.8.2015
</TransactionData>
</PaymentTransaction>
:20:1500000123 :32A:150805SAR3000, :50:/0107002268360010 Bank P.O.BOX 8524, City- 11492 Country 2 :52A:compcode :54A:/0107002268360010 compcode :57A:compcode :59:/10700500032323 Test vendor 2 SA - :70:No.TEST3/5.8.2015
</TransactionData>
</PaymentTransaction>
</PaymentMessage>
I have also attached the .txt file and .xml file to the note. Please refer to it if needed.
Any help on this will be highly appreciated.
Regards,
Nitin
Hi Nitin,
for this requirement you need to go Adapter modules, use the below adapter module parameters may be it will help to you
and please reference below notes also for more info.
http://help.sap.com/saphelp_nw73/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm
https://help.sap.com/saphelp_nwpi71/helpdata/en/32/43d84072378031e10000000a1550b0/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/EN/96/f04142099eb76be10000000a155106/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/EN/96/f04142099eb76be10000000a155106/content.htm
Regards,
Rajendra K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Nitin,
I believe FCC not working for this, we need go for Adapter module only. if you have Source xml structure please share to us.
and find below link may it will help to you.
regards,
Rajendra
Hi Rajendar,
Sorry if i have confused you.
The source is text here and target should be XML.
Source - Text
Target - XML
Please find below the data for connecting the system (you can also find these details in my initial post also and also the source and target file has been attached to the initial post) -
Source Data -
& ----------------> Character informing about start of the payment
20:123456789
:32A:150805SAR1000,
:50:/xxxxxxxxxxxxxxxx
ANB
P.O.BOX 1111,
City1- 11492
Country 1
:52A:compcode
:57A:compcode
:59:/xxxxxxxxxxxxxxxx
Test Vendor
1-44,Test street
SA - 21485
' --------------------------------> Character informing about end of the payment
& ----------------> Character informing about start of the payment
:70:No.TEST1/5.8.2015
:20:1500000123
:32A:150805SAR3000,
:50:/xxxxxxxxxxxxxxxxx
Bank
P.O.BOX 8524,
City- 11492
Country 2
:52A:compcode
:54A:/xxxxxxxxxxxxxxxx
compcode
:57A:compcode
:59:/xxxxxxxxxxxxxxxxxx
Test vendor 2
SA -
:70:No.TEST3/5.8.2015
' --------------------------------> Character informing about end of the payment
Target Data -
<PaymentMessage>
20:123456789
:32A:150805SAR1000,
:50:/xxxxxxxxxxxxxxxx
ANB
P.O.BOX 1111,
City1- 11492
Country 1
:52A:compcode
:57A:compcode
:59:/xxxxxxxxxxxxxxxx
Test Vendor
1-44,Test street
SA - 21485
</TransactionData>
</PaymentTransaction>
<PaymentTransaction>
:70:No.TEST1/5.8.2015
:20:1500000123
:32A:150805SAR3000,
:50:/xxxxxxxxxxxxxxxxx
Bank
P.O.BOX 8524,
City- 11492
Country 2
:52A:compcode
:54A:/xxxxxxxxxxxxxxxx
compcode
:57A:compcode
:59:/xxxxxxxxxxxxxxxxxx
Test vendor 2
SA -
:70:No.TEST3/5.8.2015
</TransactionData>
</PaymentTransaction>
</PaymentMessage>
Hi Raghu,
Yes, i realize that it is not possible through FCC. Hence i am writing an UDF to concatenate the payments and put each payment in the single field and i have marked this field as 1 to unbounded. But unfortunately i get only one output value.
Please find below my Source and Target MT and kindly let me know where i am doing the mistake. I know i am doing the silly mistake, need your help to recognize it.
Source MT -
Target MT -
Mapping -
Regards,
Nitin Deshpande
Raghu,
There was a context mismatch and i have fixed the issue.
But now i am facing issue with the "Null" string which is coming in the context of my mapping. I am not sure why this is coming as a part of data in the mapping. When i check the input data separately using hex viewer, i do not find any such string, So i have a strong feeling that, it is getting in the mapping. Can you please help me with this?
Please find below the screenshots for more info -
Null String in Context -
Concatenate UDF where the "Null" string may be getting added.
Regards,
Nitin
Nitin,
null is getting adding due to this statement (first time Output[j] is null).
Output[j] = Output[j]+Transactions[i] + "\n";
There is no need of this loop
for (int j=0; j<1;j++) { }.
Try this UDF
public void Concatenate(String[] Transactions, ResultList Transaction_Data, Container container) throws StreamTransformationException {
String Output = "";
for (String Transaction : Transactions) {
if (!Transaction.startsWith("ten")) {
Output = Output + Transaction + "\r\n";
}
}
Transaction_Data.addValue(Output);
}
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.