Tbale layout in smartform mail

Hi Experts,
I am sending SMARTFORM as a mail.I am able to send the mail perfectly.But in my smartform table is there.In the mail Table content is displaying but the table layout is missing.I want my smartform as a Boody of the mail not as a PDF or any type of attchment.Please can anybody give me the solution for this.Please.
I will reward you more points.
Thanks,
Swapna.

Hi,
Try This below Sample code,
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string, "To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
DATA : t_bsid TYPE  STANDARD TABLE OF zfr_efl_evcda_letter WITH HEADER LINE.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'ZFR_EFL_SCHEM_COMPLN_LETTER'
  IMPORTING
    fm_name            = v_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.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
  EXPORTING
    control_parameters = w_ctrlop
    output_options     = w_compop
    user_settings      = 'X'
  IMPORTING
    job_output_info    = w_return
  TABLES
    t_zfr_efl_evcda    = t_bsid[]
  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.
i_otf[]  =  w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
  EXPORTING
    format                = 'PDF'
    max_linewidth         = 132
  IMPORTING
    bin_filesize          = v_len_in
  TABLES
    otf                   = i_otf
    lines                 = i_tline
  EXCEPTIONS
    err_max_linewidth     = 1
    err_format            = 2
    err_conv_not_possible = 3
    OTHERS                = 4.
Fehlerhandling
IF sy-subrc <> 0.
ENDIF.
LOOP AT i_tline.
  TRANSLATE i_tline USING '~'.
  CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
  i_record = wa_buffer.
  APPEND i_record.
  SHIFT wa_buffer LEFT BY 255 PLACES.
  IF wa_buffer IS INITIAL.
    EXIT.
  ENDIF.
ENDDO.
Attachment
REFRESH:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = i_record[].
i_objtxt = 'test with pdf-Attachment'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
0.1. Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
0.1. Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = 'Mail ID'. " Give U Mail ID
i_reclist-rec_type = 'U'.
APPEND i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data              = wa_doc_chng
    put_in_outbox              = 'X'
    commit_work                = 'X'
  TABLES
    packing_list               = i_objpack
    object_header              = wa_objhead
    contents_bin               = i_objbin
    contents_txt               = i_objtxt
    receivers                  = i_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.
Reward if useful...
Thanks,
Durai.V

