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

Datatype Conversion [NUMC5 to NUMC6]

ullas_u2
Explorer
0 Likes
2,290

Dear All,

Is there any way to connect EKPO-ebelp to KONV-kposn [the two fields are type incompactable; one is numc5 and the other is numc6].

-Ullas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,356

Hi

Thers is a option to do that. Please follow the belo things in your code.

declare L_ebelp type KONV-kposn.

Move the data EKPO-EBELP to L_EBELP.

while you extact the data from KONV in the where condition you can compare Where KPOSN = L_EBELP.

This will not show any error. It will works fine. Please check and let me know.

Dear All,

Is there any way to connect EKPO-ebelp to KONV-kposn [the two fields are type incompactable; one is numc5 and the other is numc6].

-Ullas

3 REPLIES 3
Read only

Former Member
0 Likes
1,356

Hi,

it is completely false that the fields are type incompatible. They have a different length but it is not an impediment to move values from EKPO-ebelp to KONV-kposn and both are of type NUMC.

DATA: var1 TYPE ekpo-ebelp VALUE '45',
      var2 TYPE konv-kposn.


MOVE var1 TO var2.
WRITE:/10 var2.

in the other way it is not possible, because you´re losing one digit.

Read only

Former Member
0 Likes
1,357

Hi

Thers is a option to do that. Please follow the belo things in your code.

declare L_ebelp type KONV-kposn.

Move the data EKPO-EBELP to L_EBELP.

while you extact the data from KONV in the where condition you can compare Where KPOSN = L_EBELP.

This will not show any error. It will works fine. Please check and let me know.

Read only

Former Member
0 Likes
1,356

Hi UllasU,

for what purpose do you want convert the data types?

below statement works fine - table konv cannot be uses in JOIN.

SELECT *
      FROM konv
      WHERE knumv = ekko-knumv
      AND   kposn = ekpo-ebelp.

regards

REA