How to email the sales invoice to customer on his email id

hi masters,
i have got one report for development in which i have to send the sales invoice to that respective customer's email ID(email id of any domain like yahoo, gmail etc). and like this they want to send the there respective invoice to all customer's email id. i am first time working on email sending report for the external email address. plz help me how to sort out this problem?
thanks
Vicky

Hi check the following program:
REPORT zemail_gm.
*********Variable Declarations *****************************
DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
gv_bin_filesize TYPE i, " Store the file size
gv_pos TYPE i,
gv_len TYPE i,
gv_tab_lines TYPE i.
********Constants *******************************************
Data : gc_text(11) type c value 'Form Output',
gc_tst(3) type c value 'TST',
gc_testing(7) type c value 'Testing'.
*********Work Area Declarations *****************************
DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed
gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing
gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List
gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines
gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255
gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components
*********Internal tables Declarations *****************************
DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
gt_otf TYPE TABLE OF itcoo, " OTF Structure
gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
CLEAR : gv_form_name,
gs_ctrlop,
gs_outopt,
gs_otfdata,
gv_bin_filesize,
gv_pos,
gv_len,
gv_tab_lines.
START-OF-SELECTION.
• Generate Function Module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPDF_G'
IMPORTING
fm_name = gv_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
• Assigning values to Form Control Structure and Form Composer
gs_ctrlop-getotf = 'X'.
gs_ctrlop-no_dialog = 'X'.
gs_outopt-tdnoprev = 'X'.
• Getting the OTFDATA
CALL FUNCTION gv_form_name
EXPORTING
control_parameters = gs_ctrlop
output_options = gs_outopt
user_settings = 'X'
IMPORTING
job_output_info = gs_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
• Assigning the OTFDATA to OTF Structure table
CLEAR gt_otf.
gt_otf] = gs_otfdata-otfdata[.
• Convert the OTF DATA to SAP Script Text lines
CLEAR gt_pdf_tab.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_bin_filesize
TABLES
otf = gt_otf
lines = gt_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
• Assigning the Description of the object sent in the mail
CLEAR gs_docdata.
gs_docdata-obj_name = gc_tst.
gs_docdata-obj_descr = gc_testing.
• Assigning the email id to Structure of the API Recipient List table
CLEAR : gt_reclist, gs_reclist.
gs_reclist-receiver = w_id. " Here give the mail ID
gs_reclist-rec_type = 'U'.
APPEND gs_reclist TO gt_reclist.
• Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table
CLEAR : gs_objbin, gs_pdf_tab.
LOOP AT gt_pdf_tab INTO gs_pdf_tab.
gv_pos = 255 - gv_len.
IF gv_pos > 134. "length of pdf_table
gv_pos = 134.
ENDIF.
gs_objbin+gv_len = gs_pdf_tab(gv_pos).
gv_len = gv_len + gv_pos.
IF gv_len = 255. "length of out (contents_bin)
APPEND gs_objbin TO gt_objbin.
CLEAR: gs_objbin, gv_len.
IF gv_pos < 134.
gs_objbin = gs_pdf_tab+gv_pos.
gv_len = 134 - gv_pos.
ENDIF.
ENDIF.
ENDLOOP.
IF gv_len > 0.
APPEND gs_objbin TO gt_objbin.
ENDIF.
• Filling the details in SAPoffice: Description of Imported Object Components table
DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
CLEAR gs_objbin.
READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
IF sy-subrc = 0.
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
gs_objpack-transf_bin = 'X'.
gs_objpack-head_start = 1.
gs_objpack-head_num = 0.
gs_objpack-body_start = 1.
gs_objpack-body_num = gv_tab_lines.
gs_objpack-doc_type = 'PDF'.
gs_objpack-obj_name = 'ATTACHMENT'.
gs_objpack-obj_descr = 'test'.
APPEND gs_objpack TO gt_objpack.
ENDIF.
• Sending the Form Output in the PDF format to email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gs_docdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_objpack
contents_bin = gt_objbin
receivers = gt_reclist
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
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE 'Sent Successfully'.
ENDIF.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
END-OF-SELECTION.
Regards,
Rock.

Similar Messages

  • How can we make the value of pricing condition flow to the sales invoice?

    At an intercompany process, we have the condition type PBXX at the purchase order. On the other hand, at the sales invoice (which is created by VF01) of the sames process, there exists the condition type PR00. The calue of the condition types PBXX and PR00 should be the same. How can we make the value of PBXX flow to the sales invoice? I can create new pricing procedures if needed. I can change the types of the pricing conditions (such as PBXX or PR00) included at the procedures (by customization) if needed. All I need is to have the value of the price at the purchase order the same with the sales invoice at the same process. The transaction codes used at this process are:
    ME21N - Create purchase order
    VL10D - Create delivery
    VF01 - Create invoice
    Thanks in advance for the answers...

    Yes, i verified that the config item id in the pricing table and the cz_config_items table are the same (once we save the configuration).
    The reason we have to do this is coz I have to pass additional parameters, which are item speciific (captured at confiugurator runtime session) while making a call to the pricing engine.
    Hence, we are capturing some additional pricing parameters (during a runtime configurator session) in a custom table, and plan to link those to the corresponding items in the 'CZ_Pricing_Structure' table thru the config_item_id.

  • How to pull the Sale order number(sales document) to Accounting document

    Hi Gurus,
    How to pull the sale order number to the accounting document.
    Is any configuration needed to this.
    When i run the FBL5N Repoprt ,Sale order number (Sales document) is not getting updated to accounting document.It is diplaying as blank field.
    Thanks you.

    Hi Shivaji,
    In order to display the Sales document in the customer line item report, you need to add it as a special field thorugh customizing settings.
    Path - SPRO - FA-GL Accounting - GL Accounts - Line Items - Define special fields for finding and sorting data and in that select the table BSEG-and field VBEL2 (Sales document) and save/
    This will work. hope this helsp
    regards,
    radhika

  • How to create the PROFORMA INVOICE

    Hi all,
             How to create the PROFORMA INVOICE.
    T-code?
    Regards,
    T.Muruganantham

    Dear Anantham,
    After completion of the delivery you can create proforma invoice with reference to the delivery document in the transaction VF01.
    You can create Proforma invoice with reference to the Sales order also.
    Go to VF01 transaction enter the billing type as F5 if you want create proforma invoice with sales order.
    or Enter billing type as F8 it you want to create proforma invoice with delivery.
    Before all these things you should have the copy control settings between order to proforma invoice and delivery to proforma invoice
    I hope it will help you
    Regards,
    Murali.

  • How to check the sales orders that have been created with an Rebate Agreeme

    Dear Experts,
    Do you know how to check the sales orders that have been created with an Rebate Agreements?
    Thanks!!

    Hi Hoo Laa,
    I have one way but little lengthy.
    Rebate condition always appears in the billing document.
    So 1st you extract the sales order list from Table VBAK.
    once you have the sales order list then you can put your order list in Table VBFA --> Extract the billing document list.
    Now put that list in the table VBRK.
    In VBRK you will get the "Doc. condition" --> put that doc condition in table KONV with your rebate condition type.
    It will show the result.
    Later, through VLOOKUP you can identify in which order you have given rebate to your customer.
    Already said, Little lengthy
    Regards,
    MT

  • How to manage the Credit Control for Customer Consignment Process?

    Hi All,
    Could anyone tell me how to manage the Credit Control for Customer Consignment Process?
    Thanks

    Hi, there is not standard solution, we did customized process for consignment credit block , check below
    1. defined status profile - with lock/auto/approved/rejected and new t.code for approval or rejected.
    2. maintained consignment credit limit in Z table
    3. logic for detemining status written in sales order save userexit.
    4. while calcualting the values, system need to check open sonsignment order of customer/ open deliveries/ stocks at customer place MSKU table. and calculate value with MBEW/KONV ect.
    5. if value is less than Z table then status AUTO, which do not need release, if value is greater than Z table put status LOCK means credit block need to release from new T.code.
    Hope you get some idea

  • How to change the reconciliation account in customer master record?

    hi friends,
    i created customer master with wrong reconsiliation account in XD01. i failed when i am trying to change that reconsiliation account in XD02. it was suppressed. how to change the reconcilition account in customer master data?

    Hi,
    Go to this path: Spro>Financial Accounting>Account Receivable & Account Payable>Customer Accounts>Master Data>Preparations for Creating Customer Master Data>Define Account Groups with Screen Layout (Customers)
    Double Click on Your Group, Then Click on Company code Data under Field Status, Then Double click on Account Management, That screen you will find the Reconcilation Account, Select Requred Entry.
    now it will coming Customer master.
    It's useful assigne points as a way to say Thanks
    Regards
    gvr

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • How to delete the sales org information from BP Master Data in SAP CRM 5.0

    Hi Guruu2019s
    How to delete the sales org information from BP Master Data in SAP CRM 5.0
    Thanks...
    Mahesh Pasupunuri

    Hello
    There is a report attached to [SAP Note 725857|https://service.sap.com/sap/support/notes/725857] that performs the deletion.
    Regards
    Joaquin

  • How to see the MM invoice changes in sap?

    Hi
    How to see the MM invoice changes in sap ?

    Dear Prashant,
    When ever we perform LIV and is blocked for payment (due to price variance or other variance) is stored on table RBKP_BLOCKED
    Now when we release it through t. Code MRBR that time its get deleted from RBKP_BLOCKED
    So you can always track it :
    Go to ->SE16 ->Enter table name CDHDR -.>Table contents (F7)
    In the selection screen enter
    OBJECTCLAS as INCOMINGINVOICE
    OBJECTID as =Invoice no+year (e.g 51056066022011 where is 5105606602 invoice no 2011 is year)
    TCODE as MRBR
    ->Execute
    You will find the details when it was released  Date ,Time, User ID etc
    Edited by: redriver on Dec 26, 2011 2:23 PM

  • How to set the status for a customer plan to RELEASED.

    Hello all,
    I created a program for mass creation of customer plans. But after the creation of a plan, the status should be set to released, so that the user can go about creating the trade promotions for the customer plan. Can anybody tell me how to set the status of a customer plan to RELEASED.
    Thanks,
    Disha.

    Hi Clemens,
    I am not talking about doing it in the CRM_UI transaction..I created a program..which would create the customer plans based on the planning account data provided. I was succesfull in creating the plans, but I am not knowing how to release it, if only anybody can tell me about a Function module or method, which can help me do this, that would be great
    Thanks,
    Disha.

  • How to reverse the cancellation invoice?

    Dear Experts,
    Our user had an invoice document posted through MIRO:
    86 GR/IR ACCOUNT     XXXX
    50 Stock in Transit        YYYY-
    Then reverse the invoice document through MR8M, journal as follow:
    96     gr/ir account                    xxxx-
    83     exchange rate variance     xxxx-
    93     exchange rate variance     xxxx-
    40     stock in transit                 yyyy
    My question is:
    -why exchange rate variance occured in journal cancellation invoice (mr8m)?
    My client did'nt want had variance posting; therefore the cancellation invoice journal above
    should be reverse.
    How to reverse the 'cancellation invoice'?
    Kindly advice.
    Thank you.

    Hi
    Please, see SAP Note 46564 - Cancelling/reversing an invoice/credit memo: Posting logic and related notes for a proper understanding of reversing.
    I hope this helps you
    Regards
    Eduardo

  • How to see the billed invoices in VF04 transaction

    Hi,
    All
    I would like to find a way to see the invoice number for collective billing. When we process more than one Delivery at a time,
    The invoice number is generated in background and in order to find it that we have to reference back to the delivery. Is there an  place to see this or
    how to see the billed invoices in VF04 transaction
    Thanks
    rajesh

    Hi
    You may check the table VBRK, give the date of creation of invoice in ERDAT field and execute, it will give all the Invoice created on that date.
    you may also check with ref. to the invoive no. in table VBRP for the Delivery no. in the field VGBEL.
    If require you may create an ABAP Querry for these two tables VBRK and VBRP.
    Hope it will help
    Regards
    AA

Maybe you are looking for

  • How to move Acrobat 8 Pro to a new computer?

    I bought a new computer and need to transfer  Acrobat 8 Pro from the old to the new. Both use Windows 7 Ultimate. The old in 32 bits, the new in 64 bits. How can I do it? Thanks,

  • How do I prompt a user to download a file

    I have reference to something that is similar to a txt file extension. Instead of IE displaying the file I would like the user to be prompted with the Save As dialog box or even better have word open the document on their computer, any of you clever

  • [FIXED!] tearing in sdl (GL) apps

    Problem: If you have compositing extension enabled, sdl 1.2 based opengl apps will produce tearing unless you manage to disable backing store. Causes: * In the past SDL relied on the environment variable: SDL_VIDEO_X11_BACKINGSTORE to enable backing

  • HT4863 iCloud Mail is showing incorrect storage capacity

    My Mailbox is currently showing 3.1 GB capacity, and is causing huge trouble in my iCloud backup and operations in several of my iDevices including my mac. When I open my iCloud account, I've ensured I deleted majority all of my previous email and is

  • Importing a DV File

    I have a DV file on my hard drive that I want to import into an iMovie project. I've never really used iMovie before. Really all I want to do is insert chapter markers for use in iDVD. The file's 18.88 GB. When I drag the file into iMovie, the "impor