Similar Messages

  • Purchase order layout using Smartform

    Hi All,
    Can anyone let me know how to create Purchase order layout using smartforms and assigning it to output type.
    Is there standard smartform for purchase order?

    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    http://www.sap-basis-abap.com/sapsf001.htm
    http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://www.esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
    http://www.esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
    http://www.esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Try this. A simple sample Smart Form.
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    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.
    SMARTFORMS GENERATION: (calling internal table fields)
    &#61656; Open a smartform using the tcode ‘smartforms’.
    &#61656; Usually form attributes shows admn data.
    &#61656; In the form interface declare import/export parameters if any. Else declare the tables in tables tab button.
    &#61656; In the windows and pages expand and create a table. It automatically generates header, main area and footer for the table.
    &#61656; In data tab button in the table we usually declare a work area to bring the data from se38. Like: ktab into wa. ( The purpose of declaring the wa is , to get the data of the ktab in to header from the body area of the internal table).
    &#61656; And in the tablepainter pushbutton in table we can have any no of line types. Depending on the requirement. ( for ex: If we want to devide a row in to 4 columns, we can devide it as 4,4,4,4cm as line type 1, And usually for the footer we don’t need no of columns, So, we declare it as one column with 16cm measure with the name line type 2.). We can use these line types in the tables.
    &#61656; In the header right click>>create>>tableline. It asks for line type. Select one line type which is appropriate.
    &#61656; Like same create a row2 in main area using right click. If we select the line type 1, it automatically generates 4 cells. We can create text in each cell as per requirement.
    &#61656; We can generate general attributes using general attributes tab button in the text. Or in the other way. We can switch on the field list on/off button from the application tool bar. It displays all the attributes in the left down corner of the screen. We can drag and drop the required fields in the general attributes tab button of the text.
    &#61656; We continue the same procedure for all the texts. The texts should be displayed in the gray color. Then only it can collects the data from the abap editor fields.
    &#61656; If it wont turns gray, we can check the fields in the editor by changing it to the line editor. The best thing is to drag the fields from the list, rather than declaring like &wa-matnr&
    &#61656; In the footer also we create a line type and in that table line we create text.
    SE38 PROGRAM(method I):
    REPORT Z_CALLING_SMARTFORM2 .
    tables: mara.
    select-options: S_MATNR for MARA-MATNR.
    DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.
    data: FM_NAME TYPE RS38L_FNAM.
    SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in
    S_MATNR.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Z_MYFIRST_FORM2'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_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.
    CALL FUNCTION fm_name
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    ktab = ktab
    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.
    IN THE OTHER WAY(method II):
    REPORT Z_CALLING_SMARTFORM2 .
    tables: mara.
    select-options: S_MATNR for MARA-MATNR.
    DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.
    SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in S_MATNR.
    CALL FUNCTION '/1BCDWB/SF00000199'
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    ktab = ktab
    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.
    In the method I we are calling the amartform dynamically using the function module 'SSF_FUNCTION_MODULE_NAME'.
    Here we are exporting form name and importing fm_name.
    So we need to declare the variable fm_name as
    data: FM_NAME TYPE RS38L_FNAM.
    We can have the type of the fm_name in the function module 'SSF_FUNCTION_MODULE_NAME' (in the export tab button).
    Since we are passin the name of the Function module generated by the smart form in to the fm_name variable. We run the function module with the name fm_name, but not the FM generated by the smartform(like /1BCDWB/SF00000199)¬¬¬¬¬¬.
    In the method II we directly call the smartform generated function module (i.e, /1BCDWB/SF00000199).
    But the method I is recommended. In the method I, The fm_name is a variable we don’t put it in the quotes while calling.
    In the both methods we declare the internal table using the like option, but not begin of…. end of. And in select statement we select *, But not individual fields.
    EX2:
    SMART FORM NAME: ZGITI_FORM1.
    SE38:
    REPORT Z_CALL_GIRI_FORM1 .
    TABLES: VBRK.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    *INITIALIZATION.
    *T1 = 'SELECTION-CRIETERIA'.
    DATA: BEGIN OF I_INVOICE OCCURS 1.
    INCLUDE STRUCTURE ZSTR_INVOICE.
    DATA: END OF I_INVOICE.
    DATA: VAR1 LIKE VBRP-NETWR.
    DATA: BEGIN OF I_ADDRESS OCCURS 1.
    INCLUDE STRUCTURE ZSTR_ADDRESS.
    DATA: END OF I_ADDRESS.
    DATA: BEGIN OF I_ORDER OCCURS 1.
    INCLUDE STRUCTURE ZSTR_ORDER.
    DATA: END OF I_ORDER.
    DATA: BEGIN OF I_ITEM OCCURS 1.
    INCLUDE STRUCTURE ZSTR_ITEM.
    DATA: END OF I_ITEM.
    DATA: BEGIN OF I_VBFA OCCURS 1,
    VBELV LIKE VBFA-VBELV,
    VBELN LIKE VBFA-VBELN,
    END OF I_VBFA.
    SELECT KUNAG VBELN VKORG VTWEG SPART FROM VBRK INTO TABLE I_INVOICE
    WHERE VBELN IN S_VBELN.
    IF I_INVOICE[] IS NOT INITIAL.
    SELECT KUNNR LAND1 NAME1 NAME2 ORT01 PSTLZ REGIO FROM
    KNA1 INTO CORRESPONDING FIELDS OF TABLE I_ADDRESS FOR ALL ENTRIES IN
    I_INVOICE WHERE KUNNR = I_INVOICE-KUNAG.
    ENDIF.
    IF I_INVOICE[] IS NOT INITIAL.
    SELECT VBELV VBELN FROM VBFA INTO TABLE I_VBFA FOR ALL ENTRIES IN
    I_INVOICE WHERE VBELN = I_INVOICE-VBELN.
    ENDIF.
    IF I_VBFA[] IS NOT INITIAL.
    SELECT VBELN BSTNK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE I_ORDER
    FOR ALL ENTRIES IN I_VBFA WHERE VBELN = I_VBFA-VBELV.
    ENDIF.
    IF I_INVOICE[] IS NOT INITIAL.
    SELECT POSNR MATNR ARKTX FKIMG NETWR FROM VBRP INTO TABLE I_ITEM FOR ALL
    ENTRIES IN I_INVOICE WHERE VBELN = I_INVOICE-VBELN.
    ENDIF.
    LOOP AT I_ITEM.
    AT LAST.
    SUM.
    VAR1 = I_ITEM-NETWR.
    ENDAT.
    ENDLOOP.
    CALL FUNCTION '/1BCDWB/SF00000223'
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    var = VAR1
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    tables
    i_vbrk = I_INVOICE
    i_vbak = I_ORDER
    i_vbrp = I_ITEM
    i_kna1 = I_ADDRESS
    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.

  • Prob in PO smartform mail sending

    Dear  all,
    We are facing prob at the time of PO smartform  mail sending.
    Issue is if in vendor master if in general tab there is option to mantain mail id.
    if i keep blank than mail is not going this is right.
    but our requirement is if in general tab email is not maintained than also we have to check in contact person tab in vendor master
    there is tab called partners details if mail id maintained in partners than mail should  shoot.
    Thanks in advanced.
    Laxman Sankhla.

    Hi,
    Just find an exit and populate the mail id based on your logic,
    or if you are using WF just chip your logic in one activity.
    Regards
    Bikas

  • Layout in smartforms

    how to create layout in smartform ?

    hi,
      For smartforms refer to the following links
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sap-img.com/smartforms/smart-002.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    regards,
    Veeresh

  • Smartform Mail -DOCUMENT_NOT_SENT Exception

    Hi ,
    We are using the FM - SO_NEW_DOCUMENT_ATT_SEND_API1 to send a smartform mail with PDF attachement, we are able to acheive this in the Developement system, where as in Quality system this FM is raising exception DOCUMENT_NOT_SENT (sy-subrc = 2).
    The same code exists in both the systems, I read in SDN that the SU01 settings should be checked, I checked it and made it similar to the developement system.
    Can anyone let me what may be the root cause of the issue ?
    Thanks in advance.

    Hi Jay,
    Thanks for your quick reply.
    commit_work = 'X' is in the code in both the systems.
    Logged off and logged in again for SU01 settings to be effective.
    But still the same exception.

  • Dynamic table layout in Smartform

    Hi,
    Is there a way to have a dynamic table layout in smartform?
    The idea is to be able to print any kind of table with fieldsymbols without having to define the table layout/cell layout at design time, or if it's not possible choose one of the predefined line types at runtime. Please don't post how to print out a table using fieldsymbols, this is not the topic of this question.
    So I guess you'd need to choose the table line type at runtime or even better, create a table line type at runtime. Is this even possible?
    Thanks
    Edited by: Stanley Marsh on Oct 16, 2008 12:43 PM

    hi
    good
    Tables
    You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed. Table functions are:
    ·        Line feeds in individual table cells
    ·        Event-controlled output of table headings and footers
    ·        Integrated calculation of grand totals and subtotals
    ·        Colored boxes and shadings in tables
    thanks
    mrutyun^

  • Smartform Mail Issue

    Can anyone please let me know how to set the value of JOB_OUTPUT_INFO-OUTPUTDONE to 'X' in the class CL_SF_MAIL_PPF.
    My requirement is to avoid error mesage in logs of transaction CRMD_ORDER which is triggering a smartform mail, if I change the value of  JOB_OUTPUT_INFO-OUTPUTDONE to 'X' while debugging, I am not getting the error message in the logs.
    Mail is triggerred with PDF, there is no issue in the mail, except the above issue.
    Please let me know how to set the above mentioned field to 'X' programatically. Point ll be awarded.
    Thanks in Advance.
    Edited by: Mohana Vijayan on Oct 9, 2009 4:27 PM

    REPORT ZSMF_MAIL_PROGRAM.
    DATA: OUTPUT_OPTIONS TYPE SSFCOMPOP,
    CONTROL_PARAMETERS TYPE SSFCTRLOP,
    OUTPUT_DATA TYPE SSFCRESCL.
    DATA: FILESIZE TYPE I.
    DATA:FM_NAME TYPE RS38L_FNAM.
    DATA LT_OTFDATA LIKE ITCOO OCCURS 1000 WITH HEADER LINE.
    DATA LT_PDFDATA LIKE TLINE OCCURS 100 WITH HEADER LINE.
    DATA:LT_PDF LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA:LW_PDF LIKE LINE OF LT_PDF.
    DATA:LW_PDFDATA LIKE LINE OF LT_PDFDATA.
    DATA:LS_JOB_INFO TYPE TABLE OF SSFCRESCL WITH HEADER LINE.
    DATA:LT_MESSAGE TYPE TABLE OF SOLISTI1 WITH HEADER LINE.
    DATA: DOCU_DATA LIKE SODOCCHGI1 OCCURS 0 WITH HEADER LINE.
    DATA PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE.
    DATA OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA REAL_RECIPIENTS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
    DATA CONTENTS_TXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA CONTENTS_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA PACKING_LIST_TXT LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE.
    DATA OBJECT_HEADER_TXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA OBJECT_HEADER_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    DATA PACKING_LIST_ATT LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE.
    DATA: W_EMAIL(1215) TYPE C.
    DATA:PSUBJECT(90) TYPE C.
    DATA: LD_FORMAT TYPE SO_OBJ_TP ,
    LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
    LD_ATTFILENAME TYPE SO_OBJ_DES .
    *Calling the Smartform.
    Get Email id from ztab_email table.
    select single email_id from ztab_email
    into w_email.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'Z_CONTD_DEBT_FORM'
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    ENDIF.
    CONTROL_PARAMETERS-DEVICE = 'MAIL'.
    CONTROL_PARAMETERS-NO_DIALOG = 'X'.
    CONTROL_PARAMETERS-GETOTF = 'X'.
    CONTROL_PARAMETERS-PREVIEW = SPACE.
    OUTPUT_OPTIONS-TDTITLE = SY-TITLE.
    OUTPUT_OPTIONS-TDNEWID = 'X'.
    OUTPUT_OPTIONS-TDNOPREV = 'X'.
    OUTPUT_OPTIONS-TDDELETE = 'X'.
    CALL FUNCTION FM_NAME
    EXPORTING
    CONTROL_PARAMETERS = CONTROL_PARAMETERS
    OUTPUT_OPTIONS = OUTPUT_OPTIONS
    USER_SETTINGS = SPACE
    IMPORTING
    JOB_OUTPUT_INFO = OUTPUT_DATA
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    OUTPUT_DATA-OUTPUTDONE = 'X'.
    *Convert to PDF Format.
    CLEAR LT_PDFDATA.
    REFRESH LT_PDFDATA.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = '132'
    IMPORTING
    BIN_FILESIZE = FILESIZE
    TABLES
    OTF = OUTPUT_DATA-OTFDATA
    LINES = LT_PDFDATA
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    ENDIF.
    REFRESH LT_PDF[].
    *Convert 132 line sized internal table into 255 line sized internal table.
    CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
    LINE_WIDTH_DST = '255'
    TABLES
    CONTENT_IN = LT_PDFDATA[]
    CONTENT_OUT = LT_PDF[]
    EXCEPTIONS
    ERR_LINE_WIDTH_SRC_TOO_LONG = 1
    ERR_LINE_WIDTH_DST_TOO_LONG = 2
    ERR_CONV_FAILED = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
    Sending it as an Email Attachment.
    LD_FORMAT = 'PDF'.
    LD_ATTDESCRIPTION = 'CONTESTED'.
    LD_ATTFILENAME = 'TEST_FILE'.
    CLEAR REAL_RECIPIENTS.
    REFRESH REAL_RECIPIENTS.
    REAL_RECIPIENTS-REC_TYPE = 'U'.
    REAL_RECIPIENTS-COM_TYPE = 'INT'.
    REAL_RECIPIENTS-NOTIF_DEL = 'X'.
    REAL_RECIPIENTS-NOTIF_NDEL = 'X'.
    REAL_RECIPIENTS-RECEIVER = W_EMAIL.
    APPEND REAL_RECIPIENTS.
    CLEAR PACKING_LIST.
    REFRESH PACKING_LIST.
    *Describe the body of the message
    PACKING_LIST-TRANSF_BIN = ' '."""""""""""""" CHANGE IT FROM 'X' TO ' ' """""""""""""
    PACKING_LIST-HEAD_START = 1.
    PACKING_LIST-HEAD_NUM = 0.
    PACKING_LIST-BODY_START = 1.
    PACKING_LIST-BODY_NUM = 1.
    PACKING_LIST-DOC_TYPE = 'RAW'.
    APPEND PACKING_LIST.
    PACKING_LIST-TRANSF_BIN = 'X'.
    PACKING_LIST-HEAD_START = 1.
    PACKING_LIST-HEAD_NUM = 1.
    PACKING_LIST-BODY_START = 1.
    DESCRIBE TABLE LT_PDF LINES PACKING_LIST-BODY_NUM.
    PACKING_LIST-DOC_TYPE = LD_FORMAT.
    PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
    PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
    PACKING_LIST-DOC_SIZE = PACKING_LIST-BODY_NUM * 255.
    APPEND PACKING_LIST.
    *Populate the subject/generic message attributes
    DOCU_DATA-DOC_SIZE = 1.
    DOCU_DATA-OBJ_LANGU = SY-LANGU.
    DOCU_DATA-OBJ_NAME = 'SAPRPT'.
    DOCU_DATA-OBJ_DESCR = PSUBJECT.
    DOCU_DATA-SENSITIVTY = 'F'.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = DOCU_DATA
    SENDER_ADDRESS_TYPE = 'INT'
    COMMIT_WORK = 'X'
    PUT_IN_OUTBOX = 'X'
    SENDER_ADDRESS = V_SENDER
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    PACKING_LIST = PACKING_LIST
    OBJECT_HEADER = OBJECT_HEADER
    CONTENTS_BIN = LT_PDF
    CONTENTS_TXT = CONTENTS
    RECEIVERS = REAL_RECIPIENTS
    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.
    ENDIF.

  • How to change font size in smartform and set layout of smartform

    Dear abapers,
                           I want to change font size in smartform and also set the layout of smart form how can we do this.
                                                 Thank you sir.

    Hi,
    you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
    Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
    When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
    Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
    Thanks,
    venkat

  • Page layout for smartforms

    dear all,
    I have made 2 smartforms for checmical and mechanical print.one has to be printed in landscape and the other has to be printed in potrait format.The problem is the user wants the smartforms to be called from the same program and hence everytime he has to set the printer settings.
    for exapmle
    mechanical smartform is in landscape format and if the printer settings is not changed to landscape then the smartform wont get printed in landscape format, its getting printed in potrait format only and half of the data is cut off.
    Please tell whether any option is there so that I can change the printer setting from landscape to potrait in the runtime only based on the layout of the smartform.

    Hello,
    To my knowledge at runtime we cannot change printer settings.U have to desgin 2 form for each and set printer settings accordingly.
    Regards

  • Smartform Mail Sending via Action profile

    Hi,
    we have a big problem, because our sended emails going into customers spam filter. We hava SAP CRM 5.0 and we send the emails via action profile.
    For that we use the standard for sending smartforms via action profile. Follwing problems are occured:
    1) email recipient is fill only in the cc field, not in the to field of an email
    2) the subjet ist the sam as the dcument name
    3) the emial is sended without text only whith attachment
    So my question are:
    how can i customize that the email is wirtten in the to field and how i can change the subject of this mail.
    Is ist possible to add a text to the email? Maybe not, but than we could add a disclaimer in the mail hub - so my firts questions are more importent for me.
    Thank you for your help
    Stefan

    Hi,
    To manipulate the subject Refer   Note 895550 - Name of Smart Form used as e-mail subject 
    Im not sure why the email recipient is in CC instead of To. Please check your Action settings. How are you determining the recipient? if it's by partner function, it should automatically be filled in To field.
    Smartforms can be sent either as Text or pdf attachment. This is controlled globally in SMTP settings in SCOT. I believe you can choose attachment option and also add some text by manipulating the Action class.
    HOpe this helps.
    Shaik

  • Smartforms Mail by Business Communications Interface

    Hi,
    According to the documentation in SAP library on SmartForms, you should be able mail a smartform as PDF, directly from the generated function module. For that, you have to set the CONTROL_PARAMETERS-DEVICE = 'MAIL'. Then you need to create recipient, sender and application BOR ID's and pass these to parameters MAIL_RECIPIENT, MAIL_SENDER and MAIL_APPL_OBJ. I have no experience with BOR objects, and I think something goes wrong at that point.
    The SAP Library refers to sample code, in report RSSOKIF2. I have copied this code, and modified a little, to be able to send to an e-mail address, only changing the recipient type to 'U', and moving the e-mail address to the AddressString parameter.
    This doesn't work. Does anyone have any working code to send smartforms to an e-mail address USING THE BUSINESS COMMUNICATIONS INTERFACE ?
    I know how to send e-mail with PDF attachment. I am trying to find out how to use the BOR objects technique.

    Hello Peter,
    I did also follow this example but it was from the book - "SAP Smart Forms" by Werner Hertleif and Christoph Wacheter.  Chapter 10 has a nice exaple that you can follow.  You have to copy some of the source code from the back of the book's appendix.  I wa not able to get it to work initially.  I found that it was necessary to issue the commit work command if you are sending via external (internet) e-mail.  It seemed to me that the commit work was not necessary if you just send to an internal sap user e-mail address.
    Also be sure that you have set up the e-mail address for your current user in the SU01 user maintenance.

  • Smartform Mail via SCOT

    Hi all : )
    I generated a Smartform with Table and Bold text. When the Form will send trough SCOT Transaction, the Mail received will not show any Table lines or Text in Bold Style.
    Someone know why ? Thanks a lot.

    hi
    check manually whether the conversioon is happening properly or not
    if u receive mail then check whether the font size is small or some sily issues
    still if u get blank then u might use some other logic to send the form through mail.
    Regards,
    Venkat.

  • Smartform mail

    Hi,
    I am sending the smartform as mail content using the CRM_ISA_AUCTION_SMART_FORM method present in class CL_DOC_PROCESSING_CRM_ORDER.
    I have a standard text displayed in smartform. In this i am using smartstyle and paragraph format in which i have declared tabs.
    In the output the tabs are not working.
    Best Regards,
    Azaz.

    Hi Azaz,
    exactly, If I use CRM_ISA_AUCTION_SMART_FORM method for sending a smartform by email, when I receive it I realise that all table designs and smartstyles are lost.
    In that way, I wonder if you have found out how to fix this problem.
    Thanks above all.

  • Sales order confirmation,standard layout set,smartforms.

    What is the standard layout set for sales order confirmation in smartforms.
    I promise to reward,than Q

    Hi,
    Check In Transaction Code NACE and
    Check table TNAPR.
    TNAPR is the table which will have all the Standard Script and Smartforms
    Regards
    Sudheer

  • Excel-layout to Smartforms

    Dear development team,
    I have a requirement to the smartforms with a lot of information (such as article data, info record data, vendor, etc.). For this there is a template in Excel format.
    To reduce the effort to design the smartforms Iu2019m looking for an approach to import the excel layout to the smartformsu2019 table structure.
    Is there any possibility to import the excel-format (the format is fully reassessed) to the smartforms?
    Thanks for your hint.
    Best regards,
    Kurt.

    Or you can start from scratch using ABAP OLE for Excel or generate XML Excel.
    You can understand what to do from these blogs:
    /people/otto.gold/blog/2010/02/11/happy-reporting-with-excel-ii
    /people/otto.gold/blog/2010/02/09/happy-reporting-with-abap-ole-excel
    regards, Otto

