Answer Posted / 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 |
Post New Answer View All Answers
What is view? Different types of view. Explain?
Give an example of interface from your project explaining why you used it?
What are the data types of the abap/4 layer? : abap data dictionary
how can we enable hyperlink in screen painter?
What is the logo in sap script?
How to get that a secondary index is attached to a select query?
What are the function modules used to create batch input session? : abap bdc
While sorting field groups we cannot use more than one key field. State true or false. : abap modularization
How will you read from internal table records in a given value range (without using loop)
What is Transactional based Application & Role based Application?
please give the remaining answers.
What are the differences between a database index and a match code?
wat are the process that can be executed & tracked in a workflow?
How can cluster table be created?
What are conditional chain statement?