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

Faching data from Standard table

Former Member
0 Likes
1,022

Hi Abaper,

In my standard table there is a field concepto and it value are

'ALLOWOTH

'ALLOWROOM'

'ALLOWFB'

In this way all the values of this concepto field starts wit ALLOW.

Right now there are only 3 values as mentioned above. So we used the below Query(Harded coded)

SELECT xconcepto

FROM /ccsht/rs_linfol

INTO TABLE it_linfol

FOR ALL ENTRIES IN it_comp_hotel

WHERE xhotel_id EQ it_comp_hotel-xhotel_id

*WHERE xhotel_id IN p_hotid "it_comp_hotel-XHOTEL_ID

AND xfecha_prest IN p_date

AND ( xconcepto) EQ 'ALLOWOTH' OR xconcepto EQ 'ALLOWROOM' OR xconcepto EQ 'ALLOWFNB' ).

But Some more values are going to add in future. So we don't want to hard code the concepts.

Can any one help us to rectify this prolem.

Thanks and regards,

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
931

In where clause try :

AND xconcepto like '%ALLOW%'.

6 REPLIES 6
Read only

kamesh_g
Contributor
0 Likes
931

HI

we cant use offset in SAP query

so fetch data from your table .

And read the internal table with string what do u require .

Read <your Internal table> with key <your filed(5)> = 'ALLOW'.

append to another table .

it will work sure .

Read only

Former Member
0 Likes
931

like 'ALLOW%'.

This takes all the values starting with ALLOW.

Read only

faisalatsap
Active Contributor
0 Likes
931

Hi, Amit

Please Test my Sample Code in the following Thread here i am Selecting Dynamically Hope will help you to solve out your problem,

[Dynamic Select Statement |;

Kind Regards,

Faisal

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
932

In where clause try :

AND xconcepto like '%ALLOW%'.

Read only

0 Likes
931

Hi,

Thanks for youe help.

My problem is solve.

Thanks & Regards,

Amit

Read only

Former Member
0 Likes
931

Hi ,

u have make use of ranges in this case .

ex.

ranges: concepto for table-concepto.

concepto-sign = 'I' ."Include.

concepto-Option = CP."contains pattern

concepto-low = 'ALLOW*'.

append concepto.

clear concepto .

if concepto[] is not initial.

SELECT xconcepto

FROM /ccsht/rs_linfol

INTO TABLE it_linfol

FOR ALL ENTRIES IN it_comp_hotel

WHERE xhotel_id EQ it_comp_hotel-xhotel_id

*WHERE xhotel_id IN p_hotid "it_comp_hotel-XHOTEL_ID

AND xfecha_prest IN p_date

AND xconcepto in concepto

endif.

regards

Prabhu