Application Development and Automation 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: 
Read only

Select statement

Former Member
0 Likes
689

Hi All,

I want to fetch language based on Region.How to do it.

u201CEu201D u2013 for English for all customers where field Region on ADDR1_DATA / REGION is not equal to 'CT'. Else u201CFu201D.

How to get it.

Regards,

Sai

5 REPLIES 5
Read only

former_member188827
Active Contributor
0 Likes
670

select single regio from kna1 into zregion where kunnr eq zkunnr.

if zregion ne 'CT'.

zlang = 'E'.

else.

zlang = 'F'.

endif.

Read only

Former Member
0 Likes
670

Hi Sudha,

Try this way :

Select <field-names>
    from <table name>
    into  <itab name>.

Loop at itab.

    if addr1-data/region ne 'CT'.
           
        Write :/ 'English Customers'.

    else.

         Write :/ 'French Customers'.

    endif.

endloop.

Reagrds,

Swapna.

Read only

Former Member
0 Likes
670

Hi Sudha,

Try the following:

Select <language>

from <table>

into table <itab>

for all entries in <itab2>

where region eq 'CT'.

<language> - language field

<table> - database table

<itab> - internal table with language field

<itab2> - internal table with customer numbers

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
669

hi,

You can try this.

select distinct <lang> <region>
from <table>
into table <itab>
for all entries in <itab2>
where region EQ <itab2>-region.

Hope this will help.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
669

Hi Sudha,

Check this out;-

Select language
   from dbtab
into table tab2
for all entries in tab1
where region ne 'CT'.

Here,

itab1 - internal table with customer number

itab2 - internal table with language

Regards,

Bhumika