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

Report

Former Member
0 Likes
486

Hi Friends,

how to make field selection based on * search for fields on "intf_name" and "sap_order" . If user enters first 3 characters with * , then it should only fetch the "intf_name" field with value starting with these 3 characters only.

SELECT sap_invoice

intf_name

legacy_order

inv_create_date

source_psid

CURRENCY

inv_total_amount

FROM zcfinvoices

INTO TABLE t_zcfinvoices1

WHERE sap_invoice IN s_in_rng

AND intf_name IN intf_name " field1

AND sap_order IN sap_order " field2

AND inv_create_date IN s_incrdt

AND intf_date IN s_invdat

AND dest_psid IN s_dtpsid.

thanks in advance..

3 REPLIES 3
Read only

Former Member
0 Likes
461

use select query like this -

select * from dbtab into corresponding fields of table itab

where field1 like 'ABC%'.

it wil fetch all data having field field1 value starting with ABC

or refer demo code -

tables zgill_main.

parameters p_var(3).

data begin of itab occurs 0.

include structure zgill_main.

data end of itab.

concatenate p_var '%' into p_var.

select * from zgill_main into table itab where name like p_var.

loop at itab.

write:/ itab-name.

endloop.

Read only

Former Member
0 Likes
461

Hi,

you can select it using CP operator,

SELECT *

WHERE intf_name CP '*abc'.

create a variable which can hold *XXX chars.

regards,

Raghavendra

Read only

Former Member
0 Likes
461

hi Prakash,

try the following query...

SELECT sap_invoice
intf_name
legacy_order
inv_create_date
source_psid
CURRENCY
inv_total_amount
FROM zcfinvoices
INTO TABLE t_zcfinvoices1
WHERE sap_invoice IN s_in_rng
AND intf_name LIKE intf_name% " field1 
AND sap_order LIKE sap_order% " field2
AND inv_create_date IN s_incrdt
AND intf_date IN s_invdat
AND dest_psid IN s_dtpsid.

Hope this helps,

Sajan Joseph.