‎2007 Apr 09 1:38 PM
Hi all,
When we save the sales order in t-code VA01 i need to write a code in the user exit (save_document) i need to send a mail to vendor.kindly provide me the code.
Thanks,
praveena.
‎2007 Apr 09 1:44 PM
hi,
GO TO INCLUDE MV45AFZZ,
AND CHECK THE FORM
USEREXIT_SAVE_DOCUMENT_PREPARE.
AND WRITE YOUR CODE.
PLEASE FEEL FREE TO ASK MORE CLARIFICATION.
REGARDS,
SANTOSH.
‎2007 Apr 09 1:44 PM
hi,
GO TO INCLUDE MV45AFZZ,
AND CHECK THE FORM
USEREXIT_SAVE_DOCUMENT_PREPARE.
AND WRITE YOUR CODE.
PLEASE FEEL FREE TO ASK MORE CLARIFICATION.
REGARDS,
SANTOSH.
‎2007 Apr 09 1:45 PM
Hi,
Go to MV45AFZZ include program, And in that in the FORM FORM USEREXIT_SAVE_DOCUMENT. or in the form FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
write your code relavent for sending mail using the fun module:
SO_NEW_DOCUMENT_ATT_SEND_API1
reward if useful
regards,
ANJI
‎2007 Apr 09 1:51 PM
Hi,
Will you pls provide me some sample code by using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Thanks,
praveena.
‎2007 Apr 09 1:53 PM
It is a well documented FM: Please Check the FMs documentation.
There is an example given in there.
Or you can search the forum with that FM name. There are lot of examples for the sample usage of the FM.
Regards,
Ravi
‎2007 Apr 09 2:00 PM
‎2007 May 10 1:57 PM
Hi
what is the use exit u have used for save document?
beacuz I ahve a program like this to find user exits for a particular t.code.
REPORT z_find_userexit NO STANDARD PAGE HEADING.
&----
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*&
&----
&----
*& Tables
&----
TABLES : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
&----
*& Variables
&----
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
&----
*& Selection Screen Parameters
&----
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
&----
*& Start of main program
&----
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.
IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP Modifactions
SELECT * FROM tadir
INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object = 'SMOD'
AND devclass = v_devclass.
SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/(95) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
WRITE:/(95) sy-uline.
LOOP AT jtab.
SELECT SINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOT ON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
GET CURSOR FIELD field1.
CHECK field1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
this is the ouput Ihave got :
Transaction Code - VA01 Create Sales Order
Exit Name Description
SDAPO001 Activating Sourcing Subitem Quantity Propagation
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly)
V45L0001 SD component supplier processing (customer enhancements)
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing plan
No of Exits: 16
But Im unable to find the Suitable user exit for u r requirement,can upls guide me in this issue.Beacuse I have to do the same issue.
If u have code with u pls mail me to:[email protected]
Thanks in advance