[52157] in SAPr3-news

home help back first fref pref prev next nref lref last post

Re: Basic ABAP Question

daemon@ATHENA.MIT.EDU (Gerhard Fricke)
Mon Nov 8 00:59:17 2004

To: sapr3-news@mit.edu
Date: 7 Nov 2004 21:59:12 -0800
From: gerhard.fricke@stadtwerke-wolfsburg-ag.de (Gerhard Fricke)
Message-ID: <a2482af7.0411072159.7095654a@posting.google.com>

Wulf Kruempelmann <wulfk@t-online.de> wrote in message news:<cmie4c$ms8$01$1@news.t-online.com>...
> Buck Turgidson wrote:
> > I am trying to implement the following if/then psuedocode in ABAP.  I am not
> > sure how to do this with the ABAP construct.  Any advice would be
> > appreciated.  It is the nested "then" that I am not sure how to do in ABAP.
> > 

This ist wright.

> if f1 = 'a'.
>    if f2 = 'b'.
>      perform something_1.
>    else.
>      perform something_2.
>    endif.
> else.
>   perform something_1.
> endif.


but perhaps you can use the CASE-construct.... ;-)

case f1.
  when 'a'.
    if f2 = 'b'.
      perform something_1.
    else.
      perform something_2.
    endif.
  when others.
    perform something_1.
endcase.

and now another if-construct.

if (f1 = 'a' and f2 = 'b') or (f1 <> 'a').
  perform something_1.
else.
  perform something_2.
endif.

There are a lot of ways to go to Rome. ;-)

Gerd

home help back first fref pref prev next nref lref last post