11-16-2009 8:44 AM
Hi,
i have a select statement..
SELECT matnr
werks
lvorm
mmsta
mmstd
FROM marc
INTO TABLE i_marc
WHERE matnr = xt_iotab-matnr.
here xt_iotab is the internal table with header line. but is showing the error like.. xt_iotab is with out header line.
how to write the above select statement when the I.T table is with header line..
11-16-2009 8:47 AM
HI Mythily
IF xt_iotab[] IS NOT INITIAL.
SELECT matnr
werks
lvorm
mmsta
mmstd
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN xt_iotab
WHERE matnr EQ xt_iotab-matnr.
ENDIF.
Pushpraj
11-16-2009 8:51 AM
Hello Mythily,
Are you doing a FOR ALL ENTRIES or selecting data by LOOP'ing on the table xt_iotab?
Please be more specific when you post your code, else it is not possible to analyse.
BR,
Suhas
11-16-2009 8:56 AM
hi , mithily ,
use if xt_iotabp[] is not initial .
endif.
Don't use xt_iotab[] is initial .
Deepak
11-16-2009 8:53 AM
Try this ,
types : Begin of w_iotab ,
matnr type mara-matnr ,
bismt type mara-bismt ,
end of w_iotab.
types : begin of w_marc ,
matnr type marc-matnr ,
werks type marc-werks,
lvorm type marc-ivorm ,
mmsta type marc-mmsta ,
mmstd type marc-mmstd,
end of w_marc .
data : xt_iotab type standard table of w_iotab with header line .
data : i_marc type standard table of w_marc with header line .
select bismt
matnr
from mara into corresponding fields of table xt_iotab.
if sy-subrc = 0 .
if xt_iotab[] is initial .
SELECT matnr
werks
lvorm
mmsta
mmstd
FROM marc
INTO corresponding fields of TABLE i_marc
for all entries in xt_iotab
WHERE matnr = xt_iotab-matnr.
endif.
endif.
use this code ....
Regards
Deepak .
11-16-2009 8:58 AM
Hi,
First you need to check if the internal table is initial or not and then use for all entries in your select statement as told above.
Regards,
Rahul