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

internal tbale

i am having one internal table itab.

one of the field from itab is BUKRS.

loop at itab.

endloop.

inside the loop i need to check company code BUKRS from the ITAB with the fixed set of company codes US1 US2 US4 US5 US6 US9 US10 ....... like this i have 25 to 30 fixed set of company codes.

based on this i want to populate some other fields of the output internal table.

for eamaple if the company code is with in this set of values i wnat to polate some out fields with some constants other wise with some other value.

*example itab-bukrs* = US1 or US2 or US4 or US5 or US6 or US9 or US10 or us12 or us 14 or etc ...... like this i need to compare with some other 15 values .

can any one plesae help me is there any easy way to do this.

regards

raadha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 05:50 AM

    Hi,

    There are two ways of having the Company codes and can be used for validating the Internal Table.

    a) You can use ITAB-BURKS IN ('B1','B2',...'Bn')

    Where B1..n is company codes.

    or

    b) Declare a range for BURKS and add all the Company codes in the range and use it for validating as below.

    ITAB-BUKRS in rng_BURKS.

    where rng_BURKS is range .

    Hope it helps you.

    Regards,

    Anbalagan.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 30, 2008 at 05:56 AM

    Hi,

    You can use local ranges in program or selection-options from selection screen (using transaction variant etc.).

    1) case with ranges.

    DATA lr_bukrs TYPE RANGE OF burks WITH HEADER LINE.
    
    CLEAR lr_bukrs.
    lr_bukrs-opti  = 'EQ'.
    lr_bukrs-sign = 'I'.
    
    lr_bukrs-low  = 'US1'.
    APPEND lr_bukrs.
    lr_bukrs-low  = 'US2'.
    APPEND lr_bukrs.
    " .... and so on.
    
    LOOP AT itab.
       IF itab-burks IN lr_bukrs.
    "     your logic
       ENDIF.
    ENDLOOP.
    

    2) if you use selection screen. you can add hided selec-options s_bukrs FOR bkpf-bukrs (for example). and than create system variant for you program then fill default values in selection screen for s_burks. and check it-bukrs in s_bukrs.

    Best Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 11:53 AM

    Hi,

    You can try this...

    Loop at itab.

    If itab-bukrs in ('US1','US2',....... so on).

    Then your functionality...

    Endif.

    Endloop.

    ******************************

    Reward if helpful.

    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.