cancel
Showing results for 
Search instead for 
Did you mean: 

Web DynPro ABAP - Disable a entire row in the Table of the output.

Former Member
0 Kudos

Hi Web Dynpro Experts,

Need ur Help.!

I have a requirement to disable the one row of the table in web dynpro ABAP

For example . my table is like

Field1 Field2

A Success

B Failure

C Failure

I need to allow the User to select the record only if its status is Success,if status is Failure then i should not the allow user to select.

This enabling and disabling of the rows should be done before displaying on to the Screen.

Please suggest me ASAP.

Thanks,

Akila

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Ail ,

i don't think you requirement is achievable ( as per my knowledge ) , watelse u can do is

1.why do you create a check inbox instead of standard selection button , thru this approach , u can handle the selections of the rows for futher processes.

2. Make use of Table Event OnSelection -->whenever user selections Row with Status 'E' then raise a Error Message.

regards

Prabhu

former_member1151507
Participant
0 Kudos

Hi Akila,

please try this.

Create a node (Eg: TEST) of type 0-n and 0-1. Take attributes attr1, attr2, flag (of type BOOLEAN). Create a table and give the TEST node as datasource. Now using "Create Binding" create columns for attr1 and atte2. Now, bind the read-only property of the columns with flag attribute.

Now, in the INIT method, set the table values like this:

For examle, if you want to disable row having test2,

ls_test-attr1 = 'A'.

ls_test-attr1 = 'TEST1'.

ls_test-flag = ' '.

append ls_test to lt_test.

clear ls_test.

ls_test-attr1 = 'B'.

ls_test-attr1 = 'TEST2'.

ls_test-flag = 'X'.

append ls_test to lt_test.

clear ls_test.

ls_test-attr1 = 'C'.

ls_test-attr1 = 'TEST1'.

ls_test-flag = ' '.

append ls_test to lt_test.

clear ls_test.

lo_test->bind_table( lt_test ).

By doing this, 2nd row gets disabled.

Also, if you already have the internal table with values, based on some condition you can change the value of flag and bind the table to node.

Hope this helps you, Please let me know in case of any queries.

Regards,

Manogna

Former Member
0 Kudos

Hi,

As mension by S.Meganadhan, bind the rowSelection value of the table row with a attribute with type boolean and

now go to field and write a moethod name for onLeadselection, write the appropriate code in the method to get the data inserted into field and depending on the value set the value of the attribute as 'X' or ' '.

This may help you, close the threat if it is answered.

THanks,

Anmol.

Former Member
0 Kudos

Hi ,

I did the same u mentioned :

Follow the below steps.

1. Create an attribute of type 'BOOLEAN' (for example row_selectable, type boolean).

2. Go to table, in the properties you can find "rowSelectable" bind the attribute which you created in step1.

3. Go to the INIT method of the View (or as per your requirement, you can write this code on any event handler)

4. Check the condition , and set attribute value row_selectable = abap_false.

As mension by S.Meganadhan, bind the rowSelection value of the table row with a attribute with type boolean and

now go to field and write a moethod name for onLeadselection, write the appropriate code in the method to get the data inserted into field and depending on the value set the value of the attribute as 'X' or ' '.

I am getting an Error - ADAPTER ERROR & VIEW_ELEMENT_TYPE& "Table" of View "My View Name" . It is possible to set either Lead seelection or Selection for a Context element...

Please help me ASAP.

Thanks in Advance,

Regards,

Akila.

Former Member
0 Kudos

Hi Akila,

Please check the cardinality and selection of the context node.

It should be like below:

Cardinality: 1:n

Selection: 0:n

or

Cardinality: 0:n

Selection: 0:n

Regards,

S.Meganadhan.

Former Member
0 Kudos

Hi Akila,

Follow the below steps.

1. Create an attribute of type 'BOOLEAN' (for example row_selectable, type boolean).

2. Go to table, in the properties you can find "rowSelectable" bind the attribute which you created in step1.

3. Go to the INIT method of the View (or as per your requirement, you can write this code on any event handler)

4. Check the condition , and set attribute value row_selectable = abap_false.

Then Execute.

Hope this will helpful.

Regards,

S.Meganadhan