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

Remove trailing zero Quantity Field Module Pool Programming

former_member300076
Participant
0 Likes
1,927

Hi all,

I have to delete trailing zero of a quantity field in Module Pool Programming.

For example :

123.000 => 123

The Format of my field is QUAN (quantity),

"From Dict" is checked,

Ref Field : MYTABLE-MEINS

If anyone could help me.

Thank you

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,606

Hi Sam,

Take the quantity field into character variable, use SPLIT statement at ' . ' to break the integer and zero part.

regards

kumar shantanu

11 REPLIES 11
Read only

rambabu_k3
Active Participant
0 Likes
1,606

Use character type while creating screen element for qty field

write your logic to delete the trailing before passing to screen element in PBO event.

Read only

0 Likes
1,606

I need this field to be quantity and not character type

Read only

Former Member
0 Likes
1,607

Hi Sam,

Take the quantity field into character variable, use SPLIT statement at ' . ' to break the integer and zero part.

regards

kumar shantanu

Read only

0 Likes
1,606

Hi kumar,

Thank you for your reply, but i need the field to be displayed like quantity and not character type

Read only

0 Likes
1,606

Define the variable using data element BCONS_VAR and pass the value ...

Read only

0 Likes
1,606

Thank you Rakesh,

I've added a new field in my structure with the data element BCONS_VAR and i changed the name of my field in the screen by this new field, and it's working.

Regards

Sam

Read only

0 Likes
1,606

You are welcome Sam...

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,606

AFAIK, from 3.0A on,

If a unit from table T006 (maintenance transaction CUNI) is found in a UNIT field, the respective QUAN field is output with as many places after the decimal point as required according to table T006.

However, no more decimals are output than the QUAN field has according to the ABAP/4 Dictionary. Conversely, no significant decimal places are suppressed, so if a place after the decimal point is to be suppressed and has a value not equal to zero, the quantity specification is output with its defined

So refer to a ddic QUAN field without decimal (Look via SE16N on DD01L where DATATYPE = 'QUAN' and DECIMALS = 0)

Regards,

Raymond

Read only

0 Likes
1,606

Hi Raymond,

Because my field is taken directly from the dictionary, i cannot change its reference field and also its format.

Read only

0 Likes
1,606

Well but you were able to change its data element (Correct Answer) and with a data element associated to a domain of type QUAN without decimal

ROFL

Read only

0 Likes
1,606

You're right