cancel
Showing results for 
Search instead for 
Did you mean: 

Interface determination condition to check value empty or not

Former Member
0 Kudos

Hi Experts,

Good day to all,

I am working one File to IDoc scenario, my sender structure look like this,

<Order>1..unbounded

<MaterialNumb>

<Customer>

</Order>

I want to send two different IDocu2019s to SAP based on material number value. If material number value empty means I have to send DelIVERY IDoc, else I have to ORDER IDoc.

I developed two mappings, Could you please tell me how to write a condition in Interface determination for this Logic.

I tried different ways but no luck.

Regards,

Jam

Accepted Solutions (0)

Answers (3)

Answers (3)

samiullah_qureshi
Active Contributor
0 Kudos

I think in your case u need not to go for the condition in interface determination. You can user I..N mapping in your interface determination as explained in following blog :

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3115] [original link is broken] [original link is broken] [original link is broken];

This way ur condition check part will go into message mapping and there u can handle it easily.

Former Member
0 Kudos

Hi,

I feel the simplest way of working on it is using the "exists function" in mapping and using the same in Receiver determination.

If Materialnumber "exists" & not equal to " " = True then send the data.

If Material number does not exists then route the data to delivery.

regards,

Sainath Chutke

Edited by: Sainath Chutke on Jan 12, 2011 8:35 AM

Former Member
0 Kudos

Hi Rahul/Sainath,

Exists function will not work here because if no value for material number, the field will be created in source data.

i have tried condition like = null, not eqaul to null, but nothing worked out.

Regards,

Jam

RKothari
Contributor
0 Kudos

Hello,

I hope you have tried the value 'NULL' i.e. in uppercase too.

If its not working, can you try the below expression using exsits operator for checking empty value :

/order/MaterialNumb[not(text())]            EX

-Rahul

Edited by: Rahul Kothari on Jan 12, 2011 1:52 PM

stefan_grube
Active Contributor
0 Kudos

You could use string-length function like this:

Just compare with 0.

Former Member
0 Kudos

Hi Rahul,

What about other case condition?

Regards,

Jam

RKothari
Contributor
0 Kudos

Hello,

Just remove the 'not' from the condition:

/order/MaterialNumb[text()]            EX

-Rahul

Former Member
0 Kudos

Hi Stefan,

I tried alredy with string length function , this is working for only one record present in source data, but in my case source data will have multiple records like below,

<Order>
 <MaterialNumb>11123455<MaterialNumb>
 <Customer>12345 </Customer>
</Order>
<Order>
 <MaterialNumb/>
 <Customer>12345 </Customer>
</Order>
<Order>
 <MaterialNumb>23455<MaterialNumb>
 <Customer>12345 </Customer>
</Order>

@Rahul:

even your logic also not working for multiple records.

Regards,

Jam

stefan_grube
Active Contributor
0 Kudos

> I tried alredy with string length function , this is working for only one record present in source data, but in my case source data will have multiple records like below,

>

What schould happen, when you have multiple records? I suppose you will need both types of Idocs.

Former Member
0 Kudos

Yes exactly, but it is not working,,

for below data i am expecting one delvry and one order IDoc , but i am getting two delivery and 2 order idocs,

i have not written any logic to filter IDoc at mapping level.

<Order>
 <MaterialNumb/>
 <Customer>12345 </Customer>
</Order>
<Order>
 <MaterialNumb>23455<MaterialNumb>
 <Customer>12345 </Customer>
</Order

Regards,

Jam

Former Member
0 Kudos

Hi,

I hope u have checked the Multiline in the Condition editor.

If it satisfies for a field means then it should apply for all the other occurences if u check the multiline.

Babu

Former Member
0 Kudos

Hi Babu,

yes i have checked multi line in condition, but why it is not working? any clue.?

Regards,

Jam

RKothari
Contributor
0 Kudos

Hello,

Please try the below mentioned option:

//MaterailNumb[not(text())]           EX

//MaterailNumb[text()]                 EX

Can you check the trace: Is it satisfying conditions correctly??

-Rahul

Former Member
0 Kudos

no luck...same problem...

stefan_grube
Active Contributor
0 Kudos

> for below data i am expecting one delvry and one order IDoc , but i am getting two delivery and 2 order idocs,

>

> i have not written any logic to filter IDoc at mapping level.

Then, what do you expect when you do not have any logic in mapping?

Of course you will have two idocs each.

Edited by: Stefan Grube on Jan 12, 2011 11:22 AM

Former Member
0 Kudos

Hi Stefan,

Interface determination condition will filter right?

correct me if i am wrong?

Regards,

Jam

stefan_grube
Active Contributor
0 Kudos

> Interface determination condition will filter right?

No. The name is "interface determination" and that is just what is done.

You have to do the filter in mapping.

Former Member
0 Kudos

Hi ,

This can be done in Interface determination by specifying the condition to the Material number.

Say if Material is empty then used the map corresponding to DELVRY

and if it has a value use the Map Corresponding to ORDERS.

Thanks

Sampath

Former Member
0 Kudos

Hi Sampath,

Thanks for your replay, tell me the condition what shoild i write.

Regards,

Jam

RKothari
Contributor
0 Kudos

Hello,

Have you tried the option

Delivery Idoc mapping : /order/MaterialNumb =(equal to) NULL

Order Idoc mapping : /order/MaterialNumb !=(Not equal to) NULL

-Rahul