Skip to Content
avatar image
Former Member

How to map constant value using value mapping

Hi All,

In my scenario i had map constant value like vendor number to field PARTN of  segment EIEDKA1 in  idoc oders05   . But now functional is telling me that vendor number can't be constant, it can be changed on testing and production system. And suggested me to use value mapping. But in value mapping feature i have to mention source field and destination field both. But here source is constant that only i have replace with value mapping.

How can i do this mapping???? Please help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 02, 2014 at 02:24 PM

    >>>But now functional is telling me that vendor number can't be constant, it can be changed on testing and production system.


    You don't need valuemap.


    Simply write a UDF to get the system name handle the constant in it.


    String sysname = (String) System.getProperty("SAPSYSTEMNAME");

    if(sysname.equals("DEV"))

    {

    return "dev constant ";

    }

    else if(sysname.equals("QA"))

    {

    return "QA constant";

    }

    else

    {

    return "PRD constant ";

    }

    Add comment
    10|10000 characters needed characters exceeded

    • True you can use UDF, but I have the rule use UDF only when there is no other way. If you use UDF you need to check the code if anything goes wrong. With a parameter it should be clear.

      But you are right, as long as the system names do not change (very unlikely) your solution works just as good.

  • Dec 02, 2014 at 02:26 PM

    I amnot sure if I understand you, but you want to map a constant which has a different value in developpment, quality and production system ?

    In that case you can define a parameter in your mapping, still choose a constant, but now use the field help to choose the parameter as the constant.

    Now you can fill the parameter in the interface determination, in every system you can use another value.

    That way there is no need for value mapping.

    Add comment
    10|10000 characters needed characters exceeded