cancel
Showing results for 
Search instead for 
Did you mean: 

FixValues and Global Variable

Former Member
0 Kudos

hi,

Is there a functionality which does exactly like FixValues but stores the value thorugh out the mapping?

I have a requirement where i have to map 2 different values to other values but i have to repeat this for all the fields using FixValue instead if there would be a Global Variable i could use that instead.

Any ideas.

Thanks,

KP

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Tirumal,

For your requirement you can define a HashMap in Java Sections Tab of Graphical mapping and refer the values from UDF.

Steps

1. Goto MessageMapping (Design TAB)-> Edit JAVA Sections (Found on top-right side)

2. Declare a HashMap in Global variables section.

Eg.

HashMap materialNumMap = null;

3. Initialize the same variable and fill some values.

Eg.

materialNumMap = new HashMap();
            materialNumMap.put("MAT-01","10001");
            materialNumMap.put("MAT-02","10002");  
            materialNumMap.put("MAT-03","10003");
            materialNumMap.put("MAT-04","10004");

 

4. Write UDF to retrieve value from Global container


public void chkExists(String materialNUM,ResultList result,Container container){

  String valueFrmMap = (String)materialNumMap.get(materialNUM);
  
  return valueFrmMap;

}

Hope this solves your problem.

Regards,

Ananth

Former Member
0 Kudos

Hi,

You can use Value Mapping. That might be a better solution. Check out for value mapping in the following link.

http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm

regards,

P.Venkat

Former Member
0 Kudos

Tirumal

Can you go through the below url and resolve your issue.

/people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi

---Satish