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

passing parameters to a subroutine

Former Member
0 Likes
738

hi this is a listing from SAMS ABAP IN 21 DAYS.

plz verify how the output of p1 is coming 'AAA'.

report ztx1802.

2 data: f1 value 'A',

3 f2 type i value 4,

4 f3 like sy-datum,

5 f4 like sy-uzeit.

6

7 f3 = sy-datum.

8 f4 = sy-uzeit.

9

10 perform s1 using f1 f2 f3 f4.

11

12 form s1 using p1 type c

13 p2 type i

14 p3 type d

15 p4 type t.

16 write: / p1,

17 / p2,

18 / p3,

19 / p4.

20 endform.

-


The code in Listing 18.2 produces the following output:

AAA

4

19980510

164836

1 ACCEPTED SOLUTION
Read only

Nimesh_S_Patel
Explorer
0 Likes
719

Hi Nikhil,

If you have written output from the book than it;s a mistake in SAMS.

Your output should be :

A

4

Today's Date

Today's Time

Thanks

Nimesh S. Patel

hi this is a listing from SAMS ABAP IN 21 DAYS.

plz verify how the output of p1 is coming 'AAA'.

report ztx1802.

2 data: f1 value 'A',

3 f2 type i value 4,

4 f3 like sy-datum,

5 f4 like sy-uzeit.

6

7 f3 = sy-datum.

8 f4 = sy-uzeit.

9

10 perform s1 using f1 f2 f3 f4.

11

12 form s1 using p1 type c

13 p2 type i

14 p3 type d

15 p4 type t.

16 write: / p1,

17 / p2,

18 / p3,

19 / p4.

20 endform.

-


The code in Listing 18.2 produces the following output:

AAA

4

19980510

164836

5 REPLIES 5
Read only

Former Member
0 Likes
719

I just tried the same program...

Here is the output

A

4

20122007

100616

I see no issues with that.

Lokesh

Read only

Former Member
0 Likes
719

Nothing wrong..

I'm getting out like

A

4

20122007

110545

data: f1 value 'A',

f2 type i value 4,

f3 like sy-datum,

f4 like sy-uzeit.

f3 = sy-datum.

f4 = sy-uzeit.

perform s1 using f1 f2 f3 f4.

form s1 using p1 type c

p2 type i

p3 type d

p4 type t.

write: / p1,

/ p2,

/ p3,

/ p4.

endform.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
719

as per the coding here it could only print A once

Read only

Former Member
0 Likes
719

Hi,

The output is only A and not AAA.

I executed this and verified.

Please reward points if its helpful.

Regards,

kamalapriya

Read only

Nimesh_S_Patel
Explorer
0 Likes
720

Hi Nikhil,

If you have written output from the book than it;s a mistake in SAMS.

Your output should be :

A

4

Today's Date

Today's Time

Thanks

Nimesh S. Patel