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

Need logic for process the SELECT-OPTION table for diff. combinations.

Hi Experts,

This is copy of my prv. thread, with more clarity

Pls. give me some hint or idea to get my requitrement, its,

The selection screen contains a select-options field with name of so_EXCLUDE_Materials_of_product_heirarchy field.

I hv a list of 500 materials, in my_inatrenal_tabel.

Am pulling the product heirarchy values for these 500 matreials.

If user enters, some value in this field of so_EXCLUDE_Materials_of_product_heirarchy, I need to EXCLUDE that product heirachy having matreial from my_internal tbale.

My code is as follows,

MOVE sy-tabix to sy_tabix.

READ TABLE t_mara WITH KEY matnr = my_itab-matnr

BINARY SEARCH.

IF sy-subrc IS INITIAL.

IF NOT so_EXCLUDE_Materials_of_product_heirarchy[] IS INITIAL.

IF my_itab-prdha(2) IN so_EXCLUDE_Materials_of_product_heirarchy[].

DELETE my_itab INDEX sy_tabix.

ENDIF.

ENDIF.

ENDIF.

Isuue, is that, if user inputs this select option normally, its working, fine.

but, if he inputs like 1234* (STAR), then, all records r deleting from my-itab.

at that point the select-option table id populated like,

sign - I

option- CP

low-value- 1234* (star - wild card)

so, pls. let me know the piece of code, to meet my requiremwent.

thanq

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 08:21 PM

    You will have to select all possible product hierarchies based on your select option (so_EXCLUDE_Materials_of_product_heirarchy) from table T179 into another range table. Then use this range table in your logic to exclude product hierarchies.

    Pseudo code below:

    ranges: r_exclude_product_hierarchy for t179-prodh.
    move: 'I' to r_exclude_product-sign,
             'EQ' to r_exclude_product-option.
    select prodh into r_exclude_product-low
    from t179
    where prodh in so_exclude_materials_of_product_heirarchy
    and stufe = '9'  "<--Replace the appropriate level of product hierarchy here...
    
           append r_exclude_product.
    
    endselect.
    clear r_exclude_product.
    .
    .
    .
    If mara-prodh in r_exclude_product_hierarchy.
    ...
    else.
    ....
    endif.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 09:15 PM

    Hi,

    You can use this code for the field that u want to check.

    ranges : r_field for fieldname.

    IF NOT fieldname IS INITIAL.

    r_field-sign = 'I'.

    IF fieldname CA '*'.

    r_field-option = 'CP'.

    ELSE.

    r_field-option = 'EQ'.

    ENDIF.

    r_field-low = fieldname.

    r_field-high = ' '.

    APPEND r_field.

    CLEAR r_field.

    ENDIF.

    now in select statements, check field in r_field. it will give u desired reult.

    Award me points if it helps.......

    Thanks,

    Sheel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 09:18 PM

    Check my answer in your other thread.

    Rob

    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.