Skip to Content
author's profile photo Former Member
Former Member

how to write the select statement when the I.T table is with header line

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Nov 16, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 16, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 16, 2009 at 08: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 .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.