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

Re: Dynamic programming with field-symbol and select-option

$
0
0

My final code is:

 

 

FORM f_verifica_periodo USING num_bloco   TYPE c

                               nome_campo  TYPE fieldname.

 

   DATA: codlocal  TYPE string,

         codaneel  TYPE string,

         l_char    TYPE c LENGTH 72.

 

   CONCATENATE: 'S_CODLO'  num_bloco INTO codlocal,

                'S_ANEEL'  num_bloco INTO codaneel,

                nome_campo num_bloco INTO nome_campo.

 

   FIELD-SYMBOLS: <fs_range>      TYPE ANY TABLE,

                  <fs_line>       TYPE any,

                  <fs_comp_low>   TYPE any,

                  <fs_comp_high>  TYPE any.

 

   CONCATENATE '(' sy-repid ')' nome_campo '[]'

               INTO l_char.

 

   ASSIGN (l_char) TO <fs_range>.

 

   LOOP AT <fs_range> ASSIGNING <fs_line>.

 

     " Recupera valor dinamicamente do campo LOW - Coluna 3

     ASSIGN COMPONENT 3 OF STRUCTURE <fs_line> TO <fs_comp_low>.

     CHECK sy-subrc EQ 0.

 

     " Recupera valor dinamicamente do campo HIGH - Coluna 4

     ASSIGN COMPONENT 4 OF STRUCTURE <fs_line> TO <fs_comp_high>.

     CHECK sy-subrc EQ 0.


Viewing all articles
Browse latest Browse all 9236

Trending Articles



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