cancel
Showing results for 
Search instead for 
Did you mean: 

Confirmation window on standard FPM application button

Former Member
0 Kudos

I have read many discussions on how to create a confirmation pop up box for webdynpro application. I am trying to create a pop up box ( YES or NO) when a user hits SEND button in a standard SAP application

HRESS_A_W2_REPRINT

Is there a way to achieve this via enhancement? Appreciate any inputs on this.

Thanks,

Anjali

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Anjali,

Please check if you can embed these pop up windows in your application, by making changes in the process event of the feeder class,

Regards,

Harsha

Former Member
0 Kudos

Thanks for the link Harsha,

I am quite stuck with this. I checked the link you provided but it appears the scenario is a lot different from what is listed there.

What I have done so far is to create a custom view and a window. I have two buttons in the view (Yes or No). Now if you look at the FPM application HRESS_A_W2_REPRINT, the button SEND is called via PROCESS_EVENT (event ID: FPM_SEND) . So, I tried to create an implicit enhancement here to see if I can call that window and the view. To start with I put a break point here but it is not stopping in the enhancement option (sorry I am very very new to this). When I put the break point in the PROCESS_EVENT method itself, it is calling IF_FPM_UI_BUILDING_BLOCK->Process Event and preparing the message.

I am trying to intercept this and instead of the system generated message (T100), display my window/view and have the user click YES or NO via this. Based on the return parameter, I will have to call the correct event.

Appreciate any inputs on this.

Thanks,

Anjali

harsha_jalakam
Active Contributor
0 Kudos

Hi Anjali,

I was referring to the first part(standard approach) in the blog in the link I have shown and sorry if I had confused.

And I dont think there is a need to create a sperate view, for this. Any Component implementing IF_FPM_UI_BUILDING_BLOCK interface will have a method called needs_confirmation, wherein you can configure to provide a pop up window, with your custom text that needs to be defined in the pop up view.

I suggest you check the component to which FPM is configured to and check for the method NEEDS_CONFIRMATION and in there, you can use following snippet to generate a pop up window, with your customised text.

DATA lv_interface_view TYPE string.

data lo_test type ref to CL_FPM_CONFIRMATION_REQUEST.

data : lt_popup_text TYPE STRING_TABLE,

          ls_popup_text TYPE STRING.

  ls_popup_text = 'Are you sure?'.

       APPEND ls_popup_text to lt_popup_text.

create object lo_test

  EXPORTING

           it_confirmation_text = lt_popup_text.

         CASE io_event->mv_event_id.

               WHEN if_fpm_constants=>gc_event-next_step. //in your it would be FPM_SEND

                                                       eo_confirmation_request  = lo_test.

         ENDCASE.

Check the class CL_FPM_CONFIRMATION_REQUEST in case if you want to customize much more.

Regards,

Harsha

Former Member
0 Kudos

It was very helpful info, Harsha.

I checked the feeder class and the component controller methods but I do not see these implementing IF_FPM_UI_BUILDING_BLOCK directly. I am attaching the screens from my debugging session below.


Feeder Class- methods implemented.


The only way I could intercept the SEND (event it: FPM_SEND) is by putting the break point in the PROCESS_EVENT in the feeder class below. Right after PROCESS_EVENT, it is calling the method DISPATCH_PROCESS_EVENT

In the class CL_FPM_FORM_UIBB_ASSIST above, I do see the method DISPATCH_NEEDS_CONFIRMATION. Should I be calling this method instead of the DISPATCH_PROCESS_EVENT?


Thanks,

Anjali

former_member197475
Active Contributor
0 Kudos

Hi Anjali,

Hope you are checking in the feeder class. Your GUIBB interface wont have the method NEEDS_CONFIRMATION.

It will be available only in your component controller where this will have been implemented in the Implemented interface tab of your respective component.

Sorry could not check it up from my side as I don't have the respected package installed in my system.

BR,

RAM.

Former Member
0 Kudos

