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

Looping select-options

$
0
0

Hi all guys,

May i ask. Why can't i looping in select-options using comma like this

loop.jpg

when i execute error message like this

loop.jpg

this my code

<code>

REPORT ZPP_CBR NO STANDARD PAGE HEADING.

TABLES: stko, mbew, afpo.

data: BEGIN OF fpro,

       fnum(5)   TYPE i,

       fprd      TYPE afpo-aufnr,

       END OF fpro,

       ifpro LIKE TABLE OF fpro,

       BEGIN OF fqty,

       fnum1(5)   TYPE i,

       fqt       TYPE stko-bmeng,

       END OF fqty,

       ifqty LIKE TABLE OF fqty,

       BEGIN OF fhrg,

       fnum2(5)   TYPE i,

       fhr        TYPE mbew-stprs,

       END OF fhrg,

       ifhrg LIKE TABLE OF fhrg.

selection-screen begin of block gm with frame title text-abc NO INTERVALS.

 

selection-screen begin of line.

   selection-screen comment (17) for field pro modif id prn.

     select-options:pro for afpo-aufnr modif id prn.

   selection-screen end of line.

   selection-screen begin of line.

   selection-screen comment (17) for field qty modif id prn.

     select-options:qty for afpo-aufnr modif id prn.

   selection-screen end of line.

selection-screen begin of line.

   selection-screen comment (17) for field hrg modif id prn.

     select-options:hrg for afpo-aufnr modif id prn.

   selection-screen end of line.

 

selection-screen end of block gm.

 

START-OF-SELECTION.

 

LOOP AT pro.

   fpro-fnum = sy-tabix.

   fpro-fprd = pro+3.

 

   append fpro to ifpro.

ENDLOOP.

 

LOOP AT qty.

   fqty-fnum1 = sy-tabix.

   fqty-fqt   = qty+3.

 

   append fqty to ifqty.

ENDLOOP.

 

LOOP AT hrg.

   fhrg-fnum2 = sy-tabix.

   fhrg-fhr = hrg+3.

 

   append fhrg to ifhrg.

ENDLOOP.

 

LOOP AT ifpro INTO fpro.

   READ TABLE ifqty INTO fqty WITH KEY fnum1 = sy-tabix.

   READ TABLE ifhrg INTO fhrg WITH KEY fnum2 = sy-tabix.

   sum = fqty-fqt * fhrg-fhr.

 

  WRITE:/ fpro-fprd, fqty-fqt, fhrg-fhr, sum.

 

ENDLOOP.

</code>

Thanks guys


Viewing all articles
Browse latest Browse all 8644

Trending Articles



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