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

Status Message for ABAP Program

Former Member
0 Likes
1,437

Hello Gurus,

I have an internal table. I placed the contents of the internal table on the application server using executable program. Everything works fine.

When I execute the program, the selection screen appears and after I give the inputs and execute again, the file is placed on the application screen and the screen is back to the abap code from selection screen.

I want a status message at the bottom indicating that the file was placed in the application server successfully. If it fails then I need the failure message that the file was not placed.

Please help me out how I can get these messages when I execute my program and where I need to place this code in my program.

Regards,

Balu

8 REPLIES 8
Read only

Former Member
0 Likes
1,044

Hi,

You would be using OPEN DATASET, to transfer the internal table contents to Application Server file.So check sy-subrc.

OPEN DATASET.....

<b>IF sy-subrc eq 0.</b>

loop at itab.

transfer itab....

endloop.

Close Dataset.

Message 'File successfully saved!'.

<b>else.</b>

Message 'Error in saving the file !'.

<b>endif.</b>

Best regards,

Prashant

Read only

Former Member
0 Likes
1,044

Is your program placing the content of internal table to Application server file?

In that case, you can handle the status logic in your program. Let me know what is exactly happening?

Read only

0 Likes
1,044

Prashanth,

It did not work the way you mentioned.

It gives error in the syntax. Some message ID like that.

Ashish,

Yes, I am placing the contents of an internal table onto application server.

The program works fine.

But I want a status message once the program is executed successfully stating the file has been placed in application server if not then an error message.

I created a message class in SE91 and kept a message for 000 for successfuly placing of file.

How should I proceed. What needs to be added in the program.

Regards,

Balu

Read only

0 Likes
1,044

Prashant's solution is correct. You need to use correct message id and message class.

This will display appropriate message after the process ends. Were you using the code suggested by Prashant as it is?

Read only

0 Likes
1,044

I am using this code. I already created a message class ybpmsg in se91 and saved the messages 000 - file ok and 001 - file not ok. Is there anything I need to add to this code.

Does the message statements work only under the event start of selection??

OPEN DATASET.....

IF sy-subrc eq 0.

loop at itab.

transfer itab....

endloop.

Close Dataset.

MESSAGE S000(YBPMSG).

else.

MESSAGE E000(YBPMSG).

endif.

Regards,

Balu

Read only

0 Likes
1,044

This should work. Just make following change regarding message no

OPEN DATASET.....

IF sy-subrc eq 0.

loop at itab.

transfer itab....

endloop.

Close Dataset.

MESSAGE S000(YBPMSG).

else.

MESSAGE E001(YBPMSG).

endif.

Read only

0 Likes
1,044

Ashish,

I tried that..It gives no error message in code but I dont see the message after I execute the code. When I execute, I get a selection screen and then when I execute again, I get back to the program. The file is placed in the application server. But I dont see any message.

Regards,

balu

Read only

0 Likes
1,044

If you are aware of debugging, execute the program in debug mode. Let me know if you need any help.