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: 

Getting dump error while saving my ALV program into ztable.

mohit_mantoo
Explorer
1,565

Runtime Errors PERFORM_NOT_FOUND
Except. CX_SY_DYN_CALL_ILLEGAL_FORM

Short text
Call (PERFORM) to a non-existent routine.

Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_FORM', was
not caught in
procedure "USER_COMMAND" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The program "SAPLSLVC_FULLSCREEN" is meant to execute an external PERFORM,
namely the routine "USER_COMMAND " of the program "ZSD_REPORT12 ", but
this routine does not exist.

This may be due to any of the following reasons:

1. One of the programs "SAPLSLVC_FULLSCREEN" or "ZSD_REPORT12 " is currently
being developed.
The name "USER_COMMAND " of the called routine may be incorrect, or
the routine "USER_COMMAND " is not yet implemented in the program "ZSD_REPORT12
".
-

2. If the program SAPMSSY1 is involved in the runtime error, one of
the function modules called via RFC is not flagged as remote-capable.
(see Transaction SE37 Goto -> Administration -> RFC flag)

3. There is an inconsistency in the system. The versions of the
programs "SAPLSLVC_FULLSCREEN" and "ZSD_REPORT12 " do not match.

Missing RAISING Clause in Interface
Program SAPLSLVC_FULLSC
Include LSLVC_FULLSCREE
Row 1,122
Module type (FORM)
Module Name USER_COMMAND

-----------------------------------------------------------------PROGRAM------------------------------------------------------------------------------


*& Include ZSD_DELIVERY_DATA
*&---------------------------------------------------------------------*
TYPE-POOLS SLIS.
TABLES: VBAK, VBUK, ZVBAK, VBAP, KNA1.

TYPES: BEGIN OF TY_VBAK,
VBELN TYPE VBELN,
KUNNR TYPE KUNNR,
END OF TY_VBAK.

TYPES: BEGIN OF TY_VBUK,
CMGST TYPE CMGST,
END OF TY_VBUK.

TYPES: BEGIN OF TY_VBAP,
vbeln type vbeln,
WERKS TYPE WERKS,
END OF TY_VBAP.

TYPES: BEGIN OF TY_KNA1,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1_GP,
END OF TY_KNA1.

DATA: BEGIN OF TY_FINAL OCCURS 0,
TEXT1 TYPE CHAR30,
VBELN TYPE VBAK-VBELN,
KUNNR TYPE VBAK-KUNNR,
CMGST TYPE VBUK-CMGST,
WERKS TYPE VBAP-WERKS,
NAME1 TYPE KNA1-NAME1,
END OF TY_FINAL.


DATA: BEGIN OF TY_ZVBAK OCCURS 0,
VBELN TYPE ZVBAK-VBELN,
KUNNR TYPE ZVBAK-KUNNR,
CMGST TYPE ZVBAK-CMGST,
WERKS TYPE ZVBAK-WERKS,
NAME1 TYPE ZVBAK-NAME1,
END OF TY_ZVBAK,

WA_ZVBAK LIKE LINE OF TY_ZVBAK.


DATA: IT_VBAK TYPE STANDARD TABLE OF TY_VBAK,
WA_VBAK TYPE TY_VBAK,
IT_VBUK TYPE STANDARD TABLE OF TY_VBUK,
WA_VBUK TYPE TY_VBUK,
IT_VBAP TYPE STANDARD TABLE OF TY_VBAP,
WA_VBAP TYPE TY_VBAP,
IT_KNA1 TYPE STANDARD TABLE OF TY_KNA1,
WA_KNA1 TYPE TY_KNA1,
IT_FINAL LIKE TY_FINAL OCCURS 0,
WA_FINAL LIKE TY_FINAL.


DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S52 { color: #0000FF; } *&---------------------------------------------------------------------*
*& Include ZSD_DELIVERY_STATEMENT
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: P_VBELN FOR VBAK-VBELN.
SELECT-OPTIONS: P_WERKS FOR VBAP-WERKS.
SELECT-OPTIONS: P_KUNNR FOR VBAK-KUNNR.

SELECTION-SCREEN END OF BLOCK B1.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S52 { color: #0000FF; } *&---------------------------------------------------------------------*
*& Include ZSD_DELIVERY_DATA_NEW
*&---------------------------------------------------------------------*
FORM GET_DATA.

SELECT VBELN " SALES ORDER
KUNNR "SOLD TO PARTY
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN IN P_VBELN AND
KUNNR IN P_KUNNR.


SELECT VBELN " SALES ORDER
WERKS "PLANT
FROM VBAP
INTO TABLE IT_VBAP
WHERE WERKS IN P_WERKS.

SELECT KUNNR " CUSTOMER NUMBER
NAME1 "PARTY NAME
FROM KNA1 INTO TABLE IT_KNA1.

ENDFORM.

FORM FINAL_DATA.
*LOOP.
IF IT_VBAK IS NOT INITIAL.

LOOP AT IT_VBAK INTO WA_VBAK.

READ TABLE IT_VBAK INTO WA_VBAK WITH KEY VBELN = WA_VBAP-VBELN.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBAK-KUNNR.
READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBAK-VBELN.
WA_FINAL-VBELN = WA_VBAK-VBELN.
WA_FINAL-KUNNR = WA_VBAK-KUNNR.
WA_FINAL-CMGST = WA_VBUK-CMGST.
WA_FINAL-WERKS = WA_VBAP-WERKS.
WA_FINAL-NAME1 = WA_KNA1-NAME1.
APPEND WA_FINAL TO IT_FINAL.
CLEAR: WA_FINAL, WA_VBAK, WA_KNA1, WA_VBAP.

*FOR INSERT DATA INTO ZVBAK FROM VBAK*

LOOP AT IT_FINAL INTO WA_FINAL.
MOVE WA_FINAL-VBELN TO WA_ZVBAK-VBELN.
MOVE WA_FINAL-KUNNR TO WA_ZVBAK-KUNNR.
MOVE WA_FINAL-CMGST TO WA_ZVBAK-CMGST.
MOVE WA_FINAL-WERKS TO WA_ZVBAK-WERKS.
MOVE WA_FINAL-NAME1 TO WA_ZVBAK-NAME1.
INSERT ZVBAK FROM WA_FINAL.

ENDLOOP.

ENDLOOP.
ENDIF.
ENDFORM.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } START-OF-SELECTION.



PERFORM GET_DATA.
PERFORM FINAL_DATA.
PERFORM SAVE_DATA.



END-OF-SELECTION.

PERFORM FIELD_CAT.
*&---------------------------------------------------------------------*
*& Form FIELD_CAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELD_CAT .

WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-REF_TABNAME = 'IT_FINAL'.
WA_FCAT-SELTEXT_L = 'SALES ORDER'.
APPEND WA_FCAT TO IT_FCAT.

WA_FCAT-FIELDNAME = 'WERKS'.
WA_FCAT-REF_TABNAME = 'IT_FINAL'.
WA_FCAT-SELTEXT_L = 'PLANT'.
APPEND WA_FCAT TO IT_FCAT.

WA_FCAT-FIELDNAME = 'KUNNR'.
WA_FCAT-REF_TABNAME = 'IT_FINAL'.
WA_FCAT-SELTEXT_L = 'SOLD TO PARTY'.
APPEND WA_FCAT TO IT_FCAT.

WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-REF_TABNAME = 'IT_FINAL'.
WA_FCAT-SELTEXT_L = 'PARTY NAME'.
APPEND WA_FCAT TO IT_FCAT.


call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
it_fieldcat = it_fcat "PASS FIELD CATALOG TO ALV
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'(003)
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'(002)

tables
t_outtab = it_final.


ENDFORM. " FIELD_CAT

FORM SAVE_DATA.

SET PF-STATUS 'SAVE'.
CASE SY-UCOMM.
WHEN 'SAVE'(004).
INSERT ZVBAK FROM TABLE IT_FINAL.
ENDCASE.

ENDFORM.

1 ACCEPTED SOLUTION

michael_piesche
Active Contributor
921
call function 'REUSE_ALV_GRID_DISPLAY'
  exporting
    i_callback_program = sy-repid
    it_fieldcat = it_fcat "PASS FIELD CATALOG TO ALV
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'(003)
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'(002)
  tables    
t_outtab = it_final.

Your 'error' starts with the above coding of yours.

The parameter I_CALLBACK_USER_COMMAND expects a form routine for the ALV-Grid to handle a user-command by the callback-programm defined in I_CALLBACK_PROGRAM.

You have assigned the text-value 'USER_COMMAND'(002), and based on the error the localized value of that text is also 'USER_COMMAND'. (Why are you assigning a name for a form routine to a text value that can be translated? I have to assume you did not know what you were doing when you ran a SAP check and it recommended for text to be translatable, hence adding the text-symbols (002) and (003) as well.)

But you have not implemented a form routine user_command within your programm 'ZSD_REPORT12', therefore you get the error, once a user-command from the ALV is triggered. This form would have a layout like this.

FORM user_command USING iv_ucomm        TYPE salv_de_function
                        it_alv_messages TYPE bapiret2_t.
  CASE iv_ucomm.
    WHEN x.
      " do a
    WHEN y.
      " do b
    WHEN OTHERS.
  ENDCASE.

ENDFORM.

Solution:

A) If you dont need to handle user-commands from the ALV yourself, dont assign a form routine to it, it is not mandatory. Also, I assume you did also not create a PF-Status called 'PF_STATUS_SET' or the actuall text behind its text-value, so in that case, dont assign a value to it.

