‎2006 Jun 25 8:42 PM
hi every body,
can anyone please tell me ......
my requirement is like this in my selection screen there is a parameter which accepts both numeric and character
as an input . if i give both char & numeric but it should accept only character.
thanks inadvance....
with regards,
vidya.
‎2006 Jun 25 8:55 PM
Hi,
Can you please post the code for parameter in quoestion ? Also make u'r requiremnet more clear ?
Regards,
Ben.
‎2006 Jun 25 9:14 PM
Try this way.
At selection-screen on p_input.
if p_input ca '0123456789'.
Message s000 with 'Invalid input'
exit.
endif.Regds
Manohar
‎2006 Jun 26 5:51 AM
Declare your parameter as character type so that it will consider both numarics and charcters.
and write selection screen validation logic as below
At selection-screen on p_input.
if p_input ca '0123456789' and p_input ca sy-abdce.
Message e000 with 'Invalid input'.
endif.
‎2006 Jun 26 5:58 AM
hi,
Can u explain clearly.
if we give both nume and char , do u want to select only the characters from the given input or do u want to give error message when we give both in the input field.
Regards,
Lucky.
‎2006 Jun 26 6:13 AM
Hi can you please try this code:
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : p_belnr LIKE bkpf-belnr.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON p_belnr.
IF p_belnr CA '0123456789'.
IF p_belnr CA 'abcdefghijklmnopqrstuvwxyz'
OR p_belnr CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
MESSAGE ID 'ZZ' TYPE 'E' NUMBER '001'.
ENDIF.
ENDIF.
‎2006 Jun 26 6:32 AM
Hi Vidya,
I am assuming like this,
1) if u give only char, it should accept
2) if u give only numeric char, it should accept
3) if u give combination, then it should not
If this is ur requirement, please follow the code below.
parameters : p(10) type c.
At selection-screen on p.
if p co '0123456789'.
exit.
elseif p ca '0123456789'.
Message e000(YSIMPLE) with 'Invalid input'.
stop.
endif.
start-of-selection.
write : / p.
Hope this will help u in some way.
‎2006 Jun 26 6:35 AM
Hi Vidya,
parameter : data1(10) type c.
data : lv_len type i,
l_pos like sy-tabix,
lv_char type c,
lv_data(10) type c.
describe field data1 length lv_len in character mode.
do lv_len times.
l_pos = sy-index - 1.
lV_char = data1+l_pos(1).
if lv_char co sy-abcde.
concatenate lv_data lv_char into lv_data.
endif.
enddo.
write lv_data.
Rgds,
Prakash