cancel
Showing results for 
Search instead for 
Did you mean: 

catching the single row in a table

Former Member
0 Kudos

hi

i have a scenario on click of button

a single row gets interted in the table

and there are about 15 to 20 elements in the single row

now i need to catch the whole single row instance

at once and set it to another structure .

i have structure called IT_car_data which is table

in which a single row got inserted not i need to

catch the row elements and set it to a structure

called IT_car which has same structure as IT_car_data .

can any one help me ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

U can use following code for copying the current row from IT_car_data to IT_car.


IPrivateMycompView.IIT_carElement ele;

 ele=wdContext.nodeIT_car().createIT_carElement();

 ele.setCorrespondingele(wdContext.currentIT_car_dataElement().getCorrespondingele());//need to write for each attribute.

 wdContext.nodeIT_car().addElement(ele);//after copying each value need to add that element to it_car

By using wdCopyservice u can copy whole node not current Row.

Regards

Surender Dahiya

Edited by: Surender Dahiya on May 28, 2008 11:11 AM

Former Member
0 Kudos

hi

thanks for the reply

iam trying with the below code as what has been

posted but

ele.setCorrespondingele(wdContext.currentIt_Car_DataElement().getCorrespondingele());

in place of getCorrespondingele()

i cannot get 38 elements and its not so feasible .

in the table for first trial we have only single row

entry in the table IT_Car_Data which is table structure

the table may have 1000 of rows in the table later on .

scenario is i need to get or fetch the selected row elements

then set to a structure called IT_CAR elements and then

add this IT_CAR to the rfc and execute the RFC .

this is flow i need to goahead with .

any suggestions .

int n=wdContext.nodeIt_Car_Data().size();

int n1=wdContext.nodeIt_Carv_Data().size();

for(int i=0;i<n;i++)

{

if(wdContext.nodeIt_Car_Data().isSelected(i))

{

IPrivateSampleView.IIt_CarElement ele;

ele=wdContext.nodeIt_Car().createIt_CarElement(new Zlgs_Car_Data());

ele.setCorrespondingele(wdContext.currentIt_Car_DataElement().getCorrespondingele());

//need to write for each attribute.

wdContext.nodeIT_car().addElement(ele);

//after copying each value need to add that element to it_car

Former Member
0 Kudos

Hi,


ele.setCorrespondingele(wdContext.currentIT_car_dataElement().getCorrespondingele());//need to write for each attribute.

setCorrespondingele means ur are setting corresponding columns form IT_car_data to IT_car.

suppose u have 10 columns in a row then in this case u have to write the above statement for 10 times u cant escape from this situation.

As of now u dont have any option apart from previous to copy current row from one node to other.

Regards

Surender Dahiya

Former Member
0 Kudos

hi

thanks for the response

but there are 38 elements and i cannot

this setCorrespondingele (get.....)

38 times and about copying it_car_data to the

it_car this is not a feasible way

table contain 1000's of records and on select

of particular row the all the row data has to be

set to it_car and this structure will added to the RFC

wdcontext.contextzrfc.modelobject.addit_car(itcar);

then need to execute the RFC .

and there is also similar scenario where i have perform

same procedure as above . here too i cannot write

set 38 elements

Former Member
0 Kudos

IF U FIND ANY FEASIBLE SOLUTION THEN LET ME KNOW PLEASE

Former Member
0 Kudos

You can get the selected row data:

wdContext.currentIT_car_dataElement()