Regarding smartforms error

hi experts,
i have developed a driver program for the smartforms ,in the driver program i am displaying with the help of final internal table and with the help of structure i m declaring an internal table in the smartforms,the structure is containg the fields which i used in the driver program for output but when i execute this its giving error...plz helpme to short out this problem what are the points i must consider while declaring structure ....
the error:::
ShrtText
Type conflict when calling a function module (field length).
What happened?
Error in ABAP application program.
The current ABAP program "ZRAW_PRODUCTION_REPORT_SFM" had to be terminated
because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
A function module was called incorrectly.
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE',
was neither
caught nor passed along using a RAISING clause, in the procedure "FORM_DISP"
"(FORM)"
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
The call to the function module "/1BCDWB/SF00000211" is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "ITAB_FINAL_SFM".
Although the currently specified field
"ITAB_FINAL" is the correct type, its length is incorrect.
the final table in the driver program is given below::
,from this table i m showing output.......
TYPES:BEGIN OF S_FINAL ,
MATNR TYPE MARD-MATNR, "for material number
WERKS TYPE MARD-WERKS, "for plant id
LGORT TYPE MARD-LGORT, "Storage location
LABST TYPE MARD-LABST, "opening stock
INSME TYPE MARD-INSME, "Stock in quality inspection
SPEME TYPE MARD-SPEME, "Blocked stock
EINME TYPE MARD-EINME, "Totl Stck of All Restricted Batches
RETME TYPE MARD-RETME, "Blocked Stock Returns
LIFNR TYPE MSEG-LIFNR, "vendors number
MAKTX TYPE MAKT-MAKTX, "for material description
NAME1 TYPE T001W-NAME1, "plant name
NAME2 TYPE LFA1-NAME1, "vendors name
LABST_TM TYPE MARD-LABST, "target monthly
LABST_CL TYPE MARD-LABST, "closing stock
LABST_RT TYPE MARD-LABST, "receive today
LABST_RTLD TYPE MARD-LABST, "receive till date
LABST_RTY TYPE MARD-LABST , "receive till year
LABST_IT TYPE MARD-LABST, "issued today
LABST_ITLD TYPE MARD-LABST, "issued till date
LABST_ITY TYPE MARD-LABST, "issued till year
BWART TYPE MSEG-BWART, "movement type
MBLNR TYPE MSEG-MBLNR, "material doc number
EISBE_CL TYPE MARC-EISBE , "closing balance
EISBE TYPE MARC-EISBE, "safety stock
LGOBE TYPE T001L-LGOBE, "Description of storage location
P_DATE TYPE SY-DATUM, "for previous date
GPTXT TYPE T750E-GPTXT, "for remarks
END OF S_FINAL.
DATA:ITAB_FINAL TYPE STANDARD TABLE OF S_FINAL WITH HEADER LINE.
the fields which are bolds i m not showing in the output using for some calculation thatsit.
with the refrence of this final table how will i declare my structure so that it wont give the above error if possible kindly send me the syntax of declaring structure along with my fields....

hi
its better dat u create a structure in abap dictionary in se11...den declare ur internal table of dat type in program and declare ur structure and internal table in smartform of dat type (dictionary structure).im sure dis problem wont arise...
plz reward points if it helps

