Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

if initial

Former Member
0 Kudos

Hi,

           i want the condition like this If S_CUST is  initial and S_VEND is intial...i  want satisfy both in single if condition.i mean what is exact statement

          for example if i am  giving value in selection scree for Customer it should go to my ELSE select statement for vendor also same.

5 REPLIES 5

roberto_vacca2
Active Contributor
0 Kudos

Hi.

I suppose your S_CUST and S_VEND are select-options.


In that case

IF S_CUST[] IS INITIAL AND S_VEND[] IS INITIAL.

  "Do code with empty input for Customer AND for Vendor

ELSE.

" If you're giving value in selection screen for Customer OR for Vendor

ENDIF.

Hope to help

Bye

0 Kudos

HI Roberto,

Thank for Your Reply,can i write like this in my select statement where condition

select * from ztable into it

   wher bukrs = ist_bseg-bukrs

          and kunnr IN (s_cust , s_vend).

Regards,

Ramu

0 Kudos

No of course

You should merge them in a big range


DATA: R_KUNNR TYPE RANGE OF KNA1-KUNNR.

LOOP AT S_KUNNR

    APPEND S_KUNNR TO R_KUNNR.

ENDLOOP.

LOOP AT S_LIFNR

    APPEND S_LIFNR TO R_KUNNR.

ENDLOOP.

SELECT * FROM ZTABLE WHERE KUNNR IN R_KUNNR

............................................

but you have to check those two select-options are not in conflict

Max

0 Kudos

Or check out the APPEND LINES OF syntax

0 Kudos

Ramu,

You can use them directly in your select statement! However, you need to write like this:

select * from ztable into it

   where bukrs = ist_bseg-bukrs

          and (kunnr IN s_cust

              or kunnr IN s_vend).


Also make sure that your ranges are not empty, otherwise all the data from you ztable will be retrieved.