Skip to Content
author's profile photo
Former Member

move the data in select options to internal table

I have the code as in the fillowing

SELECT-OPTION:S_MATNR FOR MARA-MATNR.
DATA:BEGIN OF IT_MATNTR OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF IT-MATNR.

NOW HOW CAN I ADD THE MATNER VALUES IN THE SELECT-OPTIONS IN INTERNAL TABLE

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:00 PM

    hi,

    Select matnr

    from mara

    into table it_matnr

    where matnr in s_matnr.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 21, 2007 at 01:01 PM

    Hi,

     
    LOOP AT S_MATNR .
    CLEAR: IT_MATNR.
    if S_MATNR-low is not initial.
    IT_MATNR-MATNR = S_MATNR-low to IT_MATNR.
    APPEND IT_MATNR.
    endif.
    if S_MATNR-high is not initial.
    IT_MATNR-MATNR = S_MATNR-high.
    APPEND IT_MATNR.
    endif.
    ENDLOOP.
     
    SORT IT_MATNR.
    DELETE ADJACENT DUPLICATES from IT_MATNR.
    

    Regards,

    Sesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:02 PM

    hi

    Select matnr
    from mara
    into table it_matnr
    where matnr in s_matnr. 
    

    regards

    ravish

    <b>plz dont forget to reward points if helpful</b>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:02 PM

    Hi Vamsikrishna,

    Yes. You can move the values from S_MATNR to IT_MATNR.

    you can try either it_matnr[] = s_matnr[].

    if not then you can loop in to the select-options as follows.

    Define LS_MATNR as a structure type of s_matnr.

    Define LS_IT_MATNR as a structure type of it_matnr.

    LOOP S_MATNR INTO LS_MATNR.

    MOVE LS_MATNR to LS_IT_MATNR.

    APPEND LS_IT_MATNR to IT_MATNR.

    CLEAR: LS_MATNR, LS_IT_MATNR.

    ENDLOOP.

    <b>Reward points for helpful answers.</b>

    Best Regards,

    Ram.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:18 PM

    hi vamsi

    just declare like below...

    selection-screen : begin of block blk1 with frame title text-001.

    select-options : p_matnr for mara-matnr.

    selection-screen : end of block blk1.

    select matnr erdat ernam from mara into table itab_mara where matnr in p_matnr.

    loop at itab.

    write :/ wa_final-matnr.

    end loop.

    reward if useful...........

    Add comment
    10|10000 characters needed characters exceeded