Similar Messages

  • Printing dunning notices using SMARTFORMS,error during parameter transfer

    Hi Friends,
                    I face a error message "Include text ZGA_DUN_HDR does not exist (object TEXT, ID ST)" when i run the dunning run.
                    I had searched every node for text ZGA_DUN_HDR in the smartform,I didnt find the text in it.
    However when I execute the smart form for print preview an error message "Printing dunning notices using SMARTFORMS,error during parameter transfer".This error i believe is due to wrong parameter passing in the fm 'GET_SF_DUNN_DATA'.It raises an error no_parameters_found.All parameters are passed correctly.
                    Can you guys help me out.
    Edited by: RAJIV KAUSHAL on Nov 14, 2008 6:03 PM

    you can create this text ZGA_DUN_HDR  in SO10 tcode and try ...

  • Smartforms error 173

    I would like to know how to solve the following error in smartforms:
    Error number: 173
    Message     : "Table does not fit into window."
    Exception   : FORMATTING_ERROR
    Message ID  : SSFCOMPOSER
    I am trying to fit a main window and another window in a
    template
    Thanks in advance

    As I discovered, this error occurred when there is a conflict between the window created for a template and the template itself. The main node for the template is the window in which one can define a height. In the template, which is the node below the window node, one is also required to enter a value for height that has to be the same value. This can be done in the Template table (tab Template), you’ll find the height defined that is in conflict with the height defined in the table of the window.

  • I can't log in to game centre but I can log into iTunes. I recently changed my password. I checked the troubleshooter and am getting the message regarding server error but how do I fix this? It doesn't specify this in that article. I don't have firewalls

    I can't log in to game centre but I can log into iTunes. I recently changed my password. I checked the troubleshooter and am getting the message regarding server error but how do I fix this? It doesn't specify this in that article. I don't have firewalls

    Hello sadiepix,
    The following article details several things that can be done to quell iTunes' constant need for authorization.
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/TS1389
    Cheers,
    Allen

  • Error Logging and notifying users regarding the errors

    Hi..
    we are designing a workflow in which if any user comes across an error (at any branch or while executing an action) must be alerted with the error and must send a notification to the admin that the process has stalled at that particular part of the workflow due to some error.
    my doubts are
    1.how can we notify the admin and the initiator of the workflow regarding the error a particular user gets.i saw in adminui that there are two tabs for the admin to view the stalled actions/stalled branches.but the admin and the user needs to be notified with an alert or email that a particular action has been stalled.
    i think i conveyed my problem in a correct manner.if its confusing then plz tell me coz i am already confused in this..

    Thank you sir for your immediate response of the query.
    In the workflow which we are designing,a service request from filled by the user will be routed to the particular approver and he inturn will approve/reject the form accordingly.once he approves,the form is routed to the service provider who will fulfill the service requested and approved.
    1.Now,for instance suppose that the workflow gets stalled while the form is with the approver.my question is how to notify the user that the service he requested is delayed due to the stalling of the process in between as well as the admin alerting him with the error which stalled the workflow process.
    2.you said that it is easy to setup an email address within the adminui..but i dont know how to do that as i am a beginner.
    3.Also u asked me to specify the errors for which we need to send alerts and email notifications...whatever error that occurs whenever the workflow gets staleld needs to be notified both to the user and the admin (as per our requirements).it would be helpful to us if u give a solution for this.
    thank you..
    Raghava Kumar V.S.S.

  • How do we contact a real person regarding billing errors?

    How do we contact a real person regarding billing errors on our itunes account?

    You can contact iTunes support via email via this page (I'm not aware of any phone support for iTunes) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Regarding dump error in smartforms

    hi experts,
                   my one driver program along with smartforms is working fine in the development server after transportation to production server it is showing dump error :::
    the error is:
    Function module " " not found.                                                                
    What happened?                                                                               
    The function module " " was called, but cannot be                                             
        found in the Function Library.                                                                               
    Error in ABAP application program.                                                                               
    The current ABAP program "ZSD_DELIVERY_ORDER_DRIVER_PREP" had to be terminated                
         because one of the                                                                               
    statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.                                         
    What can you do?                                                                               
    Print out the error message (using the "Print" function)                                      
        and make a note of the actions and input that caused the                                      
        error.                                                                               
    To resolve the problem, contact your SAP system administrator.                                
        You can use transaction ST22 (ABAP Dump Analysis) to view and administer                      
         termination messages, especially those beyond their normal deletion                          
        date.                                                                               
    is especially useful if you want to keep a particular message.                                
    Error analysis                                                                               
    An exception occurred. This exception will be dealt with in more detail                       
        below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_FUNC', was                
         not caught, which                                                                               
    led to a runtime error. The reason for this exception is:                                    
        The program "ZSD_DELIVERY_ORDER_DRIVER_PREP" contains a CALL FUNCTION                         
         statement. The name                                                                               
    of the function module to be called is " ".                                                                               
    No function module exists with the name " ".                                                  
        All function modules are stored in the Function Library (SE37).                                                                               
    Possible reasons:                                                                               
    a) Wrong name specified. Particular attention should be paid                                  
           to upper/lower case and underscores ("_")                                                  
        b) Transport error                                                                               
    c) If an enqueue/dequeue module has been used, the lock object                                
           may not have been activated (ABAP Dictionary)                                              
           may not have been activated (ABAP Dictionary).                                             
    i have checked in the production server but i m not finding <b>" "</b> this thing in the program ..plz help me to solve this.

    Hi Ravi,
    Can you show me the code where you have called the smart form in driver program.Becaus the FM generated in Development server may differ from the FM generated in Production server.Make sure u r passing the FM  which is generated from the function module SSF_FUNCTION_MODULE_NAME.

  • Smartforms error

    Hi experts
    i did a print prg for sending the pdf attachment by smartforms.
    but it's getting dumpped,this is my code
    plz help me,its urgent.
    i checked even SDN Forums also.i made some changes,
    even though i don't get the output.
    it shows not matching the I_OBJBIN in "SO_NEW_DOCUMENT_ATT_SEND_API1" function module.
    REPORT  ZCS_SF6.
    Internal Table declarations
    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
          w_objhead TYPE soli_tab,     
          w_ctrlop TYPE ssfctrlop,
          w_compop TYPE ssfcompop,
          w_return TYPE ssfcrescl,     
          w_doc_chng typE sodocchgi1,  
          w_data TYPE sodocchgi1,
          w_buffer TYPE string,       
    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.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
      formname = 'ZCS_FORM6'
    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
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = W_CTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = W_COMPOP
       USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = W_RETURN
      JOB_OUTPUT_OPTIONS         =
    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         
    LINES-TDLINE
    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.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Convert PDF from 132 to 255.
    LOOP AT i_tline.
    Replacing space by ~
    TRANSLATE i_tline USING '~'.
    CONCATENATE w_buffer i_tline INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~'.
    DO.
    i_record = w_buffer.
    Appending 255 characters as a record
    APPEND i_record.
    SHIFT w_buffer LEFT BY 255 PLACES.
    IF w_buffer IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    Attachment
    Refresh: i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
    clear w_objhead.
    Object with PDF.
    i_objbin[] = i_record[].
    *******DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    *i_objtxt = 'Regards,'.
    *APPEND i_objtxt.
    *i_objtxt = 'Chandu'.
    *APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    read table i_objtxt index v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.         
    w_doc_chng-expiry_dat = sy-datum + 10.     
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'.               
    w_doc_chng-doc_size = v_lines_txt * 255.   
    Pack to main body as RAW.
    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.
    Packing as PDF.
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 1.
    i_objpack-body_start = 1.
    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 = 'Smartform'.          
    i_objpack-obj_descr = 'sf output'
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'. 
    *i_reclist-express = 'X'.    "Send express
    i_reclist-rec_type = 'U'.                             
    APPEND i_reclist.
    Sending mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data = w_doc_chng 
      put_in_outbox = 'X'        
    TABLES
      packing_list = i_objpack   
      object_header = w_objhead  
      contents_hex = 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.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    points wl be rewarded,if it is useful
    thanks in advance.

    HI,
      Here is the complete program for you.. I have done the same requirment..
                 P R O G R A M     D E C L A R A T I O N                 *
    PROGRAM ID            : ZF_QUERY_BANK
    AUTHOR                : Mahesh Raganmoni
    OWNER(Process Team)   :
    CREATE DATE           : 03/04/2004
    R/3 RELEASE VERSION   : 4.72
    BASED-ON PROGRAM      : none
    ADS                   : BP14.B&CF.301
    DESCRIPTION           : This program calles the Bank Query Smartform
                            and sends this smartforms as an email to the
                            bank
    MODIFICATION LOG CONTROL (Most recent on top):
    DATE             AUTHOR              CTS REQ     DESCRIPTION
    *09/13/2004    Mahesh Raganmoni        DR1K901766  Original Version    *
                          T   A   B   L   E   S                          *
    TABLES : BUT021, "BP: Address usages
             BUT020, "BP: Addresses
             T001,   "Company Codes
             DFKKZP, "Payment lot: Data for payment
             BUT000, "BP: General data I
             ADR3,   "Fax Numbers (Business Address Services)
             BNKA,   "Bank master record
             T012.   "House Banks
                            Internal Tables                       *
    *Address Details of Business Partner
    DATA :IT_ADDRESS LIKE STANDARD TABLE OF BUS020_EXT WITH HEADER LINE.
    *Return Table
    DATA :  IT_RETURN LIKE STANDARD TABLE OF BAPIRET2.
    PDF Data to hold the data to be sent as an attachment
    DATA : IT_PDF_NUC_DATA TYPE STANDARD TABLE OF SOLI.
    Converted data from OTF
    DATA : IT_PDF_TABLE TYPE RCL_BAG_TLINE.
    Data Declaration for Sendig Email
    DATA: IT_OBJPACK    LIKE SOPCKLSTI1 OCCURS  1 WITH HEADER LINE,
          IT_OBJHEAD    LIKE SOLISTI1   OCCURS  1 WITH HEADER LINE,
          IT_OBJTXT     LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          IT_OBJBIN     LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          IT_OBJHEX     LIKE SOLIX      OCCURS 10 WITH HEADER LINE,
          IT_RECLIST    LIKE SOMLRECI1  OCCURS  1 WITH HEADER LINE,
          IT_LISTOBJECT LIKE ABAPLIST   OCCURS  1 WITH HEADER LINE.
                             Structures                            *
    DATA :WA_BUS000 TYPE BUS000_EXT,         "Business Partner Details
          WA_ADDRESS TYPE BAPIADDR3,         "Collector Address
          WA_OUTPUT_OPTIONS TYPE SSFCOMPOP,
          WA_CONTROL_PARAMETERS TYPE SSFCTRLOP,
          WA_OUTPUT_DATA TYPE SSFCRESCL,
          WA_HEADER TYPE ZFCOLL_HEADER,  "Smartform Header Info
          WA_DFKKZP TYPE DFKKZP,
          WA_DOCDATA    LIKE SODOCCHGI1.
                             Variables                             *
    DATA : W_FORMNAME TYPE TDSFNAME,             "Smartform Name
           W_NAME_ORG TYPE CHAR35,               "Business Partner Name
           W_ADDRNUMBER LIKE BUT021-ADDRNUMBER,  "Address Number of BP
           W_ADDRESS1 TYPE CHAR35,               "Address Line 1
           W_ADDRESS2 TYPE CHAR35,               "Address Line 2
           W_ADDRESS3 TYPE CHAR35,               "Address Line 3
           W_GE_NAME TYPE CHAR35,                "GE Contact Name
           W_GE_PHONE TYPE CHAR35,               "GE Contact Phone
           W_GE_PHONE1 TYPE CHAR35,               "GE Contact Phone
           W_GE_PHONE_EX TYPE CHAR10,               "GE Contact Phone
           W_GE_EMAIL TYPE CHAR35,               "GE Contact Email
           W_CLIENT_NAME TYPE CHAR30,            "Client Name
           W_GE_FAX TYPE CHAR35,                 "GE Fax No
           W_GE_FAX1 TYPE CHAR35,                "GE Fax No
           W_CLIENT_FAX TYPE CHAR35,             "Client's Fax No
           W_PDF_LEN TYPE I,                     "Length of PDF file
           W_ERR_MESG(120) TYPE C,               "Error Message
           W_ORG1R LIKE DFKKCR-ORG1R,            "Company Code
           W_REFERENCE LIKE DFKKCR-REFERENCE,    "Payment Reference
           W_FNAME TYPE RS38L_FNAM,              "Smartform Function Module
                                                 "     Name
           W_SFNAME TYPE TDSFNAME,   " Smart Form Name
           W_BANKN TYPE CHAR18,   "Bank Account Number
           W_BETRZ TYPE CHAR15,   " Credit AMount
           W_WAERS TYPE CHAR5,    " Credit Currency
           W_VALUT TYPE DFKKZP-VALUT.   " Value Date
    VARIABLES FOR EMAIL
    DATA: W_TAB_LINES  TYPE I,
          W_DOC_SIZE   TYPE I,
          W_ATT_TYPE   LIKE SOODK-OBJTP,
          W_DATFM TYPE XUDATFM.
    VARIABLES FOR DATE
    DATA: W_DAY(2) TYPE C,
          W_MONTH(2) TYPE C,
          W_YEAR(4) TYPE C,
          W_DATE(10) TYPE C.
                             Constants                            *
    DATA : C_SELECTED TYPE C VALUE 'X', "Constant for Checked
           C_COMMA(2) TYPE C VALUE ', ',"Constant for  Comma
           C_HYPHEN TYPE C VALUE '-'.   "Constant for Hypen
                      Selection Screen                            *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: P_KEYZ1 TYPE RFKZ0-KEYZ1 OBLIGATORY, "Payment Lot
                P_POSZA TYPE DFKKZP-POSZA OBLIGATORY. "Item Number
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: P_REMIT TYPE C AS CHECKBOX DEFAULT 'X', " Remitter Form
                P_GENRL TYPE C AS CHECKBOX USER-COMMAND RG1, " General Form
                P_TEXT TYPE AD_SMTPADR  MODIF ID SC1. " Free Text
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS:P_MAIL TYPE C AS CHECKBOX USER-COMMAND RG2, "Send Email
              P_MAILID TYPE AD_SMTPADR MODIF ID SC2.
    SELECTION-SCREEN END OF BLOCK b3.
                     Initialization                               *
    WA_OUTPUT_OPTIONS-XDFCMODE = 'X'.
    WA_OUTPUT_OPTIONS-XDF =  SPACE.
    WA_OUTPUT_OPTIONS-XSFCMODE = 'X'.
    WA_OUTPUT_OPTIONS-XDF = SPACE.
              At Selection Screen Output                          *
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SCREEN-GROUP1 = 'SC1'.
          IF P_GENRL = C_SELECTED.
            SCREEN-INPUT = 1.
          ELSE.
            CLEAR P_TEXT.
            SCREEN-INPUT = 0.
          ENDIF.
        ENDIF.
        IF SCREEN-GROUP1 = 'SC2'.
          IF P_MAIL = C_SELECTED.
            SCREEN-INPUT = 1.
          ELSE.
            CLEAR P_MAILID.
            SCREEN-INPUT = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    AT SELECTION-SCREEN.
      IF P_REMIT NE C_SELECTED AND P_GENRL NE C_SELECTED.
        MESSAGE E004 WITH TEXT-004.
      ENDIF.
                      Start of selection                          *
    START-OF-SELECTION.
      IF P_GENRL EQ C_SELECTED.
        IF P_TEXT IS INITIAL.
          MESSAGE I004 WITH TEXT-023.
          STOP.
        ENDIF.
      ENDIF.
      IF P_MAIL EQ C_SELECTED.
        IF P_MAILID IS INITIAL.
          MESSAGE I004 WITH TEXT-005.
          STOP.
        ENDIF.
      ENDIF.
    **Getting Payment Lot and Payment Lot number
      PERFORM GET_PAYMENT_DETAILS.
      IF NOT WA_DFKKZP IS INITIAL.
    Getting the Bank  Details
        PERFORM GET_BANK_DETAILS.
    **Getting the  Ge Contact Details
        PERFORM GET_GE_CONTACT_DETAILS .
    Populating the Structure fields to pass to smartform
        PERFORM FILL_EXPORT_STRUCTURES.
        CLEAR W_FNAME.
    Getting the Function Module name for the Smartform
        IF  P_REMIT EQ C_SELECTED AND P_GENRL NE C_SELECTED.
          W_SFNAME = 'ZF_REMITTER_FORM'.
          PERFORM GET_FORMNAME .
        ELSEIF P_REMIT NE C_SELECTED AND P_GENRL EQ C_SELECTED.
          W_SFNAME = 'ZF_GENERAL_FORM'.
          PERFORM GET_FORMNAME .
        ELSEIF P_REMIT EQ C_SELECTED AND P_GENRL EQ C_SELECTED.
          W_SFNAME = 'ZF_QUERY_BANK_FORM'.
          PERFORM GET_FORMNAME .
        ENDIF.
        IF NOT W_FNAME IS INITIAL.
          PERFORM CALL_FORM.
          IF P_MAIL EQ 'X'.
            IF NOT P_MAILID IS INITIAL.
              PERFORM SET_PARAMETERS.
              PERFORM DEVICE_TYPE.
              PERFORM CALL_FORM.
              PERFORM CONVERT_TO_PDF.
              PERFORM CONVERT_PDF_TO_BINARY.
              PERFORM SEND_MAIL_NO_DISPLAY.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    *&      Form  GET_FORMNAME
         Fetch the Function module name for the Smartform
    FORM GET_FORMNAME .
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = W_SFNAME
        IMPORTING
          FM_NAME            = W_FNAME
        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.
    ENDFORM.                    " GET_FORMNAME
    *&      Form  CALL_FORM
    To Call the Smartform
    FORM CALL_FORM .
      SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
      CALL FUNCTION W_FNAME
        EXPORTING
          CONTROL_PARAMETERS = WA_CONTROL_PARAMETERS
          OUTPUT_OPTIONS     = WA_OUTPUT_OPTIONS
          USER_SETTINGS      = 'X'
          S_HEADER           = WA_HEADER
          V_ACNO             = W_BANKN
          V_AMOUNT           = W_BETRZ
          V_CURR             = W_WAERS
          V_DATE             = W_VALUT
          V_TEXT             = P_TEXT
        IMPORTING
          JOB_OUTPUT_INFO    = WA_OUTPUT_DATA
        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.
    ENDFORM.                    " CALL_FORM
    *&      Form  FILL_EXPORT_STRUCTURES
    Populate the structure to send to the smartform as input
    FORM FILL_EXPORT_STRUCTURES .
      WA_HEADER-BANKA = BNKA-BANKA.
      WA_HEADER-ADDR_1  = BNKA-STRAS.
      WA_HEADER-ADDR_2 = BNKA-ORT01.
      WA_HEADER-ADDR_3 = BNKA-PROVZ.
      WA_HEADER-ZZSRCBPNM = T012-NAME1.
      SHIFT WA_HEADER-ZZSRCBPNM LEFT DELETING LEADING SPACE.
      WA_HEADER-FAX_NUMBER = W_CLIENT_FAX.
      WA_HEADER-BUTXT = T001-BUTXT.
      WA_HEADER-NAME1 = W_GE_NAME.
      WA_HEADER-TEL_NUMBER = W_GE_PHONE.
      WA_HEADER-TEL_EXTENS = W_GE_PHONE_EX.
      WA_HEADER-SMTP_ADDR = W_GE_EMAIL.
      WA_HEADER-GE_FAX_NUMBER = W_GE_FAX.
    ENDFORM.                    " FILL_EXPORT_STRUCTURES
    *&      FORM  CONVERT_TO_PDF
    Convert the final doucment (OTF FORMAT) into pdf format
    FORM CONVERT_TO_PDF .
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          FORMAT                = 'PDF'
        IMPORTING
          BIN_FILESIZE          = W_PDF_LEN
        TABLES
          OTF                   = WA_OUTPUT_DATA-OTFDATA
          LINES                 = IT_PDF_TABLE
        EXCEPTIONS
          ERR_MAX_LINEWIDTH     = 1
          ERR_FORMAT            = 2
          ERR_CONV_NOT_POSSIBLE = 3
          ERR_BAD_OTF           = 4
          OTHERS                = 5.
    ENDFORM.                    " CONVERT_TO_PDF
    *&      FORM  SET_PARAMETERS
    Set control parameters to get the output format (OTF) from smart form*
    FORM SET_PARAMETERS .
      WA_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
      WA_CONTROL_PARAMETERS-GETOTF    = 'X'.
      WA_CONTROL_PARAMETERS-LANGU = SY-LANGU.
    ENDFORM.                    " SET_PARAMETERS
    *&      FORM  DEVICE_TYPE
    Get the Device type
    FORM DEVICE_TYPE .
      CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
        EXPORTING
          I_LANGUAGE             = WA_CONTROL_PARAMETERS-LANGU
        IMPORTING
          E_DEVTYPE              = WA_OUTPUT_OPTIONS-TDPRINTER
        EXCEPTIONS
          NO_LANGUAGE            = 1
          LANGUAGE_NOT_INSTALLED = 2
          NO_DEVTYPE_FOUND       = 3
          SYSTEM_ERROR           = 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.
    ENDFORM.                    " DEVICE_TYPE
    *&      FORM  CONVERT_PDF_TO_BINARY
    To convert PDF file to Binary format
    FORM CONVERT_PDF_TO_BINARY .
      CALL FUNCTION 'QCE1_CONVERT'
        TABLES
          T_SOURCE_TAB         = IT_PDF_TABLE
          T_TARGET_TAB         = IT_PDF_NUC_DATA
        EXCEPTIONS
          CONVERT_NOT_POSSIBLE = 1
          OTHERS               = 2.
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " CONVERT_PDF_TO_BINARY
    *&      FORM  SEND_MAIL_NO_DISPLAY
    To send a email
    FORM SEND_MAIL_NO_DISPLAY .
      DATA: L_SLINE(255) TYPE C,
            L_INDEX TYPE SY-TABIX.
      IT_OBJBIN[] =  IT_PDF_NUC_DATA[].
      Title and Description of the mail
      WA_DOCDATA-OBJ_DESCR = TEXT-012.
    Mail Body content
      PERFORM MAIL_BODY.
      DESCRIBE TABLE IT_OBJTXT LINES W_TAB_LINES.
      READ     TABLE IT_OBJTXT INDEX W_TAB_LINES INTO L_SLINE.
      L_INDEX = W_TAB_LINES + 1.
      WA_DOCDATA-DOC_SIZE = ( W_TAB_LINES ) * 255 + STRLEN( L_SLINE ).
      WA_DOCDATA-OBJ_EXPDAT = '29991231'.
      WA_DOCDATA-SENSITIVTY = 'O'.
      WA_DOCDATA-OBJ_PRIO =  '5'.
      WA_DOCDATA-EXPIRY_DAT = '29991231'.
      WA_DOCDATA-PROC_TYPE = 'R'.
      CLEAR  IT_OBJPACK-TRANSF_BIN .
      IT_OBJPACK-HEAD_START = 0.
      IT_OBJPACK-HEAD_NUM   = 0.
      IT_OBJPACK-BODY_START = 1.
      IT_OBJPACK-BODY_NUM   = W_TAB_LINES.
      IT_OBJPACK-DOC_TYPE   = 'RAW'.
      IT_OBJPACK-OBJ_DESCR  = TEXT-013.
      APPEND IT_OBJPACK.
    Create message attachment
      W_ATT_TYPE = 'PDF'.
      DESCRIBE TABLE IT_OBJBIN LINES W_TAB_LINES.
      READ     TABLE IT_OBJBIN INDEX W_TAB_LINES.
      L_INDEX = W_TAB_LINES + 1.
      IT_OBJPACK-DOC_SIZE = ( W_TAB_LINES ) * 255 .
      IT_OBJPACK-TRANSF_BIN = 'X'.
      IT_OBJPACK-HEAD_START = 0.
      IT_OBJPACK-HEAD_NUM   = 0.
      IT_OBJPACK-BODY_START = 1.
      IT_OBJPACK-BODY_NUM   = W_TAB_LINES.
      IT_OBJPACK-DOC_TYPE   = W_ATT_TYPE.
      IT_OBJPACK-OBJ_DESCR  = TEXT-013.
      APPEND IT_OBJPACK.
    Create receiver list
      IT_RECLIST-RECEIVER = P_MAILID.  "<-- CHANGE ADDRESS
      IT_RECLIST-REC_TYPE = 'U'.
      IT_RECLIST-EXPRESS = 'X'.
      APPEND IT_RECLIST.
    Send Email
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = WA_DOCDATA
          PUT_IN_OUTBOX              = 'X'
          COMMIT_WORK                = 'X'     "USED FROM REL.6.10
        TABLES
          PACKING_LIST               = IT_OBJPACK
          CONTENTS_BIN               = IT_OBJBIN
          CONTENTS_TXT               = IT_OBJTXT
          RECEIVERS                  = IT_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 'SO' TYPE 'S' NUMBER '023'
                WITH WA_DOCDATA-OBJ_NAME.
      ELSE.
        SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
        SET SCREEN 0.
      ENDIF.
    ENDFORM.                    " SEND_MAIL_NO_DISPLAY
    *&      Form  GET_PAYMENT_DETAILS
    Get the Payment Lot and Payment Number
    FORM GET_PAYMENT_DETAILS .
    Get the Payment Lot and Payment Number
      SELECT SINGLE BETRZ
                    BVRKO
                    BUKRS
                    WAERS
                    VALUT
                    BANKS
                    BANKL
                    BANKN
                    FROM  DFKKZP
                    INTO (WA_DFKKZP-BETRZ,WA_DFKKZP-BVRKO,
                      WA_DFKKZP-BUKRS,WA_DFKKZP-WAERS,WA_DFKKZP-VALUT,
                      WA_DFKKZP-BANKS,WA_DFKKZP-BANKL,WA_DFKKZP-BANKN)
                    WHERE KEYZ1 = P_KEYZ1
                    AND   POSZA = P_POSZA.
      IF SY-SUBRC NE  0.
        MESSAGE I004 WITH TEXT-100.
        EXIT.
      ELSE.
        W_ORG1R = WA_DFKKZP-BUKRS.
        W_BETRZ = WA_DFKKZP-BETRZ.
        W_BANKN = WA_DFKKZP-BANKN.
        W_WAERS = WA_DFKKZP-WAERS.
        W_VALUT = WA_DFKKZP-VALUT.
      ENDIF.
    ENDFORM.                    " GET_PAYMENT_DETAILS
    *&      Form  GET_BANK_DETAILS
    To Retrive the Bank Details
    FORM GET_BANK_DETAILS .
    *Get the Bank Address Details
      SELECT SINGLE BANKA
                    STRAS
                    ORT01
                    PROVZ
                    FROM BNKA
                    INTO (BNKA-BANKA,BNKA-STRAS,BNKA-ORT01,BNKA-PROVZ)
                    WHERE BANKS = WA_DFKKZP-BANKS
                    AND BANKL = WA_DFKKZP-BANKL.
      IF SY-SUBRC NE 0.
       MESSAGE I004 WITH TEXT-101.
       EXIT.
      ENDIF.
    GET The Bank Contact Name.
      SELECT SINGLE NAME1
                    FROM T012
                    INTO T012-NAME1
                   WHERE BANKS = WA_DFKKZP-BANKS
                   AND   BANKL = WA_DFKKZP-BANKL.
      IF SY-SUBRC NE 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF NOT W_ORG1R IS INITIAL.
    Get the GE Legal Entity Name
        SELECT SINGLE  BUTXT FROM T001
               INTO T001-BUTXT
               WHERE BUKRS = W_ORG1R.
        IF SY-SUBRC NE  0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_BANK_DETAILS
    *&      Form  GET_COLLECTOR_DETAILS
    To get the Collector Address Details
    FORM GET_GE_CONTACT_DETAILS .
    *Getting the Collector details
      CALL FUNCTION 'BAPI_USER_GET_DETAIL'
        EXPORTING
          USERNAME = SY-UNAME
        IMPORTING
          ADDRESS  = WA_ADDRESS
        TABLES
          RETURN   = IT_RETURN.
      IF NOT WA_ADDRESS IS INITIAL.
        CONCATENATE WA_ADDRESS-FIRSTNAME0(18) WA_ADDRESS-LASTNAME0(17)
                    INTO W_GE_NAME SEPARATED BY SPACE.
        W_GE_PHONE = WA_ADDRESS-TEL1_NUMBR.
        W_GE_PHONE_EX = WA_ADDRESS-TEL1_EXT.
        W_GE_EMAIL = WA_ADDRESS-E_MAIL.
        IF NOT WA_ADDRESS-FAX_EXTENS IS INITIAL.
          CONCATENATE WA_ADDRESS-FAX_NUMBER C_HYPHEN WA_ADDRESS-FAX_EXTENS
                       INTO W_GE_FAX.
        ELSE.
          W_GE_FAX = WA_ADDRESS-FAX_NUMBER.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_GE_CONTACT_DETAILS
    *&      Form  MAIL_BODY
    To Build the email body
    FORM MAIL_BODY .
      PERFORM  GET_USER_DATE_FORMAT.
      W_YEAR = W_VALUT+0(4).
      W_MONTH = W_VALUT+4(2).
      W_DAY = W_VALUT+6(2).
      PERFORM GET_DATE.
      IF P_REMIT EQ 'X' .
        CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
                                SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-021 WA_HEADER-BUTXT  ',' TEXT-022
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
        CONCATENATE TEXT-024 W_DATE
        TEXT-025  W_BETRZ W_WAERS TEXT-026
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-027.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = WA_HEADER-NAME1.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-028 WA_HEADER-BUTXT INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-029.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
                           SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-032 WA_HEADER-SMTP_ADDR INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-033 WA_HEADER-BUTXT INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
      ELSEIF P_GENRL EQ 'X'.
        CLEAR IT_OBJTXT.
        REFRESH IT_OBJTXT.
        CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
                                SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-021 WA_HEADER-BUTXT '.'
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-034 P_TEXT '.'
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-027.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = WA_HEADER-NAME1.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-028 WA_HEADER-BUTXT INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-029.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
                           SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-032 WA_HEADER-SMTP_ADDR INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
      ELSEIF ( P_REMIT EQ 'X' AND P_GENRL EQ 'X' ).
        CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
                                 SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-021 WA_HEADER-BUTXT  ',' TEXT-022
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
        CONCATENATE TEXT-024 W_DATE TEXT-025  W_BETRZ W_WAERS TEXT-026
        INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-027.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = WA_HEADER-NAME1.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-028 WA_HEADER-BUTXT INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        IT_OBJTXT-LINE = TEXT-029.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
                           SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-032 WA_HEADER-SMTP_ADDR INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
        CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
        APPEND IT_OBJTXT.
        CONCATENATE  TEXT-033 WA_HEADER-BUTXT INTO
        IT_OBJTXT-LINE SEPARATED BY SPACE.
        APPEND IT_OBJTXT.
      ENDIF.
    ENDFORM.                    " MAIL_BODY
    *&      Form  get_user_date_format
    to get the User Date Format from USR01 table
    FORM GET_USER_DATE_FORMAT.
      CLEAR W_DATFM.
      SELECT SINGLE DATFM INTO W_DATFM
                          FROM USR01
                          WHERE BNAME = SY-UNAME.
    ENDFORM.                    " get_user_date_format
    *&      Form  GET_DATE
          Get the date in the user format
    FORM GET_DATE .
      CLEAR W_DATE.
      CASE W_DATFM.
        WHEN '1'.
          CONCATENATE W_DAY '.' W_MONTH '.' W_YEAR INTO W_DATE.
        WHEN '2'.
          CONCATENATE W_MONTH '/' W_DAY '/' W_YEAR INTO W_DATE.
        WHEN '3'.
          CONCATENATE W_MONTH '-' W_DAY '-' W_YEAR INTO W_DATE.
        WHEN '4'.
          CONCATENATE W_YEAR '.' W_MONTH '.' W_DAY INTO W_DATE.
        WHEN '5'.
          CONCATENATE W_YEAR '/' W_MONTH '/' W_DAY INTO W_DATE.
        WHEN '6'.
          CONCATENATE W_YEAR '-' W_MONTH '-' W_DAY INTO W_DATE.
      ENDCASE.
    ENDFORM.                    " GET_DATE
    Thanks
    Mahesh

  • SmartForm error: Express document "update was terminated" received from aut

    Hi friends
    we requirement to send PO smartform through Print out as well as through mail.
    after creating PO i am getting popup box saying that :
    " Express document "update was terminated" received from author "XXXX".
    Please help me.
    my code as follows:
        IF sy-subrc = 0.
          CLEAR g_outop.
          SELECT  SINGLE ldest dimme FROM nach INTO (g_outop-tddest,
         g_outop-tdimmed) WHERE knumh EQ knumh.
          CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
              formname           = 'YNZ_PO'
            IMPORTING
              fm_name            = sf_name
            EXCEPTIONS
              no_form            = 1
              no_function_module = 2
              OTHERS             = 3.
          w_ctrlop-getotf = 'X'.
          w_ctrlop-no_dialog = 'X'.
          w_compop-tdnoprev = 'X'.
          CALL FUNCTION sf_name
            EXPORTING
              output_options     = g_outop
              user_settings      = 'X'
              wa_ynz_po_head     = wa_ynz_po_head
              control_parameters = w_ctrlop
           IMPORTING
             job_output_info    = w_return
            TABLES
              t_ynz_po_item      = t_ynz_po_item
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
    for mail
          CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
              formname           = 'YNZ_PO'
            IMPORTING
              fm_name            = sf_name
            EXCEPTIONS
              no_form            = 1
              no_function_module = 2
              OTHERS             = 3.
           CLEAR g_outop.                   " Commented by sharma
           g_outop-tddest = nast-ldest.
           g_outop-tdimmed = nast-dimme.
          w_ctrlop-getotf = 'X'.
          w_ctrlop-no_dialog = 'X'.
          w_compop-tdnoprev = 'X'.
          CALL FUNCTION sf_name
            EXPORTING
              output_options     = w_compop
              user_settings      = 'X'
              wa_ynz_po_head     = wa_ynz_po_head
              control_parameters = w_ctrlop
            IMPORTING
              job_output_info    = w_return
            TABLES
              t_ynz_po_item      = t_ynz_po_item
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
      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.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Convert PDF from 132 to 255.
      LOOP AT i_tline.
    Replacing space by ~
        TRANSLATE i_tline USING ' ~'.
        CONCATENATE w_buffer i_tline INTO w_buffer.
      ENDLOOP.
    Replacing ~ by space
      TRANSLATE w_buffer USING '~ '.
      DO.
        i_record = w_buffer.
    Appending 255 characters as a record
        APPEND i_record.
        SHIFT w_buffer LEFT BY 255 PLACES.
        IF w_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
      REFRESH: i_reclist,
      i_objtxt,
      i_objbin,
      i_objpack.
      CLEAR w_objhead.
    Object with PDF.
      i_objbin[] = i_record[].
      DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
      i_objtxt = 'Find attached the output of the smart form.'.
      APPEND i_objtxt.
      i_objtxt = 'Regards,'.
      APPEND i_objtxt.
      i_objtxt = 'Narasimha'.
      APPEND i_objtxt.
      DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
      w_doc_chng-obj_name = 'Smartform'.
      w_doc_chng-expiry_dat = sy-datum + 10.
      w_doc_chng-obj_descr = 'Smart form output'.
      w_doc_chng-sensitivty = 'F'. "Functional object
      w_doc_chng-doc_size = v_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
      CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
      i_objpack-head_start = 1.
    Number of lines of an object header in object packet
      i_objpack-head_num = 0.
    Start line of object contents in an object packet
      i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
      i_objpack-body_num = v_lines_txt.
    Code for document class
      i_objpack-doc_type = 'RAW'.
      APPEND i_objpack.
    Packing as PDF.
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
      i_objpack-head_num = 1.
      i_objpack-body_start = 1.
      i_objpack-body_num = v_lines_bin.
      i_objpack-doc_type = 'PDF'.
      i_objpack-obj_name = 'Smartform'.
      CONCATENATE 'Smartform_output' '.pdf'
      INTO i_objpack-obj_descr.
      i_objpack-doc_size = v_lines_bin * 255.
      APPEND i_objpack.
    Document information.
      CLEAR i_reclist.
    e-mail receivers.
      i_reclist-receiver = '[email protected]'.
      i_reclist-express = 'X'.
      i_reclist-rec_type = 'U'. "Internet address
      APPEND i_reclist.
    Sending mail.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_doc_chng
          put_in_outbox              = 'X'
           commit_work                = 'X'
        TABLES
          packing_list               = i_objpack
          object_header              = w_objhead
          contents_bin               = i_objbin
       contents_hex               = 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.
      IF sy-subrc <> 0.
        WRITE:/ 'Error When Sending the File', sy-subrc.
      ELSE.
        WRITE:/ 'Mail sent'.
      ENDIF.

    Hi ashok
    thanks for your reply.
    i got the error at commit in the below Func module.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = w_doc_chng
    put_in_outbox = 'X'
    commit_work = 'X'
    TABLES
    packing_list = i_objpack
    object_header = w_objhead
    contents_bin = i_objbin.
    if i remove commit = 'X'.  no error but mail is not sending.
    please advice.

  • Smartform Error: Items not printed on next page

    Hi everyone,
    I am currently working on a Smartform for printing an Invoice. The problem is as follows:
    I have a First page and a Next Page. There is a Summary in the footer.
    If the items fit on the First page, then there is no problem. If there is space then the Summary is printed on the same page, if there is little space, then the Summary goes on to the Next page (Page Protection is applied).
    The problem arise when the items do no fit on the First Page. In this case, I get a weird error saying "Unexpected Error" and some Message 003. I can't understand what the problem is!
    I have various attachment pages as well and they are printed properly.
    Please help me crack this error at your own leisure!
    Thanks.
    Edited by: kishan P on Oct 13, 2010 9:44 AM

    Hi Ameya
    there might be syntax error. Try to get what exaclty is an error using following code.
    CALL FUNCTION <smartform>
        EXCEPTIONS
        IF SY-SUBRC  0.
           CALL FUNCTION 'SSF_READ_ERRORS'
                IMPORTING
                     ERRORTAB = IT_ERRORLIST.
         ENDIF.
    In IT_ERRORLIST you will get error message.
    Regards
    Sachin G Patil

  • Smartform error

    Hi,
    I have just moved my smart form from Sandbox to development. I downloaded the form from sandbox to my local machine and then uploaded the form from local machine to development environment.
    The smartform was working fine in sandbox (in web), but in development when I preview it in the web (its an SRM Purchase Order), it gives a popup saying "output cannot be created".
    When I debug, the error seems to be in function module SSFCOMP_PROCESS_DOCUMENT. It returns sy-subrc 1 and the error is FORMATTING_ERROR.
    Please help!!!!
    Regards,
    Jayesh

    Hi,
    This could be possibly because some of your table / window contents are exceeding the length or the windows are not fitting.
    Try doing a syntax check for your form in the development via smartforms transaction.
    Hope this helps.
    regards,
    Satya

  • Smartform Error "No defined value'

    Hi ,
    I am getting an error message in smartform 'Amount field has no defined value'.
    I have declared the amount field in global data & it has default value as '0' & i am computing its value in one of the nodes.
    When i try to print this field value at the end in text editor ,it gives the above error message.
    Kindly help.
    Thanks.

    Hi,
    If you are using it in the program lines, have you check if its in the list of variables in the upper part of the node (FROM/IN and TO/OUT).
    Regards,
    Leonard Chomi.

  • Smartform error of workarea..:no. cannot be converted

    hii all ,      
              i have a smartform in which i have a rate field...and i have to club all the values cming in with respect t tat....i am getting an error like this..""wa_dia may not be converted into a number"" ...what should i do????
    plss help me...

    Check data type of rate field. Also check the values which are being passed in wa_dia and make sure that it is number and not alphabets.
    Regards
    Mehwish

  • Smartform error while printing multiple documents

    Hi Friends,
    When I am  trying to print individual documents the Smartform output is correct but when I select multiple documents its showing an error that says ' Table GRAPH does not fit into the window'. When I change the GRAPH node it says some other node does not fit. And it goes on.
    Is there any easy way to correct this error ?
    Please help.
    Regards,
    Dikshitha G

    Hi Dikshitha,
    First you need to check whether you have used TABLE under a secondary window or Main window? When you use table GRAPH under MAIN window then automatically next page will be printed and Window width adjusts automatically. Only make sure Hight and Width of Window should not be less than the Table. Click on Output tab of Main window and not down hight and width similarly check for TABLES.
    Regards,
    Gaurav.

  • Smartform Error : "Sytems Message 042 from WA SSF Composer Doesnot Exist "

    Dear All,
    I am having problem with smartform. Actually it was runnning Properly and I messed up something,
    and Now I am getting a Message in status bar as <b>"System Message 042 from WorkArea SSF Composer Doesnot Exist".</b>
    Where could be the problem, Please Help me in this regard.
    Thanking you.
    Regards
    Venkat.

    Venkat,
    I don't think we can't make anything out of the error message. You can debug and find out which element is giving the problem. Then you can probably can figure out what is wrong with that element.
    Debugging elements is not going to be easy, you will have to be really careful with each element.
    Regards,
    Ravi

Maybe you are looking for