cancel
Showing results for 
Search instead for 
Did you mean: 

Checking Redundency of Data :- Multiple Models.

Former Member
0 Kudos

Hello Experts

My scenario is like this..

I have got 2 output list with the data from two different R/3 Systems and am able to display the data in the table. I have to check for the similar data occurences in two models...

For eg:-

Assume "123" is a customer number in Model 1 now I have to check whether the same customer number exists in Model 2 or not... If the same exists then I have to display some string in a different column..

Appreciate the help...

Regards

Su

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

for( i = 0; i<wdContext.node<firstoutput>().size(); i++)

for( j=0;j<wdContext.node<secondoutput>().sizse();j++)

{

if ( wdContext.node<firstOuput>.get<firstOuptut>ElementAt(i).equals(wdContext.node<secondOuput>.get<secondOutput>ElementAt(j)))

{

/// set the string in diffrent column.

}

}

Regards

Abhimanyu L

Former Member
0 Kudos

Thanks for the reply.... I was trying to make firstouput list a base and check the second output as you did...But sometimes if the size of the secondoutput increases than firstoutput then am getting indexoutbound error....

Is there any way I can append all data to a collection and compare each models with that collection...this is what am thinking as of now...If you have better idea please let me know..

Regards

Su.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

Taking into a collection and again comparing with the two model nodes will reduce the performence even more..

I suggest you to do the same coding.... just put check the condition in which node nor of elements are more accordingly you repeat the code twice...

I can suggest you one more thing if possible:

just create RFC connection between the two R/3 Systems. In first function module call the second one and filter the way you want and return to webdynpro.

Regards

Abhimanyu L

Former Member
0 Kudos

Can you tell me how to handle this indexoutofbound error....

Regards

SU

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

IndexOutbound Error occur only when you access an index which is more than the size. I think your code seems to be wrong some where access the elements using loop counter.

Regards

Abhimanyu L

Former Member
0 Kudos

Thanks for the reply.... I have one more question....

As mentioned earlier in this post,there could be similar data in both the models..While displaying the data in table only unique data should be present.

Any suggestions on this????

Regards

SU

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

I don't see any such functionality in table control.

You have to code to delete the duplicates, Unfortunately

Regards

Abhimanyu L

Former Member
0 Kudos

Thanks.......would appreciate if you can put some sample code for the same...

Regards

Su

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

Let your final node be 'Table'

for( i=0; i<wdContext.nodeTable().size();i++)

for( j=i1; j<wdContext.nodeTable().size();j+)

{

if ( wdContext.nodeTable().getTableElementAt(i).get<KeyAttribute>().equals(

wdContext.nodeTable().getTableElementAt(j).get<KeyAttribute>()){

wdContext.nodeTable().removeElement( wdContext.nodeTable().getTableElementAt(j));

}

}

Regards

Abhimanyu L

Former Member
0 Kudos

Thanks for the same... the below mentioned code is not working as desired.

In simple terms what I am looking for is to display unique(without data duplication)

records,which are comming from mulitple models, in a table...

How to make the final output node filled with only unique records.

PS:- am very much new to this develpment world......

Thanks in advance..

Regards

SU

Answers (0)