cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Id from Idoc to targets

former_member452321
Participant
0 Kudos


Hi,

Here is my mapping attached screent shot. Everything is working except one issue for first if condition

If TDLine(count)>25 and if TDID =F01 then first id on target should be F01 and remaining id should be F01-cont

For each TDLine(count)>25 ,it is generating multipes tdids but each tdid has value of F01-cont

If there are 51 TDlines with one TDID =F01

on Target

Notes

F01

Notes

F01-cont

Notes

F01-cont

Used below udf to populate notes

nt count = Integer.parseInt(segcount[0]);


for (int i = 0; i < count; i = i+25)
{
result.addValue("");
}

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Mahesh,

Can you elaborate your mapping logic? it seems to be incomplete.

regards,

Harish

former_member452321
Participant
0 Kudos

Multiple E1EDKT1 segments with one TDID for segment

and under one E1EDKT1 segment multiple TDLines E1EDKT2in source

In target side , need to generate multiple Note segments with Id and Text

for each 25 TDlines (for one E1EDKT1 ) which is working fine.

for the id value on target side

if source has E1EDKT1>TDID value of F01 and multiple TDLines E1EDKT2(count) more than 25

first id should be F01 and second id should be F01-cont and third id should be F01-cont

if the id has other than F01 it is going to else condition which is working fine

In the attached test data with one TDI F01 and 131 TDlines .Generatted 6 notes with id and text on target side first id is F01 and second id is F01-cont . first id not correct it should be F01 Not sure how to add the logic for first if condition to get only first ID value be F01 and remaining ID values F01-cont

Hope I am clear

Harish
Active Contributor
0 Kudos

Hi Mahesh,

Please correct me it the below logic is wrong

for TDID = F01, check no of TDLINE

If TDLINE count > 25 then first is F01 and rest all F01-cont

If TDLINE <25 then target is F01

I would suggest to remove graphical function if and replace with UDF. In UDF for the first check first value is F01 and rest all are F01-cont. So please try the java code for the logic and let me know if you need any help.

regards,

Harish

former_member452321
Participant
0 Kudos

Yes Logic right.  I need help on this. Not sure how to set the first F01 .and rest all F01
Thanks for your help

former_member452321
Participant
0 Kudos

Do we need add else logic in udf . If we are getting other than F01 then it should get from fixed values as it was in the attached mapping screen shot

Harish
Active Contributor
0 Kudos

Hi Mahesh,

we can take the fixed value mapping as input to UDF. try the below logic

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

   {

    if(TDID[i].equals("F01"))

    {

     if (TDLINE.length <5)

     {

for(int j=0;j<TDLINE.length;j++)

      {

      result.addValue(TDID[i]);

}

     }

     else

     {

      for(int j=0;j<TDLINE.length;j++)

      {

      

       if(j==0)

        result.addValue(TDID[i]);

       else

        result.addValue(TDID[i]+"-Cont");

      }

     

     }

else

//code the fix mapping logic

     

    }

regards,

Harish




former_member452321
Participant
0 Kudos

Thanks Harish I tested with F01 and it worked .For else condition other than F01 getting issue .something is not correct in coding after last else statment.

String  vnoteidtext ;

for(int i=0;i<TDID.length;i++)
   {
     vnoteidtext = valmap[i] ;


        if(TDID[i].equals("F01"))
         {
                 if (TDLINE.length <25)
                  {
                   for(int j=0;j<TDLINE.length;j++)
                         {
                          result.addValue(TDID[i]);
                     }
                  }
                   else
                   {
                       for(int j=0;j<TDLINE.length;j++)
                      {
                             if(j==0)
                             result.addValue(TDID[i]);
                           else
                             result.addValue(TDID[i]+"-Cont");
                      }
                  }

           else
           {
             if(!TDID[i].equals("F01"))
                  result.addValue( vnoteidtext]);
                       }
}


}

Harish
Active Contributor
0 Kudos

Hi Mahesh,

for else you want to display only one constant field or you have any conversion logic? please change the code as follow

String  vnoteidtext ;

