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: 

Ref table & field ina structure

Former Member
0 Kudos

Hi,

I've a quantity field in a standard structure. As reference field it has 'unit' field from another structure.

Is it possible to display the units along with quantity in an ABAP report?

Regards..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Sample Program to disply the Units ..

REPORT demo_list_write_unit LINE-SIZE 40.

DATA: num1 TYPE p DECIMALS 1 VALUE 1,
      num2 TYPE p DECIMALS 4 VALUE '2.5'.

SET COUNTRY 'US'.

WRITE: 'KG', num1 UNIT 'KG', num2 UNIT 'KG',
     / 'PC', num1 UNIT 'PC', num2 UNIT 'PC'.

*************************************************************************

This Program is for Currency

REPORT demo_list_write_currency LINE-SIZE 40.

DATA: num1 TYPE p  DECIMALS 4 VALUE '12.3456',
      num2 TYPE p  DECIMALS 0 VALUE '123456'.

SET COUNTRY 'US'.

WRITE: 'USD', num1 CURRENCY 'USD', num2 CURRENCY 'USD',
     / 'BEF', num1 CURRENCY 'BEF', num2 CURRENCY 'BEF',
     / 'KUD', num1 CURRENCY 'KUD', num2 CURRENCY 'KUD'.

Regards

Sudheer

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

YOu can use the write statement this way:

write: v_quan unit v_unit.

0 Kudos

Hi Ravi,

Could you please elaborate a bit more on this e.g. which one would be the reference field?

Thanks

0 Kudos

Used a different approach.

Former Member
0 Kudos

Hi,

Sample Program to disply the Units ..

REPORT demo_list_write_unit LINE-SIZE 40.

DATA: num1 TYPE p DECIMALS 1 VALUE 1,
      num2 TYPE p DECIMALS 4 VALUE '2.5'.

SET COUNTRY 'US'.

WRITE: 'KG', num1 UNIT 'KG', num2 UNIT 'KG',
     / 'PC', num1 UNIT 'PC', num2 UNIT 'PC'.

*************************************************************************

This Program is for Currency

REPORT demo_list_write_currency LINE-SIZE 40.

DATA: num1 TYPE p  DECIMALS 4 VALUE '12.3456',
      num2 TYPE p  DECIMALS 0 VALUE '123456'.

SET COUNTRY 'US'.

WRITE: 'USD', num1 CURRENCY 'USD', num2 CURRENCY 'USD',
     / 'BEF', num1 CURRENCY 'BEF', num2 CURRENCY 'BEF',
     / 'KUD', num1 CURRENCY 'KUD', num2 CURRENCY 'KUD'.

Regards

Sudheer