E-mail of PDF issue TLINE structure but SOLISTI1 needed

Hi,
So far I have done the following. I have prepared a SMARTFORM and an ABAP. My ABAP calls the Smartform and gives the data to the function module “CONVERT_OTF”. This function creates a PDF file from the Smartform data. The output of "CONVERT_OTF" is a table with the format of structure “TLINE”. In a first step I save these data into a PDF file with the function module "GUI_DOWNLOAD".
Now the issue.
In the second step I am trying to send the output with the function “SO_DOCUMENT_SEND_API1”. The function is recommended by SAP for release 6.4 instead of the former function "SO_NEW_DOCUMENT_ATT_SEND_API1".
The attachment must be delivered either with the structure “SOLISTI1” or “SOLIX” to be sent with the e-mail function “SO_DOCUMENT_SEND_API1”. I have tried to put my data with structure TLINE into the function. In these case I get short dumps. If I put the output of the function “CONVERT_OTF” in a table with the format “SOLISTI1” instead of a table with structure “TLINE” a PDF file is still created and also send out with the e-mail function, but the file can’t be opened anymore. Acrobat delivers an error message that the file is damaged.
I have tried to convert the file with structure TLINE in a hexadecimal file with structure SOLIX. For this purpose I used the function “TABLE_COMPRESS”. This worked fine. But the file which has been sent by the e-mail was still damaged. Even if I have downloaded the file I got the message that the file was damaged.
Are there any other suggestions how the attachment could be sent instead of using the function “SO_DOCUMENT_SEND_API1”? Is there a function available, which could be used to sent attachments with structure TLINE? Or are there any suggestions, how I can convert my smartform output in a SOLIX or SOLISTI1 structure?
Thank you and best regards
Karsten

Hi Arold,
<b>1</b>.
Have a look at this program.
This program is sending PDF file as attachment thru mail
<b>2</b>.
REPORT  zvenkat_mail.
TABLES :
   tsp01.
Itabs and variables .
*Tables
DATA:
   BEGIN OF i_mard OCCURS 0,
     matnr TYPE mard-matnr,
     werks TYPE mard-werks,
     lgort TYPE mard-lgort,
     labst TYPE mard-labst,
     umlme TYPE mard-umlme,
     insme TYPE mard-insme,
     einme TYPE mard-einme,
   END OF i_mard.
DATA :
   g_sy_spono LIKE sy-spono.
Mail related Variables and i tabs.
DATA:
   w_subject       LIKE sodocchgi1,
   i_pack_list     LIKE sopcklsti1 OCCURS  1  WITH HEADER LINE,
   i_objhead       LIKE solisti1   OCCURS  1  WITH HEADER LINE,
   i_contents_text LIKE solisti1   OCCURS 10  WITH HEADER LINE,
   i_cont_bin      LIKE solisti1   OCCURS 10  WITH HEADER LINE,
   i_objhex        LIKE solix      OCCURS 10  WITH HEADER LINE,
   i_receiver      LIKE somlreci1  OCCURS  1  WITH HEADER LINE,
   i_listobject    LIKE abaplist   OCCURS  1  WITH HEADER LINE,
   pdf             LIKE tline      OCCURS 100 WITH HEADER LINE,
   content_out     LIKE solisti1   OCCURS 0 WITH HEADER LINE.
DATA:
   tab_lines       TYPE i,
   doc_size        TYPE i,
   att_type        LIKE soodk-objtp,
   obj_desc        LIKE w_subject-obj_descr,
   sent_to_all     LIKE sonv-flag,
   client          LIKE tst01-dclient,
   name            LIKE tst01-dname,
   objtype         LIKE rststype-type,
   type            LIKE rststype-type,
   is_otf          TYPE c ,
   no_of_bytes     TYPE i,
   pdf_spoolid     LIKE tsp01-rqident,
   jobname         LIKE tbtcjob-jobname,
   jobcount        LIKE tbtcjob-jobcount,
   pn_begda        LIKE sy-datum,
   val(1)          TYPE c,
   pripar          TYPE pri_params,
   arcpar          TYPE arc_params,
   lay             TYPE pri_params-paart,
   lines           TYPE pri_params-linct,
   cols            TYPE pri_params-linsz,
   spool_name      TYPE pri_params-plist.
*&      START-OF-SELECTION.
START-OF-SELECTION.
  PERFORM get_data_from_database.
  PERFORM output_for_pdf.
*&      END-OF-SELECTION.
END-OF-SELECTION.
  PERFORM send_mail..
*&      Form  get_data_from_database
FORM get_data_from_database .
  SELECT matnr
         werks
         lgort
         labst
         umlme
         insme
         einme
    FROM mard
    INTO TABLE i_mard
    UP TO 20 ROWS.
ENDFORM.                    " get_data_from_database
*&      Form  output_for_pdf
FORM output_for_pdf .
  PERFORM get_print_params.
  LOOP AT i_mard.
    WRITE:/ sy-vline, i_mard-matnr,
            sy-vline, i_mard-werks,
            sy-vline, i_mard-lgort,
            sy-vline, i_mard-labst,
            sy-vline, i_mard-umlme,
            sy-vline, i_mard-insme,
            sy-vline, i_mard-einme,
            sy-vline.
  ENDLOOP.
  ULINE .
  g_sy_spono = sy-spono.
  NEW-PAGE PRINT OFF.
  CALL FUNCTION 'ABAP4_COMMIT_WORK'.
ENDFORM.                    " output_for_pdf
*&      Form  send_mail
FORM send_mail .
  PERFORM mail_without_attachment.
  PERFORM mail_with_pdf_attachment.
  PERFORM mail_with_exel_attachment.
  PERFORM mail_with_text_attachment.
ENDFORM.                    " send_mail
*&      Form  mail_with_pdf_attachment
FORM mail_with_pdf_attachment .
  CLEAR :w_subject,
         sent_to_all,
         i_pack_list[],
         i_objhead[],
         i_cont_bin[],
         i_contents_text[],
         i_receiver[].
  i_cont_bin = '  |  '.
  APPEND i_cont_bin.
Subject of the mail.
  obj_desc  = 'Hello SDN Friends ' .
  w_subject-obj_name  = 'MAIL_ALI'.
  w_subject-obj_descr = obj_desc.
Body of the mail
  DATA :head_desc LIKE i_contents_text,
        body_desc LIKE i_contents_text.
  i_contents_text = space.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  CONCATENATE
  'This mail has been generated for Test purpose.'
  'Please dont hesitate to ask any type of question in the forum.'
  INTO body_desc
  SEPARATED BY space.
  i_contents_text = body_desc.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  CLEAR body_desc.
  i_contents_text = 'Thank You.'.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  i_contents_text = 'Fellow SDN member,'.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  i_contents_text = 'Venkat.O'.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  i_contents_text = space.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
  CONCATENATE '(Note: This is system generated message, please'
              'do not reply'
              'to this Email.)'
           INTO i_contents_text
           SEPARATED BY space.
  APPEND i_contents_text.
  CLEAR  i_contents_text.
Write Packing List (Body)
  DESCRIBE TABLE i_contents_text LINES tab_lines.
  READ     TABLE i_contents_text INDEX tab_lines.
  w_subject-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
  i_contents_text ).
  CLEAR i_pack_list-transf_bin.
  i_pack_list-head_start = 1.
  i_pack_list-head_num   = 0.
  i_pack_list-body_start = 1.
  i_pack_list-body_num   = tab_lines.
  i_pack_list-doc_type   = 'RAW'.
  APPEND i_pack_list.
  CLEAR  i_pack_list.
Create receiver list
  i_receiver-receiver = '[email protected]'..
  i_receiver-rec_type = 'U'.
  APPEND i_receiver.
  CLEAR  i_receiver.
Select query for Spool requests
  REFRESH content_out.
  IF sy-subrc = 0.
    SELECT  SINGLE *
      FROM  tsp01
      WHERE rqident = g_sy_spono.
    IF sy-subrc <> 0.
      MESSAGE s000(0k) WITH 'Spool Number does not exist'.
      EXIT.
    ELSE.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
    ENDIF.
  ENDIF.
  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      authority     = 'SP01'
      client        = client
      name          = name
      part          = 1
    IMPORTING
      type          = type
      objtype       = objtype
    EXCEPTIONS
      fb_error      = 1
      fb_rsts_other = 2
      no_object     = 3
      no_permission = 4
      OTHERS        = 5.
  IF objtype(3) = 'OTF'.
    is_otf = 'X'.
  ELSE.
    is_otf = space.
  ENDIF.
Convert Spool job to PDF
  IF is_otf = 'X'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = tsp01-rqident "Spool req number
        no_dialog                = ' '
      IMPORTING
        pdf_bytecount            = no_of_bytes
        pdf_spoolid              = pdf_spoolid
        btc_jobname              = jobname
        btc_jobcount             = jobcount
      TABLES
        pdf                      = pdf
      EXCEPTIONS
        err_no_otf_spooljob      = 1
        err_no_spooljob          = 2
        err_no_permission        = 3
        err_conv_not_possible    = 4
        err_bad_dstdevice        = 5
        user_cancelled           = 6
        err_spoolerror           = 7
        err_temseerror           = 8
        err_btcjob_open_failed   = 9
        err_btcjob_submit_failed = 10
        err_btcjob_close_failed  = 11
        OTHERS                   = 12.
    CASE sy-subrc.
      WHEN 0.
      WHEN 1.
        MESSAGE s000(0k) WITH 'No OTF Spool Job'.
        EXIT.
      WHEN 2.
        MESSAGE s000(0k) WITH 'Spool Number does not exist'.
        EXIT.
      WHEN 3.
        MESSAGE s000(0k) WITH 'No permission for spool'.
        EXIT.
      WHEN OTHERS.
        MESSAGE s000(0k) WITH 'Error in Function CONVERT_OTFSPOOLJOB_2_PDF'.
        EXIT.
    ENDCASE.
  ELSE.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = tsp01-rqident
        no_dialog                = ' '
      IMPORTING
        pdf_bytecount            = no_of_bytes
        pdf_spoolid              = pdf_spoolid
        btc_jobname              = jobname
        btc_jobcount             = jobcount
      TABLES
        pdf                      = pdf
      EXCEPTIONS
        err_no_abap_spooljob     = 1
        err_no_spooljob          = 2
        err_no_permission        = 3
        err_conv_not_possible    = 4
        err_bad_destdevice       = 5
        user_cancelled           = 6
        err_spoolerror           = 7
        err_temseerror           = 8
        err_btcjob_open_failed   = 9
        err_btcjob_submit_failed = 10
        err_btcjob_close_failed  = 11
        OTHERS                   = 12.
    CASE sy-subrc.
      WHEN 0.
      WHEN 1.
        MESSAGE s000(0k) WITH 'No ABAP Spool Job'.
        EXIT.
      WHEN 2.
        MESSAGE s000(0k) WITH 'Spool Number does not exist'.
        EXIT.
      WHEN 3.
        MESSAGE s000(0k) WITH 'No permission for spool'.
        EXIT.
      WHEN OTHERS.
        MESSAGE s000(0k)
           WITH 'Error in Function CONVERT_ABAPSPOOLJOB_2_PDF'.
        EXIT.
    ENDCASE.
  ENDIF.
  CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
      line_width_src              = 134
      line_width_dst              = 255
    TABLES
      content_in                  = pdf
      content_out                 = content_out
    EXCEPTIONS
      err_line_width_src_too_long = 1
      err_line_width_dst_too_long = 2
      err_conv_failed             = 3
      OTHERS                      = 4.
  IF sy-subrc <> 0.
    MESSAGE s000(0k) WITH 'Conversion Failed'.
    EXIT.
  ENDIF.
