Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to send output of program via email?

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


Please Help Members By Posting Answers For Below Questions

What are the system fields you have worked with? Explain?

1043


What is the difference between a pool table and a transparent table?

940


How can we set the tablespaces and extent sizes ?

945


What are field symbols and field groups? Have you used component idx of structure clause with field groups?

983


What is the significance of technical settings (specified while creating a table in the data dictionary) ?

975


What are two methods of modifying sap standard tables?

1064


Which transaction code can I used to analyze the performance of ABAP program.?

1066


How will you transfer data into a file in application server?

1009


Explain what are interactive reports?

1008


What primary key and foreign key relationship

1322


The loop-endloop on extract datasets can be used without any kind of errors. State true or false. : abap modularization

1056


Explain the difference between a pool table and a transparent table?

967


How to find Kernal badi ?

1552


What is “call mode”?

932


SAP query how to use end users?

2140