cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for missing fields in the file?

Former Member
0 Kudos

Hi friends,

I have a file to file scenario in which if any of the fields have a blank value, i have to put the file back in the source folder. If none of the fields are missing, the scenario should work normally.

Can anybody tell me <b>how can i check for the field lengths</b> and if any of the fields are blank, <b>how do i send it back to the original folder.</b>

Waiting for your responses,

Divija.

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

is the fields specific or do you have to check all the fields in the file ?

If these are for specific fields then you can avoid any kind of coding and directly acheive it in the XPATH conditions of the RECV. det. step.

REF:

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Divija,

>><i>how can i check for the field lengths</i>

Since you need to basically check if the field has a value or not, i dnt think you need to check for the length of the field. Instead, you can use any one of the booloean functions available in the graphical mapping editor to check if the field has a value or not(filed value true or false)

>><i>how do i send it back to the original folder.</i>

You can maintain a flag variable in the target structure such that if any of the source fields donot have values, the flag's value becomes 1 else it remains 0.

Now, you can check if the value of flag is equal to 1/0 in the bpm and accordingly send the data.

If in case, you donot want the flag to come in the target file that is loaded/sent from the bpm in the end, i think even tat can be taklen care of.

You can create two receiver communication channels and define one file adapter in each such that one has the destination as the actual target directory and the other has the original source directory as the destination.

Regards,

Sushumna

bhavesh_kantilal
Active Contributor
0 Kudos

Divija,

Write an Adapter Module, that will check for the validity of your File even before it reaches the Integration Engine. This is a very common approach for checking for the validity of your file,

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a">How to create Modules</a>

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

You could check the value of these fields by writing java code and later, call this java code, in the interface mapping.

The java code would check if all the fields have values. If so, it populates a field(say status)to 1 else it is 0.

Now, depending on the value of status, you could determine the receiver(using conditional receiver determination)

Regards,

Smitha.

Former Member
0 Kudos

Hi Smitha,

Thanks for your response.

Can u suggest any weblogs where such a scenario is discussed?

bhavesh_kantilal
Active Contributor
0 Kudos

Divija,

You can also take a look at this SDN TV Demo,

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/elearning?class=/sdntv/main.asp?mediaId=130">Adapter Modules for validation of payloads</a>

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

I am sorry, I dont think I can help you with weblogs, but you can go ahead and try this option out. You can always get back here for help!

Regards,

Smitha.