---------------------Create Message Attachment
  DESCRIBE TABLE i_cont_bin LINES tab_lines.
  i_pack_list-transf_bin = 'X'.
  i_pack_list-head_start = tab_lines + 1.
  i_pack_list-head_num   = 0.
  i_pack_list-body_start = tab_lines + 1.
  APPEND LINES OF content_out[] TO i_cont_bin[].
  DESCRIBE TABLE content_out LINES tab_lines.
  i_pack_list-doc_size =  tab_lines * 255.
  i_pack_list-body_num = tab_lines.
  i_pack_list-doc_type = 'PDF'.
  i_pack_list-obj_name = 'ATTACHMENT'.
  i_pack_list-obj_descr = 'Materials and their Quantities' .
  APPEND i_pack_list.
  CLEAR  i_pack_list.
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = w_subject
      put_in_outbox              = 'X'
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = sent_to_all
    TABLES
      packing_list               = i_pack_list
      object_header              = i_objhead
      contents_bin               = i_cont_bin
      contents_txt               = i_contents_text
      receivers                  = i_receiver
    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 NE 0.
  ENDIF.
ENDFORM.                    " mail_with_pdf_attachment
*&      Form  get_print_params
FORM get_print_params .
  lay = 'X_65_132'.
  lines = 65.
  cols  = 132.
  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      in_archive_parameters  = arcpar
      in_parameters          = pripar
      layout                 = lay
      line_count             = lines
      line_size              = cols
      no_dialog              = 'X'
    IMPORTING
      out_archive_parameters = arcpar
      out_parameters         = pripar
      valid                  = val
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.
  IF val <> space AND sy-subrc = 0.
    pripar-prrel = space.
    pripar-primm = space.
    NEW-PAGE PRINT ON
      NEW-SECTION
      PARAMETERS pripar
      ARCHIVE PARAMETERS arcpar
      NO DIALOG.
  ENDIF.
ENDFORM.                    " get_print_params
I hope it helps u .
<b>Thanks,
Venkat.O</b>

