cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Field - Runtime

Former Member
0 Kudos

Whether it is Possible to Disable a Target Field during Runtime based on the Source Field value.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The best option for this to use Java Program as mapping program instead of Message Mapping. You can check for the required values and based on that you can generate that element otherwise don't generate that element in target xml structure.

This solution is applicable irrespective of occurrence of your data field(1..1 or 0:unbounded).

Pls let me know in case of any further clarifications.

Rgds

Sudhakar.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Sudhakar,

>>>This solution is applicable irrespective of occurrence of your data field(1..1 or 0:unbounded).

you can do the same with my code sample from graphical mapping (a few lines of code) and you don't have to write a whole java program to do just that little thing

jave mappings are not <b>best option</b> they should be regarded as the <b>Last option</b> (just like ABAP mappings) when graphical and XSLT mappings fail

(from a perspective of clients help, other developers, standards - XSLT)

my point is that java is "you can do everything with me"

but XI offers a lot of tools (graph, XSLT) just for mapping

Regards,

michal

Former Member
0 Kudos

Hi,

i fully agree with Michal. Graphical Mapping Tools is very powerfull if you understand the concepts. Java and ABAP mapping is really only the last resort and that is also the "official" SAP guideline they have communicated to us in various projects.

best regards

Christine

MichalKrawczyk
Active Contributor
0 Kudos

thanks Christine

Regards,

michal

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

sure it is:

you can create user adv anced function which in

some cases will return:

result.addValue("some value");

and if you don't want to get the value just return:

result.addContextChange(); instead

Regards,

michal

Former Member
0 Kudos

Hi Navven,

You can write a user defined function or use ifwithelse to compare source field value before you map it to target field. If you do not map your target based on the source field value then it will not appear in the target message. But to achieve this your target field should be optional parameter.

Regards

Anand