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

Type P question

Former Member
0 Likes
510

Hi

I want to define a field in types like length 17 decimas 2.

see this code and correct me what iam doing wrong.

Types : BEGIN OF t_amt_qty,

amt(17) type p decimal 2,

END OF t_amt_qty.

but it is showing error " "," expected after "P". "

correct me how to achieve it.

thanx and regards,

Rupa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
479

rupa,

declare it as

amt(9) type p decimals 2.

as the Length of this amt is 2 * 9 = 18 - 1 = 17.

Data type P will always have length = 2n - 1.

regds,

kiran

3 REPLIES 3
Read only

Former Member
0 Likes
479

Hi Rupa

Use 'decimals' and not 'decimal'. For type P a maximum length spec of 16 is allowed.

Types : BEGIN OF t_amt_qty,

amt(16) type p decimals 2,

END OF t_amt_qty.

Award points if useful

Regards

Indrajit

Read only

0 Likes
479

Hi Indra,

Thank you for your response.

my requirement is iam geting a amount field (17, 2) from legacy sysmet, so i need to capture it in a internal table. so tell me how can i define it.

Thanks and regards

Rupa.

Read only

Former Member
0 Likes
480

rupa,

declare it as

amt(9) type p decimals 2.

as the Length of this amt is 2 * 9 = 18 - 1 = 17.

Data type P will always have length = 2n - 1.

regds,

kiran