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

Query on internal table

Pls any body can tell i am putting data into some internal table and doing some manupulation.

Now i want to show data from that internal table based on selection screen fields.

E.g

Select * from mkpf into corresponding fields of table itab .

now i am doing manupulation i am adding lot of rows into the internal table.

if mkpf has thrown 10 rows , iam adding another 5 rows to it.

Now based on selection screen fields i want to show the data from the internal tables so how could i do that.

eg. in selection screen

select-options : material for mkpf-matnr.

select-options : plant for mkpf-werks.

now based on this selction i want to show data from the internal table.

WhatI am doing is

read table itab with key matnr = material werks = plant.

But it is not working

Thanks and Regards

Mave

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 10:32 AM

    Hi Mave,

    Use

    Loop at itab where matnr in material

    and werks in plant .

    ENDloop.

    Read Table will not work with select-option.

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 10:36 AM

    if i got you right

    select * from mkpf into table itab

    where matnr IN material AND

    werks IN plant.

    regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 26, 2005 at 11:19 AM

    Hi,

    Select * from mkpf into corresponding fields of table itab where matnr in material and werks in plant.

    If your manipulations to internal table will add only the entires based on the above selected matnr and plant,then you can code as above.No read or loop is required.

    If not,you can code as below.

    Select * from mkpf into corresponding fields of table itab .

    loop at itab into wa

    where matnr in material and werks in plant.

    ....

    endloop.

    Since material and werks are select-options,you cannot use read statement.Read statement is used if you are sure that only one entry will be retrived for the conditions given in read statement.In otherwords,if matnr and werks are key fields,then you can use read statement.

    Kidnly reward points by clicking the star on the left of reply,if it helps.

    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.