on 2012 Nov 08 3:50 PM
How to grayout input fields in fpm guibb ?
The same is achieved by View exit class's method adapt_field_properties.
One can set the read_only property of the field and insert the value in ct_field_properties and set the cv_field_properties_changed as ABAP_TRUE.
Other fields that should be activated are visible, enabled and the name according to one's requirement.
Regards,
Nancy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Debasish,
I'm also working on similar sort of things if you got any solution pls let me know aswell.
Reagrds,
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi phani ,
Thanks for ur replay but its not grayout the field .there is no effect of this code .can you have any other solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Debasish,
if it doesn't help to set the attribute READ_ONLY to 'X' for the feeder field in the field usage table of method GET_DATA then either you have forgotten to set the exporting parameter EV_FIELD_USAGE_CHANGED to 'X' as well in GET_DATA, or the feeder field uses a field reference READ_ONLY_REF which can be defined in the field description table of method GET_DEFINITION. In the latter case you have to change the field value of this reference field in method GET_DATA accordingly.
Best regards,
Jens
data : f_usage type fpmgb_s_fieldusage.
data : lt_field_usage type STANDARD TABLE OF fpmgb_s_fieldusage.
if flag = 'X'.
return.
endif.
flag = 'X'.
select * from zstudent into table itab.
ct_data = itab.
ev_data_changed = 'X'.
LOOP AT ct_field_usage INTO F_USAGE WHERE NAME = 'ZID'.
f_usage-name = 'ZID'.
f_usage-read_only = 'X'.
f_usage-mandatory = 'X'.
f_usage-enabled = 'X'.
MODIFY CT_FIELD_USAGE FROM F_USAGE TRANSPORTING FIXED_VALUES_CHANGED READ_ONLY MANDATORY ENABLED.
CLEAR F_USAGE .
ENDLOOP.
ev_field_usage_changed = 'X'.
------------------------------------------------------------------
method IF_FPM_GUIBB_FORM~GET_DATA.
DATA : li_makt_line TYPE makt.
data : f_usage type fpmgb_s_fieldusage.
li_makt_line = cs_data. "cs_data contains the data
IF li_makt_line-matnr IS NOT INITIAL.
SELECT SINGLE * FROM makt INTO cs_data WHERE matnr = li_makt_line-matnr .
ev_data_changed = abap_true.
ENDIF.
if ct_field_usage is NOT initial.
LOOP AT CT_FIELD_USAGE INTO F_USAGE WHERE name = ' MAKTG '.
f_usage-name = 'MAKTG'.
f_usage-read_only = 'X'.
f_usage-mandatory = 'X'.
f_usage-enabled = 'X'.
MODIFY CT_FIELD_USAGE FROM F_USAGE TRANSPORTING FIXED_VALUES_CHANGED READ_ONLY MANDATORY ENABLED.
CLEAR F_USAGE.
ENDLOOP.
ENDIF.
EV_FIELD_USAGE_CHANGED = abap_true.
===================================
HI PHANI
I ATTACHED THE CODE IF U HAVE ANY ANY SOLUTION REPLAY .
REGARDS
DEBASISH
The code seems about right. Why are you changing the mandatory and enabled fields? Only change the read_only field. I prefer to either use a field-symbol or an index when updating an internal table. Also, why are you checking if ct_field_usage is not initial. You don't really need to since you are looping on that internal table.
Hi Debasish,
LOOP AT CT_FIELD_USAGE INTO F_USAGE WHERE name = ' MAKTG '.
f_usage-name = 'MAKTG'.
f_usage-read_only = 'X'.
f_usage-mandatory = 'X'.
f_usage-enabled = 'X'.
MODIFY CT_FIELD_USAGE FROM F_USAGE TRANSPORTING FIXED_VALUES_CHANGED READ_ONLY
MANDATORY ENABLED.
CLEAR F_USAGE.
ENDLOOP.
Here you have used MODIFY and you have used Transporting and not used NAME in it user that and it should work .
Also Why do you need to use if ct_field_usage is NOT initial condition.
Thanks
Phani
Hi Debasish,
You can handle it in the GET_DATA of the Feeder class if you want to do it on a condition.
LOOP AT ct_field_usage INTO ls_field_usage WHERE name = 'Name of the field'.
*** You can change
READ_ONLY
MANDATORY
ENABLED
LABEL_TEXT
HELP_TEXT
LINK
VISIBILITY all these properties for the field and then modify the ct_field_usage****
MODIFY ct_field_usage FROM ls_field_usage TRANSPORTING fixed_values fixed_values_changed mandatory visibility.
CLEAR ls_field_usage.
endloop.
and then make the ev_field_usage_changed = abap_true .
This is how it is handled.
Thanks
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can change the input field into text view in your FPM configuration. If you want to change it at runtime, then you need to modify the field to read-only in the GET_DATA method of the feeder class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't need to instatiate anything; FPM will take care of creating feeder instances. You can either enhance the class to add your code or create a child class that you use in your configuration. As Jens mentions below, you can either enhance the GET_DEFINITION to always make a field read-only or use the GET_DATA to change it to read-only at run-time.
I recommend you go through the FPM Developer Guide document. It is a PDF document available in this website. Just type FPM Development Guide and you will find it.
Hello Abdullah,
Is there a way to check the CR Status in the GET_DATA method? I can't seem to find the status in the structures. I need to only make the fields read-only for the last status 04 and I don't wnat to use the settings in configuration "Edit Statuses of Change Request Steps". In my case, these steps are used by several different data models, same workflow.
I'm also using it with the Vendor UI, where I have to disable the Editability. There it's controlled with a different mechanism and I'm not sure if that's the best approach for me. Please advise...
Thanks in advance,
Boris
You can use MDG API classes in the feeder class. Here is a new document that should help you (it is mainly for approval but you can use the same technique to read the status): How to Read Approval Info for Master Data by Ca... | SCN
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.