Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

Is this a good method?

$
0
0

   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.


Viewing all articles
Browse latest Browse all 9052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>