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

Problem with abap Object Oriented Transaction

Former Member
0 Likes
889

Hi I have created a OO transaction for my report , and i want to print some output using "Write " statement .

Even if i copy standard program give by sap DEMO_OO_TRANSACTION to Z program and try to change statement

" message 'Instance method in local class' type 'I'.

to

Write " message 'Instance method in local class' type 'I'. "

Output is not shown.

If its not possible then how to do this, in work around.

I want to print one line message for user saying "Table successfuly updated" or "Updation Failed! "

Can anyone help.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
748

Do like this:

class demo_class implementation.

method instance_method.

submit zrtwrite1 and return.

endmethod.

endclass.

Create a Program zrtwrite1 in se38 with code:

report zrtwrite1.

write:/ 'Test'.

Regards,

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
749

Do like this:

class demo_class implementation.

method instance_method.

submit zrtwrite1 and return.

endmethod.

endclass.

Create a Program zrtwrite1 in se38 with code:

report zrtwrite1.

write:/ 'Test'.

Regards,

Ravi

Read only

0 Likes
748

Thanks Ravi, i will reward points for this. But is this the only option. Can you explain me why direct write statement is not working .

Thanks a lot.

Read only

0 Likes
748

Hi Sharad,

I am not sure as to why is not working. Please continue to search for the reason.

Regards,

Ravi

Read only

Former Member
0 Likes
748

Hi,

Try this,

class DEMO_CLASS definition.

public section.

methods INSTANCE_METHOD.

endclass.

*

class DEMO_CLASS implementation.

method INSTANCE_METHOD.

message 'Table sucessfully updated' type 'I'.

endmethod.

endclass.

data : obj1 type ref to demo_class.

start-of-selection.

create object obj1.

call method obj1->instance_method.

*----


The problem is you didn't create the object.

Thanks.

Note : Reward points if helpful..

Read only

0 Likes
748

Hi Vijay ,

thanks for your reply. but in your code if you replace

message 'Table sucessfully updated' type 'I'

by

write 'Table Successfully updated' and try running it with object oriented transaction then it will not work.

Am looking for the reason of the same, and with submit statement it will work.

Thanks & Regards,

Sharad.

Message was edited by:

Sharad T