cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert an Input field to Text view in nwbc fpm??

sandeep_gvv2
Participant
0 Kudos

Hi,

As per my requirement i need to gray out a list of fields in my fpm application but the coding for gray is working only for fields of display type 'TEXT VIEW'.

but not of type 'Input fields'.

here in my scenario there are list of input fields type so i write the above code in get definition method to convert input field to text view but it is not working.

Please check and let me know how to achieve it???

get_definition :

------------------------

if sy-uname = 'TSTIC_DSPEC'..

READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'IDENTIFICATIONTYPE'.
   IF sy-subrc = 0.
   <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'.
   ENDIF.

   READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'IDENTIFICATIONNUMBER'.
   IF sy-subrc = 0.
   <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'.
   ENDIF.

     READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'IDINSTITUTE'.
   IF sy-subrc = 0.
    <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'..
   ENDIF.

     READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'IDENTRYDATE'.
   IF sy-subrc = 0.
    <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'.
   ENDIF.

     READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'COUNTRY'.
   IF sy-subrc = 0.
     <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'.
   ENDIF.

      READ TABLE et_field_description ASSIGNING <ls_field_description>
              WITH KEY name = 'REGION'.
   IF sy-subrc = 0.
     <ls_field_description>-DEFAULT_DISPLAY_TYPE = 'TV'.
   ENDIF.
   ENDIF.

please help me out soon.....

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

As per my understanding, If you want to gray-out the field you can set the "read_only" property, which is of BOOLE type.You can set this property for Input fields.

Suppose if your requirement is display the field as 'Input field' you can set the property Default_display_type as ="IN".

Refer the below screen shot for the same.

Hope it will clear your doubts...

Regards, Naga

sandeep_gvv2
Participant
0 Kudos

yes,

you are right but the read_only property is working only for TV(TEXT VIEW) type fields.If it is an input field(IN)

we need to convert it into Text view then only read_only option will work

i paste the code but it is not working that is my problem??

Former Member
0 Kudos

I didn't get your point.

If the field type is 'TextView', what is the need of grey out??  In the UIBB configuration it self you can set the display type property as TextView(it can't be editable).

You can make input field as grey out( i mean you can make it read only).

Try to loop the fields and set the read_only property for required fields.

Note: In UIBB Configuration, the 'display type' property should be input field.

Sample code:

data:  ls_field_desc type  fpmgb_s_formfield_descr.


loop et_field_description into ls_field_desc.

     if ls_field_desc-name eq 'IDENTIFICATIONTYPE' or

        ls_field_desc-name eq 'IDENTIFICATIONNUMBER' or

        ls_field_desc-name eq 'IDINSTITUTE'.

          ls_field_desc-read_only = abap_true.  " set the read_only property for above fields

     endif.

append ls_field_desc to et_field_description.

endloop.              

Regards, Naga

Former Member
0 Kudos

Hi ,

At the Component configuration level ,select the field and go to attributes of selected row and make the field type to input field.

Regards,

Shivaji

sandeep_gvv2
Participant
0 Kudos

Thanks for your replies.

My constrain is with out converting the fields into text view the read only property will not work.as per our situation we can't change at configuration level because it is affecting other things. so i have to convert it through coding itself.

Former Member
0 Kudos

Hi Srikanth,

You can write the logic in the GET_DATA method.

There is internal table ct_fild_uasage .check with this properties.

Pass the values accordingly and EV_FIELD_USAGE_CHANGED = 'X'.

Thank you.

Regards,

Shivaji.

former_member205613
Participant
0 Kudos

Hi,

the field usage should be changed in the get_Data method of the feederclass at runtime.

If the configuration is an SAP one you can also goto the configuration editor and create a customizing for the configuration itself and change the displaytype there.

regards

Heike Leopold