Application Development 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: 

whats wrong in the below code, code executing but output is not displaying

former_member622718
Participant
REPORT zmanoj3.

TABLES mara.

TYPES: BEGIN OF manoj,

         a TYPE mara-mandt,

         b TYPE mara-matnr,

         c TYPE mara-mtart,

         d TYPE mara-bstme,

         e TYPE mara-matkl,

       END OF manoj.

DATA: it_manoj TYPE TABLE OF manoj,
      wa_manoj TYPE manoj.


SELECT-OPTIONS smanoj FOR mara-matnr.
SELECT mandt matnr mtart bstme matkl FROM mara INTO TABLE it_manoj WHERE matnr EQ smanoj.

LOOP AT it_manoj INTO wa_manoj.
  WRITE : wa_manoj.
  WRITE: / wa_manoj-a, 20 wa_manoj-b, 30 wa_manoj-c, 40 wa_manoj-d, 50 wa_manoj-e.
ENDLOOP.
1 ACCEPTED SOLUTION

FredericGirod
Active Contributor

SELECT-OPTIONS is not a simple value, it is a range

and a range in a SELECT statement must uses the operator IN

WHERE MATNR IN SMANOJ

6 REPLIES 6

FredericGirod
Active Contributor

SELECT-OPTIONS is not a simple value, it is a range

and a range in a SELECT statement must uses the operator IN

WHERE MATNR IN SMANOJ

0 Kudos

i am getting error if i used your select statements..

'smanoj is not a internal table'

thank you..

And the OP should debug his program, so the question would become "why is IT_MANOJ empty after SELECT" instead of "output is not displaying".

former_member622718
Participant
0 Kudos

thank you, but how should i specify range in select statement?

SELECT mandt matnr mtart bstme matkl FROM mara INTOTABLE it_manoj WHERE matnr    IN       smanoj.

Please use COMMENT button to post. As you can see in the box beside "your answer", SAP says:

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem.