Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT MAX query

Former Member
0 Likes
334

Hai Friends,

The following is my select query

SELECT MAX( MBLNR )

FROM ZMIGO

INTO TABLE IT_MAX.

Right now my Z table is empty. but when i debug the program it showing 1 entry and when i double the internal table there is no value and it is blank. why it is showing as 1 entry.

1 REPLY 1
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
283

Hi,

Try using:-


DATA : v_mblnr TYPE zmigo-mblnr.

SELECT MAX( DISTINCT mblnr ) FROM zmigo INTO v_mblnr.
IF sy-subrc NE 0.
  CLEAR v_mblnr.
ENDIF.

Hope this helps you.

Regards,

Tarun