2

This is the Open Sales Order Report im working on. im trying to read data from table VBUK and the VBELN field im trying to get the data from table 'VAPMA' where the error occurred. I get the following error after the second select statement.

object of class re and language en does not exist

Program:

*&---------------------------------------------------------------------*
*& Report  ZRSD_DISPLAY_OPEN_SALESORDERS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZRSD_DISPLAY_OPEN_SALESORDERS.

TABLES: VAPMA,LIKP.

PARAMETERS: P_VKORG TYPE VAPMA-VKORG,
            P_VTWEG TYPE VAPMA-VTWEG,
            P_SPART TYPE VAPMA-SPART.


SELECT-OPTIONS:
            S_KUNNR FOR VAPMA-KUNNR,
            S_VBELN FOR VAPMA-VBELN,
            S_MATNR FOR VAPMA-MATNR,
            S_AUART FOR VAPMA-AUART,
            S_AUDAT FOR VAPMA-AUDAT,
            S_LFDAT FOR LIKP-LFDAT.


TYPES: BEGIN OF TY_VBELN,
       VBELN TYPE VBUK-VBELN,
       END OF TY_VBELN.


DATA : IT_VBELN TYPE STANDARD TABLE OF TY_VBELN,
       IT1_VBELN TYPE STANDARD TABLE OF TY_VBELN,
       IT2_VBELN TYPE STANDARD TABLE OF TY_VBELN,
       WA_VBELN TYPE TY_VBELN.


SELECT VBELN INTO TABLE IT_VBELN FROM VBUK WHERE GBSTK NE 'C'.

IF SY-SUBRC NE 0.
  message E000(ZMSG) WITH 'SEL1'.
ENDIF.    

SELECT VBELN INTO TABLE IT1_VBELN FROM VAPMA  
  FOR ALL ENTRIES IN IT_VBELN 
  WHERE VBELN = IT_VBELN-VBELN AND
        VKORG = P_VKORG AND
        VTWEG = P_VTWEG AND
        SPART = P_SPART AND
        KUNNR IN S_KUNNR AND
        VBELN IN S_VBELN AND
        MATNR IN S_MATNR AND
        AUART IN S_AUART AND
        AUDAT IN S_AUDAT.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

SELECT VBELN INTO TABLE IT2_VBELN FROM LIKP 
  FOR ALL ENTRIES IN IT1_VBELN 
  WHERE VBELN = IT1_VBELN-VBELN AND 
        LFDAT IN S_LFDAT.

IF SY-SUBRC NE 0.
  message E000(ZMSG) WITH 'SEL3'. 
ENDIF.

LOOP AT IT2_VBELN INTO WA_VBELN.
  WRITE:/1 WA_VBELN-VBELN.
ENDLOOP.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Abap newbie
  • 173
  • 1
  • 5
  • 11

1 Answers1

4

It is very likely that the error message that you are getting is not relevant to the problem:

If SY-SUBRC <> 0 after this select statement, it means that no data was found for the criteria that you have in your SELECT. However, SAP does not fill the SY-MSG* variables when a SELECT fails. As such whatever is still in memory from the last message that was displayed will be displayed.

SELECT VBELN INTO TABLE IT1_VBELN  
  FROM VAPMA  
  FOR ALL ENTRIES IN IT_VBELN 
  WHERE VBELN = IT_VBELN-VBELN AND
  VKORG = P_VKORG AND
  VTWEG = P_VTWEG AND
  SPART = P_SPART AND
  KUNNR IN S_KUNNR AND
  VBELN IN S_VBELN AND
  MATNR IN S_MATNR AND
  AUART IN S_AUART AND
  AUDAT IN AUDAT.

IF SY-SUBRC <> 0.
 "From what you describing it sounds like you're triggering this error message
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Mirrorring what you have done on the other two selects I would think that you would want to use the following message in stead:

IF SY-SUBRC NE 0.
  message E000(ZMSG) WITH 'SEL2'. 
ENDIF.
Esti
  • 3,677
  • 8
  • 35
  • 57