Convert abap list to DOC

how do i convert abap list to DOC .
Rendi

hi,
this program to convert abap list to PDF file.
*& Report  ZWARUN_TEST4
REPORT  ZWARUN_TEST4.
tables:mara,bseg.
data:begin of itab occurs 2,
     matnr like mara-matnr,
     ernam like mara-ernam,
    end of itab.
data:begin of it_bseg occurs 2,
     bukrs like bseg-bukrs,
     belnr like bseg-belnr,
     gjahr like bseg-gjahr,
     shkzg like bseg-shkzg,
     dmbtr like bseg-dmbtr,
    blart like bkpf-blart,
     end of it_bseg.
data: lv_numbytes type i,
      lv_spoolno type tsp01-rqident,
      c_layout like pri_params-paart value 'X_65_132',
      C_X type c value 'X',
      numbers type i,
      cancel.
data:it_pdf like tline occurs 10 with header line.
data:p_down like rlgrap-filename.
*at selection-screen.
selection-screen:begin of  block blk with frame.
select-options:s_matnr for mara-matnr,
               s_bukrs for bseg-bukrs.
parameter: download as checkbox default 'X',
           p_file like rlgrap-filename default 'c:\warun.pdf'.
          p_down LIKE RLGRAP-FILENAME DEFAULT 'c:\warun2.txt'.
selection-screen:end of block blk .
selection-screen pushbutton 12(20) push user-command cl1.
at selection-screen.
  perform validate.
top-of-page.
  write:/10 sy-repid inverse color 3.
  write:/2 'Date:' , sy-datum,
         40 'Time:' , sy-uzeit.
  write:/2 sy-uline.
end-of-page.
  write:/50 'Intelligroup Asia Pvt'.
  write:/20 sy-pagno.
start-of-selection.
  select matnr
         ernam
         into table itab
         from mara
         where matnr in s_matnr.
  if sy-subrc = 0.
    sort itab by matnr.
  endif.
  perform besg_data.
set pf-status 'PUSH'.
at user-command.
if sy-ucomm = 'DOWNLOAD'.
  if download = space.
    perform get_file.
  endif.
end-of-selection.
  if download = 'X'.
    perform PDFfile.
  ENDIF.
*&      Form  validate
FORM validate .
  data: v_temp(40).
  select single
         matnr
         into v_temp
         from mara
         where matnr in s_matnr.
  if sy-subrc <> 0.
    message e000(zz) with 'no data found'.
  endif.
ENDFORM.                    " validate
at line-selection.
  set parameter ID 'MAT' FIELD ITAB-MATNR.
  CALL TRANSACTION 'MM03' .
  WRITE:/ 'Material data displayed' .
  write:/2 itab-matnr.
*&      Form  PDFfile
FORM PDFfile .
  data:lk_params type pri_params,
        lv_valid.
All the parameters passed are constants, so exceptions
doesn't get raised
  call function 'GET_PRINT_PARAMETERS'
    EXPORTING
      immediately    = ' '
      layout         = c_layout                             "'X_65_132'
      no_dialog      = c_x
    IMPORTING
      out_parameters = lk_params
      valid          = lv_valid.
  if lv_valid <> space .
    new-page print on parameters lk_params no dialog.
*--To display the final report
    perform print_report.
    new-page print off.
*---To convert the download to PDF
    perform conv_to_pdf_download.
    perform download.
  endif.
endif.
*--To display the final report
  perform print_report.
ENDFORM.                    " PDFfile
*&      Form  print_report
FORM print_report .
  loop at itab.
    write:/2 sy-vline,
           4 itab-matnr  color 4 HOTSPOT,
           40 sy-vline ,
           41 itab-ernam color 5,
           55 sy-vline.
    HIDE: ITAB-MATNR.
  endloop.
ENDFORM.                    " print_report
*&      Form  conv_to_pdf_download
FORM conv_to_pdf_download .
  wait up to 2 seconds.
  lv_spoolno = sy-spono.
  call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
    exporting
      src_spoolid                    =  lv_spoolno
     no_dialog                      = ''
   DST_DEVICE                     =
   PDF_DESTINATION                =
   importing
     pdf_bytecount                  = lv_numbytes
   PDF_SPOOLID                    = pdfspoolid
   LIST_PAGECOUNT                 =
   BTC_JOBNAME                    = jobname
   BTC_JOBCOUNT                   = jobcount
   tables
     pdf                            = it_pdf.
ENDFORM.                    " conv_to_pdf_download
*&      Form  download
FORM download .
  check download = 'X'.
  call function 'DOWNLOAD'
    EXPORTING
      bin_filesize = lv_numbytes
      filename     = p_file
      filetype     = 'BIN'
    IMPORTING
      act_filename = p_file
      filesize     = lv_numbytes
      cancel       = cancel
    TABLES
      data_tab     = it_pdf.
  if cancel = space.
    write: / lv_numbytes, p_file.
  endif.
