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 length

Former Member
0 Likes
645

Hi

I have a statement like this is one of the old report:

WRITE: /06 33 v_rej1, 45  v_%rej2, 57 v_rej3.

I getting the output:

35.42       90.00      100.00

I had to place a gap of 12 in between... but I need the values side by side with my specific values spaces in between.

WRITE: /06 33 v_rej1, 38  v_%rej2, 43 v_rej3.

the next value on right is closing the before value... I cannot convert the values to type c and display. Plz let me know some add on for write where I can have my values side by side.

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
498

Hi Ram Kumar, Try this way.


REPORT ztest_notepad.
DATA:v_rej1  TYPE p DECIMALS 2 VALUE '35.42',
     v_%rej2 TYPE p DECIMALS 2 VALUE '90.00',
     v_rej3  TYPE p DECIMALS 2 VALUE '100.00'.
DATA:v_rej1_c(15)  TYPE c,
     v_%rej2_c(15) TYPE c,
     v_rej3_c(15)  TYPE c.
DATA :str TYPE string.
WRITE:v_rej1   to v_rej1_c LEFT-JUSTIFIED,
      v_%rej2  to v_%rej2_c LEFT-JUSTIFIED,
      v_rej3   to v_rej3_c LEFT-JUSTIFIED.
CONCATENATE v_rej1_c
            v_%rej2_c
            v_rej3_c INTO str SEPARATED BY space.

WRITE: / v_rej1,v_%rej2,v_rej3.
WRITE: / v_rej1_c,v_%rej2_c,v_rej3_c.
WRITE:/ str.
Thanks Venkat.O

2 REPLIES 2
Read only

venkat_o
Active Contributor
0 Likes
499

Hi Ram Kumar, Try this way.


REPORT ztest_notepad.
DATA:v_rej1  TYPE p DECIMALS 2 VALUE '35.42',
     v_%rej2 TYPE p DECIMALS 2 VALUE '90.00',
     v_rej3  TYPE p DECIMALS 2 VALUE '100.00'.
DATA:v_rej1_c(15)  TYPE c,
     v_%rej2_c(15) TYPE c,
     v_rej3_c(15)  TYPE c.
DATA :str TYPE string.
WRITE:v_rej1   to v_rej1_c LEFT-JUSTIFIED,
      v_%rej2  to v_%rej2_c LEFT-JUSTIFIED,
      v_rej3   to v_rej3_c LEFT-JUSTIFIED.
CONCATENATE v_rej1_c
            v_%rej2_c
            v_rej3_c INTO str SEPARATED BY space.

WRITE: / v_rej1,v_%rej2,v_rej3.
WRITE: / v_rej1_c,v_%rej2_c,v_rej3_c.
WRITE:/ str.
Thanks Venkat.O

Read only

Former Member
0 Likes
498

left-justified worked.