cancel
Showing results for 
Search instead for 
Did you mean: 

How to move to the next step after failed event

Former Member
0 Kudos

Hi experts,

I have a requirement like in FPM GAF I need to show a pop up confirmation in the Initial screen.

Based in the pop up result Yes or No I need to go to the next step all the time.

BAsed on Yes or No some lagic will be done to display the next screen details.

How to achieve this solution? When i click on No it is going to the after failed event and from there how to pass the control to the process_event?

I have done the below coding but its not working for me.

  READ TABLE it_interface_views INTO wa_interface_views INDEX 1.

    IF sy-subrc = 0.

      CASE wa_interface_views.

        WHEN  'ZHELV_MAINREQ_WIND'.

          CASE io_event->mv_event_id.

WHEN 'FPM_LEAVE_INITIAL_SCREEN'.


              wd_this->lo_fpm = cl_fpm_factory=>get_instance( ).

              lr_event = cl_fpm_event=>create_by_id( 'FPM_LEAVE_INITIAL_SCREEN' ).

              wd_this->lo_fpm->raise_event( io_event = lr_event ).

ENDCASE.

Kindly suggest.

Thanks in advance.

Nalla B.

Accepted Solutions (0)

Answers (2)

Answers (2)

harsha_jalakam
Active Contributor
0 Kudos

HI Balu,

Please try with FPM_NEXT_STEP event.

READ TABLE it_interface_views INTO wa_interface_views INDEX 1.

    IF sy-subrc = 0.

      CASE wa_interface_views.

        WHEN  'ZHELV_MAINREQ_WIND'.

          CASE io_event->mv_event_id.

WHEN 'FPM_LEAVE_INITIAL_SCREEN'.


              wd_this->lo_fpm = cl_fpm_factory=>get_instance( ).

              lr_event = cl_fpm_event=>create_by_id( 'FPM_NEXT_STEP' ).

              wd_this->lo_fpm->raise_event( io_event = lr_event ).

ENDCASE.

Thanks ,

Harsha.

Former Member
0 Kudos

Hi Harsha,

I tried that too. its not working.

I am in EHP 7. Not sure why it didnt worked?

Thanks,

Nalla B.

harsha_jalakam
Active Contributor
0 Kudos

Hi Balu,

Are you getting any error or dump? Can you please share the total code and the scenario you are using this?

Thanks,

Harsha 

Former Member
0 Kudos

Hi Harsha,

I am not getting any dump. Earlier we were in EHP4 in which the below code worked fine and even after selecting No the control went to process event and it moved to the other screens.

Now after the upgarde this code its not working and while selecting No it remains in the same initial screen.

After selecting No from the pop Up message displaying from NEEDS_CONFIRMATIOM method

It will come to the AFTER_FAILED_EVENT event. The below code is used to move the control back to the Process_EVENT to move to the next screen.

Please give ur suggestions.

Thanks

Nalla B

DATA wa_interface_views             LIKE LINE OF it_interface_views.

  DATA lr_event                       TYPE REF TO cl_fpm_event.

  DATA: lo_event TYPE REF TO cl_fpm_event.



  IF wd_this->zg_project_elig_att = 'X'.

*****************************************************************

*  Pop screen no action rais the event.

*****************************************************************

    READ TABLE it_interface_views INTO wa_interface_views INDEX 1.

    IF sy-subrc = 0.

      CASE wa_interface_views.

        WHEN  'ZHELV_MAINREQ_WIND'.

          CASE io_event->mv_event_id.

            WHEN 'FPM_LEAVE_INITIAL_SCREEN'.

              wd_this->lo_fpm = cl_fpm_factory=>get_instance( ).

              wd_this->lo_fpm->RESUME_EVENT_PROCESSING( if_fpm_constants=>gc_event_state-failed ).

*              lr_event = cl_fpm_event=>create_by_id( 'FPM_LEAVE_INITIAL_SCREEN' ).

*              wd_this->lo_fpm->raise_event( io_event = lr_event ).



*              wd_this->zg_navigate_to_main = 'X'.

*              wd_this->zg_event_failed = 'X'.



          ENDCASE.

      ENDCASE.

    ENDIF.

Former Member
0 Kudos

Nalla,

its possible that SAP has changed the implementation of NEEDS_CONFIRMATION for action "NO". For the testing purpose can you remove the needs confirmation and popup your own WDA view.

like here mentioned http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d057e14e-0504-3010-5bb1-9b8b9cb39...

in section 4.1

Former Member
0 Kudos

Hi Senthivel,

Thanks for ur inputs.

Will try the custom pop up option and let u know in case of any difficulties.

Thanks

Nalla B.

harsha_jalakam
Active Contributor
0 Kudos

Hi Balu,

I am not sure if NO functionality could have been changed after upgrade.

Request you to check by passing   defer  TYPE into  wd_this->lo_fpm->RESUME_EVENT_PROCESSING( if_fpm_constants=>gc_event_state-defer )., incase if you want to trigger process_event method.



Regards,

Harsha

Former Member
0 Kudos

Hi Balu,

When the code has not been changed and after upgrade if its not working then i would look into the upgrade changes .  i am not saying that SAP has changed specifically NO implementation but they may have changed the behaviours of data loss handling.

My stand point is that this is not the right use case for Need_confirmation popup.

and also you should defer the event incase if you want to bring the control to get the user interaction and resume it again to go back to complete fpm event cycle.

This suggestion would fit defer ->bring your own popoup -resume. no need to fire fpm_next_step because after leaving initial screen you would automatically land in the first main step.

Former Member
0 Kudos

Hi Senthivel,

I have done as you suggested line.

I deferred the process_event

IF wd_this->zg_project_elig_att = 'X'.

    wd_this->fire_project_pop_up_evt( ).  " Trigger Custom Pop Up Confirmation event
    ev_result = 'DEFER'. " if_fpm_constants=>gc_event_result-defer.

  ENDIF.

Triggred my own pop up confirmation

In the pop up confimation yes and No event if have raised the resume_venent_processing event

DATA lo_fpm TYPE REF TO if_fpm.


lo_fpm = cl_fpm_factory=>get_instance( ).


lo_fpm->resume_event_processing( if_fpm_constants=>gc_event_result-ok ).

But the problem is even after using the defer in process event it executed all the logics below that.

And after the resume_event_processing the control didnt come back to the process_event.

Kindly seggest where it went wrong.

Thanks,

Nalla B.

jens_boeckenhauer
Active Participant
0 Kudos

Hi Balu,

I would simply implement method NEEDS_CONFIRMATION of the UIBB interface, maybe with some code like the following. No failing, no defer, no resume.

Regards

Jens

CASE io_event->mv_event_id.

WHEN 'FPM_LEAVE_INITIAL_SCREEN'.

CREATE OBJECT EO_CONFIRMATION_REQUEST

EXPORTING

IT_CONFIRMATION_TEXT = <<table with text>

IV_WINDOW_TITLE = 'my text'

IV_BUTTON_TEXT_APPROVE = 'Yes'

IV_BUTTON_TEXT_REJECT = 'No'.

ENDCASE.

Former Member
0 Kudos

NallaB,

This code would go on looping because you are raising the same event FPM_LEAVE_INITIAL_SCREEN when you are handling the event WHEN 'FPM_LEAVE_INITIAL_SCREEN'. You need to rethink your design what exactly you want to achieve here.


consider the following :


from the initial screen  ,show a webdynpro popup view for showing yes or no. handle the yes and no from your webdynpro and then continue with FPM resume event or fire FPM_LEAVE_INITIAL_SCREEN