Application Development 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: 

Type conversion problem

Former Member
0 Kudos

Dear gurus,

i have written a bdc for order creation then i extract order no from message i.e.BDCMSGCOLL-MSGV1.

then i have have search data from vbap from that order no.

if ( m_tab1-MSGID = 'V1' and m_tab1-msgnr = 311 ).

orderno = m_tab1-msgv2.

endif.

then

data : orderno like vbap-vbeln.

select single * from vbap

where vbeln = orderno.

if sy-subrc = 0.

shippoint = vbap-VSTEL.

endif.

but problem is that its not finding the data as vbeln is extract frm msgv2.

for : orderno = 200017445

so while debuggin when i put 0 in order no i.e - 0200017445

then its working fine.

please can u help me , how to handle this code ?

while de

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

1. declare numc variable of length 10.

2. pass the order number to numc variable.

3. use the numc variable in your select statement.

Data: n_c(10) type n,

order_no type BDC_VTEXT1.

n_c = order_no.

select ...

vbeln = n_c.

Reward if found helpful.

Regards,

Boobalan Suburaj

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use 'conversion_exit_alpha_input' function module to get resolve your problem. Pass the order number in the message variable and use the same for your further process.....

Rgds,

Bujji

Edited by: Bujji on Jun 17, 2008 1:32 PM

Former Member
0 Kudos

Hi,

if ( m_tab1-MSGID = 'V1' and m_tab1-msgnr = 311 ).

orderno = m_tab1-msgv2.

endif.

use conversion exit here:

call function module 'CONVERSION_EXIT_ALPHA_INPUT'

then pass the returned value to the select statement.

data : orderno like vbap-vbeln.

select single * from vbap

where vbeln = orderno.

if sy-subrc = 0.

shippoint = vbap-VSTEL.

endif.

Thanks,

Keerthi.

baradakanta_swain2
Participant
0 Kudos

Hi,

Please see the code below

  • Declare the data types as required

DATA : v_input TYPE bdcmsgcoll-msgv2,

v_output TYPE vbeln.

  • I have taken up the example you had given

v_input = '200017445'.

  • Call the FM to convert the number to proper format

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = v_input

IMPORTING

output = v_output.

  • The varible would have the formatted value

This should solve your purpose.

Thanks

Barada

Former Member
0 Kudos

Hi,

1. declare numc variable of length 10.

2. pass the order number to numc variable.

3. use the numc variable in your select statement.

Data: n_c(10) type n,

order_no type BDC_VTEXT1.

n_c = order_no.

select ...

vbeln = n_c.

Reward if found helpful.

Regards,

Boobalan Suburaj

Former Member
0 Kudos

Hi,

data : orderno like vbap-vbeln.

DATA : L_ORDNO(10).

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = ORDERNO

IMPORTING

OUTPUT = L_ORDNO.

select single * from vbap

where vbeln = L_ORDNO.

if sy-subrc = 0.

shippoint = vbap-VSTEL.

endif.