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 sap locking?
What are the major steps will you use for tuning?
How do you send files to the legacy systems from sap and vice versa? How does one know that the legacy files have come on to the sap server you are working on? : abap bdc
What are the modes in which any update tasks work?
How to read files and process BDC's automatically ?
HOW TO TRANSFER VENDOR MASTER DATA FROM LEGACY SYSTEM TO SAP SYSTEM THRU LSMW (IN LSMW, USING DIRECT INPUT PROGRAM:RFBIKR00)
what is the process of creating quotation using BAPIs.
SAP query how to use end users?
In order to upload purchase order details, how you handle multiple values for a single field?
what is the purpose of BAPI BAPI_CUSTMATINFO_GETLIST What is input and output of this BAPI.
Work most on which module: name a few tables?
What are the function modules used in f4 help?
What are the sequences of event block?
What is the significance of the memory table ‘screen’?
Can any tell me ECC 5.0, ECC 6.0 Released year? and difference between them?