Error in Calling Smartforms-During FAX output

Hi experts
I am getting the following error while processing the FAX output type.....
Can you please advice how to proceed on this..
Error message
Error in Calling Smartforms
Processing log of the Output type
Object 0130001210
Output type: Delivery Note
Processing log for program RVADDN01 routine ENTRY
Error during reading T001G (Return code
Cannot process message, no route from userID to fax number
Advance thanks for your support
regards
Raja

Hi experts
I am getting the following error while processing the FAX output type.....
Can you please advice how to proceed on this..
Error message
Error in Calling Smartforms
Processing log of the Output type
Object 0130001210
Output type: Delivery Note
Processing log for program RVADDN01 routine ENTRY
Error during reading T001G (Return code
Cannot process message, no route from userID to fax number
Advance thanks for your support
regards
Raja

Similar Messages

  • Error in sending smartform as fax

    Hi everyone,
    I am trying to send a smartform through Fax, and i am getting the following error;
    Cannot process message in node, parameters cannot be converted
         Message no. XS821
    Diagnosis
         The message cannot be processed in the node as parameters such as 'Send
         time' or 'Priority' cannot be converted. It is possible that entire
         parameters such as 'Recipient list' or 'Packet list' are missing.
    System Response
         Processing was terminated.
         SAP system additional information (error number, if available):
         MRSUM
         Additional information of the node used (in the system language of the
         node)
    Can you guys please help me solving this problem?
    Thanking you,
    Kind regards,
    I have changed my code several times, using different functions to send  the fax and i am getting the same error message each time.
    Please find below the piece of code i am using to send the fax.
    DATA:GT_MAIL_LINES TYPE STANDARD TABLE OF soli.
      data: gs_mail_lines TYPE soli.
    DATA: ls_object_hd TYPE sood1,
    ls_receivers TYPE soos1,
    lt_receivers TYPE STANDARD TABLE OF soos1,
    l_lines TYPE i,
    ls_sadrfd TYPE sadrfd.
    CLEAR: ls_object_hd, ls_receivers.
    REFRESH lt_receivers.
    ls_object_hd-objla = sy-langu.
    ls_object_hd-objnam = 'NOTE'.
    ls_object_hd-objdes = 'Fax subject line in here'.
    "Calculate size of table
    DESCRIBE TABLE gt_mail_lines LINES l_lines.
    READ TABLE gt_mail_lines INDEX l_lines INTO gs_mail_lines.
    ls_object_hd-objlen = ( l_lines - 1 ) * 255 + STRLEN( gs_mail_lines ).
    "Set Fax control structure
    "Fax number in structure must have no leading zero
    "as this is added by SAPOffice from the country code
    ls_sadrfd-rec_fax = '4421844
    ls_sadrfd-rec_street = 'Addr'.
    ls_sadrfd-rec_town = 'Addr'.
    ls_sadrfd-rec_name1 = 'Name'.
    ls_sadrfd-rec_state = 'MU'.
    ls_sadrfd-form_langu = 'EN'.
    ls_sadrfd-fax_form = 'Z_FAX_COVER'.
    ls_sadrfd-send_comp = 'USER'
    ls_sadrfd-send_immi = 'X'.
    ls_sadrfd-send_nam = sy-uname.
    ls_sadrfd-send_date = sy-datum.
    ls_sadrfd-send_time = sy-uzeit.
    "Convert Receiver information to char field
    CALL FUNCTION 'C147_WORKAREA_TO_CHARFIELD'
    EXPORTING
    I_WORKAREA = ls_sadrfd
    IMPORTING
    E_CHARFIELD = ls_receivers-recextnam.
    ls_receivers-recesc = 'F'.
    ls_receivers-mailstatus = 'E'.
    ls_receivers-sndart = 'FAX'.
    ls_receivers-sndpri = '1'.
    APPEND ls_receivers TO lt_receivers.
    "Send fax
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    object_hd_change = ls_object_hd
    object_type = 'RAW'
    owner = sy-uname
    originator_type = 'B'
    TABLES
    objcont   = gt_mail_lines
    receivers = lt_receivers
    EXCEPTIONS
    OTHERS = 01.
    break buantoch.
    "The function doesn't commit so we must
    "do it if successful.
    IF sy-subrc = 0.
    COMMIT WORK AND WAIT.
    ELSE.
    WRITE: / 'Fax failed RAISE ERROR '(012).
    ENDIF.

    Hi,
    Then, you can test the FAX fuctionality like:
    go to System->Short Message->give a test message,give recipient as the FAX number,type as FAX->Shift+F8 the see if it works... else only SCOT errors will be there...
    See:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
    Also see:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4b4fa090-0201-0010-d3b7-b233296d95ff
    Regards,
    Renjith Michael.

  • Getting run time error while calling smartform

    hi,
    i am getting run time error of "maintain output device in your master data" while calling smart form.
    p_output_options-xsfcmode = 'X' .
      p_output_options-xsf = space .
      p_output_options-xdfcmode = 'X' .
      p_output_options-xdf = space .
      p_output_options-tddest = 'LP01'.
      p_output_options-tdnewid = 'X'.
      p_output_options-tddelete = SPACE.
      p_control_parameters-no_dialog = 'X' .
      p_control_parameters-getotf = 'X' .
      p_control_parameters-DEVICE = 'PRINTER'.

    Hi Neha
    Your program looks out for the default printer configured against your user (Check SU01 : Constant tab ). You dont seem to have maintained it properly as a result of which you get this message. You will have to configure your printer device to overcome this error.
    Choose menu: System -> User Profile -> Own data.
    On the Defaults tab, give LOCL code for the output device.
    You can also check the output device setting in transaction SPAD.
    Regards,
    Uday

  • Error, while calling driver program for Smartforms

    Hi All,
    I am getting a error while running DRIVER PROGRAM of smart form.
    both driver program and smart form running successfully without any error while executing separately. But
    while calling Smart Form from driver program. it is giving error as :-
    *Events are already defined.*
    Description :- You tried to define events for a section, but a section with
    events is already active. You are not allowed to nest events.
    Regards,
    Pavan.M

    This is nothing to do with coding, this coz of error is from smartforms....
    Regards,
    Pavan.M

  • Error in FAX output

    Hi All,
    I am getting following error when I send the output to fax.
    Conversion from OTF to PS: Termination in C_RSPO_PROCESS_DIALOG, return code   128 Printjob not found
    Conversion from OTF to PS: Termination in SX_OBJECT_CONVERT___S_PRT, return code 1
    Message cannot be processed as it cannot be converted
    Need to know if the issue is with ABAP or its related to FAX...
    Need this urgently.
    Regards,
    Shahu

    This was issue with the test system environment.. when the same fax output was fired in other test evironment it worked fine...
    regards,
    Shahu

  • Pixma 330 fax output error check paper size

    I received a fax on my Pixma 330. The document came through fine, but now I have "fax output error, check paper size and press OK". The paper size is correct, and when I press OK, it prints out the original document again, then gives me the same error message. If I turn off the machine, when I turn it back on, it again prints the document, then gives me the error message. The machine will not let me do anything except press OK. How can I get this to go away? Thanks.

    Hi JWK,
    Please make sure that the paper is loaded correctly and the settings are correct.  To do this, please follow these steps:
    1. Flatten the four corners of the paper before loading it.
    Note
    Align the edges of paper neatly before loading. Loading paper without aligning the edges may cause paper jams.
    If paper is curled, hold the opposing curled corners and gently bend them in the opposite direction until the paper becomes completely flat. See Paper is curled..
    To avoid curling, handle paper as follows.
    - When you do not print, remove unused paper from the Rear Tray, put them back into the package, and keep it on a level surface.
    - Take out only the necessary number of sheets from the package, just before printing.
    2. Load the paper.
    (1) Open the Paper Support, raise it, then tip it back.
    (2) Open the Paper Output Tray gently, and open the Output Tray Extension.
    (3) Slide the Paper Guides (A) to open them, and load the paper in the center of the Rear Tray WITH THE PRINT SIDE FACING YOU
    Important
    Always load paper in the portrait orientation (B). Loading paper in the landscape orientation (C) can cause paper jams.
    (4) Slide the Paper Guides (A) to align them with both sides of the paper stack.
    Do not slide the Paper Guides too hard. The paper may not be fed properly.
    Note:
    Do not load sheets of paper higher than the Load Limit Mark(D).
    After loading paper
    When using the machine to copy or print without a computer, select the size and type of the loaded paper in Page size and Media type of the settings screen in each mode.
    If you continue to have difficulties, please contact our support group using the following link:
    http://www.usa.canon.com/cusa/consumer/standard_display/contact_us_consumer
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Problem while sending Smartform through Fax

    Hi Folks,
    I am sending a Smartform through fax by setting the essential Control Parameters and Output Options while calling the function module of the Smartform.
    In SOST I get the status message 710(Message transferred to node FAX(...) ) and later in around 20 minutes the message 812(No delivery to FAX(.......fax no) ) occurs for some requests.
    Only few requests are sent successfully by the same program and same O/P Type and shows the status message 701(Delivered to FAX (................)).
    There is no much time difference between those requests while creating.
    Do you know what could be the problem?
    Can you help me in solving the issue?

    may it be that in those cases where it doesnt work, that you got no fax number?
    Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario.

  • Error while calling a method on Bean (EJB 3.0)

    I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me
    Error is -->
    Error while destroying resource :An I/O error has occured while flushing the output - Exception: java.io.IOException: An established connection was aborted by the software in your host machine
    Stack Trace:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
    at sun.nio.ch.IOUtil.write(IOUtil.java:75)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
    at com.sun.enterprise.server.ss.provider.ASOutputStream.write(ASOutputStream.java:138)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
    at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
    at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.rollback(AbstractJdbc1Connection.java:1031)
    at org.postgresql.jdbc2.optional.PooledConnectionImpl$ConnectionHandler.invoke(PooledConnectionImpl.java:223)
    at $Proxy34.close(Unknown Source)
    at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:274)
    at com.sun.enterprise.resource.LocalTxConnectorAllocator.destroyResource(LocalTxConnectorAllocator.java:103)
    at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:603)
    at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:713)
    at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:424)
    at com.sun.enterprise.resource.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:393)
    at com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:69)
    at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:618)
    at com.sun.gjc.spi.ConnectionHolder.close(ConnectionHolder.java:163)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:379)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:367)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:402)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.afterJTSTransaction(DatasourceAccessor.java:100)
    at oracle.toplink.essentials.threetier.ClientSession.afterTransaction(ClientSession.java:104)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.afterTransaction(UnitOfWorkImpl.java:1816)
    at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:161)
    at oracle.toplink.essentials.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:87)
    at com.sun.ejb.containers.ContainerSynchronization.afterCompletion(ContainerSynchronization.java:174)
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:467)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    End of Stack Trace
    |#]
    RAR5035:Unexpected exception while destroying resource. To get exception stack, please change log level to FINE.
    EJB5018: An exception was thrown during an ejb invocation on [DepartmentSessionBean]
    javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException
    javax.transaction.SystemException
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:452)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    Means theres an error in XML/ABAP conversion probably due a syntax error...
    Regards
    Juan

  • Error while calling the Mapping function module for BW Extraction

    Hi
    iam getting runtime error while calling the BW mapping function
    The error description is as shown below.
    Runtime Errors         CALL_FUNCTION_UC_STRUCT
    Except.                CX_SY_DYN_CALL_ILLEGAL_TYPE
    <b>Short text</b>
        Type conflict during structure parameter transfer at CALL FUNCTION.
    <b>What happened?</b>
        Error in the ABAP Application Program
        The current ABAP program "GP466CV1Y7W2VML1PJ3VB80KDOP" had to be terminated
         because it has
        come across a statement that unfortunately cannot be executed.
    <b>Error analysis</b>   
    An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
         not caught in
        procedure "CALL_MAPPING_FUNCTION" "(FORM)", nor was it propagated by a RAISING
         clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        In the function "CMS_CB_BW_MAP", the STRUCTURE parameter "EXTRACT_DATA" is
         typed in such a way
        that only actual parameters are allowed, which are compatible in Unicode
         with respect to the fragment view. However, the specified actual
        parameter " " has an incompatible fragment view.
    I am passing the EXTRACT_DATA  parameter as specification LIKE with the associated type  - corresponding structure
    Please let me know how can i resolve this issue
    Regards
    Leon

    Dear benarji ,
    I'm having the  same problem help me to correct . I have mentioned below as what error i got.
    Runtime Errors         CALL_FUNCTION_UC_STRUCT
    Except.                CX_SY_DYN_CALL_ILLEGAL_TYPE
    Short text
         Type conflict during structure parameter transfer at CALL FUNCTION.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "ZDLROUTSTANDING_COPY" had to be terminated because it
          has
         come across a statement that unfortunately cannot be executed.
    Error analysis
         An exception occurred that is explained in detail below.
         The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
          not caught in
         procedure "PDF" "(FORM)", nor was it propagated by a RAISING clause.
         Since the caller of the procedure could not have anticipated that the
         exception would occur, the current program is terminated.
         The reason for the exception is:
         In the function "/1BCDWB/SF00000080", the STRUCTURE parameter "IT_WORKS_SF" is
          typed in such a way
         that only actual parameters are allowed, which are compatible in Unicode
          with respect to the fragment view. However, the specified actual
         parameter "SFTWORKS" has an incompatible fragment view.
    Missing RAISING Clause in Interface
        Program                                 ZDLROUTSTANDING_COPY
        Include                                 ZDLROUTSTANDING_COPY
        Row                                     876
        Module type                             (FORM)
        Module Name                             PDF
    Trigger Location of Exception
        Program                                 ZDLROUTSTANDING_COPY
        Include                                 ZDLROUTSTANDING_COPY
        Row                                     894
        Module type                             (FORM)
        Module Name                             PDF
    Source Code Extract
    Line  SourceCde
      864 **            i_logo             = 'ENJOYSAP_LOGO'
      865 *            IT_LIST_COMMENTARY = I_LIST_COMMENTS1.
      866
      867 ENDFORM.                    "alv_top_of_page1
      868 *&---------------------------------------------------------------------*
      869 *&      Form  PDF
      870 *&---------------------------------------------------------------------*
      871 *       text
    872 *----------------------------------------------------------------------*
    873 *  -->  p1        text
    874 *  <--  p2        text
    875 *----------------------------------------------------------------------*
    876 FORM pdf .
    877
    878 *  *** Smartforms & PDF ***
    879
    880   ssfctrlop-no_dialog = 'X'.
    881   ssfctrlop-preview   = 'X'.
    882   ssfctrlop-getotf    = 'X'.
    883   ssfcompop-tddest = 'ERP7'.
    884   DATA : mcheck LIKE sy-subrc.
    885   CLEAR : fm_name.
    886
    887   "Get Function module name for given smartform
    888   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    889     EXPORTING
    890       formname = 'ZSFDLOS1'
    891     IMPORTING
    892       fm_name  = fm_name.
    893
    >>>>   CALL FUNCTION fm_name
    895   EXPORTING
    896         control_parameters   = ssfctrlop
    897         output_options       = ssfcompop
    898         mrefno               = mrefno
    899 *       P_TITLE              = MTITLE
    900   IMPORTING
    901         document_output_info = st_document_output_info
    902         job_output_info      = st_job_output_info " IT_OTF_DATA
    903         job_output_options   = st_job_output_options
    904   TABLES
    905         it_works_sf          = sftworks
    906   EXCEPTIONS
    907         formatting_error     = 1
    908         internal_error       = 2
    909         send_error           = 3
    910         user_canceled        = 4
    911     OTHERS               = 5.
    912
    913   IF sy-subrc NE 0.
    Advance Thanks

  • Problems when trying to send a smartform through fax

    Hi,
    Im currently confronting a problem when sending smartforms through fax to multiple recipients.
    This is the scenario Im working on:
    The client needs to be able to send a document, could be a PO or invoices, to diferent recipients at the same time. So far in case of purchase orders, we have been able to find the respective faxes and emails for each of the partner functions.
    Functionality for email is working as desired but when sending faxes I have problems.
    Reviewing the output through SOST I get all my receipients which are email and faxes. Emails are fine since it creates a PDF attachment with the order and all of its details.
    For fax I get the same even though the paramenters are set for fax.
    Here is my code if you could please help me here on this one.
    SELECT lifn2 FROM EkPA into l_ekpa-lifn2
                 WHERE EBELN = a_EBELN.
        APPEND l_EKPA.
      ENDSELECT.
      SELECT adrnr
        FROM lfa1
        INTO itab-q_adrnr
        FOR ALL ENTRIES IN l_ekpa WHERE lifnr = l_ekpa-lifn2.
        APPEND itab.
      ENDSELECT.
    *& End of partner address
    *& Selection of Address or Fax number from ADR3 & ADR6 according to ADRNR
    *& Nato
      IF sy-subrc EQ 0.
        loop at itab.
          SELECT SINGLE smtp_addr INTO (itab-q_mail)
       from adr6 where addrnumber = itab-q_adrnr and flg_nouse eq space.
          IF itab-q_mail ne Space.
            Move 'U' to itab-q_typ2(1).
            Move 'X' to itab-q_express(1).
          Move 'EXT' to itab-XOBJT.
          ENdIF.
       SELECT SINGLE FAXNR_LONG INTO (itab-q_fax)
          SELECT SINGLE country FAX_NUMBER INTO (itab-q_cty, itab-q_fax )
       from adr3 where addrnumber = itab-q_adrnr and flg_nouse eq space.
          If itab-q_fax ne space.
            Move 'F' to itab-q_typ(1).
            Move 'TELEFAX' to itab-q_com.
          Endif.
          Modify itab.
        endloop.
    *&  END of ITAB
        CLEAR : DOC_CHNG.
        REFRESH LINES.
        IF NAST-NACHA eq '7'.
    * Fill both the fax & email Receiver lists
          clear:   reclist, reclist2.
          refresh: reclist, reclist2.
    *& loop table itab to update receipient list in table Reclist
    *& Nato
          loop at itab.
            IF not itab-q_typ is initial.
             concatenate itab-q_cty itab-q_fax into reclist2-RECNAM separated by space. "FAX NUMBER
              move itab-q_fax to reclist2-receiver. "FAX NUMBER
    *&>>>>>>>>>>>>>>>>>>>new entry for testing nato 080206<<<<<<<<<<<&
              move itab-q_cty to RECLIST2-COUNTRY.        "Country Code
              move itab-q_fax to Reclist2-FAX.            "Fax number
    *&>>>>>>>>>>>>>>ENd of entry<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&
              move itab-q_typ to REClist2-REC_TYPE.  "Communication type for fax
          move itab-q_EXPRESS to Express.        "comment for testing
              move itab-q_com to REClist2-COM_TYPE.
              Move 'X' to reclist2-NOTIF_DEL.
             Move 'TELEFAX' to reclist2-SNDART.    "TYPE OF DEVICE
              Move a_ebeln to sood-OBJDES.              "new addition for testing nato
              append Reclist2.
            endif.
            IF not itab-q_typ2 is initial.
              move itab-q_mail to REclist-receiver.  "SMT ADDRESS
              move itab-q_typ2 to REClist-REC_TYPE.
              move itab-q_EXPRESS to REClist-express.
              move 'X' to reclist-TO_ANSWER.
              Move a_ebeln to sood-OBJDES.              "new addition for testing nato
          move itab-q_com to REClist-COM_TYPE.   "comment for testing only
              append Reclist.
            Endif.
            move reclist-receiver to address.
          endLoop.
    *& END OF RECipient
        ENDIF.
        DOC_CHNG-OBJ_DESCR  = nast-objky.
      ELSE.
        IF RECLIST IS INITIAL.
         LOOP AT reclist INTO RECIPIENT .        " This logic might get commented or deleted. Nato 08/01/06
         ENDLOOP.
        ENDIF.
        DOC_CHNG-OBJ_DESCR  = L_TITLE.
      ENDIF.
      IF RECLIST[] IS INITIAL.
        MESSAGE E573(VE) RAISING RECEIVER_NOT_FOUND.
      ENDIF.
    *& New entry to determine path according to communication
    *& type
    *& If comm type eq U follow convert_otf
    *& then Read text, finaly send API
    *& If comm type eq F follow path to "Convert OTF & FAX
    *& Nato 080106
      REFRESH : HOTFDATA, LT_SOLIX, OBJBIN.
      LOOP AT JOB_OUTPUT_INFO-OTFDATA INTO HOTFDATA.
        APPEND HOTFDATA.
      ENDLOOP.
    *& Prepare content to be converted to PDF format
    *& nato
      CALL FUNCTION 'CONVERT_OTF'
           EXPORTING
                FORMAT                = 'PDF'
                    MAX_LINEWIDTH         = 132
           IMPORTING
                BIN_FILESIZE          = DOC_SIZE
                BIN_FILE              = LD_BINFILE
           TABLES
                OTF                   = HOTFDATA
                LINES                 = HTLINE
           EXCEPTIONS
                ERR_MAX_LINEWIDTH     = 1
                ERR_FORMAT            = 2
                ERR_CONV_NOT_POSSIBLE = 3
                OTHERS                = 4.
    *& new entry just for test today 080306
    *&nato
    *endif.
    *&--end of entry--
      I = 0.
      N = XSTRLEN( LD_BINFILE ).
      WHILE I < N.
        LT_SOLIX-LINE = LD_BINFILE+I.
        APPEND LT_SOLIX.
        I = I + 255.
      ENDWHILE.
    *& end of convertion pdf
      LOOP AT LT_SOLIX INTO WA_SOLIX.
        CLEAR WA_SOLI.
        ASSIGN WA_SOLI TO <PTR_HEX> CASTING.
        MOVE WA_SOLIX TO <PTR_HEX>.
        APPEND WA_SOLI TO OBJBIN.
      ENDLOOP.
    *& Prepare send mail
      CLEAR : NAME, DOCNAME.
      REFRESH : OBJTXT, OBJPACK.
      CONCATENATE NAST-KAPPL NAST-KSCHL INTO NAME.
      CONDENSE NAME.
      IF NAST-NACHA NE '7'.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
      CLIENT                        = SY-MANDT
            ID                            = 'STAM'
            LANGUAGE                      = SY-LANGU
            NAME                          = NAME
            OBJECT                        = 'OCS'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
          TABLES
            LINES                         = LINES
       EXCEPTIONS
         ID                            = 1
         LANGUAGE                      = 2
         NAME                          = 3
         NOT_FOUND                     = 4
         OBJECT                        = 5
         REFERENCE_CHECK               = 6
         WRONG_ACCESS_TO_ARCHIVE       = 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.
      ENDIF.
      CONCATENATE NAST-OBJKY '.PDF' INTO DOCNAME .
      CONDENSE DOCNAME.
    *endif.      "temp nato -080406
      if reclist-rec_type eq 'U'.
        DOC_CHNG-OBJ_NAME   = 'Delivery'.
        LOOP AT LINES.
          OBJTXT = LINES-TDLINE.
          APPEND OBJTXT.
        ENDLOOP.
        DESCRIBE TABLE OBJTXT LINES TAB_LINES.
        IF TAB_LINES > 0.
          READ TABLE OBJTXT INDEX TAB_LINES.
          DOC_CHNG-DOC_SIZE  = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
        ENDIF.
        CLEAR OBJPACK-TRANSF_BIN.
        OBJPACK-HEAD_START = 1.
        OBJPACK-HEAD_NUM   = 0.
        OBJPACK-BODY_START = 1.
        OBJPACK-BODY_NUM   = TAB_LINES.
        OBJPACK-DOC_TYPE   = 'RAW'.
        APPEND OBJPACK.
        DESCRIBE TABLE OBJBIN LINES TAB_LINES.
        OBJHEAD            = DOCNAME.
        APPEND OBJHEAD.
        OBJPACK-TRANSF_BIN = 'X'.
        OBJPACK-HEAD_START = 1.
        OBJPACK-HEAD_NUM   = 1.
        OBJPACK-BODY_START = 1.
        OBJPACK-BODY_NUM   = TAB_LINES.
        OBJPACK-DOC_TYPE   = 'PDF'.
        OBJPACK-OBJ_NAME   = 'Delivery'.
    OBJPACK-OBJ_DESCR  = NAST-OBJKY.
        OBJPACK-OBJ_DESCR  = A_EBELN.
        OBJPACK-DOC_SIZE   = TAB_LINES * 255.
        APPEND OBJPACK.
        break nhernandez.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
             DOCUMENT_DATA                    = DOC_CHNG
        PUT_IN_OUTBOX                    = 'X'
      COMMIT_WORK                      = ' '
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
          TABLES
           PACKING_LIST                     = OBJPACK
           OBJECT_HEADER                    = OBJHEAD
           CONTENTS_BIN                     =  OBJBIN
           CONTENTS_TXT                     =  OBJTXT
      CONTENTS_HEX                     =
      OBJECT_PARA                      =
      OBJECT_PARB                      =
            RECEIVERS                        =  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 E081(ZGLO) WITH SY-SUBRC RAISING MAIL_SENDING_ERROR.
        ENDIF.
      endif.
    AM I missing something?

    Hi Nat,
    You can check this link which shows how to use the PRINT_TEXT for sending fax.
    http://www.sap-img.com/abap/sending-fax-from-abap.htm
    Also you can check these
    Smartforms
    Sending Smartforms through Fax
    Sending SMARTFORM output to FAX gateway
    How to fax a smartform?
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
    ftp
    Cheers
    VJ

  • Error in opening smartform generated PDF attachments

    Hi every one,
        my smartforms generate multiple emails based on the widely used code as shown below.
    The emails are successfully being sent to different locations, but the problem is the first PDF file is opening, but the others followed by it are not opening. It's giving an error ' File damaged and cannot be opened!'
    Pls see the below code and help me out.
    Points would be awarded.
    Thanks to all in advance!!
    Arnab
    REPORT  zvenkat_smartform_via_mai.
    *&  Structures and Infotype Internal tables.
    TABLES pernr.
    INFOTYPES:
      0000,
      0001,
      0002,
      0006,
      0022,
      0023.
    INCLUDE dbpnpmac.
    *&  Declaration part
    Types
    TYPES:
       BEGIN OF t_emp_info,
         pernr TYPE pa0001-pernr,
         ename TYPE pa0001-ename,
         bukrs TYPE pa0001-bukrs,
         persk TYPE pa0001-persk,
         stell TYPE pa0001-stell,
         gblnd TYPE pa0002-gblnd,
       END OF t_emp_info,
       BEGIN OF t_mard,
         matnr TYPE mard-matnr,
         werks TYPE mard-werks,
         labst TYPE mard-labst,
         meins TYPE mara-meins,
       END OF t_mard.
    Work areas
    DATA:
      w_emp_info TYPE t_emp_info.
    Internal tables
    DATA:
      i_emp_info TYPE STANDARD TABLE OF t_emp_info,
      i_mard     TYPE STANDARD TABLE OF t_mard.
    "  Mai related declarations
    "Variables
    DATA :
         g_sent_to_all   TYPE sonv-flag,
         g_tab_lines     TYPE i.
    "Types
    TYPES:
         t_document_data  TYPE  sodocchgi1,
         t_packing_list   TYPE  sopcklsti1,
         t_attachment     TYPE  solisti1,
         t_body_msg       TYPE  solisti1,
         t_receivers      TYPE  somlreci1,
         t_pdf            TYPE  tline.
    "Workareas
    DATA :
         w_document_data  TYPE  t_document_data,
         w_packing_list   TYPE  t_packing_list,
         w_attachment     TYPE  t_attachment,
         w_body_msg       TYPE  t_body_msg,
         w_receivers      TYPE  t_receivers,
         w_pdf            TYPE  t_pdf.
    "Internal Tables
    DATA :
         i_document_data  TYPE STANDARD TABLE OF t_document_data,
         i_packing_list   TYPE STANDARD TABLE OF t_packing_list,
         i_attachment     TYPE STANDARD TABLE OF t_attachment,
         i_body_msg       TYPE STANDARD TABLE OF t_body_msg,
         i_receivers      TYPE STANDARD TABLE OF t_receivers,
         i_pdf            TYPE STANDARD TABLE OF t_pdf.
    PARAMETERS:
               p_mai_id(99) TYPE c.
    *& Start-of-selection.
    START-OF-SELECTION.
    GET pernr.
      PERFORM get_data.
      PERFORM show_smartform.
    *& End-of-selection.
    END-OF-SELECTION.
    *&      Form  get_data
    FORM get_data .
      rp-provide-from-last p0000 space pn-begda pn-endda.
      rp-provide-from-last p0001 space pn-begda pn-endda.
      rp-provide-from-last p0002 space pn-begda pn-endda.
      MOVE-CORRESPONDING: p0000 TO w_emp_info,
                          p0001 TO w_emp_info,
                          p0002 TO w_emp_info.
      SELECT matnr werks labst
      FROM mard
      INTO CORRESPONDING FIELDS OF TABLE i_mard.
    ENDFORM.                    " get_data
    *&      Form  show_smartform
    FORM show_smartform .
      DATA :
        l_sform_name TYPE tdsfname,
        l_fm_name    TYPE rs38l_fnam.
      DATA :
            l_sf_control TYPE ssfctrlop,
            l_sf_options TYPE ssfcompop.
      DATA: i_otf LIKE itcoo OCCURS 100 WITH HEADER LINE.
           i_pdf LIKE tline OCCURS 100 WITH HEADER LINE.
      DATA: op_option TYPE ssfctrlop,
            job_output TYPE ssfcrescl.
    op_option-getotf = 'X'.
      l_sform_name = 'ZVENKAT_SMARTFORM'.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = l_sform_name
        IMPORTING
          fm_name            = l_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.
      ELSE.
        CALL FUNCTION l_fm_name
          EXPORTING
            control_parameters = op_option
            output_options     = l_sf_options
            w_emp_info         = w_emp_info
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
       job_output_info            = job_output
          TABLES
            p0006              = p0006
            p0022              = p0022
            p0023              = p0023
            i_mard             = i_mard.
        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 'CONVERT_OTF'
          EXPORTING
            format = 'PDF'
          TABLES
            otf    = job_output-otfdata
            lines  = i_pdf.
        IF sy-subrc  0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        PERFORM send_mai.
      ENDIF.
    ENDFORM.                    " show_smartform
    *&      Form  send_mai
    FORM send_mail .
      "Subject of the mai.
      w_document_data-obj_name  = 'MAI_TO_HEAD'.
      w_document_data-obj_descr = 'Regarding Mai Program by SAP ABAP'.
      "Body of the mai
      PERFORM build_body_of_mai
        USING:space,
              'Hi,',
              'I am fine. How are you? How are you doing ? ',
              'This program has been created to send simple mai',
              'with Subject,Body with Address of the sender. ',
              'Regards,',
              'Venkat.O,',
              'SAP HR Technical Consultant.'.
      "Write Packing List for Body
      DESCRIBE TABLE i_body_msg LINES g_tab_lines.
      w_packing_list-head_start = 1.
      w_packing_list-head_num   = 0.
      w_packing_list-body_start = 1.
      w_packing_list-body_num   = g_tab_lines.
      w_packing_list-doc_type   = 'RAW'.
      APPEND w_packing_list TO i_packing_list.
      CLEAR  w_packing_list.
      "Write Packing List for Attachment
      w_packing_list-transf_bin = 'X'.
      w_packing_list-head_start = 1.
      w_packing_list-head_num   = 1.
      w_packing_list-body_start = 1.
      DESCRIBE TABLE i_attachment LINES w_packing_list-body_num.
      w_packing_list-doc_type   = 'PDF'.
      w_packing_list-obj_descr  = 'PDF Attachment'.
      w_packing_list-obj_name   = 'PDF_ATTACHMENT'.
      w_packing_list-doc_size   = w_packing_list-body_num * 255.
      APPEND w_packing_list TO i_packing_list.
      CLEAR  w_packing_list.
      "Fill the document data and get size of attachment
      w_document_data-obj_langu  = sy-langu.
      READ TABLE i_attachment INTO w_attachment INDEX g_tab_lines.
      w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_attachment ).
      "Receivers List.
      w_receivers-rec_type   = 'U'.      "Internet address
      w_receivers-receiver   = p_mai_id. "here mai Id should be given
      w_receivers-com_type   = 'INT'.
      w_receivers-notif_del  = 'X'.
      w_receivers-notif_ndel = 'X'.
      APPEND w_receivers TO i_receivers .
      CLEAR:w_receivers.
      "Function module to send mai to Recipients
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_document_data
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = g_sent_to_all
        TABLES
          packing_list               = i_packing_list
          contents_bin               = i_attachment
          contents_txt               = i_body_msg
          receivers                  = i_receivers
        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 i303(me) WITH 'Mai has been Successfully Sent.'.
      ELSE.
        WAIT UP TO 2 SECONDS.
        "This program starts the SAPconnect send process.
        SUBMIT rsconn01 WITH mode = 'INT'
                        WITH output = 'X'
                        AND RETURN.
      ENDIF.
    ENDFORM.                    " send_mai
    *&      Form  build_body_of_mai
          text
         -->L_MESSAGE  text
    FORM build_body_of_mai  USING l_message.
      w_body_msg = l_message.
      APPEND w_body_msg TO i_body_msg.
      CLEAR  w_body_msg.
    ENDFORM.                    " build_body_of_mai

    Hi,
    Check the code below
    1.converting smartform to PDF
    Summury: Converting the smartfrom to PDF is process of 3 simple steps.
    • Calling the Smart form, then it returns the OTF data in Return.
    • Converting the OTF data into required format using the Function Module CONVERT_OTF_2_PDF.
    • Download the File
    *& Report ZTEST_NREDDY_PDF
    REPORT ZTEST_NREDDY_PDF.
    DATA: it_otf TYPE STANDARD TABLE OF itcoo,
    it_docs TYPE STANDARD TABLE OF docs,
    it_lines TYPE STANDARD TABLE OF tline,
    st_job_output_info TYPE ssfcrescl,
    st_document_output_info TYPE ssfcrespd,
    st_job_output_options TYPE ssfcresop,
    st_output_options TYPE ssfcompop,
    st_control_parameters TYPE ssfctrlop,
    v_len_in TYPE so_obj_len,
    v_language TYPE sflangu VALUE 'E',
    v_e_devtype TYPE rspoptype,
    v_bin_filesize TYPE i,
    v_name TYPE string,
    v_path TYPE string,
    v_fullpath TYPE string,
    v_filter TYPE string,
    v_uact TYPE i,
    v_guiobj TYPE REF TO cl_gui_frontend_services,
    v_filename TYPE string,
    v_fm_name TYPE rs38l_fnam.
    CONSTANTS c_formname TYPE tdsfname VALUE 'ZTEST'.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = v_language
    i_application = 'SAPDEFAULT'
    IMPORTING
    e_devtype = v_e_devtype.
    st_output_options-tdprinter = v_e_devtype.
    *st_output_options-tdprinter = 'locl'.
    st_control_parameters-no_dialog = 'X'.
    st_control_parameters-getotf = 'X'.
    .................GET SMARTFORM FUNCTION MODULE NAME.................
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = c_formname
    IMPORTING
    fm_name = v_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 SMARTFORM............................
    CALL FUNCTION v_fm_name
    EXPORTING
    control_parameters = st_control_parameters
    output_options = st_output_options
    IMPORTING
    document_output_info = st_document_output_info
    job_output_info = st_job_output_info
    job_output_options = st_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.
    ELSE.
    .........................CONVERT TO OTF TO PDF.......................
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
    bin_filesize = v_bin_filesize
    TABLES
    otf = st_job_output_info-otfdata
    doctab_archive = it_docs
    lines = it_lines
    EXCEPTIONS
    err_conv_not_possible = 1
    err_otf_mc_noendmarker = 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.
    ........................GET THE FILE NAME TO STORE....................
    CONCATENATE 'smrt' '.pdf' INTO v_name.
    CREATE OBJECT v_guiobj.
    CALL METHOD v_guiobj->file_save_dialog
    EXPORTING
    default_extension = 'pdf'
    default_file_name = v_name
    file_filter = v_filter
    CHANGING
    filename = v_name
    path = v_path
    fullpath = v_fullpath
    user_action = v_uact.
    IF v_uact = v_guiobj->action_cancel.
    EXIT.
    ENDIF.
    ..................................DOWNLOAD AS FILE....................
    MOVE v_fullpath TO v_filename.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = v_bin_filesize
    filename = v_filename
    filetype = 'BIN'
    TABLES
    data_tab = it_lines
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    Regards,
    Raj.

  • Call smartform in web dynpro abap

    hi guys,
          I am tring to create PDF from smartform but am getting sy-subrc = 1 error after call function LV_FNAM.
    I am attaching the code below. Am not using InteractiveForm UI Elemnt .
    data: lv_fnam type rs38l_fnam,
          ls_ssfctrlop type ssfctrlop,
          ls_ssfcompop type ssfcompop,
          ls_book type ppftbook,
          ls_job_output_info type ssfcrescl,
          ls_job_output_options type ssfcresop,
          lv_bytecount type i,
          lt_lines type table of tline,
          ls_line type tline,
          lv_string type string,
          lv_buffer type xstring,
          l_xline type xstring,
          l_pdfstring type xstring,
          it_add_rel type table of zprint_add_rel.
    *      p_pdf type xstring.
    data : wa_board type mara-matnr,
           plant type marc-werks.
    wa_board =  'SYPJ764'.
    plant = '2001'.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSSF_ADD_REL'
    importing
    fm_name = lv_fnam.
    ls_ssfctrlop-no_dialog = 'X'.
    ls_ssfctrlop-getotf  = 'X'.
    ls_ssfctrlop-preview = 'X'.
    ls_ssfcompop-tdnoprev = 'X'.
    ls_ssfcompop-tdtitle = 'X'.
    ls_ssfcompop-tdnewid = 'X'.
    call function lv_fnam
    exporting
    control_parameters = ls_ssfctrlop
    output_options = ls_ssfcompop
    *is_book = ls_book
    board = wa_board " 'SYPJ764'
    plant = plant " '2001'
    importing
    job_output_info = ls_job_output_info
    job_output_options = ls_job_output_options
    tables
    it_add_rel_i = it_add_rel
    exceptions
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    other = 5.
    if sy-subrc <> 0.
    endif.
    *convert to pdf
    call function 'CONVERT_OTF'
    exporting
    format = 'PDF'
    importing
    bin_filesize = lv_bytecount
    tables
    otf = ls_job_output_info-otfdata
    lines = lt_lines
    exceptions
    err_conv_not_possible = 1
    err_bad_otf = 2.
    loop at lt_lines into ls_line.
    lv_string = ls_line.
    export mydata = lv_string to data buffer lv_buffer.
    import mydata to l_xline from data buffer lv_buffer in char-to-hex mode.
    concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
    endloop.
    p_pdf = l_pdfstring.
    Please help me out with this error.
    Regards,
    Santosh

    Hi Santhosh,
    Please find the below code:
    FUNCTION ZP3088_NEW_JOINEE_ACT.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PERNR) TYPE  PERSNO
    *"  EXPORTING
    *"     REFERENCE(L_DISPLAY_PDF) TYPE  NUM1
    *"     REFERENCE(L_DATA) TYPE  XSTRING
    *"  EXCEPTIONS
    *"      TRAINEE_PERNR
    * Tables declaration
      TABLES: NAST,PA0041.
    *   Type pools declaration
      TYPE-POOLS: SZADR.
    *   Internal table declaration
      DATA: L_PDF_LEN TYPE I,
            IT_PDF_LINES TYPE TABLE OF TLINE,
            JOB_OUTPUT_INFO TYPE  SSFCRESCL.
    *   Variables declaration
      DATA: G_RETCODE LIKE SY-SUBRC,
            G_FMNAME TYPE RS38L_FNAM.
      DATA: L_HIRE_DATE TYPE DATS,
            L_INCLUDE_DATE TYPE DATS,
            L_WEEK_DAYS TYPE P,
            IT_P0041 LIKE PA0041.
      DATA: DAR TYPE PA0041-DAR01,
            DAT TYPE PA0041-DAT01.
      DATA: L_DEVICE(30) TYPE C,
            LA_CTRL_FORM TYPE SSFCTRLOP,
            LA_OUTPUT_OPT TYPE SSFCOMPOP.
      data: l_persg type PA0001-persg. 
    * Start of Actual Code
      SELECT SINGLE persg
        from PA0001
        INTO l_persg
       where pernr eq pernr
         and endda eq '99991231'.
        if l_persg eq 'T' or
           l_persg eq 'W' or
           l_persg eq 'X'.
          raise trainee_pernr.
        endif.
      L_DISPLAY_PDF = 0.
      SELECT SINGLE * FROM PA0041 INTO IT_P0041
             WHERE PERNR EQ PERNR.
      IF SY-SUBRC = 0.
        DO 12 TIMES VARYING DAR FROM IT_P0041-DAR01
                                  NEXT IT_P0041-DAR02
                      VARYING DAT FROM IT_P0041-DAT01
                                  NEXT IT_P0041-DAT02.
          CASE DAR .
    *        WHEN '09'.          "Hiring Date
            WHEN '51'.          "Hiring Date
              L_HIRE_DATE = DAT.
              EXIT.
            WHEN ''.
              EXIT.
          ENDCASE.
        ENDDO.
      ENDIF.
    *To get the no. of weekdays between the hire date and current date excluding sat and sun
      IF NOT L_HIRE_DATE IS INITIAL.
        WHILE L_HIRE_DATE LE SY-DATUM.
          CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
            EXPORTING
              DATE_IN  = L_HIRE_DATE
            IMPORTING
              DATE_OUT = L_INCLUDE_DATE.
          DO 5 TIMES.
            " Making sure that it starts from the from date till to_date calculate before
            IF L_INCLUDE_DATE GE L_HIRE_DATE AND L_INCLUDE_DATE LE SY-DATUM.
              L_WEEK_DAYS = L_WEEK_DAYS + 1.
            ENDIF.
            L_INCLUDE_DATE = L_INCLUDE_DATE + 1.
          ENDDO.
          L_HIRE_DATE = L_INCLUDE_DATE + 2.
        ENDWHILE.
    IF L_WEEK_DAYS LE 30.
          L_DISPLAY_PDF = 1.         "Display the PDF document
        ELSE.
          L_DISPLAY_PDF = 0.         "Do Not Display the PDF document
        ENDIF.
      ENDIF.
      IF L_DISPLAY_PDF = 1.
    * Clear local variables
        CLEAR:   L_DEVICE,
                 LA_CTRL_FORM,
                 LA_OUTPUT_OPT.
    ** Spool Parameters
        LA_OUTPUT_OPT-TDIMMED = 'X'.
        LA_OUTPUT_OPT-TDDELETE = 'X'.
        LA_OUTPUT_OPT-TDLIFETIME = 'X'.
        LA_OUTPUT_OPT-TDDEST = 'LOCL'.
    * Get Smartform function module name
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            FORMNAME           = 'ZP3088_NEW_JOINEE_ACT_PDF'
          IMPORTING
            FM_NAME            = G_FMNAME
          EXCEPTIONS
            NO_FORM            = 1
            NO_FUNCTION_MODULE = 2
            OTHERS             = 3.
        IF SY-SUBRC <> 0.
          G_RETCODE = SY-SUBRC.
          SYST-MSGTY = 'E'.
        ELSE.
    * Parameters passes to get the output in PDF format
          LA_CTRL_FORM-NO_DIALOG = 'X'.
          LA_CTRL_FORM-PREVIEW = SPACE.
          LA_CTRL_FORM-GETOTF = 'X'.
          LA_CTRL_FORM-LANGU = NAST-SPRAS.
          LA_CTRL_FORM-DEVICE = 'PRINTER'.
    Edited by: wahid hussain syed on Nov 4, 2010 3:41 AM
    Edited by: wahid hussain syed on Nov 4, 2010 3:41 AM
    Edited by: Neil Gardiner on Nov 4, 2010 2:04 PM

  • Fax output - Chinese characters are garbled

    Hello,
    We are using fax output for two forms ( One smartform and the othe sap script). Both the form outputs are thorugh  the same fax device. For the smartform output there are no issues and the output is as expected but for the sap script output the chinese characters are garbled. Instead of the chinese characters i get output like _____ _______>,<%,,<< etc.
    Interestingly, if i have a look at the print preview or take print out there is no issue and the characters are as expected. The issue arises only during fax.
    Can someone help pls?
    Thanks,
    Venkat

    HI friend,
    I found few same post in SDN which are related to this Chinese characters in SAP Scripts.
    Please see this link and find is the problem is same as yours if so make use of it.
    Link: [Output of Sapscript in Chinese language|Output of Sapscript in Chinese language;
    Link: [Problem displaying Chinese Characters|Problem displaying Chinese Characters in SAP script form WESCHEINVERS1;
    I think these will be helpful please revert back to me after going through the links.
    Thanks,
    Sri Hari

  • PO Fax output issue

    Hi,
    We have configured FAX output for PO. The fax  output is being processed successfully.
    We have issue in which if a user processes fax output and its sent successfully from ECC but there is error at the fax machine.
    In this case, User might think he has sent the fax but actually it has not been sent successfully.
    It was decided that in cases like this, email will be sent to the user who has processed fax indicating that there was error in fax and he needs to re-send PO again. The problem here is , this email which is sent from Fax machine, is not able to specify the PO number for which the error occured.
    Is there any way that while calling the PO smart form, i have to pass PO number in specific parameter which can be picked up and send  to the user in email so that user knows specific PO which went into error.
    Please let me know incase any further information is required to answer this.
    Regards,
    Shahu

    Hi Sudhir,
    The solution in the thread are for SRM.
    Do we have any solution for the POs in ECC6 R/3?
    Thanks
    Raju

  • Sending Smartform through Fax

    Hai All,
       could anyone help me with the sample code..I want to know the parameters for fax while calling the function module..
    Thanks

    HI LAXMI,
    CHECK THESE THREADS...
    Sending Smartforms through Fax
    Sending SMARTFORM output to FAX gateway
    How to fax a smartform?

Maybe you are looking for

  • Error while generating report by fragmenting two cubes.

    I have two Essbase cubes 'bas_reg'(current) and 'basreg09'(history) combined them into one in BMM layer by fragmentation based on Quarter of the Year. This two cubes have 3 unconfirmed dimensions . But for this report i am using the all fields from f

  • SOX Compliance in SAP

    Hi all, we are about do one project for US based company for which they are asking about SOX compliance in SAP. Can any one tell, what we have to do in SAP R/3 in order meet SOX compliance as per US regulations. Regs, Ramesh B

  • CommandLink Not Firing Action

    Hi, I am trying to use the commandLink to fire a action but somehow it does not fire at all !!! I am doing just like in the commandButton, is submiting the form but the action method does not fire at all. here is my code: ---------------- JSP -------

  • Enhance the IVBSAK and IVBSIK extractors

    Hi Mats We have requirement to consider financial structure (GL accounts(transactions), only specific GL account range should be part of spend , we had decided to enhance the IVBSAK and IVBSIK  extractors AND also we have the logic in place. If we pl

  • How to backup weblogic configuration

    I have experimentally determined that it is possible to lose the weblogic configuration, the stuff that defines WLS_FORMS and WLS_REPORTS etc. Since it was not clear how this happened, I would like to know if I can back up that configuration stuff an