Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Is this a good method?

   Hello, i just started learning ABAP and i made this programm in which i have an internal table, a working area and a parameter.

   I want to display the carrid,connid,cityfrom  from the spfli where the cityto is a user input.

   What do you think? Is it OK, or is it a better way of achieving the same result.?Thanks very much.

   

REPORT  ZTABLE7.

"Declaring a structure.


     types: BEGIN OF ZPFLI_STRUCTURE,

                 carrid type  spfli-carrid,

                 connid type spfli-connid,

                 cityfrom type spfli-cityfrom,

                 acityto  type spfli-cityto.

     types  end of ZPFLI_STRUCTURE.

"declaring an internal table, work area and a parameter.

data:       local_table type table of ZPFLI_STRUCTURE,

                wa_lt type ZPFLI_STRUCTURE.

                parameters: acityto  type ZPFLI_STRUCTURE-ACITYTO.

"'''''''''''''''''''''''''''''''''''''''''''''''''

" Selecting the columns needed with a condition, looping through the internal table into the work area


            SELECT carrid connid cityfrom

            into table local_table  from spfli where CITYTO = ACITYTO.

             LOOP AT local_table INTO WA_LT.

             NEW-LINE.

             WRITE:             WA_LT-carrid,

                                       WA_LT-connid,

                                       WA_LT-cityfrom.

ENDLOOP.

Former Member
Not what you were looking for? View more on this topic or Ask a question