Similar Messages

  • My InDesign to PDF script ignores warnings, but I need to change that.

    Hello,
    I have a script here that converts InDesign Docs to PDF files.
    It works fine and was created to make bulk pdf's regardles of missing images.
    Now I want to revise it so that it does stop for missing fonts and images.
    This script also was built for quark and I can see where I could remove the supress all warnings dialog to remove it for the quark part, but I can't figure out where that warning is in the InDesign part to remove it.
    Here is the script: If anyone can help me find out where this line of code is that I could remove, so that the script does stop if there are missing fonts and images, that would be great!!
    property Babs_Folder : "Babs PDF Folder"
    global deskPath
    global PathToFolder
    global PathToFolder2
    global tempPictures
    on open thefiles
        tell application "Finder"
            activate
            set tempPictures to (every item of (get selection)) -- MUST GET BEFORE MAKING FOLDERS
            if not (exists folder Babs_Folder) then make new folder with properties {name:Babs_Folder}
            set deskPath to desktop as text
            set PathToFolder to POSIX path of (deskPath & Babs_Folder)
            set PathToFolder2 to deskPath & Babs_Folder & ":"
        end tell
        my openfiles()
        say "Finished"
    end open
    on openfiles()
        try
            tell application "Finder"
                repeat with LoopFiles in tempPictures
                    set foundImages to {}
                    if kind of LoopFiles = "Folder" then
                        try
                            set foundImages to files of entire contents of LoopFiles as list
                        on error
                            set foundImages to files of entire contents of LoopFiles
                        end try
                    else
                        if kind of LoopFiles is not in {"Volume", "Disk Image", "Application", "Web Internet Location", "Document", "Text Clipping"} then
                            set end of foundImages to LoopFiles
                        end if
                    end if
                    --set WorkingFile to item i of fileList
                    repeat with WorkingFile in foundImages
                        if not ((kind of WorkingFile starts with "Quark") or (kind of WorkingFile starts with "InDesign")) then
                            activate
                            display dialog "This file is not an InDesign or Quark document!" buttons "Skipping" default button "Skipping" with icon 0 giving up after 1
                        else
                            --Determine whether to use InDesign subroutines or Quark subroutines
                            if (kind of WorkingFile starts with "InDesign") then -- Process as InDesign
                                my createInDesignPDF(WorkingFile, PathToFolder2)
                            else -- Process as Quark
                                my createQuarkPDF(WorkingFile)
                            end if
                        end if
                    end repeat
                end repeat
            end tell
        on error errmsg
            display dialog "OpenFiles." & return & errmsg giving up after 20
        end try
    end openfiles
    on createInDesignPDF(WorkingFile, savePath)
        set x to 0
        repeat
            if x = 0 then
                set newpart to ""
            else
                set newpart to " " & x
            end if
            tell application "Finder"
                set tempname to my add_extension(WorkingFile, newpart, "pdf")
                if not (exists file tempname in folder Babs_Folder) then exit repeat
            end tell
            set x to x + 1
        end repeat
        tell application "Adobe InDesign CS3"
            try
                try
                    set user interaction level of script preferences to never interact
                end try
                open WorkingFile as alias
                delay 2
                repeat
                    if exists document 1 then exit repeat
                    delay 0.2
                end repeat
                set theProps to properties of PDF export preset "[Press Quality]"
                set newProps to {view PDF:false, crop marks:false, bleed marks:false, color bars:false, registration marks:false} & theProps
                set oldProps to properties of PDF export preferences
                set properties of PDF export preferences to newProps
                export front document format PDF type to (savePath & tempname) without showing options
                set properties of PDF export preferences to oldProps
                delay 1
                tell documents to close saving no
                try
                    set user interaction level of script preferences to interact with all
                end try
            on error errmsg
                display dialog "CreateIndesignPDF." & return & errmsg giving up after 20
            end try
        end tell
    end createInDesignPDF
    on createQuarkPDF(WorkingFile)
        try
            set x to 0
            repeat
                if x = 0 then
                    set newpart to ""
                else
                    set newpart to " " & x
                end if
                tell application "Finder"
                    set tempname to my add_extension(WorkingFile, newpart, "pdf")
                    if not (exists file tempname in folder Babs_Folder) then exit repeat
                end tell
                set x to x + 1
            end repeat
            tell application "QuarkXPress"
                activate
                open WorkingFile as alias with Suppress All Warnings
                tell application "System Events" to tell process "QuarkXPress"
                    click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
                    delay 1
                    keystroke tempname
                    delay 1
                    keystroke "G" using {shift down, command down}
                    delay 1
                    keystroke PathToFolder
                    delay 1
                    click button "Go" of sheet 1 of window "Export as PDF"
                end tell
                repeat 2 times
                    delay 1
                    activate
                    tell application "System Events" to tell process "QuarkXPress"
                        try
                            if exists button "OK" of window 1 then
                                click button "OK" of window 1
                            end if
                        end try
                    end tell
                end repeat
                delay 1
                tell application "System Events" to tell process "QuarkXPress"
                    try
                        click button "Save" of window "Export as PDF"
                    end try
                end tell
                repeat 4 times
                    delay 1
                    activate
                    tell application "System Events" to tell process "QuarkXPress"
                        try
                            if exists button "OK" of window 1 then
                                click button "OK" of window 1
                            end if
                        end try
                        try
                            if exists button "List Profiles" of window 1 then
                                click button "Continue" of window 1
                            end if
                        end try
                    end tell
                end repeat
                delay 2
                close front document saving no
            end tell
        on error errmsg
            display dialog "CreateQuarkPDF." & return & errmsg giving up after 20
        end try
    end createQuarkPDF
    on add_extension(WorkingFile, new_part, new_extension)
        try
            set this_info to info for WorkingFile as alias
            set this_name to the name of this_info
            set this_extension to the name extension of this_info
            if this_extension is missing value then
                set the default_name to this_name
            else
                set the default_name to text 1 thru -((length of this_extension) + 2) of this_name
            end if
            return (the default_name & new_part & "." & the new_extension)
        on error errmsg
            display dialog "add extension " & return & errmsg
        end try
    end add_extension
    thanks!!!
    babs

    Hello,
    OK-I had then blew it... ;-(
    I was playing with a combination of removing (commenting out those two try areas you suggested), and that didn't do it on its own. It didn't do anything, it just said finished.
    Then I found this in the dictionary ( set alert missing images to true) and added it to the script below. See my changes in Bold.
    At one point, I was able to get the missing images dialog box. Then I don't know what happened, I think I tried to turn one of the try areas back on to test it, and then it stopped giving me that dialog box and only the one being asked in that on error errmsg - display dialog "CreateIndesignPDF." & return & errmsg giving up after 20,  was showing up.
    I commented out what I thought I had  changed, but even after compiling and re-saving, I can't seem to get the missing images dialog box to show???
    any thoughts?
    thanks!!!
    babs
    property Babs_Folder : "Babs PDF Folder"
    global deskPath
    global PathToFolder
    global PathToFolder2
    global tempPictures
    on open thefiles
        tell application "Finder"
            activate
            set tempPictures to (every item of (get selection)) -- MUST GET BEFORE MAKING FOLDERS
            if not (exists folder Babs_Folder) then make new folder with properties {name:Babs_Folder}
            set deskPath to desktop as text
            set PathToFolder to POSIX path of (deskPath & Babs_Folder)
            set PathToFolder2 to deskPath & Babs_Folder & ":"
        end tell
        my openfiles()
        say "Finished"
    end open
    on openfiles()
        try
            tell application "Finder"
                repeat with LoopFiles in tempPictures
                    set foundImages to {}
                    if kind of LoopFiles = "Folder" then
                        try
                            set foundImages to files of entire contents of LoopFiles as list
                        on error
                            set foundImages to files of entire contents of LoopFiles
                        end try
                    else
                        if kind of LoopFiles is not in {"Volume", "Disk Image", "Application", "Web Internet Location", "Document", "Text Clipping"} then
                            set end of foundImages to LoopFiles
                        end if
                    end if
                    --set WorkingFile to item i of fileList
                    repeat with WorkingFile in foundImages
                        if not ((kind of WorkingFile starts with "Quark") or (kind of WorkingFile starts with "InDesign")) then
                            activate
                            display dialog "This file is not an InDesign or Quark document!" buttons "Skipping" default button "Skipping" with icon 0 giving up after 1
                        else
                            --Determine whether to use InDesign subroutines or Quark subroutines
                            if (kind of WorkingFile starts with "InDesign") then -- Process as InDesign
                                my createInDesignPDF(WorkingFile, PathToFolder2)
                            else -- Process as Quark
                                my createQuarkPDF(WorkingFile)
                            end if
                        end if
                    end repeat
                end repeat
            end tell
        on error errmsg
            display dialog "OpenFiles." & return & errmsg giving up after 20
        end try
    end openfiles
    on createInDesignPDF(WorkingFile, savePath)
        set x to 0
        repeat
            if x = 0 then
                set newpart to ""
            else
                set newpart to " " & x
            end if
            tell application "Finder"
                set tempname to my add_extension(WorkingFile, newpart, "pdf")
                if not (exists file tempname in folder Babs_Folder) then exit repeat
            end tell
            set x to x + 1
        end repeat
        tell application "Adobe InDesign CS3"
            try
               --try
                --set user interaction level of script preferences to never interact
                --end try
                open WorkingFile as alias
                set alert missing images to true
                delay 2
                repeat
                    if exists document 1 then exit repeat
                    delay 0.2
                end repeat
                set theProps to properties of PDF export preset "[Press Quality]"
                set newProps to {view PDF:false, crop marks:false, bleed marks:false, color bars:false, registration marks:false} & theProps
                set oldProps to properties of PDF export preferences
                set properties of PDF export preferences to newProps
                export front document format PDF type to (savePath & tempname) without showing options
                set properties of PDF export preferences to oldProps
                delay 1
                tell documents to close saving no
                --try
                --set user interaction level of script preferences to interact with all
                --end try
            on error errmsg
                display dialog "CreateIndesignPDF." & return & errmsg giving up after 20
            end try
        end tell
    end createInDesignPDF
    on createQuarkPDF(WorkingFile)
        try
            set x to 0
            repeat
                if x = 0 then
                    set newpart to ""
                else
                    set newpart to " " & x
                end if
                tell application "Finder"
                    set tempname to my add_extension(WorkingFile, newpart, "pdf")
                    if not (exists file tempname in folder Babs_Folder) then exit repeat
                end tell
                set x to x + 1
            end repeat
            tell application "QuarkXPress"
                activate
                open WorkingFile as alias with Suppress All Warnings
                tell application "System Events" to tell process "QuarkXPress"
                    click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
                    delay 1
                    keystroke tempname
                    delay 1
                    keystroke "G" using {shift down, command down}
                    delay 1
                    keystroke PathToFolder
                    delay 1
                    click button "Go" of sheet 1 of window "Export as PDF"
                end tell
                repeat 2 times
                    delay 1
                    activate
                    tell application "System Events" to tell process "QuarkXPress"
                        try
                            if exists button "OK" of window 1 then
                                click button "OK" of window 1
                            end if
                        end try
                    end tell
                end repeat
                delay 1
                tell application "System Events" to tell process "QuarkXPress"
                    try
                        click button "Save" of window "Export as PDF"
                    end try
                end tell
                repeat 4 times
                    delay 1
                    activate
                    tell application "System Events" to tell process "QuarkXPress"
                        try
                            if exists button "OK" of window 1 then
                                click button "OK" of window 1
                            end if
                        end try
                        try
                            if exists button "List Profiles" of window 1 then
                                click button "Continue" of window 1
                            end if
                        end try
                    end tell
                end repeat
                delay 2
                close front document saving no
            end tell
        on error errmsg
            display dialog "CreateQuarkPDF." & return & errmsg giving up after 20
        end try
    end createQuarkPDF
    on add_extension(WorkingFile, new_part, new_extension)
        try
            set this_info to info for WorkingFile as alias
            set this_name to the name of this_info
            set this_extension to the name extension of this_info
            if this_extension is missing value then
                set the default_name to this_name
            else
                set the default_name to text 1 thru -((length of this_extension) + 2) of this_name
            end if
            return (the default_name & new_part & "." & the new_extension)
        on error errmsg
            display dialog "add extension " & return & errmsg
        end try
    end add_extension

  • Customer Support:: it's listed but you can't get it. Where is e-mail support for issue below?

    Version:1.0 StartHTML:0000000176 EndHTML:0000003270 StartFragment:0000002398 EndFragment:0000003234 SourceURL:file://localhost/Users/markvega/Desktop/ADOBE%20SUPPORT.doc
    I was provided with PDF of contacts but there is no specific contact e-mail for my issue, plus cannot get though to customer support, as usual. The telephone number 0116227746 does not exist. The other links provided on PDF just lead to the same pages I tired before. Still cannot locate e-mail contact address for support issue.
    I have a copy of Photoshop CS and Dreamwaver CS3 that I want to sell they are both registered in my name and I want to sell them to allow the buyer to register in his name. I realize that I will have to deactivate the software, however, as I cannot get throght to Adobe (UK) will this prove problematic. It seems there is no e-mail contact for any support in the UK.

    In the future, please post your topic once.  Posting 20 times with identical content was uncalled for.
    And the URL you gave is on your local hard drive, so not too useful to the rest of us.
    To answer your question:
    Adobe does not have email support, only phone and online chat support, plus these user forums.
    http://www.adobe.com/uk/support/contact/

  • Hot mail is not working after firefox upgrade. I am using Firefox 12.0. I did not have issue with hotmail, but I am facing problem this week .

    I am using Firefox 12.0. I did not have issue with hotmail, but I am facing problem this week after firefox upgrade. After entering login the page freeze. I am not able to continue.
    I reviewed the thread. I am not using Foxit.
    I reviewed hot mail forum. They suggest firefox upgrade causes this issue.
    I tried after clearing my browser's cache and cookies. The situation remain same. Any idea?
    What is the workaround?

    Firefox 3.6 needs the Java Second Generation Plugin which comes with newer versions than 1.6.0_03 - update Java, the latest version is 1.6.0_22

  • Issue regarding sending E-Mail with PDF file(s) as attachment

    Hi,
    Can anybody provide me with code to send PDF file as E-Mail Attachment!
    I know we have to use F.M <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> but how we have to use it to send PDF file as attachment!
    I was able to send Text files as Attachments in my previous assignments.
    Thanks in advance.
    Thanks & Regards,
    Kumar.

    Hi,
    Check this threads:
    SO_NEW_DOCUMENT_ATT_SEND_API1
    unable to e-mail a pdf  through FM  'SO_NEW_DOCUMENT_ATT_SEND_API1'
    SO_NEW_DOCUMENT_ATT_SEND_API1
    Best regards,
    Guillaume
    Message was edited by: Guillaume Garcia

  • I have many pdfs that have the identical structure, but are NOT forms. How can I collect this data?

    I have dozens of pdfs which have the identical structure, but are NOT forms. I would like to collect data across these pdfs to analyze. Is there a way to do this?

    There are a number of ways that text can be extracted, but it may not be in the order that you'd expect or want. But if it's consistent in any case, you should be able to get at the content you're interested in. JavaScript can be used to loop through the "words" on a page, for example. I've used this approach for several projects that required data extraction.

  • Having mail 4.5 issues- open mail and get a new features message so I must import messages first in order to use mail 4.5.  Just recently put in MAC OSX 10.6.7.  Once it imports click done to start using mail, but end up with the rainbow wheel? Now What?

    Having mail 4.5 issues- open mail and get a new features message that says in order to use the new features, I must import existing messages into the new version first in order to use mail 4.5.  Just recently put in MAC OSX 10.6.7.  Once it imports I am to click done to start using mail, but end up with the rainbow wheel of death and it also says you cannot use mail until the import is finished? Now What?

    Is Mail still "spinning"?  If it's been doing that for a while, I'd kill it, using either Activity Monitor or the OS X application picker.  Then relaunch Mail and see what happens.
    Two "by the ways":
    1) Your system details mention an PPC iMac.  Since a non-Intel Mac can't run OS X 10.6, you seem to have another Mac.  You might want to consider updating your system details.
    2) You seem to have been misled by the poor labeling of the message composition fields on this forum into trying to enter your entire post into the "subject" field.  In the future, just enter a summary of your post there and the main text into the field below it.

  • Error while sending PO output through mail in PDF format - Urgent

    Dear friends,
    Developed program to send sapscript output through mail in pdf format, the program running properly, even function module SO_NEW_DOCUMENT_ATT_SEND_API1 returning sy-subrc 0. But the external mail is not going to user lying in SAP outbox with message <b>"Wait for communications service"</b> . SCOT is properly configured, tested mails sending through SAP office.
    Find below the source code:
    REPORT  zmm_porder_gm
                NO STANDARD PAGE HEADING.
    TABLES: ekko, ekpa, t161t, t052, komv, j_1imocomp, t001, esll.
    Internal Tables
    DATA : txt LIKE tline-tdline,  "HEADER LINE
           your_ref LIKE ekko-ihrez, "your ref
           our_ref  LIKE ekko-unsez, "our ref
           mcompname  LIKE  t001-butxt,
           itemname   LIKE  ekpo-txz01,
           del_text LIKE tline-tdline, "delivery text
           mat_po_text LIKE tline-tdline. "material po text
    DATA: g_ind TYPE i.
    DATA: it_esll LIKE esll OCCURS 0 WITH HEADER LINE.
    DATA: sub_packno LIKE esll-sub_packno.
    DATA : po_flag(1) TYPE c.
    DATA : it_erev LIKE erev OCCURS 0 WITH HEADER LINE.
    DATA : nmebeln LIKE thead-tdname,
           obj LIKE thead-tdname.
    DATA : tline LIKE tline OCCURS 0 WITH HEADER LINE.  "HEADER TEXT
    DATA  : it_ekko LIKE ekko OCCURS 0 WITH HEADER LINE.
    DATA  : it_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
    DATA  : it_zmm_porder  LIKE zmm_porder OCCURS 0 WITH HEADER LINE.
    DATA  : it_konv        LIKE konv OCCURS 0 WITH HEADER LINE.
    DATA  : it_konv_ftr    LIKE konv OCCURS 0 WITH HEADER LINE.
    DATA  : it_konv_rate   LIKE konv OCCURS 0 WITH HEADER LINE.
    DATA  : it_komv_tax    LIKE komv OCCURS 0 WITH HEADER LINE.           " For Tax Calculation
    DATA  : it_zmm_house_bank LIKE zmm_house_bank OCCURS 0 WITH HEADER LINE.
    *DATA  : mrate TYPE konv-kbetr VALUE 0, mrate1(15).  rmoved by ganes and added following logic
    DATA  : mrate TYPE p VALUE 0 DECIMALS 2, mrate1(15).
    DATA  : mrate_gm TYPE p  DECIMALS 2.
    DATA  : BEGIN OF it_konv1 OCCURS 0,
                  knumv LIKE konv-knumv,
                  kschl LIKE konv-kschl,
    END OF it_konv1.
    DATA : BEGIN OF it_t052u OCCURS 0.
            INCLUDE STRUCTURE t052u.
    DATA : END OF it_t052u.
    DATA  : mpay_terms LIKE t052u-text1.
    DATA  : mwaers     LIKE konv-waers.
    DATA : BEGIN OF xt052 OCCURS 0.
            INCLUDE STRUCTURE t052.
    DATA : END OF xt052.
    DATA : it_t16ct LIKE t16ct OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF ztext OCCURS 0.
            INCLUDE STRUCTURE ttext.
    DATA : END OF ztext.
    DATA  : it_t001      LIKE t001 OCCURS 0 WITH HEADER LINE.
    DATA  : mtext(15)    TYPE c.
    DATA  : it_adrc      LIKE adrc OCCURS 0 WITH HEADER LINE.
    DATA  : it_adrc_ven  LIKE adrc OCCURS 0 WITH HEADER LINE.
    DATA  : it_adrc_plt  LIKE adrc OCCURS 0 WITH HEADER LINE.
    DATA :  it_makt      LIKE makt OCCURS 0 WITH HEADER LINE.
    DATA :  it_eket      LIKE eket OCCURS 0 WITH HEADER LINE.               " Schedulling
    DATA :  it_eikp      LIKE eikp OCCURS 0 WITH HEADER LINE.               " Export
    DATA :  it_t001w     LIKE t001w OCCURS 0 WITH HEADER LINE.
    DATA  : it_t685t     LIKE t685t OCCURS 0 WITH HEADER LINE.
    DATA  : it_t618t     LIKE t618t OCCURS 0 WITH HEADER LINE.
    DATA  : it_t685t_ftr LIKE t685t OCCURS 0 WITH HEADER LINE.
    DATA  : it_lfa1  LIKE lfa1 OCCURS 0 WITH HEADER LINE.
    DATA : it_bapi_mltx_ga LIKE bapi_mltx_ga OCCURS 0 WITH HEADER LINE. "Material long text
    DATA : mfirst   TYPE i  VALUE 0,
           mpay_flag(1) TYPE c VALUE 'X',
           mwerks   LIKE    t001w-werks,
           msr      TYPE i  VALUE 0,
           l_rate   TYPE p  DECIMALS 2  VALUE 0,
           l_amt    TYPE p  DECIMALS 2  VALUE 0,
           mflag(1) TYPE c,
           mlctr    TYPE i  VALUE 0,
           mfamt    TYPE p DECIMALS 2 VALUE 0,
           mcfamt(15) TYPE c,
           mfword(100) TYPE c,
           mkschl   LIKE konv-kschl,
           mchgamt  TYPE p  DECIMALS 2 VALUE 0,
           mkbetr   TYPE p  DECIMALS 2 VALUE 0,
           mkwert   TYPE p  DECIMALS 2 VALUE 0.
    DATA : j_1iexcd     TYPE  j_1imocomp-j_1iexcd,
           j_1icstno    TYPE  j_1imocomp-j_1icstno,
           j_1ilstno    TYPE  j_1imocomp-j_1ilstno.
    DATA : mjmop_r    TYPE p DECIMALS 2 VALUE 0,
           mjmoq_r    TYPE p DECIMALS 2 VALUE 0,
           mjecs_r    TYPE p DECIMALS 2 VALUE 0,
           mjvcs_r    TYPE p DECIMALS 2 VALUE 0,
           mjvrd_r    TYPE p DECIMALS 2 VALUE 0,
           mjsep_r    TYPE p DECIMALS 2 VALUE 0.
    DATA : mjmop_a    TYPE p DECIMALS 2 VALUE 0,
           mjmoq_a    TYPE p DECIMALS 2 VALUE 0,
           mjecs_a    TYPE p DECIMALS 2 VALUE 0,
           mjvcs_a    TYPE p DECIMALS 2 VALUE 0,
           mjvrd_a    TYPE p DECIMALS 2 VALUE 0,
           mjsep_a    TYPE p DECIMALS 2 VALUE 0.
    DATA  : mtitle   LIKE  t161t-batxt.
    DATA :         no_ammend(10),request_by(50),ver_txt(100),ver_reason(100),stext(200).
    begin of Email data declarations**************
    DATA: BEGIN OF otf OCCURS 0.
            INCLUDE STRUCTURE itcoo .
    DATA: END OF otf.
    DATA: itcpo LIKE itcpo.
    DATA: itcpp LIKE itcpp.
    DATA: it_docs  TYPE STANDARD TABLE OF docs,
          v_bin_filesize          TYPE i,
          it_lines TYPE STANDARD TABLE OF tline,
          wa_lines TYPE tline.
    DATA : i_pdf LIKE tline OCCURS 1000 WITH HEADER LINE,
    v_pdf_bytecount TYPE i,
    v_pdf_spoolid TYPE tsp01-rqident,
    v_otf_pagecount TYPE i,
    v_btc_jobname TYPE tbtcjob-jobname,
    v_btc_jobcount TYPE tbtcjob-jobcount.
    DATA: objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
    DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
    DATA: doc_chng LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA: vafilename(100) VALUE 'po_output.pdf'.
    DATA: jobdata TYPE sxjobdata.
    DATA arc_params TYPE arc_params.
    DATA print_params TYPE pri_params.
    DATA g_send_prog TYPE syrepid VALUE 'ZVF03_TEST_PROG'.
    DATA immediate TYPE btcchar1.
    DATA: i_jobname TYPE tbtcp-jobname,
    i_jobcount TYPE tbtcp-jobcount,
    i_jobstepcount TYPE tbtcp-stepcount.
    DATA recipient_obj LIKE swotobjid.
    CONSTANTS: sx_true TYPE sx_boolean VALUE 'X'.
    TABLES: tbtcp.
    end of Email data declarations**************
    SELECTION-SCREEN : BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS   : mebeln FOR ekko-ebeln OBLIGATORY .               " 75
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 12.
    SELECTION-SCREEN COMMENT (20) text-b01.
    PARAMETERS: b1 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : END OF BLOCK block1.
    SELECTION-SCREEN: BEGIN OF SCREEN 200 TITLE text-001 AS WINDOW.
    PARAMETERS :  p_email TYPE ad_smtpadr.     "E-Mail Address
    SELECTION-SCREEN: END OF SCREEN 200.
    INITIALIZATION.
      SET PF-STATUS 'ZMMPORD_STAT'.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'EMAIL'.
          PERFORM zemail.
        WHEN '&IC1'.
          PERFORM load_data.
          PERFORM process.
          IF NOT p_email IS INITIAL.
            PERFORM send_mail.
          ENDIF.
      ENDCASE.
    *START-OF-SELECTION.
    PERFORM load_data.
    PERFORM process.
    FORM load_data .
      DATA : gindex LIKE sy-tabix.
      SELECT * FROM t16ct INTO TABLE it_t16ct WHERE spras = 'EN'.
      SELECT * FROM ekko INTO TABLE it_ekko WHERE ebeln IN mebeln.
      IF sy-subrc EQ 0.
        SELECT * FROM erev INTO CORRESPONDING FIELDS OF TABLE it_erev FOR ALL ENTRIES IN it_ekko
        WHERE edokn = it_ekko-ebeln AND rscod <> '' .
        SORT it_erev BY edokn revno DESCENDING.
        LOOP AT it_ekko.
          IF NOT ( it_ekko-frgke EQ 'O'  OR it_ekko-frgke EQ '0' ) .
            MESSAGE e000(zsd) WITH 'Purchase Order is not Realeased'.
          ENDIF.
        ENDLOOP.
        SELECT * FROM ekpo INTO TABLE it_ekpo WHERE ebeln IN mebeln.
        IF sy-subrc EQ 0.
          SELECT * INTO TABLE it_makt
          FROM   makt
          FOR    ALL ENTRIES IN it_ekpo
          WHERE  matnr EQ it_ekpo-matnr.
          SELECT * INTO TABLE it_lfa1
          FROM   lfa1
          FOR    ALL ENTRIES IN it_ekko
          WHERE  lifnr EQ it_ekko-lifnr.
        ENDIF.
        SELECT *
          INTO TABLE it_t052u
          FROM t052u
           FOR ALL ENTRIES IN it_ekko
         WHERE zterm EQ it_ekko-zterm
          AND  spras EQ 'EN'.
        IF sy-subrc EQ 0.
          SORT it_t052u BY zterm.
        ENDIF.
        SELECT * FROM eket INTO TABLE it_eket WHERE ebeln IN mebeln.
        IF sy-subrc EQ 0.
          SORT it_eket BY ebeln ebelp.
        ENDIF.
        SELECT  *
          INTO TABLE it_eikp
          FROM eikp
           FOR ALL ENTRIES IN it_ekko
         WHERE exnum EQ it_ekko-exnum.
        IF sy-subrc EQ 0.
          SORT it_eikp BY exnum.
          SELECT  *
            INTO TABLE it_t618t
            FROM t618t
             FOR ALL ENTRIES IN it_eikp
           WHERE expvz EQ it_eikp-expvz
             AND spras EQ 'E'
             AND land1 EQ 'IN'.
          IF sy-subrc EQ 0.
            SORT it_t618t BY expvz.
          ENDIF.
        ENDIF.
        REFRESH : it_zmm_porder.
        CLEAR   : it_zmm_porder.
        SELECT * INTO TABLE it_zmm_porder
          FROM zmm_porder
         WHERE flag EQ 'L'.
        IF sy-subrc EQ 0.
          SORT it_zmm_porder BY kschl.
        ENDIF.
        SELECT * FROM konv INTO TABLE it_konv
        FOR ALL ENTRIES IN it_ekko
        WHERE knumv = it_ekko-knumv
          AND  kwert NE 0.
        LOOP AT it_konv.
          gindex = sy-tabix.
          READ TABLE it_zmm_porder WITH KEY kschl = it_konv-kschl BINARY SEARCH.
          IF sy-subrc NE 0.
            DELETE it_konv INDEX gindex.
          ENDIF.
        ENDLOOP.
        IF sy-subrc EQ 0.
          SORT it_konv BY knumv kherk kschl.
        ENDIF.
        REFRESH : it_zmm_porder.
        CLEAR   : it_zmm_porder.
        SELECT * INTO TABLE it_zmm_porder
          FROM zmm_porder
         WHERE flag EQ 'F'.
        IF sy-subrc EQ 0.
          SORT it_zmm_porder BY kschl.
        ENDIF.
       SELECT * INTO TABLE IT_KONV_FTR FROM KONV
          FOR ALL ENTRIES IN IT_EKKO
         WHERE KNUMV = IT_EKKO-KNUMV
           AND  ( KSCHL = 'ZIN1'
              OR  KSCHL = 'ZIN2'
              OR  KSCHL = 'ZINS'
              OR  KSCHL = 'ZPF1'
              OR  KSCHL = 'ZPF2'
              OR  KSCHL = 'ZPF3'
              OR  KSCHL = 'ZPKG'
              OR  KSCHL = 'ZPKF'
              OR  KSCHL = 'FRA1'
              OR  KSCHL = 'FRB1'
              OR  KSCHL = 'FRC1'
              OR  KSCHL = 'FRD1'
              OR  KSCHL = 'FRD2'
              OR  KSCHL = 'FRD3'
              OR  KSCHL = 'FRD4'
              OR  KSCHL = 'FRD5'
    *****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
              OR  KSCHL = 'ZFBC' )
           AND  KWERT NE 0
           AND  KPOSN GT '000000'.
          AND ( KRECH = 'B'                       " RTDK906167
           OR  KRECH = 'A' ).
        SELECT * INTO TABLE it_konv_ftr FROM konv
           FOR ALL ENTRIES IN it_ekko
          WHERE knumv = it_ekko-knumv
            AND  kwert NE 0
            AND  kposn GT '000000'.
        LOOP AT it_konv_ftr.
          gindex = sy-tabix.
          READ TABLE it_zmm_porder WITH KEY kschl = it_konv_ftr-kschl BINARY SEARCH.
          IF sy-subrc NE 0.
            DELETE it_konv_ftr INDEX gindex.
          ENDIF.
        ENDLOOP.
        IF it_konv_ftr[] IS NOT INITIAL.
          SORT it_konv_ftr BY knumv kschl.
        ENDIF.
       SELECT  KNUMV KSCHL INTO CORRESPONDING FIELDS OF TABLE IT_KONV1 FROM KONV
       FOR ALL ENTRIES IN IT_EKKO
       WHERE KNUMV = IT_EKKO-KNUMV
           and kherk = 'D'
         AND  ( KSCHL = 'ZIN1'
            OR  KSCHL = 'ZIN2'
            OR  KSCHL = 'ZINS'
            OR  KSCHL = 'ZPF1'
            OR  KSCHL = 'ZPF2'
            OR  KSCHL = 'ZPF3'
            OR  KSCHL = 'ZPKG'
            OR  KSCHL = 'ZPKF'
            OR  KSCHL = 'FRA1'
            OR  KSCHL = 'FRB1'
            OR  KSCHL = 'FRC1'
            OR  KSCHL = 'FRD1'
            OR  KSCHL = 'FRD2'
            OR  KSCHL = 'FRD3'
            OR  KSCHL = 'FRD4'
            OR  KSCHL = 'FRD5'
    *****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
            OR  KSCHL = 'ZFBC' )
         AND  KWERT NE 0.
           AND ( KRECH = 'B'                       RTDK906167
            OR  KRECH = 'A' ).
        SELECT  knumv kschl INTO CORRESPONDING FIELDS OF TABLE it_konv1 FROM konv
        FOR ALL ENTRIES IN it_ekko
        WHERE knumv = it_ekko-knumv
          AND  kwert NE 0.
        DELETE ADJACENT DUPLICATES FROM it_konv1 COMPARING knumv kschl.
        LOOP AT it_konv1.
          gindex = sy-tabix.
          READ TABLE it_zmm_porder WITH KEY kschl = it_konv1-kschl BINARY SEARCH.
          IF sy-subrc NE 0.
            DELETE it_konv1 INDEX gindex.
          ENDIF.
        ENDLOOP.
        IF sy-subrc EQ 0.
          SORT it_konv1 BY knumv kschl.
        ENDIF.
        SELECT * INTO TABLE it_t685t
        FROM   t685t
        FOR    ALL ENTRIES IN it_konv
        WHERE  kschl EQ it_konv-kschl
          AND  kappl EQ it_konv-kappl
          AND  spras EQ 'E'.
        SELECT * INTO TABLE it_t685t_ftr
        FROM   t685t
        FOR    ALL ENTRIES IN it_konv_ftr
        WHERE  kschl EQ it_konv_ftr-kschl
          AND  kappl EQ it_konv_ftr-kappl
          AND  spras EQ 'E'.
        it_t685t_ftr-kschl = 'JVCS'.
        it_t685t_ftr-vtext = 'IN CST in vat'.
        APPEND it_t685t_ftr.
        SELECT * INTO TABLE it_zmm_house_bank
          FROM zmm_house_bank
         WHERE ebeln IN mebeln.
      ELSE.
        MESSAGE e899(mm) WITH 'Data not found for selection criteria...'.
      ENDIF.
    ENDFORM.                    " Load_data
    FORM process .
      DATA : mctr   TYPE i VALUE 1.
      DATA : gindex LIKE sy-tabix.
      DATA : mline(75) TYPE c.
      DATA : mlifn2    LIKE ekpa-lifn2.
      DATA :  mv_name LIKE lfa1-name1,
             madrnr  LIKE lfa1-adrnr.
      CLEAR itcpo.
      itcpo-tdgetotf = 'X'.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          form     = 'ZMM_PORDER'
          language = sy-langu
          OPTIONS  = itcpo
          dialog   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      LOOP AT it_ekko.
        CALL FUNCTION 'START_FORM'
          EXPORTING
            form = 'ZMM_PORDER'.
        SELECT SINGLE *
         FROM  t001
         INTO  it_t001
        WHERE  bukrs EQ it_ekko-bukrs.
        mcompname = it_t001-butxt.
        TRANSLATE mcompname TO UPPER CASE.
        Document Type
        SELECT SINGLE batxt
          INTO mtitle
          FROM t161t
         WHERE bstyp EQ 'F'
         AND   spras EQ 'E'
         AND   bsart EQ it_ekko-bsart.
        REFRESH it_adrc.
        SELECT SINGLE werks
          INTO mwerks
          FROM ekpo
         WHERE ebeln EQ it_ekko-ebeln.
        SELECT SINGLE *
          INTO it_t001w
          FROM t001w
         WHERE werks EQ mwerks.
        REFRESH it_adrc.
        SELECT SINGLE *
          INTO it_adrc_plt
          FROM adrc
         WHERE addrnumber EQ it_t001w-adrnr.
        REFRESH : xt052.
        mfamt  = 0.
        msr    = 0.
    in 500c this statement failed.
       SELECT SINGLE * FROM T052 INTO XT052 WHERE ZTERM = IT_EKKO-ZTERM.
       CALL FUNCTION 'FI_TEXT_ZTERM'
         EXPORTING
           I_T052  = XT052
         TABLES
           T_ZTEXT = ZTEXT.
        As per Preeti... Shipment address should be shown on top as purchase order company address. 27.04.
        PERFORM writeform USING 'PLANT' 'PLANT'.
        SELECT  SINGLE name1 adrnr
          INTO  (mv_name,madrnr)
          FROM  lfa1
         WHERE  lifnr EQ it_ekko-lifnr.
        REFRESH it_adrc[].
        CLEAR   it_adrc[].
        FREE it_adrc[].
        SELECT SINGLE *
          INTO it_adrc_ven
          FROM adrc
         WHERE addrnumber EQ madrnr.
        READ TABLE it_lfa1 WITH KEY lifnr = it_ekko-lifnr.
        PERFORM writeform USING 'VENDOR' 'VENDOR'.
         Shipment
        SELECT SINGLE werks
          INTO mwerks
          FROM ekpo
         WHERE ebeln EQ it_ekko-ebeln.
           up to 1 rows.
        SELECT SINGLE *
          INTO it_t001w
          FROM t001w
         WHERE werks EQ mwerks.
        SELECT SINGLE j_1iexcd j_1icstno j_1ilstno
                 INTO (j_1iexcd,j_1icstno,j_1ilstno)
               FROM    j_1imocomp
                WHERE  werks  = mwerks.
        REFRESH it_adrc.
        SELECT SINGLE *
          INTO it_adrc
          FROM adrc
         WHERE addrnumber EQ it_t001w-adrnr.
        PERFORM writeform USING 'SHIPMNT' 'SHIPMNT'.
        READ TABLE it_eikp WITH KEY exnum = it_ekko-exnum.
        IF sy-subrc EQ 0.
          READ TABLE it_t618t WITH KEY expvz = it_eikp-expvz.
        ENDIF.
        your_ref = it_ekko-ihrez.
        our_ref  = it_ekko-unsez.
        READ TABLE it_erev WITH KEY edokn = it_ekko-ebeln.
        IF sy-subrc = 0.
          no_ammend  = it_erev-revno.
          request_by = it_erev-crnam.
          ver_txt    = it_erev-txz01.
          READ TABLE it_t16ct WITH KEY rscod = it_erev-rscod.
          IF sy-subrc = 0.
            ver_reason = it_t16ct-rstxt.
          ELSE.
            ver_reason = ''.
          ENDIF.
        ELSE.
          no_ammend  = ''.
          request_by = ''.
          ver_txt    = ''.
          ver_reason = ''.
        ENDIF.
        PERFORM writeform USING 'PO_INFO' 'PO_INFO'.
        IF it_zmm_house_bank[] IS NOT INITIAL.
          READ TABLE it_zmm_house_bank INDEX 1.
          PERFORM writeform USING 'BANKDTL' 'BANKDTL'.
        ENDIF.
        PERFORM writeform USING 'HDR_INFO' 'HDR_INFO'.
        PERFORM writeform USING 'BRK_TTL' 'MAIN'.
        msr     = 1.
        mlctr   = 1.
    *added by ganesh to prevent deleted items to appear in print out
       LOOP AT IT_EKPO WHERE EBELN EQ IT_EKKO-EBELN.
        LOOP AT it_ekpo WHERE ebeln EQ it_ekko-ebeln AND loekz NE 'L'.
    *end of change
          CLEAR: mrate, mrate1.
          SELECT * FROM konv INTO TABLE it_konv_rate
                   WHERE knumv EQ it_ekko-knumv
                   AND   kposn EQ it_ekpo-ebelp
                   AND  ( kschl EQ 'PBXX' OR kschl EQ 'PB00'  OR kschl EQ 'P001' ).
          LOOP AT it_konv_rate.
           IF it_konv_rate-kpein > 0.             " added by ganesh as per sudhir 12.10.2007
             mrate_gm = it_konv_rate-kbetr / it_konv_rate-kpein.
             mrate  = mrate + mrate_gm. " added by ganesh as per sudhir 12.10.2007
           ELSE.
            mrate  = mrate + it_konv_rate-kbetr.
           ENDIF.
            IF it_konv_rate-waers IS NOT INITIAL.
              mwaers = it_konv_rate-waers.
            ENDIF.
          ENDLOOP.
        For Japanies Yen   "RTDK906759
          IF it_ekko-waers = 'JPY'.
            mrate = mrate * 100.
          ENDIF.
        End for japanies Yen
          mrate1 = mrate.
               End rate
          mfirst  = 0.
                MFAMT  = MFAMT + ( IT_EKPO-NETPR * IT_EKPO-MENGE ).
          mfamt  = mfamt + ( mrate * it_ekpo-menge ).
          PERFORM get_mat_long_text.
          DATA: lt_ctr TYPE i VALUE 0,lt_ctr1 TYPE i, lt_count TYPE i VALUE 0. " Long text counter
          DESCRIBE TABLE it_bapi_mltx_ga LINES lt_count.
          CLEAR it_bapi_mltx_ga.
    *Added by Rajiv 10.05.2007 Read and if condition RTDK906165
          READ TABLE it_konv WITH KEY knumv = it_ekko-knumv
                                      kposn = it_ekpo-ebelp.
          mkbetr  = 0.
          mkwert  = 0.
          IF sy-subrc EQ 0.
            LOOP AT it_konv  WHERE knumv EQ it_ekko-knumv
                               AND kposn EQ it_ekpo-ebelp.
              IF it_konv-krech EQ 'A'.
                mkbetr  = it_konv-kbetr / 10.
              ELSE.
                mkbetr  = it_konv-kbetr.
              ENDIF.
            For Japanies Yen "RTDK906759
              IF it_ekko-waers = 'JPY'.
                mkbetr = mkbetr * 100.
              ENDIF.
            End for japaies Yen
              IF mkbetr LT '0'.
                mkbetr = mkbetr * ( -1 ).
              ENDIF.
              mkwert   = it_konv-kwert.
            For Japanies Yen "RTDK906759
              IF it_ekko-waers = 'JPY'.
                mkwert = mkwert * 100.
              ENDIF.
            End for japaies Yen
              mfamt  = mfamt + mkwert.
              IF mkwert LT '0'.
                mkwert = mkwert * ( -1 ).
              ENDIF.
              IF it_ekpo-matnr IS INITIAL.
                itemname = it_ekpo-txz01.
              ELSE.
                READ TABLE it_makt  WITH KEY matnr = it_ekpo-matnr.
                itemname = it_makt-maktx.
              ENDIF.
              READ TABLE it_t685t WITH KEY kschl = it_konv-kschl BINARY SEARCH.
              READ TABLE it_eket  WITH KEY ebeln = it_ekpo-ebeln
                                           ebelp = it_ekpo-ebelp BINARY SEARCH.
              IF mfirst EQ 0.
                PERFORM writeform USING 'BRK_INFO' 'MAIN'.
                mfirst = 1.
              ELSE.
                ADD 1 TO lt_ctr.
                CLEAR it_bapi_mltx_ga.
                READ  TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
                IF sy-subrc NE 0.
                  CLEAR it_bapi_mltx_ga.
                ENDIF.
                PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
              ENDIF.
              mlctr = mlctr + 1.
            ENDLOOP.               "   it_konv.
          ELSE.
            IF it_ekpo-matnr IS INITIAL.
              itemname = it_ekpo-txz01.
            ELSE.
              READ TABLE it_makt  WITH KEY matnr = it_ekpo-matnr.
              itemname = it_makt-maktx.
            ENDIF.
                        READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
            READ TABLE it_eket  WITH KEY ebeln = it_ekpo-ebeln
                                         ebelp = it_ekpo-ebelp BINARY SEARCH.
            mfirst = 0.
            IF mfirst EQ 0.
              PERFORM writeform USING 'BRK_INFO' 'MAIN'.
              mfirst = 1.
            ELSE.
              ADD 1 TO lt_ctr.
              CLEAR it_bapi_mltx_ga.
              READ  TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
              IF sy-subrc NE 0.CLEAR it_bapi_mltx_ga.ENDIF.
              PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
            ENDIF.
          ENDIF.
    *Commented by rajiv 10.05.2007 used this code in above condition.
    added by ganesh on 260407 to print record
                if it_konv is initial.
                        READ TABLE IT_MAKT  WITH KEY MATNR = IT_EKPO-MATNR.
                        READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
                        READ TABLE IT_EKET  WITH KEY EBELN = IT_EKPO-EBELN
                                                     EBELP = IT_EKPO-EBELP BINARY SEARCH.
                        mFirst = 0.
                        if mFirst eq 0.
                             PERFORM WRITEFORM USING 'BRK_INFO' 'MAIN'.
                             mFirst = 1.
                        else.
                             add 1 to lt_ctr.
                             clear it_bapi_mltx_ga.
                             read  table IT_BAPI_MLTX_GA index lt_ctr. "For long text
                             if sy-subrc ne 0.clear it_bapi_mltx_ga.endif.
                             PERFORM WRITEFORM USING 'BRK_INFO1' 'MAIN'.
                        Endif.
                endif.
    end of change
          REFRESH it_komv_tax.
          PERFORM get_tax_cal USING it_ekpo-ebeln
                                    it_ekpo-ebelp.
                                 Changing it_komv_tax.
          REFRESH : it_zmm_porder.
          CLEAR   : it_zmm_porder.
          SELECT * INTO TABLE it_zmm_porder
            FROM zmm_porder
           WHERE flag EQ 'T'.
          IF sy-subrc EQ 0.
            SORT it_zmm_porder BY kschl.
          ENDIF.
          LOOP AT it_komv_tax.
            gindex = sy-tabix.
            READ TABLE it_zmm_porder WITH KEY kschl = it_komv_tax-kschl BINARY SEARCH.
            IF sy-subrc NE 0.
              DELETE it_komv_tax INDEX gindex.
            ENDIF.
          ENDLOOP.
          LOOP AT it_komv_tax WHERE kwert IS NOT INITIAL.
           IF ( IT_KOMV_TAX-KSCHL EQ 'JMOP' OR
                IT_KOMV_TAX-KSCHL EQ 'JECS' OR
                IT_KOMV_TAX-KSCHL EQ 'JSEP' OR
                IT_KOMV_TAX-KSCHL EQ 'JMOQ' OR
                IT_KOMV_TAX-KSCHL EQ 'JVCS' OR
                IT_KOMV_TAX-KSCHL EQ 'JVRD' OR
                IT_KOMV_TAX-KSCHL EQ 'JMIP' OR
    *             IT_KOMV_TAX-KSCHL EQ 'JEIP' OR
                IT_KOMV_TAX-KSCHL EQ 'JSEI' OR
                IT_KOMV_TAX-KSCHL EQ 'JSRT' OR
                IT_KOMV_TAX-KSCHL EQ 'JEC3' OR
                IT_KOMV_TAX-KSCHL EQ 'JVRN' )
                AND IT_KOMV_TAX-KWERT IS NOT INITIAL.
            SELECT SINGLE vtext
                   INTO   mtext
                   FROM   t685t
                  WHERE   kschl EQ it_komv_tax-kschl
                    AND   spras EQ 'E'.
            l_rate    = it_komv_tax-kbetr / 10.
            l_amt     = it_komv_tax-kwert.
            For Japanies Yen "RTDK906759
            IF it_ekko-waers = 'JPY'.
              l_amt = l_amt * 100.
            ENDIF.
            End for japaies Yen
            ADD l_amt TO mfamt.
            IF lt_ctr LT lt_count. "Long text
              ADD 1 TO lt_ctr.
              READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
            ELSE.
              CLEAR it_bapi_mltx_ga.
            ENDIF.
            IF l_rate EQ 0 OR l_amt EQ 0.
              l_rate = ''.
              l_amt  = ''.
            ENDIF.
            PERFORM writeform USING 'TAX_LINE_ITEM' 'MAIN'.
           ENDIF.
          ENDLOOP.
          IF lt_ctr LT lt_count.
            DATA mbal_line TYPE i.
            mbal_line = ( lt_count - lt_ctr ).
            DO mbal_line TIMES.
              ADD 1 TO lt_ctr.
              READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
              IF sy-subrc = 0.
                PERFORM writeform USING 'LTEXT' 'MAIN'.
              ENDIF.
            ENDDO.
          ENDIF.
          CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
          REFRESH tline.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id                      = 'F04'
              language                = sy-langu
              name                    = nmebeln
              object                  = 'EKPO'
            TABLES
              lines                   = tline
            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.
          ENDIF.
          LOOP AT tline.
            IF tline-tdline IS NOT INITIAL.
              del_text = tline-tdline.
            ENDIF.
            CONDENSE del_text.
          ENDLOOP.
          CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
          REFRESH tline.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id                      = 'F03'
              language                = sy-langu
              name                    = nmebeln
              object                  = 'EKPO'
            TABLES
              lines                   = tline
            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.
               refresh.
          CLEAR : po_flag, mat_po_text.
          LOOP AT tline.
            IF tline-tdline IS NOT INITIAL.
              MOVE tline-tdline TO mat_po_text.
              CONDENSE mat_po_text.
              PERFORM writeform USING 'MTRL_PO_TEXT' 'MAIN'.
              po_flag = 'X'.
              CLEAR : mat_po_text.
            ENDIF.
          ENDLOOP.
    *Added lines below for Schedule delivery for line item on 09.05.2007:Rajiv
          CLEAR g_ind.
          READ TABLE it_eket  WITH KEY ebeln = it_ekpo-ebeln
                                       ebelp = it_ekpo-ebelp BINARY SEARCH.
          g_ind = sy-tabix.
          LOOP AT it_eket FROM g_ind.
            IF it_eket-ebeln EQ it_ekpo-ebeln AND it_eket-ebelp = it_ekpo-ebelp.
              PERFORM writeform USING 'SCHEDULE' 'MAIN'.
            ELSE.
              EXIT.
            ENDIF.
          ENDLOOP.
    *End Addition:Rajiv
          PERFORM writeform USING 'REQSLP' 'MAIN'.
          mlctr = mlctr + 1.
          msr = msr + 1.
          CLEAR: lt_ctr, lt_ctr1.
      following lines added by ganesh to add service po details as per Mr. sadiq 21.08.2007
          IF it_ekpo-packno IS NOT INITIAL.
            CLEAR sub_packno.
            SELECT SINGLE sub_packno INTO sub_packno FROM esll WHERE packno = it_ekpo-packno.
            IF sub_packno IS NOT INITIAL.
              CLEAR it_esll.
              REFRESH it_esll.
              SELECT * FROM esll INTO CORRESPONDING FIELDS OF TABLE it_esll
              WHERE packno = sub_packno.
              IF sy-subrc = 0.
                PERFORM writeform USING 'SERVICE_PO_TEXT' 'MAIN'.
              ENDIF.
              LOOP AT it_esll.
                CONCATENATE sub_packno it_esll-introw INTO obj.
                CALL FUNCTION 'READ_TEXT'   "4500002446  C300
                  EXPORTING
                    id       = 'LTXT'
                    language = sy-langu
                    name     = obj
                    object   = 'ESLL'
                  TABLES
                    lines    = tline
                  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.
                ENDIF.
                CLEAR stext.
                LOOP AT tline.
                  CONCATENATE stext tline-tdline  INTO stext SEPARATED BY space.
                ENDLOOP.
                FREE tline.
                CLEAR tline.
                REFRESH tline.
                PERFORM writeform USING 'SERVICE_PO' 'MAIN'.
                PERFORM writeform USING 'SERVICE_TEXT' 'MAIN'.
              ENDLOOP.
            ENDIF.
          ENDIF.
        end of change
        ENDLOOP.             " it_ekpo.
        IF mlctr < 15.
          DO 5 TIMES.
            PERFORM writeform USING 'LINEFEED' 'MAIN'.
          ENDDO.
        ENDIF.
        added by ganesh  for allding line before ECC No.
        IF it_ekko-bsart NE 'ZIM'.               " IF EXPORT NO NEED TO PRINT ECC.
          PERFORM writeform USING 'LIN' 'MAIN'.
          PERFORM writeform USING 'WERKS_TAX_DETAIL' 'MAIN'.
        ENDIF.
        end of change
         MFLAG = 'Y'.
        PERFORM writeform USING 'TERMS_VAL' 'MAIN'.
        LOOP AT it_konv1 WHERE knumv EQ it_ekko-knumv.
          mkschl = it_konv1-kschl.
          mchgamt = 0.
          LOOP AT it_konv_ftr  WHERE knumv EQ it_konv1-knumv
                               AND kschl EQ mkschl.
            mchgamt = mchgamt + it_konv_ftr-kwert.
          ENDLOOP.
            For Japanies Yen "RTDK906759
          IF it_ekko-waers = 'JPY'.
            mchgamt = mchgamt * 100.
          ENDIF.
            End for japaies Yen
          mfamt = mfamt + mchgamt.
          IF mchgamt LT '0'.
            mchgamt = mchgamt * ( -1 ).
          ENDIF.
          READ TABLE it_t685t_ftr WITH KEY kschl = mkschl.
          PERFORM writeform USING 'TERMS_FTR_VAL' 'MAIN'.
          mlctr = mlctr + 1.
        ENDLOOP.
        mflag = 'T'.
        CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
          EXPORTING
            amt_in_num         = mfamt
          IMPORTING
            amt_in_words       = mfword
          EXCEPTIONS
            data_type_mismatch = 1
            OTHERS             = 2.
        CONDENSE mebeln.
        nmebeln = it_ekko-ebeln.
        REFRESH tline.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            id                      = 'F01'
            language                = sy-langu
            name                    = nmebeln
            object                  = 'EKKO'
          TABLES
            lines                   = tline
          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.
        ENDIF.
    *---- CHANGED BY MATHEW BECAUSE THIS STATMENT WORKING FINE IN 300 BUT NOT IN 500C.
       LOOP AT ZTEXT.
         IF ZTEXT-TEXT1 IS NOT INITIAL.
           PERFORM WRITEFORM USING 'TERMS_COND_VAL_PAY' 'MAIN'.
         ENDIF.
         MPAY_FLAG = 'Y'.
       ENDLOOP.
        READ TABLE it_t052u WITH KEY zterm = it_ekko-zterm.
        LOOP AT it_t052u WHERE zterm EQ it_ekko-zterm.
          IF it_t052u-text1 IS NOT INITIAL.
            PERFORM writeform USING 'TERMS_COND_VAL_PAY' 'MAIN'.
          ENDIF.
          mpay_flag = 'Y'.
        ENDLOOP.
        PERFORM writeform USING 'TERMS_COND_VAL' 'MAIN'.
        LOOP AT tline.
          IF tline-tdline IS NOT INITIAL.
            PERFORM writeform USING 'TERMS_COND_VAL_HDR' 'MAIN'.
          ENDIF.
          CONDENSE txt.
        ENDLOOP.
        PERFORM writeform USING 'FTR' 'FTR_LIN3'.
        PERFORM writeform USING 'FTR_LIN1' 'FTR_LIN1'.
        CALL FUNCTION 'END_FORM'.
      ENDLOOP.                    "   It_ekko.
      CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
       RESULT                         = itcpp
      RDI_RESULT                     =
       TABLES
         otfdata                        = otf
       EXCEPTIONS
         unopened                       = 1
         bad_pageformat_for_print       = 2
         send_error                     = 3
         spool_error                    = 4
         codepage                       = 5
         OTHERS                         = 6.
      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.                    " Process
    *&      Form  WRITEFORM
          text
         -->P_0150   text
         -->P_0151   text
    FORM writeform  USING    value(p_0150)
                             value(p_0151).
      CALL FUNCTION 'WRITE_FORM'

    Hi
    I think some basis related configuartions to be done
    Try like this and inform me
    A cyclic job runs, which processes the messages seen in the SOST queue.
    Are you sure it's not the frequency of the cyclic job, rather than the
    number of messages in the queue, that you are observing? In messages
    that are queued and before the cyclic job runs, "wait for comm. service"
    is the normal status.
    If you mean that there are always 4 items queued in SOST regardless of
    the cyclic send job, then I have no ideas. I would have thought there
    was no way to do that.
    when the send job runs it just never
    picks them up & sends them, while it picks up many others. The send job
    is somehow blind to these; no error message occurs. In this case, I
    'delete' them from the queue (in SOST) and then 'undelete' (drop down
    menu -> /Go to /Deleted Items) them and then re-queue them. THEN they
    actually get picked up & sent when the next cyclic send job executes.
    Regards
    Pavan

  • Send Mail with PDF attachment

    HI All,
    I am trying to convert one SapScript in PDF and sending the mail in Lotus Notes or Email id...
    I am able to convert the SapScript in PDF and able to send the mail on SAP INBOX also.
    But, How it will go to internet address like gmail or Lotus Notes Ids.
    i have already executed the program RSCONN01. have done SCOT and checked the SBWP..It is still there..
    Where am i doing wrong..
    Please let me know the if any more configuration required for sending the mail...
    Quick answer will be rewardful.
    Thanks,
    Suryakant Baranwal

    *& Report  ZSPOOLTOPDF                                                 *
    *& Converts spool request into PDF document and emails it to           *
    *& recipicant.                                                         *
    *& Execution                                                           *
    *& This program must be run as a background job in-order for the write *
    *& commands to create a Spool request rather than be displayed on      *
    *& screen                                                              *
    REPORT  zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver,
                         p_sender LIKE somlreci1-receiver,
                         p_delspl  AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject   LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Write statement to represent report output. Spool request is created
    if write statement is executed in background. This could also be an
    ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      new-page.
      commit work.
      new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
    Alternative way could be to submit another program and store spool
    id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
           to sap-spool
           spool parameters   %_print
           archive parameters %_print
           without spool dynpro
           and return.
    Get spool id from program called above
    IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM convert_spool_to_pdf.
        PERFORM process_email.
        if p_delspl EQ 'X'.
          PERFORM delete_spool.
        endif.
        IF sy-sysid = c_dev.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
          FORM get_job_details                                          *
    FORM get_job_details.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
          FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
          FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      CHECK gd_recsize > 0.
      PERFORM send_email USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM send_email USING p_email.
      CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachname'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
          FORM delete_spool                                             *
    FORM delete_spool.
      DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
      ld_spool_nr = gd_spool_nr.
      CHECK p_delspl <> c_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                spoolid = ld_spool_nr.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    regards,
    venkat

  • Report as pdf issue in citrix

     
    Hi,
    I have created a report in navision where it is :
    1) Saved and mailed in pdf format : For this i have used the location of filedirectory as TEMPORARYPATH.
    2) Save as pdf : where i have used codeunit 412 to save the report on user desired location.
    Now the problem faced by me is :
    a) If, I run it on local system the report runs fine, i.e. the pdf is mailed to desired recipient as well the file is saved on the location where i want it to be saved.
    b) Same happens when i run it on the server.
    c) But when i run it on citrix server i am not able to mail neither i the file is saved . 
    We use navision 5.0 version and our client accesses navision through citrix.
    Please help in this issue.
    Regards
    Snehpreet Kaur

    Hi,
    I would check with the vendor of the application that is giving you trouble or with the Citrix folks.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Export to PDF Issue (SSRS 2012 with Integration SharePoint 2013)

    Problem Description: We have an operational report that returns around 43,000 records, based on a stored procedure.  The Stored Procedure itself runs pretty quickly (under ~15 seconds).The report renders in 20 seconds.
    However, we get an error like “Sorry, something went wrong” (see below) approximately 2 minutes after we choose/select the PDF as a rendering extension for export. The download of the .PDF never starts.
    Sorry, something went wrong
    An unexpected error has occurred.
    Technical Details
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: b66ebd9c-adf0-407e-892e-00d1e37c4feb
    Date and Time: 9/29/2014 11:10:20 PM
    The 2 minutes is what I get from the execution log... it is actually 122 seconds for timerendering. As for the rs trace log from the web server, see below...
    "w3wp!library!471!09/29/2014-23:10:20:: e ERROR: Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException:
    An error occurred during rendering of the report. ---> System.ServiceModel.CommunicationException: The remote host closed the connection. The error code is 0x800704CD. ---> System.Web.HttpException: The remote host closed the connection. The error code
    is 0x800704CD.
       at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
       at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
       at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
       at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.ServiceModel.Activation.HostedHttpContext.HostedRequestHttpOutput.HostedResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       --- End of inner exception stack trace ---
       at System.ServiceModel.Activation.HostedHttpContext.HostedRequestHttpOutput.HostedResponseOutputStream.CheckWrapThrow(Exception e)
       at System.ServiceModel.Activation.HostedHttpContext.HostedRequestHttpOutput.HostedResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.BufferedStream.Write(Byte[] array, Int32 offset, Int32 count)
       at System.Xml.XmlStreamNodeWriter.WriteBytes(Byte[] byteBuffer, Int32 byteOffset, Int32 byteCount)
       at System.Xml.XmlBinaryNodeWriter.WriteBase64Text(Byte[] trailBytes, Int32 trailByteCount, Byte[] base64Buffer, Int32 base64Offset, Int32 base64Count)
       at System.Xml.XmlBaseWriter.WriteBase64(Byte[] buffer, Int32 offset, Int32 count)
       at Microsoft.ReportingServices.ServiceRuntime.WcfResponseData.Write(Byte[] buffer, Int32 offset, Int32 count)
       at Microsoft.ReportingServices.ServiceRuntime.WcfResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at Microsoft.ReportingServices.Library.BufferAndOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at Microsoft.ReportingServices.Library.RSStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.BufferedStream.Write(Byte[] array, Int32 offset, Int32 count)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.Write(String text)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndPage()
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessPage(RPLReport rplReport, Int32 pageNumber, FontCache sharedFontCache, List`1 glyphCache)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCap
    w3wp!wcfruntime!471!09/29/2014-23:10:20:: e ERROR: Reporting Services fault exception System.ServiceModel.FaultException`1[Microsoft.ReportingServices.ServiceContract.RsExceptionInfo]: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException:
    An error occurred during rendering of the report. ---> System.Exception: For more information about this error navigate to the report server on the local server machine, or enable remote errors (Fault Detail is equal to Microsoft.ReportingServices.ServiceContract.RsExceptionInfo)."
    Things Also Done
    1) I also tried exporting the report through excel and found no issues (it exports successfully and no issue when i open the file). The size of the exported excel (.xlsx) is 4.28MB. The timerendering value for export to excel is approx. 77 seconds.
    2) I also tried creating email subscription (PDF as the rendering format) for that report and it works successfully. The size of the attached PDF from the email is approx. 1.43 MB. I can also open that PDF file with no issue. And the size of the email with
    the attached PDF file is approx. 1.48 MB.
    That all said, we would like to seek for your assistance to determine what is causing the failure of exporting the report to PDF issue directly from the reporting site. (Let me remind you that the email subscription for the same report with attached
    PDF works with no issue)

    Hi roel2000,
    According to your description, you get error when exporting the report into PDF. It works properly when exporting in excel or PDF format within E-mail subscription. Right?
    In Reporting Services, the Excel and MHTML(e-mail subscription) render extensions are soft page break renderers. The PDF render extension is hard page break renderer. It has different render behavior between these two kind of renders. This might cause the
    error. Since we are not clear about your report structure, please refer to rules in the link below and do the troubleshooting.
    Rendering Behaviors (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Send Mail with PDF Attachment in ABAP

    Hi Experts,
    I have a requirement where I need to convert internal table data into PDF format and send it as an E-Mail with PDF attachment to Outlook mail using ABAP.
    How do I achieve this .
    Can anyone send me example code for doing this.
    Thanks
    Kumar

    hiii
    check following code for PDF attachment and mail
    ** Check for any ATTACHMENTS...
    IF d_desired_type = 'RAW'.           " Set to RAW?
    *    PERFORM convert_to_abaplist.       " YES - convert it
      ENDIF.                               " end...
      IF d_desired_type = 'ALI'.           " Set to ALI?
        PERFORM convert_to_alilist.        " YES - convert it
      ENDIF.                               " end...
    * Check for any ATTACHMENTS...
      IF NOT t_soli[] IS INITIAL.          " attachment?
        h_real_type = d_desired_type.      " ENABLE
        h_transf_type = 'X'.               " Transfer type BINARY...
    *   Write PDF/ALI formatted data to BINARY table...
        t_con_bin[] = t_soli[].
    *   Add Packing List (attachment) for PDF...
        DESCRIBE TABLE t_con_bin LINES h_tab_cntr.
        READ TABLE t_con_bin INDEX h_tab_cntr.
        h_doc_data-doc_size = h_doc_data-doc_size
                            + ( ( h_tab_cntr - 1 )
                            * 255 + STRLEN( t_con_bin ) ).
        h_doc_data-obj_descr  = mail_subject.
        h_body_start = 1.
        h_body_num = h_tab_cntr.
    *   Write RAW data if that's what it is (adds to TEXT)...
        IF h_real_type = 'RAW'.
          DESCRIBE TABLE t_con_text LINES h_body_start.
          h_body_start = h_body_start + 1.
          h_transf_type = space.           " Transfer type TEXT...
          LOOP AT t_con_bin.               " Zip thru TEXT stuff
            t_con_text = t_con_bin.        " set TEXT table header..
            APPEND t_con_text.             " add to what's there!
          ENDLOOP.
          CLEAR: t_con_bin.                " clear BINARY header..
          REFRESH: t_con_bin.              " reset BINARY table...
        ENDIF.
        CLEAR t_pak_list.
        IF h_transf_type = 'X'.            " Binary=PDF/ALI?
          t_pak_list-transf_bin = 'X'.
          t_pak_list-head_start = 1.
          t_pak_list-head_num   = 0.
          t_pak_list-body_start = 1.
          t_pak_list-body_num   = h_tab_cntr.
          t_pak_list-doc_type   = h_real_type.
          t_pak_list-obj_name   = 'ATTACHMENT'.
          t_pak_list-obj_descr  = 'Document'(001).
          t_pak_list-doc_size   = ( h_tab_cntr - 1 )
                                * 255 + STRLEN( t_con_bin ).
        ELSE.
          DESCRIBE TABLE t_con_text LINES h_tab_cntr.
          READ TABLE t_con_text INDEX h_tab_cntr.
          t_pak_list-transf_bin = ' '.     " Binary=RAW
          t_pak_list-head_start = 1.
          t_pak_list-head_num   = 0.
          t_pak_list-body_start = h_body_start.
          t_pak_list-body_num   = h_tab_cntr.
          t_pak_list-doc_type   = h_real_type.
          t_pak_list-obj_name   = 'ATTACHMENT'(002).
          t_pak_list-obj_descr  = 'Report'(003).
          t_pak_list-doc_size   = ( h_body_num - 1 )
                                * 255 + STRLEN( t_con_text ).
        ENDIF.
        APPEND t_pak_list.
      ENDIF.
    * Send the EMAIL out with SAP function...
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = h_doc_data
          put_in_outbox              = 'X'
    *      commit_work                = 'X'
        TABLES
          packing_list               = t_pak_list
          contents_bin               = t_con_bin
          contents_txt               = t_con_text
          receivers                  = t_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 syst-subrc NE 0.
    *    RAISE send_failed.
        CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
          EXPORTING
            msg_arbgb = '00'
            msg_nr    = '001'
            msg_ty    = 'E'
            msg_v1    = 'O/P Could not be issued '(001)
            msg_v2    = ' Due to No Mail ID'(002)
            msg_v3    = syst-msgv3
            msg_v4    = syst-msgv4
          EXCEPTIONS
            OTHERS    = 1.
    * Check General incompletion status of the header
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ELSE.
          WRITE : 'SENT'.
        ENDIF.
      ELSE.
    *    commit work.
      ENDIF.
    ENDFORM.                               " SEND_MAIL_FAX
    *&      Form  convert_otf_2_pdf
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM convert_otf_2_pdf .
      DATA: "t_line            LIKE tline OCCURS 0 WITH HEADER LINE,
            t_objcont         LIKE soli  OCCURS 0 WITH HEADER LINE,
            d_doc_size(12)    TYPE c,
            d_fle1(2)         TYPE p,
            d_fle2(2)         TYPE p,
            d_off1            TYPE p,
            d_hltlines        TYPE i,
            d_hfeld(500)      TYPE c,
            w_indx            LIKE sy-tabix.
      CLEAR: t_line, t_objcont, d_off1.
      REFRESH: t_line, t_objcont.
    * Check/set DEFAULT Desired-type attachment...
      IF d_desired_type IS INITIAL.        " Entered Desired type?
        d_desired_type = 'PDF'.            " NO  - default to PDF
      ENDIF.                               "
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = d_desired_type
        IMPORTING
          bin_filesize          = d_doc_size
        TABLES
          otf                   = t_itcoo
          lines                 = t_line
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc > 0.
        RAISE otf_convert_failed.
      ENDIF.
    ENDFORM.                               " convert_otf_2_pdf
    *&      Form  convert_otf_2_pdf_sx
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM convert_otf_2_pdf_sx .
      DATA:
        t_otf          LIKE solisti1 OCCURS 0 WITH HEADER LINE,"ENABLE
        t_pdf          LIKE tline    OCCURS 0 WITH HEADER LINE,"ENABLE
        doc_size(12)   TYPE n,
        len_out        TYPE i,
        x_real         LIKE  soodk-objtp,
        x_idx_b        LIKE sy-tabix,
        x_idx_e        LIKE sy-tabix.
      IF d_desired_type = 'PDF'.
        d_desired_type = 'OTF'.
      ENDIF.
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
        EXPORTING
          rqident              = d_spool_id
          desired_type         = d_desired_type
        IMPORTING
          real_type            = x_real
        TABLES
          buffer               = t_otf
          buffer_pdf           = t_pdf
        EXCEPTIONS
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          type_no_match        = 7
          OTHERS               = 8.
      IF sy-subrc <> 0.
        IF sy-subrc = 1.
          RAISE invalid_spool_id.
        ELSE.
          RAISE otf_convert_failed.
        ENDIF.
      ENDIF.
    * Check Desired-Type vs. Real-Type (if any)...
      IF d_desired_type IS INITIAL.
        IF x_real = 'OTF'.
          d_desired_type = 'PDF'.
        ELSE.
          d_desired_type = x_real.
        ENDIF.
      ELSE.
        IF ( d_desired_type = 'PDF' OR
             d_desired_type = 'OTF' ) AND
           ( x_real = 'OTF' OR
             x_real = 'PDF' ).
          d_desired_type = 'PDF'.
        ELSE.
          IF d_desired_type <> x_real.
            RAISE type_no_match.
          ENDIF.
        ENDIF.
        IF ( d_desired_type = 'ALI' OR
             d_desired_type = 'RAW' ) AND
             x_real = 'OTF'.
          RAISE type_no_match.
        ENDIF.
      ENDIF.
    * Check if ABAP-LIST and not SapScript...
      IF d_desired_type = 'ALI' OR
         d_desired_type = 'RAW'.
        t_soli[] = t_otf[].
        EXIT.
      ENDIF.
    * Load OTF data gotten from spool...
      LOOP AT t_otf.
        t_itcoo = t_otf.
        APPEND t_itcoo.
    *   if Vendor P/O (SapScript = Z_MEDRUCK) then
    *      trap INDEX for "Terms & Conditions" on BACK...
        IF t_itcoo-tdprintcom =  'IN' AND
           t_itcoo-tdprintpar =  '01EZ_MEDRUCK       BACK'.
          x_idx_b = sy-tabix.
        ENDIF.
        IF t_itcoo-tdprintcom =  'IN' AND
           t_itcoo-tdprintpar =  '01EZ_MEDRUCK       NEXT'.
          x_idx_e = ( sy-tabix - 1 ).
        ENDIF.
      ENDLOOP.
    * Drop from table if INDEX'S are set (see above)...
      IF ( x_idx_b > 0 AND
         ( x_idx_e > x_idx_b ) ) .
        DELETE t_itcoo FROM x_idx_b
                     TO x_idx_e.
      ENDIF.
      PERFORM convert_otf_2_pdf.
    ENDFORM.                               " convert_otf_2_pdf_sx
    *&      Form  CONVERSION_OF_SIZE                                       *
    * *"Converting the file to get a 255 char single line internal table   *
    * The PDF file that is generated out of the above function module     *
    * cannot be transported as it needs to be of 255 chars. Hence         *
    * converting the file to get a 255 char single line,internal table.   *
    FORM conversion_of_size .
    "Declaring Local Constants............................................
      CONSTANTS:
         cnv_hexconst_zero TYPE x VALUE '00'.
    * Internal table to hold 255 Char's Single Line.                      *
      DATA:
        lv_big_lines(268) TYPE c
                          OCCURS 0 WITH HEADER LINE.
    *"Local Work Variables.................................................
      DATA:
        lfl_flag          TYPE c,
        lv_left_t(268)    TYPE c,
        lv_left_i         TYPE i,
        tv_left_i         TYPE i,
        lv_curr_i         TYPE i.
      FIELD-SYMBOLS: <f>.
    * Get the lines into a table of 268 char as the first step to put it in
    * the pdf file of 255 chars
      CLEAR lfl_flag.
      LOOP AT t_line.
        IF lfl_flag EQ ' '.
          CLEAR lv_big_lines.
          ASSIGN lv_big_lines(134) TO <f>.
          <f> = t_line.
          lfl_flag = 'X'.
        ELSE.
          lv_big_lines+134 = t_line.
          APPEND lv_big_lines.
          CLEAR: lfl_flag.
        ENDIF.                             " If lfl_flag = ''..
      ENDLOOP.                             " Loop at t_pdf
      IF lfl_flag EQ 'X'.
        APPEND lv_big_lines.
      ENDIF.                               " If lflf_flag eq 'X'..
    * Next fill it into a 255 char table
      CLEAR: lv_left_t, lv_left_i, tv_left_i.
      lv_curr_i = 255.
      LOOP AT lv_big_lines.
        IF lv_left_i NE 0.
          IF lv_curr_i NE 0.
            wa_objcont(lv_left_i)           = lv_left_t(lv_left_i).
            wa_objcont+lv_left_i(lv_curr_i) = lv_big_lines(lv_curr_i).
          ELSE.
            wa_objcont = lv_left_t(lv_left_i).
          ENDIF.                           " IF lv_curr_i NE 0
        ELSE.
          wa_objcont = lv_big_lines(lv_curr_i).
        ENDIF.                             " IF lv_left_i NE 0
        APPEND wa_objcont TO t_objcont.
        tv_left_i = 268 - lv_curr_i.
        IF tv_left_i > 255.
          wa_objcont = lv_big_lines+lv_curr_i(255).
          APPEND wa_objcont TO t_objcont.
          lv_left_i = tv_left_i - 255.
          tv_left_i = 255 + lv_curr_i.
          lv_curr_i = 255 - lv_left_i.
          lv_left_t = lv_big_lines+tv_left_i.
        ELSE.
          lv_left_t = lv_big_lines+lv_curr_i.
          lv_left_i = 268 - lv_curr_i.
          lv_curr_i = 255 - lv_left_i.
        ENDIF.                             " IF tv_left_i > 255
      ENDLOOP.                             " LOOP AT lv_big_lines.
      CLEAR wa_objcont .
      ASSIGN wa_objcont(lv_left_i) TO <f>.
      <f> = lv_left_t(lv_left_i).
      APPEND wa_objcont TO t_objcont.
        h_transf_type = 'X'.                 " Transfer type BINARY...
      IF NOT t_objcont[] IS INITIAL.
        t_soli[]     = t_objcont[].        " SapScript doc to Objects...
      ENDIF.
    regards
    twinkal

  • I have nine, 1-page PDF files that are accessible and need to combine into 1 PDF file.  I have tried appending, adding and the combine PDFs process. The file created is not keeping my changes. The created file is partially accessible but I have to re-fix

    I have nine, 1-page PDF files that are accessible and need to combine into 1 PDF file.  I have tried appending, adding and the combine PDFs process. The file created is not keeping my changes. The created file is partially accessible but I have to re-fix issues I had fixed in the single files. I need suggestions on what else can be done if any. Using Acrobat pro XI.

    Out of habit, I tend to combine PDF files in the Page Thumbnails pane by right-click then "Insert Pages" -> "From File". For me, this preserves the tags from both documents, although the tags may have to be moved into the right location (if I recall correctly the tags for the inserted pages get put at the end of the tag structure, regardless of where the pages are inserted), If I first put the tags for the document to be inserted inside a container tag like Section, it makes the process easier. Moving that set of tags to the right place is the only re-fixing that I recall having to do. What behavior are you experiencing?
    a 'C' student

  • Exporting multiple e-mails as .pdf

    I'm responsible for coordinating a multi-author, book-writing project and I've been asked to store all e-mail correspondences in a fashion that allows all of the authors and project managers to access the e-mails. I have a shared folder set up on my Google drive that allows all the users to access shared files which is working fantastically, but I can't find a way to export large quantities of e-mails at the same time that also works for Google drive.
    After a quick Google search I found this site which provided instructions on how to install this set of scripts which allowed me to archive my selected e-mails as .rtf files with their attachments. It works great and allows me to customize the naming of the files to allow other authors to easily locate a specific e-mail. It names each file "From %f to %t - %s - %M %d, %Y.rtf" where %t is the recipient, %f is the sender, %s is the subject/thread topic and %M %d, %Y is Month day, year (eg To John Smith from Jane Doe - Book Project - December 12, 2012.rtf).
    Unfortunately, after uploading the folder containing all these .rtf files I found out that .rtf can't be viewed on Google and must be downloaded then opened on the user's computer. To fix this I tried having Google automatically convert the files to Google docs as it uploaded the files, but this didn't work and even if it did I fear the files would lose their attachments.
    I then tried searching for scripts that would allow me to change all of the .rtf files to .pdf. I found and tried a few, but they all had problems (the script would only operate on pre Mountain Lion, the requires Word for Mac, etc.)
    Then I tried finding a script that would work like the first successful one, but export the files as .pdf rather than .rtf. I couldn't find anything, but found an article that reminded me I could print to .pdf from mail ("Save as PDF..." in the system print window). I tried doing this, but after 'printing' the first of all the e-mails an error box pops up and no more e-mails 'print.' If I "Open PDF in Preview" I can successfully save all of the e-mails as .pdf, but their file names are all Preview of "<e-mail subject>".pdf which isn't helpful because nearly all correspondences in the group have a subject like "Book" or "Book Project" meaning it'd be impossible to determine which e-mail is which by the .pdf filename.
    I feel like their are a lot of different routes I can take to solve this problem, I just need help finding the components:
    1. Use the first successful script to export as .rtf, then use another script to convert them to .pdf. This would be the best because it will allow me to use a useful filenaming system. To do this I need a script that can convert .rtf to .pdf on my system.
    2. Find a script like the first, successful script I used that allows me to export the e-mails as a .pdf using the subject, to/from, etc. as the filename.
    3. Open PDF in Preview, save, then use a script to rename all the files by extracting the subject, to/from and date from the .pdfs. To do this I need a script that can find the subject, etc. in the .pdf and use that data to change the file name. (I highly doubt such a script exists and I don't have the script-writing skills to create one myself.)
    4. Any other solution that allows me to take a lot of e-mails from my Mail app and upload them to my Google drive while maintaining attachments and generating logical filenames.
    5. Any other solution that makes it possible for me to make correspondences available for all authors to access (keeping in mind that cross-platform compatibility is essential).
    Suggestions?

    I found your first suggestion while doing a Google search. That post was made in mid-2011, almost a year before Mountain Lion released. Apple changed the way scripts work in Mountain Lion and this script no longer works.
    As far as I can tell, the second solution only works for printing one e-mail to a .pdf at a time and doesn't support batch filenaming.

  • I went to iCloud and my mail doesn't recognize my password but even worst my iTunes does not want to open because it says my library is blocked somewhere on a hard disk where I  have no access ...

    I went to iCloud and my mail doesn't recognize my password but even worst my iTunes does not want to open because it says my library is blocked somewhere on a hard disk where I  have no access ...
    HELP HELP

    To confirm, your existing mail client isn't communicating with your existing and remote mail services at Dreamhost? Which mail client are you using (Apple mail?), and how is mail on the client set up?
    It would initially seem that your client is still referencing the server, either for its inbound or outbound mail. (And I'm not sure how unplugging the server helps here, unless there's some sort of a configuration issue, or a duplicate network address or such.) This would usually be something within the configuration of the mail client.
    The Mac OS X Server is significantly easier than the many other servers and server operating systems I've dealt with over the years, but it requires reading the manuals and/or some knowledge of networking and of server environments.
    Small shops and home folks without the time or inclination to "spin up" on these server areas can be well-served with some help initially configuring the server. Servers are different from clients. Stuff that you're implicitly used to using when you're running a client -- the DHCP server, for instance -- are what the servers provide you with.
    As for Mac OS X Server and particularly if you head outside of the default settings and sequences and off into the customizations, which is what has happened here, you might want to engage some assistance. Not just for the direct and obvious initial set-up sequence, but also for getting you set-up and started with backups and other such tasks. Before you get too deep in here and get too much underway and too much saved on your disks, do seriously consider getting somebody in to help set this box up for you.
    Mac OS X Server is not "no IT", but it is rather closer to "less IT" than most. Particularly once you get it configured and running.

Maybe you are looking for

  • How can I install to a drive other than C?

    I installed the CS6 Master Collection trial version. During the installation, I specified a destination folder on my D: drive (C: is a small SSD drive meant to hold only Windows). For the 32-bit versions of the programs, the shortcuts created in the

  • Since installing 10.7.3 Mail and Address Book no longer load and report errors. Anyone else experiencing this? Safari works fine.

    Everything worked fine prior to the installation. I am aware of bug issues that people are reporting with regard to no applications working and strange error messages. My MacBook Air is fine; my wife's MacBook is fine. It's my iMac 12,1 that isn't.

  • Mass creation of Marketing attributes under attribute set

    Hi All, Please let me know if there is a possibility for mass creation of Marketing attributes and marketing attribute sets in SAP CRM Standard functionality. I am not talking about below " creation & assignment to BPs using the expert tools. " CRMD_

  • Who carries around a Mac mini?

    My question is more a complaint than a question. I'm really disappointed with the new Mac Mini because of the lacking DVD drive! Not that I couldn't see that this may be the future. I am a proud MacBook Air owner since generation 1! I always liked th

  • Page display based on count of records

    Hi All, i have one report requirement in BIP. my report should contains 3 pages only. Fist page contains first contact information. Second page should contain Second contact inforamtion. Third page should contain comparing of first contact age and se