how to send output of program via email?
Answer / k.nagalakshmi
REPORT ZSEND .
TABLES: KNA1.
* data for send function
DATA DOC_DATA LIKE SODOCCHGI1.
DATA OBJECT_ID LIKE SOODK.
DATA OBJCONT LIKE SOLI OCCURS 10 WITH HEADER LINE.
DATA RECEIVER LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
WRITE:/ KNA1-KUNNR, KNA1-ANRED.
* send data internal table
CONCATENATE KNA1-KUNNR KNA1-ANRED
INTO OBJCONT-LINE SEPARATED BY
SPACE.
APPEND OBJCONT.
ENDSELECT.
* insert receiver (sap name)
REFRESH RECEIVER.
CLEAR RECEIVER.
MOVE: SY-UNAME TO RECEIVER-RECEIVER,
'X' TO RECEIVER-EXPRESS,
'B' TO RECEIVER-REC_TYPE.
APPEND RECEIVER.
* insert mail description
WRITE 'Sending a mail through abap'
TO DOC_DATA-OBJ_DESCR.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_DATA
IMPORTING
NEW_OBJECT_ID = OBJECT_ID
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECEIVER
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.
Is This Answer Correct ? | 0 Yes | 2 No |
hi, what is basic diff b/w RFCs and BAPI? What is basic diff b/w BADI and BAPLI?please dont give the general diff?please any one can tell me?
What are data integrity constraints?
what is the difference b/w linear search and binary search? (how can these search)
15 Answers HCL, IBM,
How to Modify the standard invoice and sales order form to generate purchase order for printing and upload the company logo. plz mention the detail coding Tahnks, Rahul
How many interactive lists?
What is an on”*-input filed” statement?
what is an user exit?
Is logo in script 1st stored as tiff format before uploading or in jpeg format?and where is that stored after uploading?
What is field catalog. Describe the purpose of it?
I want to display the different data on the multiple main windows of the form in Sapscript. Is it possible ? If yes, then How?
In Function module SAP provieds Two Standard Exception, give name of that two exceptions.
What's the difference between AT NEW and AT END OF events?