Application Development and Automation 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: 
Read only

CALL FUNCTION IN NEW TASK -> REFRESH screen.

sjk1977
Explorer
0 Likes
1,693

Hello Guys,

following situation:

  • a screen (5000) with a custom control.
  • custom container (cl_gui_custom_container) is bound to the custom control
  • within the custom container is a html viewer  (cl_gui_html_viewer)
  • a function module is started 'IN NEW TASK' and checks database changes. If there is a change in database, the module ends and calls a form routine.
  • in this form routine i try to jump to the PAI with 'SET USER-COMMAND 'CHG' '

Problem -> the jump to the PAI is not working (ends in nirvana). One exception: i press on screen before data changes occurs. Then the programms calls the PAI.

Any idea why or how to solve the problem.

THX for your answers.

Some Code:

Screen 5000:

PROCESS BEFORE OUTPUT.
  MODULE STATUS_5000.
  MODULE init_control_processing_5000.

PROCESS AFTER INPUT.
  MODULE USER_COMMAND_5000.

MODULE init_control_processing_5000.

MODULE init_control_processing_5000 OUTPUT.

  IF go_cont_head IS NOT BOUND.
    "Kopfbereich
    CREATE OBJECT go_cont_head
      EXPORTING
        container_name = 'CONT_HEAD'
      EXCEPTIONS
        OTHERS         = 1.

    CREATE OBJECT go_html_head
      EXPORTING
        parent = go_cont_head.
    IF sy-subrc <> 0.

    ENDIF.

    CALL FUNCTION 'WDY_CONSTRUCT_URL'
      EXPORTING
        application         = 'ZMM_ZK_HEAD'
      IMPORTING
        out_url             = l_url
      EXCEPTIONS
        invalid_application = 1.

    g_url = l_url.

    go_html_head->show_url( g_url ).

   CALL FUNCTION 'STARTE_TASK'
      EXCEPTIONS
        communication_failure = 1
        system_failure        = 2.
   ENDIF.

  ENDIF.

ENDMODULE. 

Function module 'STARTE_TASK'

FUNCTION starte_task .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  EXCEPTIONS
*"      SYSTEM_FAILURE
*"      COMMUNICATION_FAILURE
*"----------------------------------------------------------------------
CALL FUNCTION 'ZMM_ZK_HOLE_SCANNER_DATEN'
     STARTING NEW TASK g_scanner
     DESTINATION IN GROUP 'parallel_generators'
     PERFORMING refresh ON END OF TASK
     EXPORTING
       scannername = g_scanner.

ENDFUNCTION.

MODULE USER_COMMAND_5000.

DATA: l_url_200 TYPE char200,
         ls_data TYPE zmm_zk_scan.

   CASE sy-ucomm.
     WHEN 'EXIT'.
       LEAVE PROGRAM.
     WHEN 'BACK'.
       LEAVE TO SCREEN 1000.
     WHEN 'CANC'.
       LEAVE TO SCREEN 1000.
     WHEN 'CHG'.
       READ TABLE gt_data INTO ls_data INDEX 1.

       CONCATENATE g_url
                   '&mat='
                   ls_data-mat
              INTO l_url_200.
       go_html_head->show_url( l_url_200 ).
       CALL METHOD go_html_head->do_refresh
         EXCEPTIONS
           cntl_error = 1.

       CALL FUNCTION 'STARTE_TASK'.

       CLEAR sy-ucomm.

     ENDCASE.
ENDMODULE.   

Form REFRESH

FORM refresh USING p_task TYPE clike.

  SET USER-COMMAND 'CHG'.

ENDFORM.                    "refresh

4 REPLIES 4
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,212

Hi,

Why don't you write the logic of PAI for change in FORM refresh.?. Also you can use events ( OO ABAP ) to achieve this.

Hope this helps u.,

Thanks & Regards,

Kiran.

Read only

0 Likes
1,212

Reason: same problem. It doesn´t work.

Read only

Former Member
0 Likes
1,212

Hi,

Have you already tried the cl_gui_timer class?

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,212

Try using statement suppress dialog http://help.sap.com/abapdocu_70/en/ABAPSUPPRESS.htm -

After the PBO processing, the system triggers the event PAI in such as way, as if a user had pressed Enter