ENDFORM.                    " download
*&      Form  get_file
FORM get_file .
  Data: s_filename like rlgrap-filename,
        s_filepath like rlgrap-filename,
        tm_filepath like rlgrap-filename.
  CALL FUNCTION 'WS_FILENAME_GET'
   EXPORTING
     DEF_FILENAME           = s_filename
     DEF_PATH               = s_filepath
        MASK                   = ' '
        MODE                   = ' '
        TITLE                  = ' '
   IMPORTING
     FILENAME               =  tm_filepath
  IF SY-SUBRC = 0.
    p_down = tm_filepath.
    perform download2.
  endif.
ENDFORM.                    " get_file
*&      Form  download2
FORM download2 .
  DATA: LV_STRING TYPE STRING.
  LV_STRING = P_DOWN.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                        = LV_STRING
     FILETYPE                        = 'ASC'
  APPEND                          = ' '
     WRITE_FIELD_SEPARATOR           = 'X'
    TABLES
      DATA_TAB                        = itab
   EXCEPTIONS
     FILE_WRITE_ERROR                = 1
     NO_BATCH                        = 2
     GUI_REFUSE_FILETRANSFER         = 3
     INVALID_TYPE                    = 4
     NO_AUTHORITY                    = 5
     UNKNOWN_ERROR                   = 6
     HEADER_NOT_ALLOWED              = 7
     SEPARATOR_NOT_ALLOWED           = 8
     FILESIZE_NOT_ALLOWED            = 9
     HEADER_TOO_LONG                 = 10
     DP_ERROR_CREATE                 = 11
     DP_ERROR_SEND                   = 12
     DP_ERROR_WRITE                  = 13
     UNKNOWN_DP_ERROR                = 14
     ACCESS_DENIED                   = 15
     DP_OUT_OF_MEMORY                = 16
     DISK_FULL                       = 17
     DP_TIMEOUT                      = 18
     FILE_NOT_FOUND                  = 19
     DATAPROVIDER_EXCEPTION          = 20
     CONTROL_FLUSH_ERROR             = 21
     OTHERS                          = 22
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                                                    " download2
*&      Form  besg_data
FORM besg_data .
if itab is initial.
select bukrs
       belnr
       gjahr
       shkzg
       dmbtr
      into corresponding fields of table it_bseg
       from bseg
      where bukrs in s_bukrs.
endif.
ENDFORM.                    " besg_data
regards
warun

