E-mailing packing list to the customer

Hi,
Our business process needs emailing of packing list to the customer.
The packing list output form has been developed using SMARTFORM to print bar codes on it.
We would like to utilize contact person functionality, which is available in the customer master, to store the email id of the packing list recipient.
Can you provide the details of how to send the packing list output to the customer contact using SAP email functionality? Should I need to create a separate output condition type for it?
Thanks in advance.
Regards,
Shiva

Hi,
You can use the following code to send the smartform output to email.
*********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 = '[email protected]'.
  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.
Reward if useful.........

Similar Messages

  • Emailing packing list to the customer contact

    Hi,
    Our business process needs emailing of packing list to the customer.
    The packing list output form has been developed using SMARTFORM to print bar codes on it.
    We would like to utilize contact person functionality, which is available in the customer master, to store the email id of the packing list recipient.
    Can you provide the details of how to send the packing list output to the customer contact using SAP email functionality? Should I need to create a separate output condition type for it?
    Thanks in advance.
    Regards,
    Shiva

    Hi Shiva,
                 Is this through the SMARTFORM print program.
    If so...
    After calling a SMARTFORM function module. get the spool number from sy-spono.
    SMARTFORM output would be in OTF format. then convert this OTF Spool to pdf format using call  fm CONVERT_OTFSPOOLJOB_2_PDF or
    CONVERT_OTF_2_PDF (Check the fm, I am not sure which one is best).
    Output from this fm would be PDF table type tline
    Send this pdf file to  customer email id using fm 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    Let me know if u need further help.
    Reward points.
    Thanks
    Sampath.

  • Using ms project 2007 and vba macro to list all the custom fields used in the project?

    Hi,Using ms project 2007 vba macro, I would like to be able to list all the custom fields used in the project and their corresponding field names. e.g. let us say I create a calculated duration field and name it "expected duration" and the name
    of the field I select is Duration1.
    I am trying to write a macro that will list all the used custom fields such as the result would look like:
    Duration1 ---> "expected duration"
    Text1       ---> "anything"
    Flag1        ---> "....."
    Number1  ---> "..............."
    Can anyone provide me with the solution?
    Regards,
    Chuck

    John,
    I found this module, which provides the the list of custom fields used in the project but does not provide the name given to the field. Here below is the module and hope you could help me achieve this by modifying the macro to list the renamed field.
    ' MSP Checks all Custom Task Fields
    Sub checkfields2()
    'This macro will check and report out which custom task fields are used
    'It requires Project 2002 and above as it relies on the GetField
    'and FieldNameToFieldConstant methods which were not introduced until
    '2002.
    'It does not include resource fields, however it is a simple matter to
    'do it by replacing the pjTask constant with pjResource.
    'Copyright Jack Dahlgren, Oct. 2004
    Dim mycheck As Boolean
    Dim myType, usedfields As String
    Dim t As Task
    Dim ts As Tasks
    Dim i, it As Integer
    Set ts = ActiveProject.Tasks
    usedfields = "Custom Fields used in this file" & vbCrLf
    myType = "Text"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 30
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Number"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 20
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Duration"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If Left(ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)), 2) <> "0 " Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Cost"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Start"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Finish"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    MsgBox usedfields
    End Sub
    This is what the module gives me. But I would like to have beside Text 1 the name that is shown as below. e.g Text1 is "Test".
    Would you mind helping me achieve this?
    Thanks in advance.
    Chuck

  • Mail invoice/statement to the customer

    Hi gurus
    i would like to know how we set up in R11 so that the system can automatically sent invoices/statements to the customers,i tried the function of making the customer site a statement site,and setting the statement cycle but when i test it,i get no results,please help.
    thanks

    Depending on the SAP vesion you need to set-up transmission medium 7.
    Please check sap.help.com where you find an instruction how to enter the email address in that case.
    Just saw that your request is very old ... too late my answer I assume.

  • Items are deleted from the Pick and Pack list.

    Hallo,
    one customer of mine has a problem with the pick and pack list.
    First the pick and pack process is done according the the standard process. Everything is fine. Customer prints delivery note and also the invoice.
    One day or two days later (it is no always the same) the items disappear from the pick and pack list. The ID of the list stays there but you cannot see any articel any more.
    Version: 8.81 PL08
    I would be very thankful for any comments.
    Franz

    Dear Gordon,
    thank you very much for the reply.
    No, we have no done any update at this cliente but since we are using the pick and pack functionality at this customer, we have this problem.
    Regards,
    Franz

  • Print Material text on Pick/Pack list??

    HI Friends,
    Is there any such thing existing for text specific to a material to print on shipping papers (Pick list/Pack list)
    I have a request to print that the material xyz  "must be packed in containers & must ship in quantities"
    I can enter it in the customer master - but then it will print for every item.  Appreciate your advise and expertise.
    Thanks.
    Mike

    But how can i make sales text specific to only one material, bcoz i want this text to appear on pack list.
    For any other material if there is any text exist under sales text it would also print on pack list, here the requirement is i have to restrict this text to only one material. pls advise.
    thanks.
    Mike

  • Invoice and Packing List Issue

    I have a delivery created . Now in invoice I see the correct weignt and materials . However in the packing list all the items are duplicated adding to incorrect weights . Please guide me , how to close this issue .Screenshot given
    Thanks
    MM_sD

    Hi,
    I will just again clarify this issue.
    I have a Del Doc which has 34 packed items, but in the script its showing 55 packed items.
    For other Del Doc its has 9 packed items which is showing all 9 items properly in the sap script.
    I have debugged the print prog comparing both documents and have found that at a place a std FM is used, which is fetching the packed orders:  SD_DELIVERY_VIEW.
    But here after this FM is executed its fetching 55 packed ones for the 34 packed items Order and for the 9 packed items Order its fetching the correct 9 packed items after the FM is executed.
    Hopefully this clarifies my issue.
    Its showing correctly for an order and its displaying incorreclty for another in the SAP Script.
    If someone could(would) please help. I feel there is a solution for this.
    Many Thanks,
    Jagan.

  • Print Packing List from Delivery at Goods Issue

    We are facing an issue with our packing list for a division we are going live with in three weeks.  Our current business process for our plants already on SAP is to create the Packing List when the Delivery is created, with timing code "3" in the Packing List output condition, but to not print it until the "Check-in" button is clicked with the Shipment in VT02N based on an activity profile.
    However, for the service shipments in this division going live August 1, we do not need to create a Shipment nor generate a Bill of Lading from VT02N.  We will post goods issue from the Delivery itself, and we want the Packing List to print at the time of Post Goods Issue from the Delivery.  We have an access sequence for these service Deliveries with Shipping Point/Distribution Channel/Delivery Type, so only Distribution Channel 02 Deliveries will have Goods Issue from the Delivery, but we are not sure how to get the Packing List to not print until Goods Issue.  Any advice would be appreciated.
    Regards,
    Jeff Stewart

    Go to IMG>Logistics Execution>Shipping> Basic Shipping Functions>Output Determination> Maintain Output Determination for Outbound Deliveries.
         Select the Procedure you are using and check the control data to find the Cond. Type you are executing at the moment of the Outbound Delivery.
         Check the fifth column and see you have plenty of options, check them out helped by an ABAP team member; if there is nothing already there, just ask him/her to create a new routine with the validation you need and set it there.
    This is the same that Joao is suggesting I just went a little bit more in details.
    Good luck Jeff!

  • How do I tell Mail to look in the ~/mail folder on the IMAP server

    I run my own IMAP server. If you ask it for a listing of ~/mail, it shows every folder I want Mail to see.
    I can't seem to convince it to stop looking in ~.
    One important thing: my inbox is NOT in /var/spool/mail/$USERNAME. Everything is procmail filtered. My inbox is ~/mail/inbox.
    MacBook Pro   Mac OS X (10.4.6)  

    Okay, that and restarting Mail got it to look in the folder. Thanks.
    Why isn't ~/mail/inbox listed?
    The Special Icon labeled Inbox isn't showing the contents of ~/mail/inbox.

  • Packing list printing problem......

    Hello Experts,
    We are having a new problem in Master Packing List, after the modified package has been loaded to SPD. For same material code, appearing against different WBS elements, the print-out contains separate line items but with same WBS no. (which is appearing first in the sequence).
    Regards,
    Boseavi

    thanks for ur reply.....
    I will check & confirm...
    Boseavi

  • Error during running of Smart Form of Packing list.

    Hi,
    I am working on packing list using the standard program.
    while writing the code in smart-form i am using the SALES_UNIT field of IT_GEN.
    but it is giving the error as follows.
    *The data object "IS_DLV_DELNOTE" does not have a component called "IT_GEN-SALES_UNIT".*
    I have declared IS_DLV_DELNOTE as ledlv_delnote in Form Interface of smartform.
    Please help me in above issue.

    Hi
    The structure LEDLV_DELNOTE is having the IT_GEN
    if you  are using it for delivery then use the above structure
    Regards
    Shiva

  • Issue during printing Pack List

    Hello,
    I am getting the below error (in the Processing Log) when I am printing the Pack List from the Outbound Delivery.
    "No handling units exist" Message no. VL490
    I am using the standard output type PL00 and the standard program.
    Can anyone tell what the issue is ASAP
    Thanks
    SAP FAN

    Hi Vinod,
    I am not using HUM or packaging material but I still need a Pack list(PL00) for the item that is going out.
    Isnt it standard to print a Pack List whether or not HUM is being used.
    Do we have any other output type or a way to print pack List.
    Thanks
    SAP FAN...

  • Price list assignment to customer

    Hi,
    I have created a customer in Order Management but by default price list coming with some value. But I want to assign my own price list to my customer. Can anyone provide me solution for this.
    Thanks
    Bharat G.

    starter wrote:
    hi luko,
    I have created a price list and customer. But not added order type and price list to the customer. I have just created profile class for credit limit and assigned that profile class to the customer what I have created. Now I want to assign that order type and price list what I created to my customer. But Iam unable to do that. My actual requirement is When Iam doing sales order with my customer I have to get default order type and price list for it. But Iam unable to get them by default. By default some other value is populated in price list field. So I want to populate order type and price list as per customer.
    Regards,
    Bharat G.That is what luko has said..if you wanna know..from where the order type and price list are been defaulted...
    you have to visit the defaulting rules..so that we can figure out the sequence for ordertype and pricelist..
    If you are still confused..just try and add your price list and ordertype for your customer in ship to location..
    just give a try:)
    HTH
    Mahendra

  • Pick List and Pack List

    Can anyone please provide some light on how the system should generate a pick list and pack list. what config needs to be done and settings. or help me with some tutorials even.
    Thanks,
    Kanna Palle.

    Dear Kanna,
    Picking & Packing lists are the output types in the shipping output process.
    Packing list
    Standard output type for Packing list is PL00
    To get the Packing list output you need to do the output determination settings for the outbound deliveries.
    In the output determination procedure you keep the Packing list output type.
    Picking list
    1. First assign your Output type EK00 to the shipping point(Enterprise Structure - Definition of Shipping point), also maintain the time and medium.
    2. Use TCode V/38, to maintain the condition type EK00, maintain the time,print parameters and transmission medium.
    Also assign the processing routines Prog: RVADEK1,Form Routine: ENTRY, Form:SD_PICK_SINGLE
    3. Mainatain the print parameters for shipping pt using TCOde VL01SHP.
    For output determination in shiiping go through this IMG path
    IMG>Logistics execution>Shipping>Basic Shipping functions>Output control>Output determination>Maintain Output Determination for Outbound Deliveries
    -->Maintain Condition Tables
    -->Maintain Output Types
    -->Maintain Access Sequences
    -->Maintain Output Determination Procedure
    -->Assign Output Determination Procedures
    Maintain condition records through VV21 transaction.
    I hope this will help you,
    Regards,
    Murali.

  • Mail trigger to the customer

    HI
    we have the scenario like , we create the quotation in CRM and after creation we release the quotation , after release at the time of saving the document , system has to trigger a mail to the customer that is quotation printout .
    So for sending quotation printout , what is the standard smartform i have to use and assign to the action "Smartform mail". and also from the activity transaction say suppose we are creating Meeting activity and i maintain the list of attendees in the Meeting activity transaction (attendee also a partner function) and i will assign list of employees as a attendees in the meeting trasaction and i have to trigger a mail or some alert to the list of attendees whom i maintained in that particular transaction as " Meeting is going to held on ....................date  Etc.,)

    Hi Marthanda,
    You can try using Actions to meet this requirement.
    Check the BO event getting triggered when you save the document after releasing the quotation.
    Check this in SWEL t-code.
    Now create an Action which should trigger when this event is triggered in the system.
    You can attach a smartform at an output of this ACtion, which can be used to send mail to the customer.
    Hope this helps!
    Regards,
    Saumya

Maybe you are looking for

  • CS4 does not support XP 64....

    I just read this from Curt: "Premiere CS4 does not support XP64. It supports XP 32, Vista 32, or Vista 64 on PC" Why not? and will it be supported in the future? Will it work with Windows OS 7?

  • Computer switches off while uploading

    I have been making some changes to http://www.lerosdiving.com/diving_pics.htm and the template. When I went to upload the pages 3 minutes in, the computer made a humming noise for a moment and then switched off (WinXP Prof, DW8 no updates). I restart

  • Error when opening illustrator

    how can i fix this ? Thanks

  • NI PCI 5102 not visible in MAX

    Hi all I've got a problem on a testrig. I use a PCI 5102 high speed digitizer to acquire a signal. Since this morning, the acquisition and processing of this signal has slowed down and now it takes twice as long as before. What could be the cause of

  • Lens Profile for Nikon Nikkor AF-S 18-35mm 1:3.5-4.5 G ED

    Hi, I'am missing the Lens Profile for the above Lens from Nikon. The Lens is build since January 2013 and I hoped that the new Lightroom 5 includes a Profile für this lens. Does anybody know when Adobe will update Lightroom with this Profile? Or does