cancel
Showing results for 
Search instead for 
Did you mean: 

Custom copy event - PCUI

Former Member
0 Kudos

Hello,

I am trying to add a custom copy event apart from the standard one which would have new rules for copy control implemented by the BADI ZTR_CRM_COPY_BADI. The BADI works fine.

However, to replicate the standard copy, I use the following code in my process_event:

CASE iv_event.

WHEN 'ZTR_ALT_QUOTE'.

CALL METHOD super->if_crm_bsp_model_access_il~process_event

EXPORTING

iv_event = 'COPY'

iv_screen_structure_name = iv_screen_structure_name

iv_focus_object_key = iv_focus_object_key

iv_event_index = iv_event_index

it_selected_object_key = it_selected_object_key

it_all_object_key = it_all_object_key

IMPORTING

et_class_name = et_class_name

ev_object_key = ev_object_key

et_changed_objects = et_changed_objects

et_inserted_objects = et_inserted_objects

et_deleted_objects = et_deleted_objects.

WHEN OTHERS.

CALL METHOD super->if_crm_bsp_model_access_il~process_event

EXPORTING

iv_event = iv_event

iv_screen_structure_name = iv_screen_structure_name

iv_focus_object_key = iv_focus_object_key

iv_event_index = iv_event_index

it_selected_object_key = it_selected_object_key

it_all_object_key = it_all_object_key

IMPORTING

et_class_name = et_class_name

ev_object_key = ev_object_key

et_changed_objects = et_changed_objects

et_inserted_objects = et_inserted_objects

et_deleted_objects = et_deleted_objects.

ENDCASE.

ENDMETHOD.

This causes the new document to be created, however, on the PCUI screen, only the old doc with the old transaction number is displayed. If I try to switch to a new action, I get the popup for data loss and if I save, the message "Transaction .... has been saved" is displayed and I can find the new document in the system.

Could someone please let me know how I should trigger a screen refresh and add a new line with the new document?

The values for the export parameters from the process_event method is the same for the standard and the custom copy on debugging. Please advice.

Thanks,

Rohini.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Rohini,

Oh... can you make sure that your custom Event has the same properties (Layout or Functionality relevant) like the COPY event in the Blueprint table.

Which MAC are you using ? and is it for Opportunity Management ?

Thanks

Harsh

Former Member
0 Kudos

Hi Harsh,

As I mentioned my BADI is deactivated as I am testing. I have a new button next to my standard "Copy" which has the event ZTR_ALT_QUOTE assigned to it. In the process_event of the MAC, I am passing the standard "Copy" event for processing. The difference is in the layout.

If I click on the standard "Copy", everything works fine and a new document is created and the screen lists both docs, however, if I click on my custom button, though the document is copied, only the old screen is displayed.

I'm sorry if I'm not being too clear.

Thanks,

Rohini.

Former Member
0 Kudos

Rohini,

I had a similar problem in earlier client and we were getting old transaction number and the entire Service Order screen was getting greyed (read-only) out. On investigation we found that some code used in BADI was not updating the CRM Order ADM buffers correctly and hence we were getting previous document. Can you please paste in your BADI code ? Also just in case - can you try to use standard COPY event and see if you get similar behaviour. As I guess you are only using Transaction Type filter in the BADI ?

Thanks

Harsh

Former Member
0 Kudos

Hi Harsh,

My BADI works fine but the problem is with the code above in the process_event. As a test I'm just trying to replicate the standard "Copy" functionality with my new event and have deactivated the BADI for the moment.

I assumed with the code above I could copy the opportunity but the layout is not updated.

As you mentioned it could be due to some data in the memory. Please advice.

Thanks,

Rohini.

Former Member
0 Kudos

Rohini,

Please re-check the code in the CRM copy control BADI. Sometimes it does not clears the ABAP memory and hence you get to see old document number though a new document is already created. Please check the code related to ABAP memory, as the same BADI work fine for Win GUI. Let me know if this helps or please paste in your BADI code.

Hope your OBN issue was resolved ?

Thanks

Harsh