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 using text field is possible?

Former Member
0 Likes
1,283

Hi friends! I need some help.

I have table with field type char20. In this field is saved a serial number with a fixed layout like 00.00.00.00.00.00.00. User wants a report that he can use this field for search criteria in selection-screen, some like that:

Table

78.00.03.00.44.11.00

78.00.03.00.44.12.00

80.00.03.00.44.13.00

So, he wants to select all entries who have '44' in 5ª position. Its possible do it using select or I have to select all and do one by one?

Thanks for any help!

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,251

may be you can build a range like if its 5th position.

wa-sign = 'I'.

wa-option = 'CP'.

wa-low = '++++++++++++44*'

append wa to ra.

Aslo try using the escape symbol # instead of +

then select using ra.

you can refer to build the range

9 REPLIES 9
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,252

may be you can build a range like if its 5th position.

wa-sign = 'I'.

wa-option = 'CP'.

wa-low = '++++++++++++44*'

append wa to ra.

Aslo try using the escape symbol # instead of +

then select using ra.

you can refer to build the range

Read only

Former Member
0 Likes
1,251

Thanks Keschav. Works greats here!

Read only

Former Member
0 Likes
1,251

I will agree with Keshav's post. just adding the sample code for that

DATA w_belnr TYPE belnr_d.

ranges : r_belnr FOR w_belnr.

r_belnr-sign = 'I'.
r_belnr-option = 'CP'.
r_belnr-low = '++++++1294'.
append r_belnr.


select SINGLE belnr from rseg
  into w_belnr
  WHERE belnr in r_belnr.

  IF sy-subrc EQ 0.

    WRITE / w_belnr.

  ENDIF.

Read only

Former Member
0 Likes
1,251

I used this and works great but user wants a select-options for select this, some like '44' to '55'. Any idea?

Thanks again!!

Edited by: Fulvio Valente on Aug 25, 2010 7:28 PM

Read only

0 Likes
1,251

why you don't use a select option that point to a integer or c type data and concatenate to the range that you all ready had

Read only

0 Likes
1,251

I'm using select options, but when I use 'CP' I can't use 'BT', so I lost the use of range-high...

When user digits on screen:

sign        option      low    high
   I               BT         44      55

I can build a range like

sign        option      low                             high
   I              CP         '++++++++++++44*'    
sign        option      low                             high
   I              CP         '++++++++++++55*'

But in this case I lost values between 44 and 55.

Read only

0 Likes
1,251

you can try this\

if its a integer always and not numeric then,

data:num type n.

loop at sel_opt.

if sel_opt-option = 'BT'.

do.

wa-low = sel_opt-low + 1.

append to range here.

if wa-low = sel_opt-high.

exit.

endif.

endif.

endloop.

Read only

0 Likes
1,251

Thanks again. My problem is a character, so I can't add...

Edited by: Fulvio Valente on Aug 25, 2010 8:27 PM

Read only

0 Likes
1,251

Hi Fulvio,

you could teach your user some details about using SELECT-OPTIONS on the selection screen. He can enter everything he ever wants and save it as a Report Variant.

No need for any code. Most users are happy if they learn about the multiple selections button and the various possibilities given there and the use of + and * wildcards.

Regards,

Clemens