cancel
Showing results for 
Search instead for 
Did you mean: 

problem in mapping?

Former Member
0 Kudos

Hello All,

Need help in mapping.

Iam doing IDOC to File scenario, in this scenaio iam doing mapping,

if element ABC contain BE then i need to map DEF to XYZ.

i wrote one UDF, problem is in ABC iam getting AG and BE.

ABC contain AG for that DEF dont have value.

ABC contain BE for that DEF contain value.

so in the mapping when i check the queue for AG its space and BE iam getiing value.

but when i execute it iam not getting the value at target side.

i wrote UDF like this.

if(var1.equals("BE"))

{

return var2;

}

return " ";

Please help me

Thanks and regards,

chinna

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos
if(var1.equals("BE"))
{
return var2;
}
return " ";

As Ravi said this can be achieved without UDF also.

If you want to use UDF then remove the last return statement ---> return " ";

This is not needed. If possible have an else block also so that the UDF wont fail if var1 not equals BE.

Regards,

Abhishek.

Former Member
0 Kudos

if we dont write return its giving error.

jyothi_anagani
Active Contributor
0 Kudos

>

> if we dont write return its giving error.

There write like

else

return var2;

Thanks.

Former Member
0 Kudos

If i return var2, then if what is the use of checing the condition for BE.

if there is not BE in ABC then it will pass the some constant value into it.

Mapping is working fine........ only issue with this.

Please let me know how to remove the emty value in the Queue.

see in the XYZ when i check Queue i can see

[ ]

100

so in target iam getting empty value........... tell me how to remove [ ] and i need 100 in out put

Thanks,

chinna

jyothi_anagani
Active Contributor
0 Kudos

Hi chinna ,

If you dont want that space...Dont use if then else Use only If without else ....


                              
                        DEF------------\                                                        
ABC-------------\                         then
                   ----->equals-------if     -------XYZ
Constant[BE]-----/

Thanks.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

In the graphical mapping , use IF dont use IF ELSE , so that you can avoid the Constant [] , empty value as you said

Regards,

Jude

Former Member
0 Kudos

Hi ,

Check the context .

when i go through the req , i found that if ABC contains BE then DEF should be mapped to XYZ right ?

But in ABC you get two values BE and AG .

Do you want to consider abt the AG ? if not what you have done ( as jothi said) is correct except the else part ( constant [])

Regards,

Jude

jyothi_anagani
Active Contributor
0 Kudos

Hi chinna,

Provide your total mapping...Because it is the problem with the Mapping context..Somewhere it is not matching..That is the reason you are able to see in the Queues and not able to see when you execute...

Thanks.

former_member181962
Active Contributor
0 Kudos

Hi Chinna,

Can you give us the structure of ABC and DEF?

Is DEF under ABC? or at the same level as ABC?

Your requirement might not need a UDF. You might as well do it using graphical mapping .

Regards,

Ravi Kanth Talagana

Former Member
0 Kudos

Thanks for the reply,

Please check the IDCO structure.

IDOC

Begin

EDI_DC40

E1EDKA1

SEGMENT

ABC

DEF

Target

DATA

XYZ

Thanks and Regards,

chinna

jyothi_anagani
Active Contributor
0 Kudos

Hi Chinna,

Map like this..


                              DEF------------\                                                        
ABC-------------\                               then
                         ----->equals-------if     -------XYZ
Constant[BE]-----/                              else
                                Constant[ ]----/

No need of UDF....

Thanks.

Former Member
0 Kudos

Hi Jothi,

i done as u told

Iam not getting any value in XYZ .

I checked in the Queue at XYZ its shows Space and NUmber.

as space is first one in queue iam not getting any out put.

Thanks,

chinna

jyothi_anagani
Active Contributor
0 Kudos

Hi Chinna,

Then it is the problem with complete mapping..Is it showing any error while testing the complete Mapping..Or what..

Just give total Mapping then 'll help you...

Thanks.