‎2014 Jun 19 10:53 AM
Hello everyone,
I am beginner,
while am using with include structure , output wil be blank .
below the code which i mentioned in program.
pls help me out of these.
REPORT ZINC.
*tables:mara.
TYPES BEGIN OF jk.
include structure mara.
TYPES END OF jk.
DATA: itab TYPE STANDARD TABLE OF jk,
wa_mara TYPE jk.
SELECT matnr from MARA into TABLE itab." UP TO 10 rows.
*sort itab.
LOOP AT itab INTO wa_mara.
NEW-LINE.
WRITE: wa_mara-matnr.
* write:/ wa_mara-matkl.
* wa-pstat = mara-pstat.
ENDLOOP.
But, If i use with mandt the output is getting correct.
‎2014 Jun 19 11:10 AM
Hi Raviram,
you need to specify the target of matr as matnr field in your internal table.
SELECT matnr from mara into corresponding fields of TABLE itab.
The above select statement should solve your problem.
Problem with your code: you are trying to copy matnr into mandt field of itab .
Thanks & Regards,
Tashi
‎2014 Jun 19 11:04 AM
hi ravi,
Include structure will include all the fields of the database structure if u want only material number to be fetched use types as below.
types : begin of jk,
matnr type mara-matnr,
end of jk.
Regards,
Pavan
‎2014 Jun 19 11:08 AM
Thanks pavan,
That concept i know, instead of using this. include structure mara it wil include all the fields.
bt while am using mandt in select and with in loop . the output is getting,
‎2014 Jun 19 11:19 AM
actually in select query as per your structure
select * from mara into itab up to 20 rows.
or use can write like this
select matnr into corresponding fields of itab up to 20 rows.
Regards,
pavan
‎2014 Jun 19 11:10 AM
Hi Raviram,
you need to specify the target of matr as matnr field in your internal table.
SELECT matnr from mara into corresponding fields of TABLE itab.
The above select statement should solve your problem.
Problem with your code: you are trying to copy matnr into mandt field of itab .
Thanks & Regards,
Tashi
‎2014 Jun 19 11:27 AM
Thanks tashi,
If i use corresponding field of table the value is getting. but i cannot use into table in the above mentioned prgm.
‎2014 Jun 19 11:32 AM
Hi Raviram,
Yes, you need to use " into corresponding fields of TABLE" because you are trying to copy a single values to the table.
if you want to use "INTO TABLE" ........
then use SELECT * from mara into table itab.
or
create the structure with only matnr.
types : begin of jk,
matnr type mara-matnr,
end of jk.
and then your select statement.
Regards,
Tashi