cancel
Showing results for 
Search instead for 
Did you mean: 

Help in UDF

Former Member
0 Kudos

Hi,

Need ur help in creating UDF, i have source fields in Order IDOC under subsegment EDP35 of EDP01 segment.

QUALZ

CUSADD

CUSADD_BEZ

and target fields:

RT

RU

RC

ET

I tried graphical maping as follows:

1) If Qualz = 001 and CUSADD exists then RT else Constant

2) If Qualz = 004 and CUSADD exists then ET else Constant

3) If Qualz = 001 and CUSADD_BEZ exists then RC else Constant

4) If Qualz = 004 and CUSADD_BEZ exists then RU else Constant

It is not throwing any mapping error but the values containing in the fields are not populating properly, as CUSADD & CUSADD_BEZ fields are repeating based on EDP01 segment.

Can any body suggest me a suitable UDF plz?

regards

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

As others have mentioned above, writing a UDF may still result in the same issue. But if it helps I have written a weblog regarding context changes with UDFs. You could possibly take from it what you need and include your own logic to finish the rest. Good luck, hope it helps.

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

Message was edited by:

Harrison Holland

Former Member
0 Kudos

Hi Harrison,

Thanks 4 refering a gud blog but i have achieved my issue with a graphical mapping.

regards

Former Member
0 Kudos

Hi Vijaya,

do a splitbyvalue before creating doing a creatif function for the target nodes... Hope this helps you........

Thanks,

Rajeev Gupta

Former Member
0 Kudos

hi...

no, i tried this too...:-)

regards

Former Member
0 Kudos

you need to write a UDF using Context or Queue based on our requiremnt and loop the array and populate the values and pass via ResultList.

Regards

Sreeram.G.Reddy

Former Member
0 Kudos

Hi,

check the occurr.. of target field .. it should be 0..unbound to get multiple i hope source is having the multiple occu..

can you plz explain clearly..ur UDF.. and mapping , occurr..

Regards

Chilla..

Former Member
0 Kudos

Hi Vijaya ,

I guess you have to change the context. You rigth mouse click in grahical mapping and see that the context changes in your queue of both sourec fields are the same.

I think you will have the same problems using UDF.

Regards Mario

Former Member
0 Kudos

Hi Mario,

I tried all the options of context changes but no luck, thought that some one might be there to help me out.

regards

Former Member
0 Kudos

Hi,

Can you please let me know ur UDF..

And please change the context to above parent node..

each input field to UDF should have the removecontext and the output from UDF should have the splitbyvalue functions.. try...

Regards

Chilla..

Former Member
0 Kudos

please try the way i explained as above

Former Member
0 Kudos

hi vijaya,

you need to write a UDF using Context or Queue based on our requiremnt and loop the array and populate the values and pass via ResultList.

Reward points

Regards

Sreram.G.Reddy

Message was edited by:

Sreeram Reddy

Former Member
0 Kudos

Hi,

I am not tht gud in Java, tht's the reason i approached the forum.

regards

Former Member
0 Kudos

Hi Vijaya,

as I told a UDF will probably NOT solve your mapping.

As I told use right-mouse ( in the graphical mapping field) --> queue an "debug" your mapping. Therefor create first a test-message in tab "test".

Play a litte with this; you will find it out

The other suggestion is to create a simplified version. Create a data-type that is similar to the IDOC (same hierachy but DO NOT use all IDOC fields. This ist irritating you)

Maybe splitByValue could also be a solution.

Is the hierarchy of the IDOC you wrote correct?

Is the occurance of the fields you compare the same?

Regards Mario

Message was edited by:

Mario Müller

Former Member
0 Kudos

Thanks Mario,

I was working around with this issue for the last two hours..but unable to achieve....

regards

Former Member
0 Kudos

Hi Vijaya ,

in your case I would delete my mapping and start again "step by step". Thats the way I do it, when something won't work.

Regards Mario

Former Member
0 Kudos

hi Vijaya,

Did you write a UDf with inbound parameters passed by context and you get all the values loop throught it and send to traget.

Regards

Sreeram.G.Reddy

Former Member
0 Kudos

Hi Mario,

Ur posting <b>really motivated me</b> to look again into the cause.. ultimately i have achieved the required field mapping without going for UDF :-). with a little modification.

regards