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

Query help needed.

Former Member
0 Likes
370

Hi,

Good morning.

I have a requirement where I need to extract all standard entries and custom entries starting with ZA*.

Suppose my tables contains the following data:-

ABC

EFG

A123

ZA1

ZA2

ZB1

ZB2

Output should be:-

ABC

EFG

A123

ZA1

ZA2

Any idea on this. It will be very useful.

Regards,

Eureka.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
335

Hi

Please try as below.

  select <fld1> <fld2> into table itab
         from <table>
         where not <fld1> like 'Z%'
         or <fld1> like 'ZA%'.

Hope this helps you.

Kind Regards

Eswar

2 REPLIES 2
Read only

Former Member
0 Likes
336

Hi

Please try as below.

  select <fld1> <fld2> into table itab
         from <table>
         where not <fld1> like 'Z%'
         or <fld1> like 'ZA%'.

Hope this helps you.

Kind Regards

Eswar

Read only

Former Member
0 Likes
335

Hi Eureka,

As you have not mentioned table names, I am giving you one example.

Suppose I want to select Sales organizations extracting values which starts with "Z".

I can write a code like this:

DATA: BEGIN OF itab OCCURS 0.

DATA : vkorg LIKE vbak-vkorg.

DATA: END OF itab.

SELECT vkorg FROM tvko INTO TABLE itab.

SORT itab.

DELETE itab WHERE vkorg CP 'Z*'.

LOOP AT itab.

WRITE : / itab-vkorg.

ENDLOOP.

Hope it solves the problem.

Regards,

Dharitree