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

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

former_member622718
Participant
1,387
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
Read only

FredericGirod
Active Contributor
1,298

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
Read only

FredericGirod
Active Contributor
1,299

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

Read only

0 Likes
1,298

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

'smanoj is not a internal table'

thank you..

Read only

1,298

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".

Read only

former_member622718
Participant
0 Likes
1,298

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

Read only

1,298
SELECT mandt matnr mtart bstme matkl FROM mara INTOTABLE it_manoj WHERE matnr    IN       smanoj.
Read only

1,298

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.