Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Confirming warning message in ALV by pushing Enter

marco_weienseel
Explorer
0 Kudos

Hello Experts,


i have a Tab-Strip and inside of it a subscreen with an ALV.

The user marks one line of the ALV and than psuhes a function in the custom menu button.


The event USER_COMMAND is handled by an action handler, the action handler triggers PAI.

METHOD.

CASE e_ucomm.

     WHEN 'FUNCTION'.

          CALL METHOD cl_gui_cfw=>set_new_ok_code( new_code = 'FUNCTION' ).

   ENDCASE.

ENDMETHOD.

The user-command 'FUNCTION' is handled by the PAI of the dynpro.

FORM user_command

     gv_okcode = ok_code.
     CLEAR ok_code.

     CASE gv_okcode.

       WHEN 'FUNCTION'.

          CALL FUNCTION 'SOMETHING_SAP_STANDARD'.

          ..

     ENDCASE.

ENDFORM.

Now a SAP-Function-Module is called which can trigger WARNING Messages and here lies the problem.

Usually warnings are comfirmed by pushing ENTER and that is not working.

I can hit enter as much as i want to, but the warning does not disappear and the Function Module does not continue.

If i push the green ENTER icon left of the command field it is working as it should.

If i click somewhere else on the Dynpro it is working too, but not while my cursor is somewhere inside the ALV.

Seems the ALV is not procesing the ENTER button.

So i tried the ALV method 'register_edit_event' with parameters mc_evt_enter and mc_evt_modified and set handlers for on_data_changed and 

on_data_changed_finished. Result is that the WARNING disappears, but the Function Module does not continue. The handlers for data_changed are not event triggered. When i make one or more ALV fields editable the data_changed handler is triggered but it does only work if i hit ENTER twice.

And i can't allow the ALV to be editable, so that's no solution after all.

I tried 2 days already and dont know that to do anymore.

Thx for any help.

5 REPLIES 5

hendrik_brandes
Contributor
0 Kudos

Hello Marco,

have you tried to raise the <ENTER> event within your ALV-eventhandling?

cl_gui_cfw=>set_new_ok_code( new_code = 'ENTER' ).

or try to flush the event-queue between the ALV and SAP GUI.

cl_gui_cfw=>flush( ).

Kind regards,

Hendrik

0 Kudos

Hello thanks for your answer,

i've just put a flush everywhere i could think of, but didn't help.

The problem with your second suggestion is, that when i push enter while the warning is displayed none of my handler methods is triggered, so i cant set a new ok_code.

The only time the Event 'ON_DATA_CHANGED_FINISHED' is triggered is when i set at least one ALV field to edit mode, but even than it only works when i hit ENTER twice.

Even if it would work that way, i cant do that, because i cant allow the user to change the ALV, the data is display only.

0 Kudos

Hello Marco,

ok. Sad.

What about this:

CALL FUNCTION 'YOUR_FUNCTION'

   DESTINATION 'NONE'

   PARAMETERS...

I have testet this and no warnings occured. Only in the backlog. Not really beautiful, but perhaps, this solves your problems.

Kind regards,

Hendrik

0 Kudos

Hello Hendrik,

i've added Destination 'none' to the calling of my function module, result was a dump.

The problem seems to be that the parameter i_editor is a reference and thats not allowed with RFC.

  CALL FUNCTION 'MRM_PARKED_INVOICE_POST' DESTINATION 'NONE'
    EXPORTING
      i_rbkpv     = i_rbkpv
      ti_drseg    = ti_drseg
      i_editor     = i_editor
    IMPORTING
      e_mrm_zlspr = f_mrm_zlspr

    EXCEPTIONS
*      error_message    = 1
      OTHERS             = 2.

Was it you plan to supress the warnings? Because thats not the goal, the user needs to see those warnings and react on them, decide if he wants to post the invoice, ignoring the warning or cancel.

0 Kudos

Hello Marco,

yes, that was my idea. When your FM is a remote-FM, you can perform this and get only the error msg back.

I am not so deep into this area, but what if you try to use BAPI_INCOMINGINVOICE_POST? This BAPI also post your parked invoice and returns a clear message-table.

Kind regards,

Hendrik