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

Hi

Former Member
0 Likes
609

Hi,

I want to write a program to get the numbers in the following sequence.

Plz let me know how to do?

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5.

1 ACCEPTED SOLUTION
Read only

varma_narayana
Active Contributor
0 Likes
588

Hi..

This is the Code.

PARAMETERS: p_num type i default 5.

data : v_index type sy-index.

DO P_NUM TYPES.

V_INDEX = SY-INDEX.

DO V_INDEX TIMES.

Write: sy-index.

ENDDO.

SKIP.

ENDDO.

<b>Reward if Helpful.</b>

4 REPLIES 4
Read only

varma_narayana
Active Contributor
0 Likes
589

Hi..

This is the Code.

PARAMETERS: p_num type i default 5.

data : v_index type sy-index.

DO P_NUM TYPES.

V_INDEX = SY-INDEX.

DO V_INDEX TIMES.

Write: sy-index.

ENDDO.

SKIP.

ENDDO.

<b>Reward if Helpful.</b>

Read only

Former Member
0 Likes
588

Hi Ram,

DO 5 TIMES.

V_INDEX = SY-INDEX.

DO V_INDEX TIMES.

WRITE: SY-INDEX, ' '.

ENDDO.

SKIP.

ENDDO.

Thanks,

Vinay

Read only

Former Member
0 Likes
588

Hi,

see this code.

do 5 times.

write:/.

do sy-index times.

write:sy-index.

enddo.

enddo.

if u don't want the spaces do like this

data:n.

do 5 times.

write:/.

n = sy-index.

do sy-index times.

n = sy-index.

write:n.

enddo.

enddo.

rgds,

bharat.

Read only

Former Member
0 Likes
588

PARAMETERS: p_input TYPE i DEFAULT 5.

DATA : w_index TYPE sy-index.

DO p_input TIMES.

w_index = sy-index.

DO w_index TIMES.

WRITE: sy-index.

ENDDO.

SKIP.

ENDDO.

Regards,

Pavan