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

convert pack to integer

0 Likes
2,029

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
Read only

carlottas
Explorer
0 Likes
1,953

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,953

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,953

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