Similar Messages

  • Problem converting ABAP list into PDF

    Hello,
    Having converted a spool request of an abap list into pdf the "intensified" attribute of the list items will disappeare. Text in the list with i.e. COL_BACKGROUND INTENSIFIED would be converted to text with blue and normal font. None of the possible combinations of colours and intenstions have produced an output in bold.
    Any ideas would be appreciated.
    Thank you in advance.
    Best regards,
    Michael Weiskat

    Save Report Output to a PDF File
    This report takes another report as input, and captures the output of that report. The output is then converted to PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to create PDF files.
    Source Code Listing
    report zabap_2_pdf.
    *-- Enhancements: only allow to be run with variant.  Then called
    *-- program will be transparent to users
    *-- TABLES
    tables:
      tsp01.
    *-- STRUCTURES
    data:
      mstr_print_parms like pri_params,
      mc_valid(1)      type c,
      mi_bytecount     type i,
      mi_length        type i,
      mi_rqident       like tsp01-rqident.
    *-- INTERNAL TABLES
    data:
      mtab_pdf    like tline occurs 0 with header line,
      mc_filename like rlgrap-filename.
    *-- SELECTION SCREEN
    parameters:
      p_repid like sy-repid, " Report to execute
      p_linsz like sy-linsz default 132, " Line size
      p_paart like sy-paart default 'X_65_132'.  " Paper Format
    start-of-selection.
    concatenate 'c:\'
                p_repid
                '.pdf'
      into mc_filename.
    *-- Setup the Print Parmaters
      call function 'GET_PRINT_PARAMETERS'
       exporting
         authority= space
         copies   = '1'
         cover_page                   = space
         data_set = space
         department                   = space
         destination                  = space
         expiration                   = '1'
         immediately                  = space
         in_archive_parameters        = space
         in_parameters                = space
         layout   = space
         mode     = space
         new_list_id                  = 'X'
         no_dialog= 'X'
         user     = sy-uname
       importing
         out_parameters               = mstr_print_parms
         valid    = mc_valid
       exceptions
         archive_info_not_found       = 1
         invalid_print_params         = 2
         invalid_archive_params       = 3
         others   = 4.
    *-- Make sure that a printer destination has been set up
    *-- If this is not done the PDF function module ABENDS
      if mstr_print_parms-pdest = space.
        mstr_print_parms-pdest = 'LOCL'.
      endif.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
      mstr_print_parms-linsz = p_linsz.
      mstr_print_parms-paart = p_paart.
      submit (p_repid) to sap-spool without spool dynpro
                       spool parameters mstr_print_parms
                       via selection-screen
                       and return.
    *-- Find out what the spool number is that was just created
      perform get_spool_number using sy-repid
                 sy-uname
        changing mi_rqident.
    *-- Convert Spool to PDF
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid= mi_rqident
          no_dialog  = space
          dst_device = mstr_print_parms-pdest
        importing
          pdf_bytecount                  = mi_bytecount
        tables
          pdf        = mtab_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.
    call function 'DOWNLOAD'
         exporting
              bin_filesize            = mi_bytecount
              filename                = mc_filename
              filetype                = 'BIN'
         importing
              act_filename            = mc_filename
         tables
              data_tab                = mtab_pdf.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    -->  F_REPID               *
    -->  F_UNAME               *
    -->  F_RQIDENT             *
    form get_spool_number using f_repid
         f_uname
                    changing f_rqident.
      data:
        lc_rq2name like tsp01-rq2name.
      concatenate f_repid+0(8)
                  f_uname+0(3)
        into lc_rq2name separated by '_'.
      select * from tsp01 where  rq2name = lc_rq2name
      order by rqcretime descending.
        f_rqident = tsp01-rqident.
        exit.
      endselect.
      if sy-subrc ne 0.
        clear f_rqident.
      endif.
    endform." get_spool_number

  • Convert ABAP List to PDF

    Hi, 
    I need to convert an ABAP List that is in the spool to a PDF file, but I want to separate the SPOOL in several pages so that each page is a new PDF file. Is there any way I can do this?
    Thanks
    PS:
    I prove the function <b>CONVERT_ABAPSPOOLJOB_2_PDF</b>, but this function convert all ABAP list to a pdf file.

    Hi John,
    interesting question, I think yes, but I'm sorry I have no time to invistigate, but I think the way to do that is :
    - Find how sap is able to print only one page from a spool ?  (Trans SP01)
    - Use a function like CONVERT_OTF_2_PDF or SX_OBJECT_CONVERT___S_PRT.
    That could be
    [SPOOL x pages] -> [ 1 OTF by page] -> [1 PDF]
    Good luck and gives us feedback
    Fred

  • Convert ABAP list output to PDF without spool

    Hi All,
    We have used the FM 'CONVERT_ABAPSPOOLJOB_2_PDF' to convert the list output to PDF. It creates the spool number in SP01 and PDF is getting generated.
    But, in our SAP ECC 6.0 server all spools are redirected to printer by default and get printed because it configured like that. We requested BASIS people to reconfigure but they said no for a single report.
    So we need to find the alternate solution to generate the PDF without spool. We have searched in sdn, but didnot get any alternate solution.
    Please help us in this regard.
    Thanks in advance.

    data: begin of i_list occurs 0,
    line(255),
    end of i_list.
    data:i_mara like mara occurs 0 with header line.
    parameters: p_matnr like mara-matnr.
    start-of-selection.
    set pf-status 'PDFFILE'.
    select *
         from mara
         into table i_mara
        where matnr = p_matnr.
    loop at i_mara.
      write:i_mara-matnr,i_mara-ernam,i_mara-pstat.
      endloop.
    at user-command.
    if sy-ucomm = 'PDF'.
    DO.
    READ LINE SY-INDEX.
    IF SY-SUBRC NE 0.
    EXIT.
    ELSE.
    I_LIST = SY-LISEL.
    APPEND I_LIST.
    ENDIF.
    ENDDO.
    NEW-PAGE PRINT ON DESTINATION 'LP03' IMMEDIATELY ' ' COVER TEXT ' ' KEEP IN SPOOL 'X' NEW LIST IDENTIFICATION 'X' LINE-SIZE 132 LINE-COUNT 65 NO DIALOG.
    LOOP AT I_LIST.
    IF I_LIST-LINE IS INITIAL.
    SKIP.
    ELSE.
    at first.
      write: TEXT-001.
      endat.
    WRITE: I_LIST-LINE+0(132).
    ENDIF.
    ENDLOOP.
    NEW-PAGE PRINT OFF.
    data:filename like RLGRAP-filename value 'C:\PDFFILE.PDF'.
    DATA: SPOOL TYPE TSP01-RQIDENT.
    SPOOL = SY-SPONO.
    SUBMIT rstxpdft4
    WITH spoolno = spool
    WITH download = 'X'
    WITH p_file = filename
    AND RETURN.
    if sy-subrc = 0.
    write: 'pdf file generated'.
    else.
      write:'pdf file not generated'.
      EXIT.
      endif.
          endif.
    please paste this code and check once ,if it works modify the code according to ur requirement.
    regards,
    padmaja

  • Batch convert Pages files to Doc and stay in the same folder?

    Hi there,
    I use iWork '09 on Mountain Lion. I recently switched to Microsoft Word and prefer it over Pages (personal preference). However, I have nearly 1000 files on my computer that are in Pages format. I have extensively searched this issue in the Apple Support Communities and it appears that there are scripts that DO EXIST that batch convert Pages files into Word files. However, it appears that many of these scripts were built for older versions of iWork and therefore I run into various errors. For example, I used the script available at http://pagesfaq.blogspot.com/2008/01/export-folder-to-word-rtf-pdf-txt-or.html and click run but nothing actually happens (the script runs for less than a second, then I can click run again). I was able to use one script successfully (pasted below), but the only reason I can't use it is because it saves ALL my converted documents in one folder on my desktop and I would like a script that can save them in the original file were the Pages document is located.
    So, is there an iWork '09 compatible script that can convert my Pages documents to Word documents and save them in the same folder as the original? Oh, and for an added bonus, it'd be cool if the script also deleted my Pages version after it was done with the conversion
    --[SCRIPT batch_exportPages2DOC] (* Enregistrer ce script en tant que script ou progiciel. Exécuter ce script ou déposer l'icône d'un dossier sur son icône. Il ouvre tout document Pages du dossier et l' enregistre en fichier DOC  dans le dossier "was_Pages_now_DOC". Celui-ci peut être sur le bureau ou dans le dossier "~/Documents". Si le GUIscripting n'est pas activé le script demande votre mot de passe pour l'activer. Le script récupère le dossier d'exportation par défaut dans le fichier de préférences de Pages. Éviter de cliquer durant l'exécution du script sauf évidemment pour sélectionner le dossier source. ************* Save the script as script or application bundle. Run it or drag and drop a folder icon on its icon. It opens every Pages's documents stored in the folder and save it as DOC file in a folder named "was_Pages_now_DOC". This one may be on the desktop or in the "~/Documents" folder. according to the property storeOnDesktop. If GUIscripting is disabled the script ask for your password to enable it. The script extract the default export path from the Pages's preferences file. Don't click when the script is running. Except, of course, to select the source folder. ************* Yvan KOENIG (VALLAURIS, France) 2008/04/20 2009/06/17 adapté pour format .doc 2009/12/13 updated for MacOs 10.6… *) property theApp : "Pages" property theExt : "pages" property nomDuRapport : "report_Pages2DOC.txt" property nom_du_dossier : "was_Pages_now_DOC" property storeOnDesktop : true (* true = dest folder will be on Desktop false = dest folder will be in "~/Documents" *) property msg1 : "" -- globale property msg90 : "" -- globale property msg91 : "" -- globale -- property msg92 : "" -- globale property msg94 : "" -- globale property msg96 : "" -- globale property msg99 : "" -- globale property rapport : "" -- globale property dossierDeStockage : "" -- globale property dossierParDefaut : "" -- globale property localExport : "" -- globale property newExt : "" -- globale property newType : "" -- globale property isOs4 : missing value -- globale property isOs5 : missing value -- globale property theMenu : missing value -- globale property menuExport : missing value -- globale property types : {{"doc", "SLDocumentTypeMSWord", 2}, {"pdf", "SLDocumentTypePDF", 1}, {"txt", "SLDocumentTypePlainText", 4}, {"rtf", "SLDocumentTypeRichText", 3}, {"rtfd", "SLDocumentTypeRichTextBundle"}, 3} --===== (* our settings *) property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *) property theButton : missing value (* 1          button PDF 2          button Word 3          button RTF 4 button Standard *) --===== on run (* lignes exécutées si on double clique sur l'icône du script application • lines executed if one double click the application script's icon *)             tell application "System Events" to set dossier to choose folder (* dans un bloc System Events pour avoir un titre de dialogue "localisé" • in a System Events block to get a localized dialog title. *)           my commun({dossier})             --          my commun({"Macintosh HD:Users:yvan_koenig:Desktop:for_see:" as alias}) end run --===== on open (sel) (* sel contient une liste d'alias des éléments qu'on a déposés sur l'icône du script (la sélection) • sel contains a list of aliases of the items dropped on the script's icon (the selection) *)           my commun(sel) end open --===== on commun(elems)           my nettoie()           my prepareMessages()             tell application "System Events"                     if not (UI elements enabled) then set (UI elements enabled) to true (* Active le GUI scripting • Enable GUI scripting *)                     set titres to title of processes           end tell -- to System Events             if theApp is not in titres then my activateTheApp() (* Active et ferme la fenêtre du document créé à l'ouverture • Activate and close the doc's window created at opening *)           set {newExt, newType, theButton} to item typeNum of types (* item 1 = {"doc", "SLDocumentTypeMSWord",2} item 2 = {"pdf", "SLDocumentTypePDF",1} item 3 = {"txt", "SLDocumentTypePlainText",4} item 4 = {"rtf", "SLDocumentTypeRichText",3} item 5 = {"rtfd", "SLDocumentTypeRichTextBundle",3} *)           set sysAtt to (system attribute "sys2")           if 4 > sysAtt then                     if my parleAnglais() then                               error "This script requires MacOs X 10.4 or higher !"                     else                               error "Ce script requiert MacOs X 1.4 ou ultérieur !"                     end if           else if 5 > sysAtt then                     set isOs4 to true                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 9                     end if           else if 6 > sysAtt then                     set isOs4 to false                     set isOs5 to true                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           else                     set isOs4 to false                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           end if           my fermeFenetres() (* • Close existing windows *)             my afficheLeMessage(msg1) (* Éviter de cliquer… • Don't click… *)           tell application theApp to set localExport to localized string "Export"           set dossierParDefaut to my getDefaultExport() as text           set rapport to ""           set dossierDeStockage to my creeDossierDeStockage(nom_du_dossier) (* Unicode text *)             try                     repeat with elem in elems                               try                                         my exploreTraite(elem as alias, "")                               end try                     end repeat                       if rapport = "" then set rapport to msg90                     -- crée un fichier texte sur le Bureau                     set p2d to path to desktop                     set p2r to (p2d as Unicode text) & nomDuRapport                     tell application "System Events"                               if exists (file p2r) then delete (file p2r)                               make new file at end of p2d with properties {name:nomDuRapport}                     end tell                     set rapport to rapport as text                     write rapport to (p2r as alias)             on error MsgErr number NroErr                     if NroErr is not -128 then                               beep 2                               tell application (path to frontmost application as string) to ¬                                         display dialog "" & NroErr & " : " & MsgErr with icon 0 buttons {msg99} giving up after 20                     end if -- NroErr is…                     return           end try             my nettoie()           if my parleAnglais() then                     my afficheLeMessage("Export done.")           else                     my afficheLeMessage("Traitement terminé.")           end if end commun --===== on nettoie() (* pour ne pas stocker dans le fichier script • So it will not be stored in the script file *)           set dossierDeStockage to ""           set dossierParDefaut to ""           set rapport to ""             set localExport to ""           set newExt to ""           set newType to ""           set isOs4 to missing value           set isOs5 to missing value           set theMenu to missing value           set menuExport to missing value           set theButton to missing value           set msg1 to ""           set msg90 to ""           set msg91 to ""           set msg92 to ""           --           set msg94 to ""           set msg96 to ""           set msg99 to " " end nettoie --=====  on afficheLeMessage(m)           beep 1           tell application (path to frontmost application as string)                     activate                     if my parleAnglais() then                               display dialog m buttons {" OK "} default button 1 giving up after 10                     else                               display dialog m buttons {" Vu "} default button 1 giving up after 10                     end if           end tell end afficheLeMessage --===== on creeDossierDeStockage(Nom) (* S'il n'existe pas, construit un dossier destination sur le bureau ou dans "~/Documents" • If does not exist, create a destination folder on the desktop or in "~/Documents" *)           local dd, dds           if storeOnDesktop is true then                     set dd to path to desktop as Unicode text           else                     set dd to path to documents folder as Unicode text           end if             if Nom ends with ":" then                     set dds to dd & Nom           else                     set dds to dd & Nom & ":"           end if           (* dossierDeStockage n'existe pas, on le crée • dossierDeStockage is not available, build it *)           tell application "System Events" to if not (exists item dds) then make new folder at end of folder dd with properties {name:Nom}           return dds as Unicode text end creeDossierDeStockage --===== on exploreTraite(elem, ptree) (* elem est un alias • elem is an alias *)           local elem_, cl_, type_Id           set elem_ to elem as Unicode text           tell application "System Events" to tell disk item elem_                     set cl_ to class                     if cl_ is folder then                               set type_Id to ""                     else                               set type_Id to type identifier                     end if           end tell --  "System Events"           set cl_ to cl_ as Unicode text             if type_Id is in {"com.apple.iwork.pages.pages", "com.apple.iwork.pages.sffpages"} then (* C'est un fichier Pages. • It's a Pages document *)                     my TraiteUnDocument(elem_)           else if cl_ is in {"file package", "«class cpkg»"} then                     set rapport to rapport & msg91 & elem_ & return (* "Package", Attention, un package EST un dossier "spécial". • Caution, a package IS a "special" folder. *)           else if cl_ is in {"folder", "«class cfol»"} then                     my ExploreUnDossier(elem_, ptree)           else                     set rapport to rapport & msg92 & elem_ & return (*  "Pas un document Pages". • "Not a Pages's document" *)           end if -- typeId_ is … end exploreTraite --===== on ExploreUnDossier(dossier, ptree)           local nomElement, cheminElement, c           repeat with nomElement in list folder dossier without invisibles                     set cheminElement to dossier & nomElement                     tell application "System Events" to set c to name of (dossier as alias)                     my exploreTraite(cheminElement as alias, ptree & c & ":")           end repeat end ExploreUnDossier --===== on TraiteUnDocument(leCheminOriginal_UniText)           my export2Doc(leCheminOriginal_UniText as alias, leCheminOriginal_UniText) end TraiteUnDocument --===== on export2Doc(p, leCheminOriginal_UniText) (* • here p is the path as alias *)           local flag, nom_de_p, nouveauChemin, w, bof, x, p_xport           try                     tell application theApp                               open p                               set flag to false                               repeat 300 times (* Attends que le fichier soit réellement ouvert. • Wait until the file is really open *)                                         if my getNbWindows() > 0 then                                                   set flag to true                                                   exit repeat                                         end if                               end repeat                     end tell -- to theApp                     if flag is false then error number 8888 (* Le fichier n'a pu être ouvert. • The file can't be open. *)           on error MsgErr number NroErr                     if NroErr = 8888 then                               set rapport to rapport & msg94 & leCheminOriginal_UniText & return                     else                               set rapport to rapport & "### " & MsgErr & " ### " & errNbr & return                     end if                     return (* can't do the remaining tasks *)           end try             tell application "System Events" to tell file leCheminOriginal_UniText                     set nom_de_p to name           end tell -- System Events             if nom_de_p ends with theExt then set nom_de_p to text 1 thru -(2 + (length of theExt)) of nom_de_p           set nouveauChemin to dossierParDefaut & nom_de_p & "." & newExt           --log nouveauChemin           tell application "System Events" to if exists (file nouveauChemin) then set name of file nouveauChemin to nom_de_p & my horoDateur(modification date of file nouveauChemin) & "." & newExt (* name stamped *)           try                     set {w, bof} to my getFrontWindow()                       tell application "System Events" to tell application process theApp                               click menu item menuExport of menu 1 of menu bar item theMenu of menu bar 1 (* Exporter… *)                               repeat until exists sheet 1 of window w                                         delay 0.1                               end repeat                               tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *)                                         --          get properties of UI elements of radio group 1                                         if isOs4 then                                                   click button theButton of radio group 1                                         else if isOs5 then                                                   click checkbox theButton of radio group 1                                         else                                                   click radio button theButton of radio group 1 (* I hope that they will no longer change it *)                                         end if -- isOs4 is true                                         (*                                         if typeNum is 2 then                                                   delay 0.2                                                   tell pop up button 1                                                             click                                                             click menu item quality of menu 1                                                   end tell                                                   delay 0.2                                         end if                                         *)                                         click button 1 (* Suivant… *)                                         repeat until exists button localExport                                                   delay 0.1                                         end repeat                                         click button localExport (* Exporter… *)                               end tell -- to sheet…                                 repeat 20 times                                         if exists sheet 1 of window w then                                                   click button 2 of sheet 1 of window w (* "Ne pas consulter " dans éventuel rapport d'anomalies • "Don't review" in sheet reporting possible export anomalies *)                                                   exit repeat                                         end if                                         delay 0.1                               end repeat                     end tell -- to process … System Events                       if dossierDeStockage is not dossierParDefaut then (* we must move the file from folder dossierParDefaut to folder dossierDeStockage *)                                 set p_xport to dossierDeStockage & nom_de_p & "." & newExt                                 tell application "System Events" to if exists (file p_xport) then set name of file p_xport to nom_de_p & my horoDateur(modification date of file p_xport) & "." & newExt                               tell application "Finder" to duplicate file nouveauChemin to folder dossierDeStockage (*                               • before 10.5, System Events is unable to move *)                                 my wait4File(p_xport)                                 tell application "System Events" to if exists file nouveauChemin then delete file nouveauChemin                     end if -- dossierDeStockage is not…                     my ferme1fenetre()             on error errMsg number errNbr                     set rapport to rapport & msg96 & p & return & errMsg & " ### " & errNbr & return           end try end export2Doc (* ===== • Build a stamp from the modification date_time *) on horoDateur(dt)           local annee, mois, jour, lHeure, lesSecondes, lesMinutes           set annee to year of dt           set mois to month of dt as number (* existe depuis 10.4 *)           set jour to day of dt           set lHeure to time of dt           set lesSecondes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           set lesMinutes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           return "_" & annee & text -2 thru -1 of ("00" & mois) & text -2 thru -1 of ("00" & jour) & "-" & text -2 thru -1 of ("00" & lHeure) & text -2 thru -1 of ("00" & lesMinutes) & text -2 thru -1 of ("00" & lesSecondes) (* • Here, the stamp is  "_YYYYMMDD-hhmmss" *) end horoDateur (* ===== • Take care, the front window may be an Inspector or a dialog one. *) on getFrontWindow()           local namesOfWindows, w, flag           tell application theApp to activate           set flag to false           tell application "System Events" to tell application process theApp                     set namesOfWindows to name of every window                     repeat with w in namesOfWindows                               if subrole of (get properties of window w) is "AXStandardWindow" then                                         set flag to true                                         exit repeat                               end if                     end repeat           end tell           return {w, flag} (* • w is the name of the front document's window *) end getFrontWindow (* ===== • Wait that the file is completely written on disk *) on wait4File(p) (* • p must be Unicode text *)           local oldSize, nnn, newSize           set oldSize to 0           tell application "System Events" to set nnn to name of file p             repeat                     try                               tell application "System Events" to set newSize to physical size of file p                               if oldSize < newSize then                                         set oldSize to newSize                               else                                         exit repeat                               end if                     end try           end repeat end wait4File --===== on activateTheApp()           local bof, status           tell application theApp to activate           if my getStartingStatus() is false then tell application "System Events" to tell application process theApp to keystroke return           repeat                     set {bof, status} to my getFrontWindow()                     if status is true then exit repeat           end repeat end activateTheApp (* ===== • Close existing open windows *) on fermeFenetres()           repeat while my getNbWindows() > 0                     my ferme1fenetre()           end repeat (* • Now there is no open window *) end fermeFenetres --===== on ferme1fenetre()           tell application theApp to activate           tell application "System Events" to tell application process theApp to keystroke "w" using {command down} end ferme1fenetre --===== on getPlistValue(valName, default)           local thePlist, u           set thePlist to (path to preferences folder as Unicode text) & "com.apple.iWork." & theApp & ".plist"           tell application "System Events"                     if exists file thePlist then                               tell contents of property list file thePlist                                         try                                                   set u to (value of property list item valName) (* Unicode Text *)                                         on error (* On est là si Pages n'a rien enregistré avec des préférences neuves • Here if Pages never saved with the new preferences file. *)                                                   set u to default                                         end try                               end tell -- to contents of…                     else (* On est là s'il n'y a pas de fichier de préférences • Here if there is no preferences file. *)                               set u to default                     end if           end tell -- to system events           return u end getPlistValue --===== on getStartingStatus()           return my getPlistValue("LSDefaultsUseDefaultStartingPoint", false) end getStartingStatus --===== on getDefaultExport()           local u           (* son of a *****, I forgot that they don't use the same name !! *)           if theApp contains "Pages" then                     set u to my getPlistValue("SLDocumentDefaultExportDirectory", "~/Documents")           else if theApp contains "Numbers" then                     set u to my getPlistValue("LSDocumentDefaultExportDirectory", "~/Documents")           else                     error "I didn't coded a Keynote version !"           end if             set u to (POSIX file (do shell script "echo " & u)) as text           if u ends with ":" then                     return u           else                     return (u & ":")           end if end getDefaultExport --===== on getNbWindows()           tell application "System Events" to tell application process theApp to return count of windows end getNbWindows --===== on getLocale(a, x)           tell application a to return localized string x end getLocale --===== on getVersion()           try                     tell application theApp to return version           on error                     return "1"           end try end getVersion --===== on parleAnglais()           local z           try                     tell application theApp to set z to localized string "Cancel"           on error                     set z to "Cancel"           end try           return (z is not "Annuler") end parleAnglais --===== on prepareMessages()           if my parleAnglais() then                     set msg1 to "Don’t click when the script is running." & return & "Except, of course, if it ask for."                     set msg90 to "No problem during the export process."                     set msg91 to "Package"                     set msg92 to "Not a " & theApp & "’s document"                     --                     set msg94 to theApp & " can’t read it"                     set msg96 to "Not copied."                     set msg99 to "Oops"           else                     set msg1 to "Éviter de cliquer durant l’exécution du script" & return & "sauf s’il le demande."                     set msg90 to "Exportation réussie sans incident."                     set msg91 to "Package"                     set msg92 to "Pas un document " & theApp                     --                     set msg94 to theApp & " n’a pas pu le lire"                     set msg96 to "Pas copié."                     set msg99 to " Vu "           end if           set msg91 to "### " & msg91 & " ###  "           set msg92 to "### " & msg92 & " ###  "           --           set msg94 to "### " & msg94 & " ###  "           set msg96 to "### " & msg96 & " ###  " end prepareMessages --===== --[/SCRIPT]

    Try this app: http://tyorex.com/iWorkConverter
    Batch convert Pages files to doc and pdf.

  • Put logo in ABAP list/smallest font when sending to spool

    Hi Gurus,
    I have a requirement. I did a ABAP list, not ALV, classic one, I also send it to spool and then convert to pdf and download to pc.
    Now our customer wants a logo for it, also as the report is long, when print it or downloading it to pdf, some of parts are missing. So they say that can't we take it in smallest fonts??
    So is it possible to place logo for a classic ABAP list and is it possible to send it in smallest fonts when sending to spool or downloading to pdf??
    I will be pleased for your replies.
    Thanks.

    Hi,
    ABAP lists are simple reports with just rows and columns with text only. it is not possible to put a graphic into an ABAP list. For graphics, you need to use a sapscript form or smartform to create the spool.
    Regards,
    Aidan

  • ABAP list in Thai lang. is display properly after Unicode Conversion

    Recently at a customer site we converted our SAP ERP ECC6 to unicode from non-unicode,  Whenever there is some vowel in thai font at the beginning of the line , position of the line will shift right.
    1.  |  ุทรปราการ | aa |   >> abap list result
    2.  |  ุทรปราการ  | aa |  >> print result
    We have done as what SAP Note 947514 recommend but the issue is still not fixed.
    Please share any information you are having in this matter.
    Regards,

    Hi,
    Pl follow the below steps,
    1. If you print via access methods U/S and use SAPlpd, replace SAPlpd with SAPSprint (note 894444).
    2. If you print via access methods 'F', switch to access method 'G'.
    3. Download device type THSWINU that is attached to this note.
    4. Import the device type using report RSTXSCRP and assign it to package SPOO.
    5. Assign the device type to your output devices that formerly used THSAPWIN.
    Hope this helps,
    Thanks,
    Naga

  • How to convert report list to an excel

    HI all,
    i have a requriment that i want to convert list which has been displayed
    into excel format
    please help me

    Kiron, hi
      If it is a classical ABAP list (i.e. constructed using the WRITE keyword) then once the list is displayed, use the system drop down menu, then the list sub-menu, then the save sub-menu, then select the option 'Local file'. You will have radiobutton options representing the file formats to save to, one of which is spreadsheet.
    Good luck.

  • SO_NEW_DOCUMENT_ATT_SEND_API1 - Send ABAP List

    Hello,
    I have an Abap-List in an internal table and i want to sent this list via FM SO_NEW_DOCUMENT_ATT_SEND_API1 to an e-mail adress. But I have no idea, how to convert the abaplist (raw with length 1000) to the content_hex table (raw with length 255) under unicode (unicode check is active). Who can help me?
    Message was edited by: Hannes Zach

    Hi,
    you may have a look at note 478984. sample code enclosed in the note. I tried in my programs. it works.
    Rgds!
    Kevin

  • While Changing ABAP List from Spool to PDF Whole List is not displaying

    Hi,
    There is Z Program to convert Payslip ABAP List to PDF, when it is generating in PDF from Spool, I cannot view whole Payslip.
    Previously it is dislpaying fully in PDF file, But not Now.
    Please Help me...............
    With Regards,
    Gaurav.

    Hi,
    Thank you very much. My problem has been solved
    Thanks & Regards,
    Gaurav Mittal

  • Unable to convert ABAP Spool in Thai to a PDF.

    Hi
    I an issue where if I try to download an ABAP List output (Spool) to a PDF using CONVERT_ABAPSPOOLJOB_2_PDF (Also checked with RSTXPDF4), I am getting junk characters in place of Thai characters in the PDF.
    Any pointer on this will be of great help
    Regards
    Arjun

    hi check this example .......
    *& 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.

  • ABAP list report, multiple selections - select-options

    I have written a very simple ABAP list report, that contains a single select-option.  On the selection screen, I have the option of entering multiple values, with each new value being displayed directly underneath the old, but I am only getting the first value entered on the screen displayed.  Does anyone have any sample code for me?

    Hi Daniel,
    Select_Options consists of 4 parameters, in with the range consists in eg...
    Select-options s_vbeln for vbak-vbeln.
    then s_vbeln-low, s_vbeln-high are the range values...
    So whne you write select query.
    write vbeln in s_vbeln
    instead of vbeln eq s_vbeln
    Hope this solves your problem.
    Thanks & Regards,
    Dileep .C

  • ABAP list report wont print on Z device type with Z format

    Our developer have created a report which outputs data in ABAP list format and the standard format would not fit. We have since created a custom format and copied a device type in to custom device type. So we now have a custom format and custom device type. However when we print, it spools correctly and shows as green but the report wont print. The only thing that gets printed is
    "Sort criteria         AscdgDescndSubtotalGRAND  TOTAL  :               X                X     PROJ" "
    The abap list format is Z_100_500. Basically the report has 450 columns and hence we created this format.
    I am not sure what this means. I have been advised by SAP to follow instruction on note 17895 - Adapting print list formats for customers however i cant fully comprehend point 5 of the note and I believe this is why it wont print. Has anyone adapted ABAP list using this note. Can you please let me know how i should go about printer initialisation mentioned in the noted.
    We have checked everything however dont seem to get around the issue. Any ideas will be appreciated

    No comments

  • Total Page in ABAP List

    Hi Experts,
    I have a requirement to print: "Page XX of XX" in my ABAP List report (this report is meant to be printed).
    For Current Page, I know that the system field is SY-PAGNO.  But I can't find the field for Total Page. Is there anyway to print this (Total Page) since it means that we have to predict how long the report will be before we WRITE anything?
    Thanks a lot,
    Sam

    In the first statement of ur report u'll have to reserve some lines for footer as follows:
    REPORT <prg name> LINE-COUNT 25(2).
    here ur list will display 23 lines of data and then 2 lines are reserved for footer.
    This means that in each page u can display 23 lines of text.  Now depending on number of entries in your internal table which contains data to be displayed, we can calculate the number of pages required to print the total output.
    E.g: I have 62 records in my internal table, so to get the total number of pages use the following logic:
          (U can find out the number of recs in internal table dynamically using DESCRIBE stmt)
           62/23 = 2.69
           Round the result to the next integer using CEIL , so the next interger is 3.
           So ur total number of pages is 3.  And u now the current page number by sy-pagno.
    Hope this solves ur problem.

  • Inactivate the print button is the ABAP list

    How can I inactivate the print button in the report program (ABAP list)?
    I can inactive the print button on selection screen by using 'RS_SET_SELSCREEN_STATUS'. But can't achieve the same effect after the program jumped to the list output screen.
    Thanks!

    hi,
    To achieve this you need to create your own custom pf-status. The tcode for creating new pf-status is se41. Goto SE41, enter the program name and click create.
    Enter the menu bar buttons, application tool bar button and Function key as per your requirement. Active the pf-status. Once the pf-status is created, use this in your program using the statement.
    set pf-status 'ZPF'.
    Regards,
    Richa.

Maybe you are looking for

  • How to make an URL link in tabel connected to text or image?

    I have a tabel with cells. in each cell is a picture and the name of twitter accounts. Just like a Vcard Now I want to link the image or/and the accountname to the webpage of that twitter account. This doesn't seem to work in the normal link way opti

  • How to convert .mp2 audio files?

    I've been given a large quantity of .mp2 audio files. They play fine in QuickTime Pro, but I need to add them to iTunes. The inspector/properties in QT Pro says they are MPEG-1 audio files. Can anyone recommend any utilities (freeware, preferably) th

  • How would a corporation deploy Sun ONE Web Proxy Server?

    A corporation should deploy Sun ONE Web Proxy Server at the following key places: * The Internet gateway: Sun ONE Web Proxy Server deployed just behind the firewall facilitates access to the Internet and reduces response times and communications expe

  • 1.5 won't load on MacBook Pro

    I'm trying to update Aperture 1.1.2 to 1.5 on my MacBook Pro. I've got the Academic version of Aperature. But when I try to update, the updater tells me I have to have Aperture installed. I do. What gives? I tried repairing all permissions, but it do

  • CSS or What?

    Can someone assist as I don't know how to accomplish this tasks. I would like for all the squares areas to stay the same as I will be placing pictures and linking them with videos. Basically, I would like for the first row to look like the 2nd and 3r