cancel
Showing results for 
Search instead for 
Did you mean: 

Reading UI mode and setting field mode in WebUI

Former Member
0 Kudos

Hi

Just getting into crm and I have some questions.

How do I determine if a UI view is in create or change mode?

How can i change a fields from input fields to display fields?

The reason is I need to close 2 fields for input on the screen in change mode. But they need to be open i Create mode. It is the same view that is used for Create and Edit mode.

Hope you can hint me in the right direction.

Sonny

Accepted Solutions (1)

Accepted Solutions (1)

CarstenKasper
Active Contributor
0 Kudos

Hi,

I suppose you are asking for ABAP statements.

How do I determine if a UI view is in create or change mode?

data: lv_displaymode type abap_bool.

lv_displaymode = view_group_context->is_view_in_display_mode( me ).

How can i change a fields from input fields to display fields?

view_group_context->set_view_editable( ).

If the view groupcontext is not used, you can set the state manually on the HTMLB tags on the .htm page.

Finetuning can be done in the GET_I methods of the context node.

cheers Carsten

Former Member
0 Kudos

Hi Carsten

Your answer has certainly helped me in the right direction. I was looking to determine if the view is in create mode or in edit mode (not display mode), but I can probably find a suitable method.

Unfortunately my enhanced view dumps, when i try to generate a new I Getter method, so I have not finished it yet, but will create a Note to SAP on the matter.

Thanks a lot.

Sonny

Former Member
0 Kudos

Hi,

I am quite sure what Carsten has mentioned should work. I have myself done it. To read whether the view is create/change mode really depends on which view you are in. As long as you know OO ABAP you should be able to read it. You could possibly be able to identify from one of the method of the controller class of that view.

simple step would be to create GET_I method for the fields you want and read the view mode, set to disable/enagbled.

-ASB

Answers (0)