cancel
Showing results for 
Search instead for 
Did you mean: 

ALE conversion rules. Can I set default field value instead of constant ?

Former Member
0 Kudos

Hi !

We need to assign a "/" (NODATA) character to several fields of an IDOC when receving it from XI, before processing in the application. But the conversion rule should only put a "/" (NODATA) when the field is empty, and when it is not, it should leave the current value.

We only found a way to specifiy a constant value, and R/3 is using that value always, also when real data comes in those fields.

Is there any way to write an expression or to define a default value instead of a constant value ?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matias,

You can use the 'mapWithDefault' function which would map a constant "/" if the particular field is absent...

Is this what you are looking for ?

Thanks,

Renjith.

Former Member
0 Kudos

Hi Renjith !

The problem is that the scenario is File->XI->IDOC, with a very small file (5 o 6 fields), and with a very large IDOC (more than 100 fields). Instead of creating via graphical mapping, hundreds of mapWithDefault cases, we solved it using ALE conversion rules in R/3, by creating some rules that should apply when the message arrives, before processing.

If you have a quick method of assignment of mapWithDefault boxes for hundreds of fields, please tell me !

The possible problem with our solution is that if any other interface needs to send the same IDOC to R/3 with other completed fields, it could happen that the conversion rule replaces the real data with "/".

I agree that the best way is with mapWithDefault, but they are hundreds of fields.

Thanks.

Former Member
0 Kudos

Hi Mathias,

OK ..now i understand...Putting a mapwithDefault in so many fields can be a pain....

Anyways...now when you create your alert rules...you are mapping '/' as a constant to all the fields of the segments...am i right ?

Now in that case as you rightly said it will be overwitten always whether the source is blank or had a value.....

To be on the safe side...i can suggest another thing..may be you thought of it already and did not want to do this....

In the alert rules screen, donot assign constants, instead click on the 'Create Proposal for rule' button , so that it will map the source to target directly for all fields....now for each of the fields attach an Exit(a custom exit) to it....

This exit will be a Z_ one and will output '/' if source is blank or will pass the source to target in case a value is present...I know that this may be a bit of work an you will have to go through each field...However it is much easier than doing the 'mapWithDefault' function in XI...

Thanks,

Renjith

Answers (0)