cancel
Showing results for 
Search instead for 
Did you mean: 

PCUI Fields

Former Member
0 Kudos

Hi Guys,

Could I change the field type dynamically in PCUI? I am trying to prevent users from editing the address field if it is flagged as a standard address. Thanks.

Regards,

Conrad Chia

Message was edited by: Conrad Chia

Accepted Solutions (1)

Accepted Solutions (1)

vijayakm
Advisor
Advisor
0 Kudos

Hi Conrad,

Application class has IF_CRM_BSP_MODEL_ACCESS_IL~READ method with export parameter ET_FIELD_ATTRIBUTE. This needs to be filled up to change the field during runtime. PCUI Framework looks into ET_FIELD_ATTRIBUTE parameter to do the runtime attributes of a field.

Following properties can be set during runtime for every field. 'A - Not changeable'; 'B- Not Relavent'; 'C - Mandatory'; 'D- No Value Help(F4)'.

You can look in the CL_CRM_BSP_AM_HEADFM_1O class there are many instances where ET_FIELD_ATTRIBUTE is filled up.

Regards,

vijaya Kumar M.

Former Member
0 Kudos

Hi there,

Here is what I did. First, I create a application class. I inherited verything from the original class CL_BSP_ACC_ACCMOD. I change the Application Set's access clase to my own class. I added in my own codes.

ls_field_attr-field_name = space. " valid for all fields

ls_field_attr-field_property = 'A'. " display mode

APPEND ls_field_attr TO ls_object_attr-field_attribute.

ls_object_attr-object_key = ls_account-object_key.

APPEND ls_object_attr TO et_field_attribute.

And it can't seem to work, but when I put the codes into my own application, it works. Do I still need to add anymore stuff since I am changing the standard? Thanks.

Message was edited by: Conrad Chia

vijayakm
Advisor
Advisor
0 Kudos

Hi Conrad,

You need to use ls_field_attr-field_name = "FiledName"

(Don't use space.)

Field Name for which you want to apply the field property

Regards,

vijaya Kumar M.

Message was edited by: Vijaya Kumar

Former Member
0 Kudos

Hi Vijaya,

Do I need to refresh the et_field_attribute table? It seems to only work when I refresh the table. I also can't seem to disable the fields in the application CRMM_ACCOUNT, Address tab.

Regards,

Conrad

vijayakm
Advisor
Advisor
0 Kudos

Hi Conrad,

READ method request to the application need to populate the et_field_attribute table.

1)Evey time a read request comes , its applications need to populate this table or not.

2) Are you passing the et_field_attribute filled up in

you application classes used for CRMM_ACCOUNT ?

Its very easy to check , use break point

in CL_CRM_BSP_IL class READ method which you need to see if attributes are set or not.

Pls Check if your new application call is been used during the READ call , and are you filling up the attributes properly.

regards,

vijaya Kumar M.

Former Member
0 Kudos

Hi Vijaya,

I have already fill the table and my class is being called. Do you need to refresh the table before adding the fields in? Cos I when I never refresh the table in the search result area, the fields will not be disable. I am doing this for Detail area 1.

vijayakm
Advisor
Advisor
0 Kudos

Hi Conrad,

To your query if I interpret correctly , do you need to refresh the table in application class before filling ?

<b>Every call to READ the et_field_attribute is to be given by the application.</b> PCUI framework will not keep a state of this table. You need to explictly fill up the table every time. You check this with debug mode and see what values are present in the et_field_attribute.

Hopefully this answers you.

Further reading....

The READ method can return table ET_FIELD_ATTRIBUTE with display attributes for the fields. These attributes override the entries of the field group table. So the application can decide if fields of an object are changeable and visible at runtime. If the field names of one object are not maintained in ET_FIELD_ATTRIBUTE and the field property set to "read-only", all fields of that object will be displayed as "read-only".

Above content is from PCUI Book I assume you have PCUI Book.Please refer to section : 5.3.3.2.

regards,

Vijaya Kumar M.

Former Member
0 Kudos

Hi Guys,

The problem is solved. The thing was I had to check the method 'Read_focus_object'. The attributes should be set there. Thanks alot guys.

Regards,

Conrad Chia

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Conrad,

If I am not wrong you are looking to change field attributes and not types.

In order to change field attributes (eg: read only) for standard address, look if the 'standard addresses' has a seperate field group for itself. If yes, than using IMG make the fields 'not changeable' in that particular field group only against your custom view.

Most likely standard address should be having its own field group and this would solve your problem.

Are you look for standard addresses in Accounts/ BP Application ? Pls tell me the exact Tab where you want to change the field attributes.

Thanks

Harsh

Former Member
0 Kudos

Yeah, I want to change the attributes of the field. The standard address can be change , and I don't think it has its own field group. I am trying to prevent users from changing the standard address in both Accounts and BP application. I think in R/3, the standard can't be change right? I am trying to do that. Thanks.

Message was edited by: Conrad Chia

Former Member
0 Kudos

Hi,

While creating fieldgroups, make those perticular fields as read only. If they are already created by SAP, just go to that field group (CRMC_FIELDGRP) and change the perticular field properties and make them read only.

Hope this will clear your questions.

Murthy