Skip to Content
author's profile photo Former Member
Former Member

Regarding IfThenElse

hi @,

I have a scenario where using exists and ifthenelse function i need to check for existence of a field and then if source field is present then map to a target field and if it is not present then map target with different field.

But the problem is when the source field is present then it is getting mapped to target but when it is not present in source message then target is nt getting mapped to another field which is contant.

I am not able to figure it out where the problem is?

Regards,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 09:10 AM

    In the condition part use mapWithDefault instead of exists function.

    Regards,

    Jai Shankar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 25, 2007 at 09:05 AM

    > hi @,

    > I have a scenario where using exists and ifthenelse

    > function i need to check for existence of a field

    > and then if source field is present then map to a

    > target field and if it is not present then map

    > target with different field.

    There is a standard function available for this.

    Use <b>MAPWITHDEFAULT</b>.

    It checks if the source field exists and maps it to the target if it does not it maps the default value provided. To add default value, double click on the MAPWITHDEFAULT.

    Regards

    Bhavesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 25, 2007 at 09:13 AM

    Then -


    > The source filed

    Source -> (Exists) -> If -


    > target

    Else -


    > Constant

    try that rule, it should ideally work else using mapwithdefault in case u r passing a constant would be ideal.

    Ref -

    Node functions in

    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 09:17 AM

    Hi Amit,

    mapWithDefault is in <b>Node Functions</b>.

    Thanks,

    Maheshwari

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.