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

Write problem

Former Member
0 Likes
645

Hello friends,

I am a problem in writing the result in the proper alignment.

My code is

      LOOP AT tmp_caufv.
      CONCATENATE 'Total number of records for'
      tmp_caufv-dsnam '=' tmp_caufv-succ_mrp
               INTO report SEPARATED BY space.
    WRITE : / report.
  ENDLOOP.

The output is,

Total number of records for ABCDEFGH = 2

Total number of records for ABCD = 3

Total number of records for ABCDEFGHIJKLM = 2

However I want my output as

Total number of records for ABCDEFGH         = 2
Total number of records for ABCD             = 3
Total number of records for ABCDEFGHIJKLM    = 2

( The last number in the proper vertical alingment)

tmp_caufv-dsnam is a 18 character field.

Any suggestions.

Ster.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615

You can do this:

LOOP AT tmp_caufv.

CONCATENATE 'Total number of records for'

<b>tmp_caufv-dsnam '='</b> INTO report SEPARATED BY space.

WRITE : / report, <b>70 tmp_caufv-succ_mrp</b>.

ENDLOOP.

70 is the 70th character in the line. 70 is just an example. You can check the program and give appopriate number.

6 REPLIES 6
Read only

Former Member
0 Likes
616

You can do this:

LOOP AT tmp_caufv.

CONCATENATE 'Total number of records for'

<b>tmp_caufv-dsnam '='</b> INTO report SEPARATED BY space.

WRITE : / report, <b>70 tmp_caufv-succ_mrp</b>.

ENDLOOP.

70 is the 70th character in the line. 70 is just an example. You can check the program and give appopriate number.

Read only

Former Member
0 Likes
615

Hi,

LOOP AT tmp_caufv.

CONCATENATE 'Total number of records for'

tmp_caufv-dsnam '=' INTO report SEPARATED BY space.

write: /1 report,

50 tmp_caufv-succ_mrp.

ENDLOOP.

Regards,

Vidya.

Message was edited by:

Vidya Chowdhary

Read only

Former Member
0 Likes
615

Hi,

When you use CONCATENATE instruction you will have only one space between each part.

Try to write your numbers at a specific position.

Regards,

Mathieu

Message was edited by:

Mathieu ILHE

Read only

Former Member
0 Likes
615

If you use separated by space it will take one space.

loop at tmp_caufv.

write:/ 1 'Total number of records for' ,20 tmp_caufv-dsnam ,35 '=',39 tmp_caufv-succ_mrp

endloop.

Reward Points if it is helpful

Thanks

Seshu

Read only

0 Likes
615

Thanks Everyone.

Ster.

Read only

Former Member
0 Likes
615

HI

instead of concatenate u can use write statement like this.

LOOP AT tmp_caufv.

CONCATENATE 'Total number of records for', tmp_caufv-dsnam, '=' tmp_caufv-succ_mrp

INTO report SEPARATED BY space.

write:/ 'Total number of records for',27 tmp_caufv-dsnam,45 '=', tmp_caufv- succ_mrp

ENDLOOP.

provide ur reward points if ur satisfy.

Regards

Ravi