on 09-12-2012 4:00 PM
Hi All,
I have a requirement where i am picking a text file which will have multiple records and each record will create a new Idoc in SAP system. I am fine with that approach, using FCC convert that file into XML and then using multimapping generate multiple idocs.
The main requirement is to do the some validations at mapping level (like if value start with X i have to fail that record etc) and if something goes wrong then i have to generate the same CSV file on error folder and if transformation at PI level happens sucessfully then will need to place that CSV file on sucess folder.
1) Mapping sucessful -> create source CSV file on Sucess FTP folder
2) Mappiung failed -> create source CSV file on error FTP folder
Please help.
Thanks!!
Hi Vasant,
In the same message mapping where you are performing the validation there you can use an UDF to read the source file as shown in this thread
http://scn.sap.com/thread/1569382
and write the contents of the file either in Success FTP folder or Error FTP folder depending on outcome of validation as shown in this thread
http://scn.sap.com/thread/316570
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vasant,
As per your initial post you defined success of mapping by validation check. If a validation of a particular field is ok then create sucess file else create error file. Now there is another case of exceptions raised in mapping. There also java allows catching of runtime exceptions. In the catch block you write the code of creating error file, at the end of try statement put the code for creating the success file. Thus if there is no exception thrown success file will be there in respective folder. This requireemnt is best met if you would use java mapping instead of message mapping. In case of message mapping for each validation you need to write separete UDF, where as in java mapping all validation can be combined in one code. Since all statememts will be in try block in case anything goes wrong you can raise an exception and error file gets written as explained above. This approach avoids the use of BPM and also takes care of mapping failure due to exceptions raised.
Regards
Anupam
Hi Vasant,
I would recommend to below options
Develop interface ith two receivers
1)File
2)ECC
Step1:
Develop two operation mappings and write a condition in receiver determination to call FTP when there are records with X but dont write any condition for SAP ECC receiver.
Step2:
Operation mapping 2(File to ECC) you need to write a mapping logic to create IDoc for the records which doesnot have X and supress X records.
or
1)Interface1:
Wiate a validation logic and filter the records and create XML file or CSV file in FTP,the records starts with X will be in different file with different name and valid records in different file.
Interface2:
Then create one more interface to read the valid file and process to SAP.
try exploring this options.. with small changes you can achive this requirement.
PS: I dont recommend thrwoing manual mapping exception.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
My client wants that if any error occurs during mapping i need to cancel the entire file and move it to some folder and if mapping executes then move the original file to some other folder and create the idoc in ECC??
Above appraoch wont able to handle all kind of validations??
Thanks!!
i think you can handle this also at receiver determination also , if value of that field is X then you can fail at that level also and only send that message to error field . and if message is success then send to other two options.
for that you need two more Receiver CC with FCC.
Regards
Gagandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gagandeep,
There can be multiple validations on which the transformation can failed at mapping. Suppose, if mandatory value is missing, integer value is expected and alphanumeric comes into PI and many more.
So idea behind this if transformation i.e. mapping is sucessful then in addition to creating message to ECC create a same source CSV file on folder1 and if mapping is failed then create the soucrce csv file on folder2.
Thanks!!
Hi Vasant ,
Instead of creating multiple mapping , try Michal blog. It will easy way to create multiple Idocs.http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/05/21/xipi-collecting-idocs--possible-w...
Regards
Hari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
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.