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: 

GETTING DATA FROM PRDHA(1-3 & 9-17 characters) IN MARA

Former Member
0 Kudos

Dear All,

I want to get data from Table MARA from field PRDHA. PRDHA is 18 char. Now on selection screen user inputs first 1-3 characters of PRDHA then fetch data from MARA accordingly and if user enters 9-17 characters of PRDHA then fetch data from MARA accordingly.

I have inserted data from select-option into Ranges internal table and then used '*' (wildcard) and then passing the same in the where condition of select option.

But its not returning the data.

Can someone help please.

4 REPLIES 4

Former Member
0 Kudos

Anurag,

You cannot use * as the wild characater in the WHERE clause. Use % and it will work.

Regards,

Ravi

Note : Please close the thread if this resolves the issue

Former Member
0 Kudos

HI

GOOD

IF POSSIBLE SEND THE SELECT STATEMENT THAT YOU R USING TOO FETCH THE DATA FROM MARA.

THANKS

MRUTYUN

Former Member
0 Kudos

Hi Anurag,

dont think % or * will work for a variable in select statement. wat u can do is select the materials from mara and then filter it from the internal table by some logic..

something like this

loop at itab.

if itab-prdha(3) = var.

move itab to itab1.

append itab1.

endif.

endloop.

ur itab1 will contain the relevant entries.

RHope it helps,

Regards,

Bikash

Former Member
0 Kudos

Hello Anurag,

use the following code...

tables: mara.

parameters p_prdha like mara-prdha.

concatenate '%' p_prdha '%' into p_prdha.

select * from mara where prdha like s_prdha.

break-point.

endselect.