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

very small doubt

Former Member
0 Likes
874

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

1 ACCEPTED SOLUTION
Read only

kostas_tsioubris
Contributor
0 Likes
849

Hi,

you should give v_vbeln = '0090000613'.

regards

Kostas

8 REPLIES 8
Read only

kostas_tsioubris
Contributor
0 Likes
850

Hi,

you should give v_vbeln = '0090000613'.

regards

Kostas

Read only

0 Likes
849

thanx

Read only

Former Member
0 Likes
849

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

Read only

Former Member
0 Likes
849

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

Read only

Former Member
0 Likes
849

thankx sir!!

Read only

Former Member
0 Likes
849

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

Read only

Former Member
0 Likes
849

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

Read only

Former Member
0 Likes
849

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