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

Leave Transaction ECC 6 error

Former Member
0 Likes
885

This piece of code was used to refresh alv data automatically for every 3 minutes and it worked perfectly in sap 4.7

But in SAP 6 I am getting runtime error :RPERF_ILLEGAL_STATEMENT

Statement LEAVE TO TRANSACTION is not allowed in this form

---------------------------------------------------------
FORM f_call_rfc_wait .

  DATA lv_mssg(80).                                         "#EC NEEDED

  CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '0O1'
    PERFORMING f_task_end ON END OF TASK
    EXPORTING
      seconds               = 180        " Refresh time
      busy_waiting          = space
    EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.
ENDFORM.                    " f_call_rfc_wait
FORM f_task_end USING taskname.

  DATA lv_mssg(80).                                         "#EC NEEDED

  RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'
     EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.

  CHECK sy-subrc EQ 0.

  SET USER-COMMAND '&NTE'.             "Refresh
 LEAVE TO CURRENT TRANSACTION AND SKIP FIRST SCREEN.

ENDFORM.                    " f_task_end

*&--------------------------------------------------------------------*
*&      Form  user_command1
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->UCOMM      text
*      -->SELFIELD   text
*      for detailed list and automatic refreshing
*---------------------------------------------------------------------*
FORM area_prod_alv.

  TYPE-POOLS: slis.
  DATA t_fieldalv  TYPE slis_t_fieldcat_alv.
  DATA: ls_slis_fieldcat  TYPE slis_fieldcat_alv.
  PERFORM f_call_rfc_wait.
  PERFORM initial_alv_fieldcat CHANGING t_fieldalv[].
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_bypassing_buffer      = 'X'
      i_buffer_active         = ' '
      i_callback_program      = 'ZMPQ203_SHOP_HONEW'
      i_callback_pf_status_set = 'PF_STATUS'
      i_callback_user_command = 'USER_COMMAND1'
      it_fieldcat             = t_fieldalv[]
      i_save                  = 'X'
      it_events               = gt_event[]
      is_layout               = lo_layout
    TABLES
      t_outtab                = itab3
    EXCEPTIONS
      program_error           = 1
      OTHERS                  = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

ENDFORM.                    " area_prod_alv
--------------------------

instead of LEAVE TO CURRENT TRANSACTION AND SKIP FIRST SCREEN.

i have also tried LEAVE to TRANSACTION TRASACTION_NAME AND SKIP FIRST SCREEN.

& also CALL TRANSACTION TRASACTION_NAME AND SKIP FIRST SCREEN.

but i got same error

1 ACCEPTED SOLUTION
Read only

arseni_gallardo
Active Participant
0 Likes
844

I suggest you to use another approach for the autorefresh: use class CL_GUI_TIMER instead of the RFC_PING_AND_WAIT function module. There is an example report (I don't remember its name but it is in the the same package of the class) and there are a few posts in the SDN.

http://wiki.sdn.sap.com/wiki/display/Snippets/AutomaticDataRefreshonModulepoolScreen

6 REPLIES 6
Read only

Former Member
0 Likes
844

are u passing a parameter id

Read only

Former Member
0 Likes
844

are u passing a parameter id

Read only

0 Likes
844

parameter id is not passed

this is used in a report program

Read only

arseni_gallardo
Active Participant
0 Likes
845

I suggest you to use another approach for the autorefresh: use class CL_GUI_TIMER instead of the RFC_PING_AND_WAIT function module. There is an example report (I don't remember its name but it is in the the same package of the class) and there are a few posts in the SDN.

http://wiki.sdn.sap.com/wiki/display/Snippets/AutomaticDataRefreshonModulepoolScreen

Read only

Former Member
0 Likes
844

Try it may work.

Set Screen (next Screen Number).

Leave screen.

Read only

Former Member
0 Likes
844

Hi

try with below methods and FM in your object

*call screen 0.

LEAVE TO CURRENT TRANSACTION AND SKIP FIRST SCREEN.

  • Usually this command is enough to call PAI/PBO by force

CALL METHOD CL_GUI_CFW=>SET_NEW_OK_CODE

EXPORTING

NEW_CODE = 'DUMMY'.

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

EXPORTING

FUNCTIONCODE = '/00'

EXCEPTIONS

FUNCTION_NOT_SUPPORTED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • Implement suitable error handling here

ENDIF.

CALL METHOD CL_GUI_CFW=>FLUSH

might be your issue will solve the above solution.

Thanks and Regards,

Syfulla