Hi Ram, yes I am checking feeder class-  please see the screen prints above.

harsha_jalakam
Active Contributor
0 Kudos

Hi Anjali,

Please check this component HRESS_C_W2REPRINT_CONFIG, which I found in the package. Try keeping the debugger in the component controller in WDDOINT / OVERRIDE_EVENT_OVP and start the application. If the debugger is executed at these methods , implement the IF_FPM_UI_BUILDING_BLOCK interface in this component and activate and try implementing the code in the NEEDS_CONFIRMATION method as above. If everything is fine, it should work.

Regards,

Harsha

Former Member
0 Kudos

Harsha, big thanks for coming back to this thread and trying to help.

I tried to put break point in both WDDOINT & OVERRID_EVENT_OVP but it doesn't seem to stop there.

I am finding success in the IF_FPM_GUIBB_FORM~PROCESS_EVENT via feeder class. I was able to apply the code you provided above. It did stop at the break point to process my enhancement point but the text did not pop up. I am sure I must be missing something here. Here is the code below and now getting an error that it does not recognize wd_this. Could you please check?

data : lo_event type ref to cl_fpm_event,

          lo_fpm   type ref to if_fpm.

data lo_confirmation_request type ref to cl_fpm_confirmation_request.

data : lt_popup_text type string_table,

        ls_popup_text type string.

        ls_popup_text = 'Are you sure?'.

        append ls_popup_text to lt_popup_text.

   case io_event->mv_event_id.

     when 'FPM_SEND'.

       eo_confirmation_request = wd_this->check_before_data_loss( ).

*Create a instance passing the string table which contains the texts to be displayed on the popup

       create object lo_confirmation_request

           exporting

            it_confirmation_text = lt_popup_text.

             eo_confirmation_request = lo_confirmation_request.

  endcase.



Also I tried with eo_confirmation_request parameter and the code has no syntax error. It does process through the code but then goes directly to process the DISPATCH_PROCESS_EVENT (class CL_FPM_FORM_UIBB_ASSIST).


Thanks,

Anjali.

harsha_jalakam
Active Contributor
0 Kudos

Hi Anjali,

Please implement IF_FPM_GUIBB_FORM_EXT interface in your Feeder class. This implementation would inherit the method NEEDS_CONFIRMATION. Please implement the code over here for the event FPM_SEND.

Hope this has to work.

Regards,

Harsha

harsha_jalakam
Active Contributor
0 Kudos

Hi Anjali,

I did try this now in one of my feeder class, it is working fine. Please add the interface IF_FPM_GUIBB_FORM_EXT and then implement all the inherited 3 methods by activating them individually. And then in the method IF_FPM_GUIBB_FORM_EXT~NEEDS_CONFIRMATION, implement the code as shown below.


And to confirm again, there is no need to create any view or any.

Regards,

Harsha

Former Member
0 Kudos

Harsha, I tried putting the code in many places as an enhancement and the code is getting processed. However, the pop up box is not generating. This may be due to the message area design in the application itself, I suppose.

Let me show you how the original message appears - please see screen print below.

The feeder class uses the following method(s) to display messages here

if_fpm_message_manager->report_t100_message

if_fpm_message_manager->report_bapiret2_message

I could not show the message as a pop here. I put the code you shared- I got the syntax error that it could not recognize EO_CONFIRMATION_REQUEST (please note I have the IF..EXT already implemented and active in my feeder class as you suggested above). So, I had to declare it two times like shown below:

data :           eo_confirmation_request type ref to cl_fpm_confirmation_request,

                    lo_confirmation_request type ref to cl_fpm_confirmation_request,

  

The result for this code is:

                  

Appreciate any ideas on getting this message here as a pop up.

Thanks for your help,

Anjali.

Former Member
0 Kudos

Harsha, big thanks to you. This resolved my issue.

Again, many many thanks for helping out and not giving up on this. You are the best! Full points awarded.

Sincerely,

Anjali.

Answers (0)