Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

"dynamic" variable

$
0
0

Dear experts,

 

I have an cust. table where once per week from 1 to 3 different values will be written.

 

Currently I have 3 variables for each table field and I do following:

 

SELECT *

   FROM zdyu_vstel

      INTO CORRESPONDING FIELDS OF TABLE ta_dyu_vstel.

 

LOOP AT ta_dyu_vstel

    INTO wa_dyu_vstel.

   IF sy-tabix = 1.

     v_vstel_1 = wa_dyu_vstel-vstel.

   ENDIF.

   IF sy-tabix = 2.

     v_vstel_2 = wa_dyu_vstel-vstel.

   ENDIF.

   IF sy-tabix = 2.

     v_vstel_3 = wa_dyu_vstel-vstel.

   ENDIF.

ENDLOOP.


Could you give me some advise how I can use just one variable in my program which would loop the table and in depends of the ammount of the fields buil itself containing every unique field?


Thank you in advance.


Viewing all articles
Browse latest Browse all 8332

Trending Articles