on 02-01-2007 12:51 PM
hi my scenario is file to proxy. i wanted to do some validations. some of the fields in my structure are mandatory fields. whenever a file is picked, i need to check whether the mandatory fields are filled, otherwise, i need to raise an exception and reject the file. how do i achieve this. thanks in advance.
Hi,
2 options,
1. Write a module that does the validation and then set some flag that can be used in the conditional routing in Receivr Determination to determine if the file is to be sent to the proxy or is it a rejected file.
2. Use a BPM and do the validtion inside a mpping step in a BPM and use a Switch step to determine if file is to be sent to a proxy or raise the exception.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi bhavesh, i also read in one of the thread that we need not worry about the mandatory field if the field is set to 'minoccurs>0'. If the field is not filled, automatically a mapping exception will be raised during runtime. if an alert category and rule is defined for that particular interface, whenever the exception occurs during runtime, the alert is triggered. is that right. correct me if i am wrong.
Hi,
Yes it is true. If your target field has a occurence of 1.. unbounded and if the source field is not available , then a maping error will occur in theruntime.
Using Alerts of XI you can handle this for sure.
But, this is an extremely poor design and you need to handle such things in your mapping ( there is a standard function MAPWITHDEFAULT to handle this ) and better way would be to use either of the 2 approaches i mentioned above.
Regards
Bhavesh
hi bhavesh,
can you please explain me in detail or refer to a blog other than the one mentioned in your reply for
>>1. Write a module that does the validation and then set some flag that can be used in the conditional routing in Receivr Determination to determine if the file is to be sent to the proxy or is it a rejected file.
thanks in advance.
bala
Hi,
If you want to map the madatory field , you can use Mapwithdefault , this will helps you , even the source field is not existed then the target field will have the empty or you can specify with some data with Mapwithdefault function in graphical mapping.
Spcifically if you want to raise an Alert if the source field is empty then , this can be handled in Message mapping.
You can raise with the following in MM.
through new RuntimeException("Hello No data for this field");
Respectively this error can be handled in Receiver deterimination.
Restartpossible or terminate the message process like that
see the below links
http://help.sap.com/saphelp_nw2004s/helpdata/en/26/5ccd3bb4560f01e10000000a11402f/content.htm
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
Regards
Chilla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can think of another solution ...this will avoid the need of a module or the need to hae a BPM....
The receiver determination has to be based on a mapping...'Extended' receiver determination..This way the mapping program will check the input message and depending on the presence of an error the receiver will be determined...
see the link on enhanced/extended receiver determination...
http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can try with a UDF. Map the source field to a UDF and inside a UDF check if the field is empty. If yes then raise an exception else the value is mapped to the target field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mapping will not activated untill all the mandatory fields are mapped in target str.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.