Skip to Content
author's profile photo Former Member
Former Member

OTF attachment in IW21

Hi Experts,

I am getting an OTF attachment to SAP inbox while executing IW21 Tcode.Is this a smartform or SAP Script?

Can I make any changes in its display?I want to send a mail along with this modified OTF format.I have written code for triggering mail using BAdi.But was unable to find this OTF form.

Can any one help me in finding this form and making necessary display changes to send it to as an attachment to the users?

Regards,

Sam

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2010 at 06:47 AM

    Hi,

    Did you goto main program of IW21 and check if they are calling any script or smartform from the standard print program?

    I think you should get your answer by analyzing the print program for IW21.

    Thanks,

    Archana

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      You will have to declare a variable of type XSTRING.

      data: V_PDF_XSTRING    TYPE        XSTRING.
      
      call function 'CONVERT_OTF_2_PDF' 
      importing 
         bin_filesize             = lv_len_in 
         BIN_FILE                 = V_PDF_XSTRING
      tables 
         otf = gs_return-otfdata[] 
         doctab_archive = it_docs[] 
         lines = lt_tline[] .

      This FM will fetch the PDF converted data in the form of xstring into 'V_PDF_XSTRING' as well as in table lines.

      You need to use 'V_PDF_XSTRING' to convert it into binary format as i have explained above.

      Thanks,

      Archana

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2010 at 05:49 AM

    see example

    FORM GET_SF .
    *u2022 Generate Function Module name
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME           = 'Ytest'
        IMPORTING
          FM_NAME            = GV_FORM_NAME
        EXCEPTIONS
          NO_FORM            = 1
          NO_FUNCTION_MODULE = 2
          OTHERS             = 3.
      IF SY-SUBRC  <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *u2022 Assigning values to Form Control Structure and Form Composer
      IF R_OUT <> 'X'.
        GS_CTRLOP-GETOTF = 'X'.
        GS_CTRLOP-NO_DIALOG = 'X'.
        GS_OUTOPT-TDNOPREV = 'X'.
      ENDIF.
    
      CALL FUNCTION GV_FORM_NAME
        EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
          CONTROL_PARAMETERS         = GS_CTRLOP
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
          OUTPUT_OPTIONS             = GS_OUTOPT
          USER_SETTINGS              = 'X'
          TEMP_VBELN                 =  P_VBELN
       IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
          JOB_OUTPUT_INFO            = GS_OTFDATA
    *   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.
    
    ENDFORM.                    " GET_SF
    
    
    
    
    

    Edited by: kk.adhvaryu on Sep 3, 2010 7:53 AM

    Edited by: kk.adhvaryu on Sep 3, 2010 7:55 AM

    Edited by: kk.adhvaryu on Sep 3, 2010 7:56 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2010 at 05:56 AM
    FORM CONVERT_OTF .
    
     data  :GV_BIN_FILESIZE TYPE I.
    *u2022 Assigning the OTFDATA to OTF Structure table
      CLEAR GT_OTF.
      GT_OTF[] = GS_OTFDATA-OTFDATA[].
    *u2022 Convert the OTF DATA to SAP Script Text lines
      CLEAR GT_PDF_TAB.
    
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         FORMAT                      = 'PDF'
         MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
       IMPORTING
         BIN_FILESIZE                = GV_BIN_FILESIZE
    *   BIN_FILE                    =
        TABLES
          OTF                         = GT_OTF
          LINES                       = GT_PDF_TAB
       EXCEPTIONS
         ERR_MAX_LINEWIDTH           = 1
         ERR_FORMAT                  = 2
         ERR_CONV_NOT_POSSIBLE       = 3
         ERR_BAD_OTF                 = 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.
    
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi K.K,

      Presently I am using Acrobat 6.Which version I have to install for viewing this attachment.

      In our organization,most of the users are using the same version.Isn't there any other alternative?

      I tried opening the attachment in Acrobat 9 and was unsuccessful.

      Regards,

      Sam

      Edited by: sam24 on Sep 6, 2010 8:35 AM

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2010 at 11:48 AM

    First u use CALL FUNCTION 'CONVERT_OTF'

    then after for send mail u use

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1 'that it no need other FM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.