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: 

convert pack to integer

0 Kudos
689

Hi all,

I want to convert pack quantity to integer.

Here is the field tpcny for below if condition i want to change field type to integer. Please refer below screenshot.

Declaration:

tpcny TYPE p DECIMALS 2.

IF wa_tcurr-fcurr = 'KRW' OR wa_tcurr-fcurr = 'IDR' .

??????

Endif.

What will be the syntax for converting?

Thank you.

3 REPLIES 3

carlottas
Explorer
0 Kudos
613

Hi ankitashinde173,

you can declare the field gs_output-tpcny like an integer (make attention on the lenght of the field). If you pass to that field a quantity with decimals, the value will be directly converted.

Regards

Sandra_Rossi
Active Contributor
0 Kudos
613

Is your question about rounding a number with decimals to its closest integer value? (half-down, half-up, ...?)

raymond_giuseppi
Active Contributor
0 Kudos
613

You can use an implicit conversion from packed to integer (move, 😃

  • Read online help, Conversion Rules for Elementary Data Objects, Numeric Source Fields, Source Field Type p, Numeric Target Fields

Or use functions related to conversion