cancel
Showing results for 
Search instead for 
Did you mean: 

populating the field in PCUI

Former Member
0 Kudos

Hi,

I have added a field through EEWB for Opportunities and i can see it in both SAP GUI and PCUI screens.

Now i want to populate this field only in PCUI for display.

I have figured out the model access class and the screen structure. The model access class is CL_CRM_BSP_AM_HEADFM_1O. I have made a Z_ copy of this class and linked it to the screen structures.

In this class, in READ method, i can see the values of opportunity in ET_SCREEN_STRUCTURE. Even the EEWB field exists in the structure. I want to populate this EWWB field.

Can i do it in READ method of CL_CRM_BSP_AM_HEADFM_1O?

Can anyone please send me piece of code on how to add the value to the EEWB field of this ET_SCREEN_STRUCTURE.

Thanks & Regards,

Karthik.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

What version of CRM are you using?

Former Member
0 Kudos

Hi Michael,

Am using CRM 4.0

Thanks & Regards,

Karthik.

Former Member
0 Kudos

oops, I was assuming you were on 5.0, sry.

There are differences between both versions and I've never worked with PCUI in 4.0...

Michael.

Former Member
0 Kudos

Anyways, thanks a lot michael for your replies.

Thanks & Regards,

Karthik.

Former Member
0 Kudos

Hi,

Define your Z class by making it a subclass of the standard class CL_CRM_BSP_AM_HEADFM_1O: a lot easier and the recommended way.

redefine the Read method and call the standard read method of the upper class.

below the call of the standard class, inmplement the following code:

data: lt_screen_structure type standard table of CL_CRM_BSP_AM_HEADFM_1O.

field-symbols: <fs_struct> type CL_CRM_BSP_AM_HEADFM_1O.

  • First map from the standard structure to your own

CALL METHOD cl_bsp_bp_global_service=>table_mapping

EXPORTING

iv_structure_name_dest = 'CL_CRM_BSP_AM_HEADFM_1O'

it_table_dest = et_screen_structure

iv_structure_name_target = iv_screen_structure_name

IMPORTING

et_table_target = lt_screen_structure.

loop at lt_screen_structure assigning <fs_struct>.

  • change the fields as you whish in the field symbol

endloop.

  • Map back to the standard table

CALL METHOD cl_bsp_bp_global_service=>table_mapping

EXPORTING

iv_structure_name_dest = 'CL_CRM_BSP_AM_HEADFM_1O'

it_table_dest = lt_screen_structure

iv_structure_name_target = iv_screen_structure_name

IMPORTING

et_table_target = et_screen_structure.

Kind regards,

Michael.

Former Member
0 Kudos

Hi Michael,

Thanks for your reply, i have some idea about how to go with the implementation, i have rewarded your answer as very helpful.

I have redefined the read as per your advice.

Before adding the sample code you have mentioned, i just tried calling the super class read method.

CALL METHOD SUPER->IF_CRM_BSP_MODEL_ACCESS_IL~READ

EXPORTING

  • IV_LOCK =

IT_OBJECT_KEY = it_object_key

IV_SCREEN_STRUCTURE_NAME = iv_screen_structure_name

IMPORTING

ET_SCREEN_STRUCTURE = et_screen_structure

ET_FIELD_ATTRIBUTE = et_field_attribute

ET_CLASS_NAME = et_class_name

When i search for the transactions and select one from the result list, my browser gets locked, then it shows a data loss warning giving me the option to save.

Is it because i need to handle to IV_LOCK parameter in the subclass?

Also i have another doubt, in the sample code you have referred to CL_CRM_BSP_AM_HEADFM_1O as structure which is a class, do i need to replace it with the appropriate screen structure which has to be handled?

Thanks & Regards,

Karthik.

Former Member
0 Kudos

yeah, sry about the confusion between class and structure: it's the structure you need.

pass along all variables to the read method of the super class, including the iv_lock.

Michael.

Former Member
0 Kudos

Hi Michael,

I have implemented the following code,

method IF_CRM_BSP_MODEL_ACCESS_IL~READ .

CHECK NOT it_object_key IS INITIAL.

CHECK NOT iv_screen_structure_name IS INITIAL.

CALL METHOD SUPER->IF_CRM_BSP_MODEL_ACCESS_IL~READ

EXPORTING

IV_LOCK = iv_lock

IT_OBJECT_KEY = it_object_key

IV_SCREEN_STRUCTURE_NAME = iv_screen_structure_name

IMPORTING

ET_SCREEN_STRUCTURE = et_screen_structure

ET_FIELD_ATTRIBUTE = et_field_attribute

ET_CLASS_NAME = et_class_name

.

data: lt_screen_structure type standard table of CRMT_BSP_OPP_DISPLAY.

field-symbols: <fs_struct> type CRMT_BSP_OPP_DISPLAY.

CALL METHOD CL_BSP_BP_GLOBAL_SERVICE=>TABLE_MAPPING

EXPORTING

IV_STRUCTURE_NAME_DEST = 'CRMT_BSP_OPP_DISPLAY'

IT_TABLE_DEST = et_screen_structure

IV_STRUCTURE_NAME_TARGET = iv_screen_structure_name

IMPORTING

ET_TABLE_TARGET = lt_screen_structure

.

CALL METHOD CL_BSP_BP_GLOBAL_SERVICE=>TABLE_MAPPING

EXPORTING

IV_STRUCTURE_NAME_DEST = 'CRMT_BSP_OPP_DISPLAY'

IT_TABLE_DEST = lt_screen_structure

IV_STRUCTURE_NAME_TARGET = iv_screen_structure_name

IMPORTING

ET_TABLE_TARGET = et_screen_structure

.

endmethod.

But when i load the application in BAB, it shows me PAGE CAN NOT BE DISPLAYED.

Is it because of am using wrong structures in CL_BSP_BP_GLOBAL_SERVICE~TABLE_MAPPING method?

When i debugged the standard opportunity application, i found that the screen structure CRMT_BSP_OPP_DISPLAY is used in this MAC.

Can you please advice.

Thanks & Regards,

Karthik.