Maybe you are looking for

  • TS1424 I can't open iTunes. Get error message "the file iTunes library.itl cannot be opened because it was created by a newer version of iTunes"

    I cannot open itunes.  Getting error message: "the file iTunes library.itl cannot be read because it was created by a newer version of iTunes" What do I need to do so I dont lose all my loaded music, etc.? Thanks

  • How do i make a full diagnostic for software and hardware both?

    Hi everyone, because of my macbook pro(this is my first mac and only one i have) have been change logic board for three time, but i always use it nicely but still like this(maybe I overprotect it?),  recently i heard "pop" sound out from the air vent

  • Filmstrip Magnify Effect, need help...

    Heya, So if you visit http://www.hookmedia.biz/cabinet_source/v4_f then you'll see that on the gallery page there is an area for a filmstrip. This filmstrip works great except that I need the images to magnify a little when you mouseover them. Can an

  • Powerbook vs ibook

    I have a 17 1.5 with 2 gigs of ram, for my honey I bought a refurbed 12" ibook with less than a gig of ram, how is it possible that her ibook always gets better reception on our wireless than my PB? I have a airport express setup in the living room a

  • Date format in apex4

    HI How can i change the date foramt in apex 4 when i open the object browser and browse the table's data it display the date in this foramt 'MM/DD/YYYY', how can i change it to default database format 'DD-MON-YYYY' ? BEST REGARDS