cancel
Showing results for 
Search instead for 
Did you mean: 

How can I move the record of selected row up and down in advancelistpane?

chandrusomasudaram
Participant
0 Kudos

I want to move the record of selected row up and down in AdvanceListPane of SAP Cloud Application Studio, SAP ByDesign. Like in Compensation(WorkCenter) -> Compensation Structure -> Edit -> Compensation Grades -> Grades(AdvanceListPane).

Please suggest the idea/solution to do that.

Accepted Solutions (0)

Answers (1)

Answers (1)

VenkateshG
Explorer

Hi Chandrasekaran,

Please check if the below ruby script written for UP Action can work for you. Let me know if you want further help.

Logic: Below, we are storing the values of the currently selected data & currently selected -1 data in temporary variables. swap the same and store it.

LeadSelection = $data.DataList.LeadSelectedIndex

RequiredDataField1 =$data.DataList.Get(LeadSelection).AnydataField1

RequiredDataField2 =$data.DataList.Get(LeadSelection).AnydataField2

RequiredDataField3 =$data.DataList.Get(LeadSelection-1).AnydataField1

RequiredDataField4 =$data.DataList.Get(LeadSelection-1).AnydataField2

$data.DataList.Get(LeadSelection-1).AnydataField1 =RequiredDataField1

$data.DataList.Get(LeadSelection-1).AnydataField2 =RequiredDataField2

$data.DataList.Get(LeadSelection).AnydataField1 =RequiredDataField3

$data.DataList.Get(LeadSelection).AnydataField2 =RequiredDataField4

chandrusomasudaram
Participant
0 Kudos

Hi Venkatesh,

Thanks for your answer.

But in my case, I'm using node inside the node in that case how can we do.

VenkateshG
Explorer
0 Kudos

Hi Chandrasekar,

I think it is still possible. Try the below code.

LeadSelection = $data.CustomBO.subnode.LeadSelectedIndex

RequiredDataField1 =$data.CustomBO.subnode.Get(LeadSelection).AnydataField1

RequiredDataField2 =$data.CustomBO.subnode.Get(LeadSelection).AnydataField2

RequiredSubnode1=$data.CustomBO.subnode.Get(LeadSelection).subnode1

RequiredDataField3 =$data.CustomBO.subnode.Get(LeadSelection-1).AnydataField1

RequiredDataField4 =$data.CustomBO.subnode.Get(LeadSelection-1).AnydataField2 RequiredSubnode2=$data.CustomBO.subnode.Get(LeadSelection-1).subnode1

$data.CustomBO.subnode.Get(LeadSelection-1).AnydataField1=RequiredDataField1 $data.CustomBO.subnode.Get(LeadSelection-1).AnydataField2=RequiredDataField2 $data.CustomBO.subnode.Get(LeadSelection-1).subnode1 = RequiredSubnode1

$data.CustomBO.subnode.Get(LeadSelection).AnydataField1=RequiredDataField3 $data.CustomBO.subnode.Get(LeadSelection).AnydataField2=RequiredDataField4 $data.CustomBO.subnode.Get(LeadSelection).subnode1 = RequiredSubnode2

chandrusomasudaram
Participant
0 Kudos

Hi Venkatesh,

I will try the above one.

Meanwhile, Can we do that in ABSL using collection?