for(int i=0;i<TDID.length;i++)
   {
     vnoteidtext = valmap[i] ;


        if(TDID[i].equals("F01"))
         {
                 if (TDLINE.length <25)
                  {
                   for(int j=0;j<TDLINE.length;j++)
                         {
                          result.addValue(TDID[i]);
                     }
                  }
                   else
                   {
                       for(int j=0;j<TDLINE.length;j++)
                      {
                             if(j==0)
                             result.addValue(TDID[i]);
                           else
                             result.addValue(TDID[i]+"-Cont");
                      }
                  }

           else
           {

  for(int j=0;j<TDLINE.length;j++)

                      {


                  result.addValue( vnoteidtext);

}
                       }
}

former_member452321
Participant
0 Kudos

Not sure what the issue . Everything i copied samebbut still I am getting the compile error

String  vnoteidtext ;

for(int i=0;i<TDID.length;i++)
   {
      vnoteidtext = valmap[i] ;
        if(TDID[i].equals("F01"))
        {
            if (TDLINE.length <25)
            {
                for(int j=0;j<TDLINE.length;j++)
                {
                    result.addValue(TDID[i]);
                }
            }
            else
            {
                for(int j=0;j<TDLINE.length;j++)
                {
                    if(j==0)
                        result.addValue(TDID[i]);
                        else
                        result.addValue(TDID[i]+"-Cont");
                }
            }

        else
           {
    for(int j=0;j<TDLINE.length;j++)
                 {
                 result.addValue( vnoteidtext);
     }
            }
     }

    }

Harish
Active Contributor
0 Kudos

Hi Mahesh,

Some problem with { position please check the below

String  vnoteidtext ;

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

   {

      vnoteidtext = valmap[i] ;

        if(TDID[i].equals("F01"))

        {

            if (TDLINE.length <25)

            {

                for(int j=0;j<TDLINE.length;j++)

                {

                    result.addValue(TDID[i]);

                }

            }

            else

            {

                for(int j=0;j<TDLINE.length;j++)

                {

                    if(j==0)

                        result.addValue(TDID[i]);

                        else

                        result.addValue(TDID[i]+"-Cont");

                }

            }

}

        else

           {

    for(int j=0;j<TDLINE.length;j++)

                 {

                 result.addValue( vnoteidtext);

     }

            }

    

    }

former_member452321
Participant
0 Kudos

Thanks Harish. I testED with data  first EDKT1 >TDID =F01 and EDKT2 with 30 lines of TDlines  and second EDKT1 >TDID =ST and EDKT2 with 10 lines of TDlines

So first ID it created Fo1 and second ID created with F01-continue which is correct.

but for third TDID  also it created with same F01-cont instead of third input for ST which is in the fixed values .This should come from last else statement

Thanks

former_member452321
Participant
0 Kudos

Attached display queue for udf and output

For third Id it should come as Stadnadardtext which is third input

Harish
Active Contributor
0 Kudos

Please change the logic as below

String  vnoteidtext ;

double number;

int no;

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

   {

  vnoteidtext = valmap[i] ;

        if(TDID[i].equals("F01"))

        {

number = TDLINE.length;

number = Math.ceil(number/25);

no = (int) number;

  if (TDLINE.length <25)

            {

                for(int j=0;j<no;j++)

                {

                    result.addValue(TDID[i]);

                }

            }

            else

            {

                for(int j=0;j<no;j++)

                {

                    if(j==0)

  result.addValue(TDID[i]);

                        else

                        result.addValue(TDID[i]+"-Cont");

                }

            }

}

        else

           {

    for(int j=0;j<no;j++)

                 {

                 result.addValue( vnoteidtext);

     }

            }

    

    }

former_member452321
Participant
0 Kudos

Thank you Harish for looking in to this issue. Initially it gave the error variable no might not have been initialized .Then I added int no =0 ; It worked with F01 and STcombination .but if there is ST only source , in target id value is empty for all the segments  .,Attached udf display

Harish
Active Contributor
0 Kudos

Hi Mahesh,

i misplaced the variable, now it should work

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

   {

  vnoteidtext = valmap[i] ;

number = TDLINE.length;

number = Math.ceil(number/25);

no = (int) number;

        if(TDID[i].equals("F01"))

        {

  if (TDLINE.length <25)

            {

                for(int j=0;j<no;j++)

                {

                    result.addValue(TDID[i]);

                }

            }

            else

            {

                for(int j=0;j<no;j++)

                {

                    if(j==0)

  result.addValue(TDID[i]);

                        else

                        result.addValue(TDID[i]+"-Cont");

                }

            }

}

        else

           {

    for(int j=0;j<no;j++)

                 {

                 result.addValue( vnoteidtext);

     }

            }

    

    }

former_member452321
Participant
0 Kudos

Thank you Harish .It worked

former_member452321
Participant
0 Kudos

Hi Harish,

Can i use the same logic at each item level also. E1DP01>E1EDPT1>E1EDPT2>TDLINE or any changes requried

Thanks

Harish
Active Contributor
0 Kudos

Hi Mahesh,

for item you need to loop at TDLINE (the udf which loop for TDLINE.length) and for header you need to use the same logic.

regards,

Harish

former_member452321
Participant
0 Kudos

Hi Harish,

Did u get a chance to look at the udf for item level mapping for text and id

Thanks


Answers (0)