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: 

Its giving error it_sf is not an internal table

Former Member
0 Kudos

hii experts,

can anyone pls helpme out in this .




TABLES SFLIGHT.


SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
   PARAMETERS P_CARRID TYPE SFLIGHT-CARRID DEFAULT  'AA'.
   SELECTION-SCREEN END OF BLOCK B1.

   AT SELECTION-SCREEN ON P_CARRID.
     IF P_CARRID IS NOT INITIAL.
       SELECT * FROM SFLIGHT
         where CARRID = P_CARRID.
         ENDSELECT.
         IF SY-SUBRC <> 0.
           MESSAGE E001(Z_IM).
           ENDIF.
           ENDIF.



   TYPES : BEGIN OF TY_SFLIGHT,
            CARRID TYPE SFLIGHT-CARRID,
            CONNID TYPE SFLIGHT-CONNID,
             FLDATE TYPE SFLIGHT-FLDATE,
            PAYMENTSUM TYPE SFLIGHT-PAYMENTSUM,
           END OF TY_SFLIGHT.

           DATA : IT_SF TYPE  TABLE OF TY_SFLIGHT,
                  wa_sf like line of it_sf.

                  start-of-selection.

                  select * into CORRESPONDING FIELDS OF TABLE IT_SF
                    FROM SFLIGHT
                    where carrid eq p_carrid.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You have placed IT_SF declaration inside event AT SELECTION SCREEN and hence compiler is not recognizing it. Move it at top below TABLES declaration and you will not face this issue.

TABLES: SFLIGHT.

TYPE: BEGIN OF TY_SFLIGHT<

           END OF TY_SFLIGHT.

DATA: IT_SF TYPE TABLE OF TY_SFLIGHT.

and then start writing your logic.

Regards,

Manish

1 REPLY 1

Former Member
0 Kudos

You have placed IT_SF declaration inside event AT SELECTION SCREEN and hence compiler is not recognizing it. Move it at top below TABLES declaration and you will not face this issue.

TABLES: SFLIGHT.

TYPE: BEGIN OF TY_SFLIGHT<

           END OF TY_SFLIGHT.

DATA: IT_SF TYPE TABLE OF TY_SFLIGHT.

and then start writing your logic.

Regards,

Manish