cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a popup (confirmation popup with Yes/No/Cancel) in Freight Order screen in TM

Former Member
0 Kudos

Hi,

I have a requirement to open a popup in the Freight Order general tab on click of save according to the

status of the Freight Order.

I have tried the method 'adapt_needs_confirmation' of the view exit class /SCMTMS/CL_UI_VIEWEXIT_TOR of the

Freight Order by creating a post exit in it but this method does not get triggered on Save.

It gets triggered when we change the value of some field using F4 help or dropdown.

I think this is due to the Return statement in standard code of this method.

Please give your valuable inputs regarding this issue.

Accepted Solutions (0)

Answers (2)

Answers (2)

Dragoș
Employee
Employee

Hi,

generally, every FPM event runs into the phase "Needs Confirmation" and the method ADAPT_NEEDS_CONFIRMATION is the one that needs to be enhanced, by creating an overwrote exit (so that the return inside it is not executed). Of course, you'd need to check whether the Event ID is the one intended.

SAP TM uses the Floorplan Manager - BOPF Integration (FBI) as feeder engine. With it, another way to enforce a confirmation dialog for a specific event is to customize the FBI view, adding a OTR text alias in the "confirmation" field of the corresponding event ID (under the tag "Actions"). This way, there is no need for coding.

The event for Save (FPM_SAVE) is not known by the FBI view that handles the toolbar events, and therefore FBI does not call ADAPT_NEEDS_CONFIRMATION for it.

So the solution is to enhance (customize) the FBI view /SCMTMS/FRE_ORDER_HTLB (using the WD application CUSTOMIZE_COMPNENT) and add a new entry in the list of Actions, with Action ID = FPM_SAVE and Confirmation = an alias of a suitable OTR text (created with tcode SOTR_EDIT).

Regards,

Dragos

PS: Generally, you can find out the FBI view responsible for the toolbar buttons of a certain applicatrion by adding the suffix "_HTLB" to the WD application configuration name. E.g.:

- freight order > appl. configuration  /SCMTMS/FRE_ORDER > /SCMTMS/FRE_ORDER_HTLB

- air booking > appl. config. /SCMTMS/FRE_BOOK_CBAIR > /SCMTMS/FRE_BOOK_CBAIR_HTLB

bharath_k6
Active Participant
0 Kudos

Dear Prabhav,

You can write code in class - /SCMTMS/CL_UI_CONTROLLER_CMN and method - OVERRIDE_EVENT_OVP. Probably you can create implicit enhancement at the beginning/end of the method depending on your requirement and then code accordingly.

You can also find sample code in same class and method.

For your reference, you can use below classes and methods to display confirmation popup.

Class - /SCMTMS/CL_HELPER_UI method - GENERATE_DIALOG_SIMPLE

Class - /SCMTMS/CL_UI_DISPSETT method - ATTACH_BUTTON_TO_OVP

On the other hand, you can also do the where used list for FPM event - FPM_OPEN_DIALOG.

Go to Class - CL_FPM_EVENT and attributes section. Here you will find all the standard FPM events declared as constants.

Please let me know if you have any challenges.

Thanks,

Bharath.K

Former Member
0 Kudos

Hi Bharath,

Thanks for the information.

I did check the classes you mentioned but I am unable to identify the

config id which we have to pass for a simple confirmation popup.

Do we have to create a custom configuration for it.

bharath_k6
Active Participant
0 Kudos

Dear Prabhav,

First did you try putting a breakpoint in the method - OVERRIDE_EVENT_OVP.

May be you can write below code in that.

-------------------------------

IO_OVP is importing parameter in the above method. So you can use the same.

      /scmtms/cl_helper_ui=>generate_dialog_simple(

           io_ovp  = io_ovp

           io_comp = me ).

--------------------------------

or

-------------------------------

lo_event->mv_event_id EQ cl_fpm_event=>gc_event_open_dialog_box.


  lv_area_id = get_target_page( io_event = lo_event ).

   /scmtms/cl_ui_dispsett=>attach_button_to_ovp( lv_area_id ).

-------------------------------

Thanks,

Bharath.K

Former Member
0 Kudos

Yes I did try this.

The method OVERRIDE_EVENT_OVP gets trigerred on save  of FO.

But the problem is that the event is not set to 'FPM_OPEN_DIALOG'

and since we dont have the config id, the method generate_dialog_simple

of the helper class gives error.