cancel
Showing results for 
Search instead for 
Did you mean: 

Non Key Field Enable Disable

0 Kudos

While creating Account I observed that BP_NUMBER is a key field and is editable only for a new creation of account. It is disabled once it is generated.
Now I have added new AET field to Account General Data but since it is not a key field current->is_property_readonly in GET_I method returns false so I am not able to capture this functionality.

Please suggest what should I do?

Accepted Solutions (0)

Answers (1)

Answers (1)

sumeet_gehlot
Contributor
0 Kudos

Hi Rohan,

comment existing code and write in get_i method.

rv_disabled = 'TRUE'.

Regards,

S

0 Kudos

Dear Sumeet,

I know this but I want this field to work as a key field.

Because the above solution will enable the field if data does not exist in the field.

I want this field to be enabled only for New creation.

Thanks & Regards,

Rohan

former_member190077
Participant
0 Kudos

Copy the code of the method in the method GET_I_"BP_NUMBER" in your NEW field and adjusted correspondingly ...

Best Regards,

JMP.

Former Member
0 Kudos

Hi Rohan,

You can not make a custom field a key field in a table using AET. So you have to enhance I-getter method.

If you want to keep it changeable only in create mode,  write following at the end in your I-getter method:

1. Read BP number of the BP

2. If number exists and is also present in BUT000 RV_DISABLED = ABAP_TRUE