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
Does sap handle multiple currencies?
Explain the table, which contain the details of all the name of the programs and forms?
What are the data types of the external layer? : abap data dictionary
What are the differences between structure and table in data dictionary in abap? : sap abap data dictionary
What is narrow casting and wide casting?
What work you have done in HR module
What are the check tables and value tables?
Can you assign a matchcode object to a parameter? If so how?
Did you create any joins?
What is the difference between a structure and a table? : abap data dictionary
Suppose the client wants me the vacancy to be displayed on a website as well as ess. How should I do it? : sap abap hr
Different types of locks?
Difference between user exit and badis?
How do you take care of performance issues in your ABAP programs?
In tm, if a group of employees gets 10 days of annual leave, what will be the time evaluation status? : sap abap hr