Skip to Content
avatar image
Former Member

Mapping problem in context handling

Hi experts,

I am doing a file to file scenario in which i have to change the queue context is it possible? for simple context change we use ResultList.CC in advance UDF but what to do if we want to add a queue cahnge .To dig more deep into the problem i am explaining my scenario.

my output structure is <GROUP> .....(1 to unbounded)

<Records>....(1 to unbounded)

field1

field2

..

..

..

field13

In one group there can be many records and there will be multiple Groups.Suppose in my udf i want to add a queue change to add some field in other group then how will i achive it ? please guide me with ur inputs

Regards,

Saurabh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    May 20, 2008 at 05:18 AM

    Hi Saurabh,

    to force a context change in UDF, use:

    ResultList.addContextChange();

    See also

    http://help.sap.com/saphelp_nw04/helpdata/en/b1/83a09f668320419dbe00a741e0fe6a/content.htm

    Regards Mario

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 20, 2008 at 05:45 AM

    Hi Mario,

    Thanks for ur quick reply,but when i used it i got the error" non-static method addContextChange() cannot be referenced from a static context ResultList.addContextChange();".please tell me if i have to do any other setting to use this code.Secondly hope u understand my requirement i have to add context change to move to diffrent queue not simple context change.

    Please feel free to ask any question if u have not understood clearly .

    Regards,

    Saueabh

    Add comment
    10|10000 characters needed characters exceeded

    • You can use result.addContextChange()

      See also:

      /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

      Regards

      Stefan

  • May 21, 2008 at 05:57 PM

    Hi,

    context object is a generic term used to make a reference to message heder fileds in the XML file (also vth XPATH). Context of an element is nothing but just the level (with reference to its parent node) where the XML tag appears in the given XML document.

    Check this links for more info:

    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f59730fa-0901-0010-df97-c12f071f7d3b

    http://help.sap.com/saphelp_nw2004s/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm

    /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

    /people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi

    http://help.sap.com/saphelp_nw2004s/helpdata/en/4b/a20c4cfea96b498b1e1af3f32f0670/frameset.htm

    /people/venkataramanan.parameswaran/blog/2007/02/06/is-there-a-possibility-to-access-xi-standard-functions-in-user-defined-functions-yes

    Reward points if this helps

    Regards

    Pragathi.

    Add comment
    10|10000 characters needed characters exceeded

  • May 21, 2008 at 06:03 PM

    function myudf(String a[], ResultList result, Container container)

    {

    for(int i=0;i<a.length;i++)

    {

    if(!a<i>.equals(""))

    result.addValue(a<i>);

    else

    result.addContextChange();

    }

    }

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 17, 2008 at 02:01 PM

    The solution i got by appending as many space as the suprressed values

    Add comment
    10|10000 characters needed characters exceeded