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

Getting value from quantity field

Former Member
0 Likes
612

Hi experts,

i have a quntity field with values like 61.00 and 121.00 like that

from these i have to get 61 and 121 and need to concatenate with measure like PC

output:

61 PC

121 PC.

how can i acheive this..can plz help me out?

Thanks & regards,

veena.

4 REPLIES 4
Read only

GauthamV
Active Contributor
0 Likes
581

Use split and concatenate commands.


DATA: var1 TYPE string VALUE '61.00',
      var3 TYPE string,
      var4 TYPE string.

START-OF-SELECTION.

  SPLIT var1 AT '.' INTO var3 var4.

  CONCATENATE var3 'PC' INTO var3.

  WRITE: var3.

Read only

Former Member
0 Likes
581

Hi goutham ,,

Thanks for giving your reply

as per your code var1 is string but mine is qunatity field.

SPLIT command should not allow qunatity..so i declared var1 is qunatity field.

This is the code i have written..Solved..

data:var1 type kmpmg VALUE '10.000',

var2 type I,

VAR3 TYPE string,

VAR4 TYPE string.

var2 = var1.

VAR3 = VAR2.

CONCATENATE VAR3 'PC' INTO VAR4 SEPARATED BY SPACE.

write:/ var4.

Anyway thanks alot.

Read only

Former Member
0 Likes
581

Hi Veena,

Have a separate field like

qty_in_uom(15) type c.

concatenate quantity UoM into qty_in_uom separated by space.

Regards,

Jovito

Read only

Former Member
0 Likes
581

you can try this.

DATA : w1 TYPE p DECIMALS 2,

n TYPE p.

w1 = '61.00'.

n = TRUNC( w1 ).