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

Automatic Report

Former Member
0 Likes
523

Hie All

Can you please assist me with code to print a report automatically for receipting purposes.

4 REPLIES 4
Read only

Former Member
0 Likes
491

William,

The parameter to set as default for the user is set up in the screen when you go to print it. You would need the users that perform this task to set the one option to Print Immediately and then SAVE it with the User-Specific print parameters Button at the top of the screen.

After that, the user shouldn't have to do anything more.

Read only

Former Member
0 Likes
491

Hi,

To send an email please use this sample code:

code

Declarations.

PARAMETERS: p_email(50) LOWER CASE.

DATA: document_data LIKE sodocchgi1.

DATA: t_content LIKE STANDARD TABLE OF solisti1.

DATA: s_content LIKE solisti1.

DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.

DATA: s_receivers LIKE somlreci1.

START-OF-SELECTION.

Receivers.

s_receivers-receiver = p_email.

s_receivers-rec_type = 'U'.

s_receivers-express = 'X'.

APPEND s_receivers TO t_receivers.

Subject

document_data-obj_descr = 'New mail from Sap'.

Body

s_content = 'Hi,'.

APPEND s_content TO t_content.

CLEAR: s_content.

APPEND s_content TO t_content.

s_content = 'Test email from sap, please don''t reply to this email'.

APPEND s_content TO t_content.

CLEAR: s_content.

APPEND s_content TO t_content.

s_content = 'Thanks,'.

APPEND s_content TO t_content.

s_content = 'Naren.'.

APPEND s_content TO t_content.

Send the email.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = document_data

TABLES

object_content = t_content

receivers = t_receivers

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

IF sy-subrc 0.

MESSAGE e208(00) WITH 'Error in sending email :-(('.

ELSE.

MESSAGE s208(00) WITH 'Email sent )'.

ENDIF.

SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.[/code]

In order to do it automaticly either:

create program which will read a table and look for new entries and schedule it SM36

use workflow (configure event handling)

regards,

venkat.

Read only

Former Member
0 Likes
491

Hie

thank you so much but i want code that print a receipt after making a deposit or withdrawal how to attache fields to a report and print.

Read only

Former Member
0 Likes
491

Thanks