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

Re: how to apply cursor to achieve this:

$
0
0
DATA: mybelnr TYPE bseg-belnr,      mygjahr TYPE bseg-gjahr,      mycount TYPE i.

SELECT SINGLE belnr gjahr COUNT( * ) AS cnt "using single to get only one row, and the alias to make easier the HAVING clause
  INTO (mybelnr, mygjahr, mycount)  FROM bseg  WHERE ktosl = 'WRX'  GROUP BY belnr gjahr  HAVING cnt > 1.

IF sy-subrc <> 0.   "whatever
ENDIF.

 

It should do the work...


Viewing all articles
Browse latest Browse all 11212

Trending Articles