‎2007 Apr 04 2:21 PM
Hi all,
I m facing a very small / silly / very imp doubt.
Plz go through the follwing code and help me.
REPORT ZTEST_SELECT.
parameters : p_vbeln type vbeln.
data : v_adrnr type adrnr,
v_vbeln type vbeln.
v_vbeln = '90000613'.
SELECT single adrnr FROM vbpa INTO v_adrnr where vbeln EQ v_vbeln.
Write : 'sy-subrc:',sy-subrc,
/ v_adrnr.
Error: for paramaters , its working fine.
If i give vbeln directly (hardcoding) its not fetching data.
Thanks
‎2007 Apr 04 2:24 PM
‎2007 Apr 04 2:24 PM
‎2007 Apr 04 2:27 PM
‎2007 Apr 04 2:24 PM
Hi try this..
<b>v_vbeln = '0090000613'.</b>
as it is of type C of size 10.
while u r using screens it will take care of leading zeroes(in case of parameters).
But , when u hard code u need to take care of zeroes also...
Message was edited by:
Rammohan Nagam
‎2007 Apr 04 2:25 PM
hi
check in ur database table if there are any laeding zeros in vbeln hard coded value.
if yes give them too
regards
navjot
reward if helpfull
‎2007 Apr 04 2:26 PM
‎2007 Apr 04 2:26 PM
Hi,
REPORT ZTEST_SELECT.
parameters : p_vbeln type vbeln.
data : v_adrnr type adrnr,
v_vbeln type vbeln.
v_vbeln = '90000613'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT.
exporting
field = v_vbeln
importing
field = v_vbeln
.
SELECT single adrnr FROM vbpa INTO v_adrnr where vbeln EQ v_vbeln.
Write : 'sy-subrc:',sy-subrc,
/ v_adrnr.
Regards
Sudheer
‎2007 Apr 04 2:27 PM
REPORT ZTEST_SELECT.
parameters : p_vbeln type vbeln.
data : v_adrnr type adrnr,
v_vbeln type vbeln.
v_vbeln = '90000613'.
You have to use the appropriate conversion exit to get the leading zeroes
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = v_vbeln
importing
output = v_vbeln
exceptions
others = 1.
SELECT single adrnr FROM vbpa INTO v_adrnr where vbeln EQ v_vbeln.
Write : 'sy-subrc:',sy-subrc,
/ v_adrnr.
CONVERSION_EXIT_ALPHA_INPUT
‎2007 Apr 04 2:28 PM
Hi ,
The reason for this is when you give a parameter or select option the input automatically gets converted to the internalt format.
What i would suggest , put a paramater and debug the program and see what is the value of your parameter.
This will help you better.
Regards
Arun