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

Ref table & field ina structure

Former Member
0 Likes
643

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

Former Member
0 Likes
613

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

Former Member
0 Likes
613

YOu can use the write statement this way:

write: v_quan unit v_unit.

Read only

0 Likes
613

Hi Ravi,

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

Thanks

Read only

0 Likes
613

Used a different approach.

Read only

Former Member
0 Likes
614

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