cancel
Showing results for 
Search instead for 
Did you mean: 

ALV: columns in read-only mode look like editable columns in edit mode

Isegrim
Explorer
0 Kudos

Hi,

My application contains an ALV table which should be toggled between display and edit mode like the rest of the fields.

The evident solution was to use

if_salv_wd_table_settings~set_read_only( abap_true or abap_false)

However, unlike the rest of the fields, when the application changes into display mode and the fields get grey like in any SAP application, the columns in the table which were editable remain white, and those which were not editable and thus grey, get now white, too, instead of the other way round. So it will look to the normal user, as if now all columns would be editable!

Of course, he would realize that they are not when he tries to edit them, but this is irritating.

See following link with screenshots (only active for 3 weeks from now on):

[Link to my webmail space/SDN: .|https://businesswebmail.telekom.at/filestorage/MzYxMTk1OTMx/]

I have looked

  • through my books ("Einstieg in Web Dynpro for ABAP", "Praxisbuch Webdynpro for ABAP", ...)

  • through the wiki for Webdynpro for ABAP here in SDN as well as through this forum (by searching with "ALV edit")

  • through the notes in BC-WD-CMP-ALV

but could not find any solution. Most tables in those PDF articles found here in the WD4A wiki also show white cells although they are probabliy in read-only mode (e.g. the imitation of the SE16N browser article).

The attributes to the LO_CELL_EDITOR for both Inputfields and textview columns contain exactly the same values when toggling between display and edit mode (read-only in table settings), so also no chance to change here anything.

Also changing the cell design is not a solution as there is no design that looks like grey for not editable according to WDUI_TABLE_CELL_DESIGN ([SAP Help - WDUI_TABLE_CELL_DESIGN|http://help.sap.com/saphelp_nw2004s/helpdata/en/56/5e9041d3c72e7be10000000a1550b0/frameset.htm].

I do not know if I have made an error, as this is my 3rd Web Dynpro (after the first 2 of the introduction book), or SAP is really inconsistent in User interface between "normal" fields and ALV table fields.

Can you please help me?

Thanks in advance,

Erlend

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You are right. If the columns are eidtable then it is in EDITABLE, Grey means NOn-Editable but this is the case when the

set_read_only of ALV table settings is set to abap_false.

If this is set to ABAP_TRUE then all the colmuns will be shown as WHITE cells(but not editable).

Regards,

Lekha.

Isegrim
Explorer
0 Kudos

OK, thanks, but what should I do now?

Is there any better solution than setting the ALV table to edit mode, set all columns to read-only and deactivate "Append row" etc. buttons, which is a "dirty" solution in my opinion?

Cheers,

Erlend

Former Member
0 Kudos

Hi,

In my application aslo, i have 30 columns out of which 10 are input fields. But, i'm showing the table as ABAP_TRUE incase of Non-editable otherwise to abap_false. Now i'm getting everything as in WHITE cells.

Do you want to show it is Grey mode with Non-editable feature. Is that so.

How many columns are there which has Input fields.

Get the column references.

Now, based on the mode of display create the object as Input or Textview field.

For that column -

If mode eq 'D'.

Create an object for Textview(cl_salv_wd_uie_text_view)

else.

Create an Object for Inputfield(cl_salv_wd_uie_input_field)

endif.

The Append row is a standard button or custom one on ALV toolbar.

Do you want to hide the toolbar or just disable these buttons.

If you want to hide the toolbar then refer my wiki -

http://wiki.sdn.sap.com/wiki/display/WDABAP/NullreferenceforUPDATETOOLBARerrorsofALVinthewebdynpro+ABAP

Regards,

Lekha.

Edited by: Lekha on Sep 30, 2009 8:06 PM

Isegrim
Explorer
0 Kudos

Hi,

> Do you want to show it is Grey mode with Non-editable feature. Is that so.

Yes: when in Display mode, it should show all the columns in grey as the user would expect.

> How many columns are there which has Input fields.

Currently, only for those columns which should be editable in general, I have set the cell editor to input fields, the rest is textviews as automatically created.

For my "dirty" solution I will have to check first, whether an input field which is set to read-only, would get grey like the textview fields in Edit mode. However; I want to wait for a better solution.

> The Append row is a standard button or custom one on ALV toolbar.

The "Append row" button is a standard button like some others which come with the Edit mode using table setting

if_salv_wd_table_settings~set_read_only( abap_false )

> If you want to hide the toolbar

No, thanks, I only want to disable the buttons which come with Edit mode.

Cheers,

Erlend

Former Member
0 Kudos

Hi,

Yes, you can try that out by passing abap_false/abap_true based on condition for the Input fields. This is not a dirty solution as you want them in GREY mode. I guess this should work or else based on the condition you need to create objects of type

textview and Input field.

You can even disable the standard buttons.

You need to get the reference of the standard buttons and then disable it.

DATA: lo_value type ref to cl_salv_wd_config_table,
            lo_funcstd  type ref to if_salv_wd_function_settings.

lo_funcstd ?= lo_value.
lo_funcstd->set_enabled
exporting
value = abap_false.    "All functions on toolbar are disabled.

Or

Single function disable - 
DATA: lr_std_func type ref to  CL_SALV_WD_FUNCTION_STD.
lr_std_func = lo_funcstd->GET_FUNCTION_STD
exporting
ID = IF_SALV_WD_C_STD_FUNCTIONS=>EDIT_APPEND_ROW
receiving
value =  lr_std_func.

lr_std_func->set_enabled
exporting
value = abap_false  "Disable

Regards,

Lekha.

Isegrim
Explorer
0 Kudos

Hi Lekha,

In my opinion, it is a dirty solution, but one which I am forced to use by SAP. I think, I will try that in GUI ALV, because I don't remember to have had this problem there and then post an OSS message, so that they at least offer an additional cell design for that.

> You can even disable the standard buttons.

> You need to get the reference of the standard buttons and then disable it.

> ...

As I said, I don't want to hide away the entire toolbar, just the Edit buttons, and those, I will disable with the methods such as SET_EDIT_APPEND_ROW_ALLOWED to use the standard functions provided by SAP for that purposes.

But thanks for your efforts and especially for your fast reply,

Cheers,

Erlend

Former Member
0 Kudos

HI,

The code in my previous post is to disable the standard buttons on the toolbar. It doesnot hide the toolbar.

This is what is you require right.

Isegrim
Explorer
0 Kudos

Hi,

Does this not disable "View" droplist, "Export" button and "Filter"/"Settings" hotspots, too? If not, I indeed could use it.

Cheers,

Erlend

Former Member
0 Kudos

Hi,

As per my previous post, you can all the standard functions references and can disable all of them at a time.

Refer If_salv_wd_function_settings.

Answers (0)