cancel
Showing results for 
Search instead for 
Did you mean: 

Validation of outbound FIle with respect to outbound Message type

Former Member
0 Kudos

Hi Experts,

I have file system at outbound side and defined the Data Type, Message Type for this. Now a want to validate the outbound file against the Message type structure i have defined. Now if the file is not validated against Message type, i want to create the log file that will explain what were the errors in the outbound file and move the file to other archive else send it to inbound system.

Plz suggest the solution.

Thanks and regards,

Vishal

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Vishal,

May be you can control it at the Communication Channel level.

Use 'Run Operating System Command Before Message Processing'

CommandLine <pass the shell script>

begin of shell script..

First check for the record count...% wc -l <sourcefilename>

check for the records gt 1.

if no...

mv <sourcedirectory>/<sourcefilename> <targetdirectory>

OR

rm <sourcedirectory>/<sourcefilename> (for ur testing)

end of shell script..

In this case message processing will not be done since there is no file available its moved.

Let me know if that was useful or need any help with the shell script.

Regards,

bhavesh_kantilal
Active Contributor
0 Kudos

Even if you use a script, it is exectued only after the file is picked , ie., the file data is read by the file adapter and then the script is exectued and then the file adapter starts processing the message.

Regards

Bhavesh

Former Member
0 Kudos

If I am not wrong here, file is picked up.. but the situation here is.. it has to be processed or archived? basing on the record count.

I guess we can control that.

Regards,

Former Member
0 Kudos

Thanks Bhavesh,

Plz give me some links for adapter modules..

Regards,

Vishal

bhavesh_kantilal
Active Contributor
0 Kudos

This is the best document for starting on Adapter Modules,

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a">How To Create Modules for the J2EE Adapter Engine</a>

Example Adapter Module,

http://help.sap.com/saphelp_nw2004s/helpdata/en/e9/61e1407e858031e10000000a1550b0/content.htm

Regards

Bhavesh

PS : Do a search on SDN. For instance, look into the How To gudies Section on the XI home page.You will find most of the documents available here.

Former Member
0 Kudos

Hi Bhavesh,

I have a simple file(CSV) to file(CSV) scenario and i am going with graphical maping. On the outbound message type the record occurance is (2...unbounded) . but even if the there is only one record in the file it is processed and i receive it on inbound side.

I should not happen.. i want to move such files to different archive and correct files should be processed only.

Suggest me the solution.

Regards,

Vishal

bhavesh_kantilal
Active Contributor
0 Kudos

Vishal,

Write an Adapter Module on the Sender File Adapter,.

This will check for the Source Strcture.

If valid, set some falg and if inavlid set sometoher flag.

Do a conditional Receiver Determination and determine if the file is to be sent to thtarget system or the error archive folder.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Vishal,

What is the mapping that yhou are using?

If it is graphical mapping then the output of the graphical mapping is always validated against the XSD strcutures.

Regards

Bhavesh