B) If you need to enhance the ALV with further functionality outside of ALV, please familarize yourself with the Test-Report SALV_DEMO_TABLE_EVENTS and the many other SALV_DEMO_* Reports.

6 REPLIES 6

GK817
Active Contributor
921

Hi,

It's quite clear from the run time error text is that program is trying to call a subroutine, which doesn't exist. I am sure by going through the error text, you can find which subroutine it is.

GK

FredericGirod
Active Contributor
921
FORM SAVE_DATA.
  SET PF-STATUS 'SAVE'.
  CASE SY-UCOMM.
    WHEN 'SAVE'(004).
      INSERT ZVBAK FROM TABLE IT_FINAL.
  ENDCASE.
ENDFORM.

This part of the code is really strange. You declare the PF-STATUS & try to catch the event at the same place. Take an example of the usage of this FM with event.

(next time use SALV, it is really more simple & powerfull)

michael_piesche
Active Contributor
922
call function 'REUSE_ALV_GRID_DISPLAY'
  exporting
    i_callback_program = sy-repid
    it_fieldcat = it_fcat "PASS FIELD CATALOG TO ALV
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'(003)
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'(002)
  tables    
t_outtab = it_final.

Your 'error' starts with the above coding of yours.

The parameter I_CALLBACK_USER_COMMAND expects a form routine for the ALV-Grid to handle a user-command by the callback-programm defined in I_CALLBACK_PROGRAM.

You have assigned the text-value 'USER_COMMAND'(002), and based on the error the localized value of that text is also 'USER_COMMAND'. (Why are you assigning a name for a form routine to a text value that can be translated? I have to assume you did not know what you were doing when you ran a SAP check and it recommended for text to be translatable, hence adding the text-symbols (002) and (003) as well.)

But you have not implemented a form routine user_command within your programm 'ZSD_REPORT12', therefore you get the error, once a user-command from the ALV is triggered. This form would have a layout like this.

FORM user_command USING iv_ucomm        TYPE salv_de_function
                        it_alv_messages TYPE bapiret2_t.
  CASE iv_ucomm.
    WHEN x.
      " do a
    WHEN y.
      " do b
    WHEN OTHERS.
  ENDCASE.

ENDFORM.

Solution:

A) If you dont need to handle user-commands from the ALV yourself, dont assign a form routine to it, it is not mandatory. Also, I assume you did also not create a PF-Status called 'PF_STATUS_SET' or the actuall text behind its text-value, so in that case, dont assign a value to it.

B) If you need to enhance the ALV with further functionality outside of ALV, please familarize yourself with the Test-Report SALV_DEMO_TABLE_EVENTS and the many other SALV_DEMO_* Reports.

0 Kudos
921
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'(003)
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'(002)

A text symbol means it should be translated.

Instead, use pragma ##NO_TEXT to tell the check tools that you identified the literal as not translatable:

    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET' ##NO_TEXT
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'  ##NO_TEXT

921

Issue Resolved.

Thanks, you are expert Michael Sir.

0 Kudos
921

Mohit Mantoo, please follow up on your open question.

  • comment answers or your question if there are still open issues.
  • otherwise mark an answer as accepted if it helped you solve your problem
  • or post an answer of yourself and accept it if you found another useful solution yourself
  • or redirect your question to another question that is related and was useful to solve your problem
  • in the end, close your question