‎2010 Aug 25 12:36 PM
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!
‎2010 Aug 25 12:59 PM
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
‎2010 Aug 25 12:59 PM
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
‎2010 Aug 25 1:51 PM
‎2010 Aug 25 1:57 PM
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.
‎2010 Aug 25 6:27 PM
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
‎2010 Aug 25 6:35 PM
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
‎2010 Aug 25 6:50 PM
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 55I 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.
‎2010 Aug 25 6:58 PM
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.
‎2010 Aug 25 7:12 PM
Thanks again. My problem is a character, so I can't add...
Edited by: Fulvio Valente on Aug 25, 2010 8:27 PM
‎2010 Aug 25 7:56 PM
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