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

how to convert data type

laxman_sankhla3
Participant
0 Likes
1,246

hi

i want to convert data type from <b> vbuk-vbeln to mkpf-xblnr</b>.

thanks.

laxman

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
947

Hi

MKPF-XBLNR is CHAR 16 field

where as VBUK-VBELN is Char 10 field

since both are CHAR you can use the MOVE command

or mkpf-xblnr = vbuk-vbeln.

But it gives syntax error when using for all entries of that field. so move it char 10 field and use

Regards

Anji

6 REPLIES 6
Read only

former_member386202
Active Contributor
0 Likes
947

Hi,

while defining structure of internal table use data element of XBLNR

ex.

types : begin of it_vbln,

vbeln type xblnr,

end of it_vbln.

Regards,

Prashant

Read only

Former Member
0 Likes
947

Hi

Both fields are of type CHAR 10. SO no conversion is required.

Use : MOVE vbuk-vbeln to mkpf-xblnr.

It will work....

Read only

Former Member
0 Likes
947

HI,

no need of conversion as both are of char type.

rgds,

bharat.

Read only

Former Member
0 Likes
948

Hi

MKPF-XBLNR is CHAR 16 field

where as VBUK-VBELN is Char 10 field

since both are CHAR you can use the MOVE command

or mkpf-xblnr = vbuk-vbeln.

But it gives syntax error when using for all entries of that field. so move it char 10 field and use

Regards

Anji

Read only

0 Likes
947

hi

actually i writing query

SELECT budat

cputm

xblnr

FROM mkpf

INTO TABLE int_mkpf

FOR ALL ENTRIES IN itab

WHERE xblnr = itab-vbeln.

below is error message.

When you use the addition "FOR ALL ENTRIES IN itab", the fields "XBLNR"

and "ITAB-VBELN" must have the same type and the same length.

thanks.

Read only

0 Likes
947

Laxman,

while declaration of internal table, declare vbeln with same length and same type as xblnr.

reward if it helps,

Satish