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

internal table

hi all,

in my function module when i give the export parameter i get 2 fields in my internal table

F1 F2

A A

B A

C A

i want that if F2 has multiple values ie may be a or b or c it shuld give me a error message???

thnkjx

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:50 AM

    hi bhanu.

    check this.

    data v type f2.

    wa_table like line of it_table.

    READ TABLE it_table INTO wa_table.

    if flg = 0.

    v = wa_table-f2.

    endif.

    loop at it_table.

    if it_table ne v.

    error message.

    endif.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 10:00 AM

    Hi,

    First loop the internal table and then read then read the table.

    Loop at itab into wa.

    read table itab into wa1 with key f2 = wa-f2.

    if sy-subrc = 0.

    message

    endif.

    endloop.

    Reward if helpful

    Regards,

    Suganya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 10:04 AM

    clear counter.

    Loop the internal table to wa.

    if wa-f2 not initial .

    counter = counter+1.

    if counter > 1.

    message<>.

    endif.

    endif.

    Endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 10:06 AM

    hi Bhanu,

    read table it_out into wa_out index 1.

    if sy-subrc = 0.

    f2 = it_out-fld2.

    endif.

    loop at it_out into wa_out.

    if f2 ne wa_out-fld2.

    message e000.

    endif.

    endloop.

    thanks,

    keerthi

    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.