Exporting BDC program to Word or Notepad file

hellow sirs,
is ther any way out for Automating the Export of BDC program
( Source Code) into Word file or note pad file..
i.e.. whenever i run my BDC it performs its function as well as it copy its Source Code into Word File..
thanking  you
Rahul

HI Rahul .
Check this sample program to download source code of the program . Club your BDC program and this to get ur req done.
*& Report  YDWNLD_REP
REPORT  ydwnld_rep.
TABLES: trdir,trdirt,devaccess,tadir.
DATA: BEGIN OF itab OCCURS 0,
      text(300),
      END OF itab.
DATA program LIKE rlgrap-filename .
DATA: BEGIN OF int_reposrc OCCURS 0,
      progname LIKE trdir-name,
      END OF int_reposrc.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
*PARAMETER CNAM LIKE TRDIR-CNAM.
SELECT-OPTIONS: author FOR trdir-cnam.
SELECT-OPTIONS: pogram FOR trdir-name OBLIGATORY.
PARAMETERS: filename LIKE rlgrap-filename OBLIGATORY DEFAULT 'C:\'.
SELECTION-SCREEN END OF BLOCK b1.
SELECT * FROM devaccess.
  CLEAR author.
  author-sign = 'I'.
  author-option = 'EQ'.
  author-low =  devaccess-uname.
  APPEND author.
ENDSELECT.
SELECT name  FROM trdir INTO TABLE int_reposrc
                      WHERE name IN pogram
                      AND   cnam  IN author.
LOOP AT int_reposrc.
  CLEAR: itab,program.
  REFRESH itab.
  READ REPORT int_reposrc-progname INTO itab.
  IF sy-subrc = 0.
    CLEAR trdirt.
    SELECT SINGLE * FROM trdirt WHERE name  =  int_reposrc-progname
                                AND   sprsl = 'E'.
    CLEAR tadir.
    SELECT SINGLE * FROM tadir WHERE obj_name = int_reposrc-progname.
    CONCATENATE filename tadir-devclass '\' int_reposrc-progname '-'
                 trdirt-text '.TXT'  INTO program.
    IF NOT itab[] IS INITIAL.
      CALL FUNCTION 'WS_DOWNLOAD'
        EXPORTING
          filename                = program
          filetype                = 'DAT'
        TABLES
          data_tab                = itab
        EXCEPTIONS
          file_open_error         = 1
          file_write_error        = 2
          invalid_filesize        = 3
          invalid_type            = 4
          no_batch                = 5
          unknown_error           = 6
          invalid_table_width     = 7
          gui_refuse_filetransfer = 8
          customer_error          = 9
          no_authority            = 10
          OTHERS                  = 11.
    ENDIF.
  ENDIF.
ENDLOOP.
I hope that it helps u .
Regards,
Venkat.O

Similar Messages

  • Convert pdf files into wiki pages, and export wiki pages as word and pdf files

    I am working on an enterprise wiki site collection inside my SharePoint server 2013. And there was a requirement to automatically generate wiki pages from word documents. As I read that the built-in service within SharePoint does not support importing the
    pictures within the word documents. So I looked into 3rd party tools and I settle on the “Kaboodle Word to Wiki” link
    which will manage to convert word docs into wiki pages, with only minor layout problems.
    But I want to know if there are additional tools which support the following:-
    Converting pdf files to SharePoint wiki pages.
    Exporting SharePoint wiki pages into pdf and word documents?
    Regards

    I haven't seen any third party tool converting pdf files to SharePoint wiki pages and and exporting SharePoint wiki pages into pdf and word files.
    You need to write custom feature where you can use iTextSharp pdf for pdf conversion. you can also check below blog which shows the export of SharePoint Wiki to Word/PDF without 3rd party tools:
    http://blogs.msdn.com/b/thomsven/archive/2011/09/09/export-sharepoint-wiki-to-word-pdf-without-3rd-party-tools.aspx
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.
    the link you posted is a manual process for converting wiki to pdf ,, i was looking for a tool which allow converting wiki to pdf ?

  • Save the export parameter as an excel or notepad file in ecatt

    Hello,
    Que: I want to save the export parameter value to an excel or a notepad file in my ecatt script?
    Importing of notepad file can be handled as an external file variant input from test data container.
    But I am not able to export the value to a file.
    Kindly help.

    Well, dont know if that is like VB-Script
    but you could give it a try ...
    set xclapp = createObject("Excel.Application")
    set xclwbk = xclapp.Workbook.New
    set xclsht = xclwbk.Sheets("Tabelle1")
    xclsht.Cells(1,1).Value = [your Parameters go here!]
    set xclsht = Nothing
    xclwbk.close
    set xclwbk = nothing
    xclapp.quit
    set xclapp = Nothing

  • Changes in BDC program to upload data from text/excel file

    Hi friends i have obtained the BDc program after recording :
    start-of-selection.
    perform open_group.
    perform bdc_dynpro      using 'SAPLCOIH' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'AUFPAR-PM_AUFART'
                                  'PM01'.
    perform bdc_field       using 'CAUFVD-IWERK'
                                  '460a'.
    perform bdc_field       using 'CAUFVD-GSBER'
                                  '2460'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_dynpro      using 'SAPLCOIH' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'CAUFVD-KTEXT'
                                  'abc'.
    perform bdc_field       using 'CAUFVD-INGPR'
                                  'GM'.
    perform bdc_field       using 'CAUFVD-VAPLZ'
                                  'RTN_VELR'.
    perform bdc_field       using 'CAUFVD-VAWRK'
                                  '460A'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-GLTRP'.
    perform bdc_field       using 'CAUFVD-GSTRP'
                                  '1.8.2010'.
    perform bdc_field       using 'CAUFVD-GLTRP'
                                  '1.8.2010'.
    perform bdc_field       using 'CAUFVD-TPLNR'
                                  'RTNP-HIG'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_field       using 'AFVGD-INDET'
                                  '1'.
    perform bdc_field       using 'AFVGD-WERKS'
                                  '460A'.
    perform bdc_field       using 'AFVGD-STEUS'
                                  'PMIN'.
    perform bdc_field       using 'AFVGD-ARBEH'
                                  'H'.
    perform bdc_field       using 'AFVGD-DAUNE'
                                  'H'.
    perform bdc_dynpro      using 'SAPLCOIH' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-KTEXT'.
    perform bdc_field       using 'CAUFVD-KTEXT'
                                  'abc'.
    perform bdc_field       using 'CAUFVD-INGPR'
                                  'GM'.
    perform bdc_field       using 'CAUFVD-VAPLZ'
                                  'RTN_VELR'.
    perform bdc_field       using 'CAUFVD-VAWRK'
                                  '460A'.
    perform bdc_field       using 'CAUFVD-GSTRP'
                                  '01.08.2010'.
    perform bdc_field       using 'CAUFVD-GLTRP'
                                  '01.08.2010'.
    perform bdc_field       using 'CAUFVD-TPLNR'
                                  'RTNP-HIG'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_field       using 'AFVGD-LTXA1'
                                  'abc'.
    perform bdc_field       using 'AFVGD-INDET'
                                  '1'.
    perform bdc_field       using 'AFVGD-ARBPL'
                                  'RTN_VELR'.
    perform bdc_field       using 'AFVGD-WERKS'
                                  '460A'.
    perform bdc_field       using 'AFVGD-STEUS'
                                  'PMIN'.
    perform bdc_field       using 'AFVGD-ARBEH'
                                  'H'.
    perform bdc_field       using 'AFVGD-DAUNE'
                                  'H'.
    perform bdc_transaction using 'IW31'.
    perform close_group.
    after executing it has two options.one is for call transactioin and other is for with session.Now i want to do the uploading from text file.Please guide me how to achieve that and what should be the order of fields in the text file.I am just a beginner.I know how to do that with LSMW bt trying BDc first time for creating PM orders

    You can use class "cl_gui_frontend_services". First you must select file with "file_open_dialog" method and the you can upload file with "gui_upload" method into internal table. Here is a sample: (I didn't try the code but I'm sure you can get it working, there are lots of sample codes about that. You can also search FM "GUI_UPLOAD").
    REPORT  zreport.
    DATA:
    gv_subrc TYPE sysubrc,
    gv_result TYPE abap_bool,
    gt_data_tab type table of zstruc.
    PARAMETERS: p_fname LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
        PERFORM file_open_dialog USING space space space space
                            CHANGING p_fname gv_action gv_subrc.
    START-OF-SELECTION.
    PERFORM gui_upload TABLES gt_data_tab
                     USING p_fname  CHANGING gv_subrc.
    *** FORMS ***
    FORM file_open_dialog USING pv_window_title
                                pv_default_extension
                                pv_default_filename
                                pv_initial_directory
                       CHANGING pv_filename
                                pv_user_action
                                pv_subrc.
      DATA:
      lt_file_table TYPE filetable,
      lv_rc         TYPE i,
      lv_initial_directory TYPE string.
      IF pv_initial_directory IS INITIAL.
        PERFORM get_desktop_directory CHANGING lv_initial_directory.
      ELSE.
        lv_initial_directory = pv_initial_directory.
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = pv_window_title
          default_extension       = pv_default_extension
          default_filename        = pv_default_filename
    *     file_filter             =
    *     with_encoding           =
          initial_directory       = lv_initial_directory
    *     multiselection          =
        CHANGING
          file_table              = lt_file_table
          rc                      = lv_rc
          user_action             = pv_user_action
    *     file_encoding           =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5
      pv_subrc = sy-subrc.
      IF pv_subrc EQ 0.
        READ TABLE lt_file_table INTO pv_filename INDEX 1.
      ENDIF.
    ENDFORM.
    FORM gui_upload TABLES pt_data_tab
                     USING pv_filename
                  CHANGING pv_subrc    TYPE sysubrc.
      DATA:
      lt_data_tab TYPE TABLE OF string,
      lv_filename TYPE string.
      lv_filename = pv_filename.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename                = lv_filename
          filetype                = 'ASC'
         has_field_separator     = 'X'
    *     header_length           = 0
    *     read_by_line            = 'X'
    *     dat_mode                = SPACE
    *     codepage                = SPACE
    *     ignore_cerr             = ABAP_TRUE
    *     replacement             = '#'
    *     virus_scan_profile      =
    *     show_transfer_status    = 'X'
    *   IMPORTING
    *     filelength              =
    *     header                  =
        CHANGING
          data_tab                = lt_data_tab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          not_supported_by_gui    = 17
          error_no_gui            = 18
          OTHERS                  = 19
      pv_subrc = sy-subrc.
      IF pv_subrc EQ 0.
        pt_data_tab[] = lt_data_tab[].
      ENDIF.
    ENDFORM.

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • How can I display files in external program like Word?

    Using NetBeans 6.5, IE7, Windows XP
    I have not had any luck attempting to get a PDF file to display in a separate browser window,
    so I thought I might try to combine that with a new issue.
    I have 3 file types - jpg, rtf and pdf that should be able to be displayed in external programs like Word or Adobe.
    Is there a way to start an external application and pass the file name from a backing bean?
    The files would be located on the server in a directory that is mapped to the client and the applications (Word, etc.) would reside on the client.
    Can this be done from within the confines of a JSF application?
    Thanks

    I was kind of hoping that someone could point me to an example of how to do this.
    I've tried the servlet approach, but can't seem to get the file to display in a separate browser window.
    That is why I thought about maybe launching a separate application, if that is possible.

  • How to upload a multistructured file in BDC program using gui_upload?

    I want to upload a multistructured file in BDC program...in which some structures are repeating for multiple records..how to do this..
    BP_GEN_DATA     FR0100270154                         FR12345678902
    BP_PAYMENT     FR     0123456789     01234567890          
    BP_UNLOAD     MARSEILLE     X     FR                    
    BP_UNLOAD     PARIS          FR                         
    Here BP_GEN_DATA is root structure and BP_UNLOAD is lower level structure which is repeating

    Resolved

  • Why Acrobat x professional is changing the text formatting specifically the font family  and the font size of the text in my pdf on exporting it to Microsoft word file format ?How should i stop Acrobat x professional from doing that so that i get an exact

    Why Acrobat x professional is changing the text formatting specifically the font family  and the font size of the text in my pdf on exporting it to Microsoft word file format ?How should i stop Acrobat x professional from doing that so that i get an exactly same word file on exporting it from its pdf counterpart?

    I was testing the preciseness & efficiency of Adobe acrobat x professional's doc conversion capabilities. As i have to take a document editing project in future which is going to need lot of pdf to word and vice versa conversions . What I did was I created a test word document converted into a pdf using a pdf maker in my word 2007 , Acrobat did convert the document from word to pdf keeping everything in the source file intact , However when i tried the other way round and attempted to convert the same pdf to word 2007 file format I lost my formatting ?So the font that I used to create the pdf are the ones taken from word 2007 which i believe is using the fonts that are installed in my computer. Any suggestions on how to preserve the formatting of the document after converting it from pdf to word file format?
    Regards
    Mike

  • The export of a Crystal Reports to MS Word creates big files

    Hi all,
    if I export a report to pdf the file size is 72 KB . But if I export to Microsoft Word (97-2003) format, the filesize amounts to 1,35 MB.
    After I opened the exported document in MS Word and saved it with a new name, the size is only 176 KB.
    Is this a common problem? Is it possible to force crystal reports produce a smaller document?
    Why does Crystal Reports create such large files?
    (Environment: Crystal Reports 2008 SP1)
    Regards, Timo

    Hallo Don,
    first Iwill tell you, if I do export the Report to MS Word, in the FileDialog, it is only possible to create a *.rtf - File.
    Do it act normal?
    So due to your suggestion, i replaced an Image in the report (embedded as an OleObject) as a Graphic-JPG-Object.
    The size of the exported report has reduced from 1,39 MB to 141 KB.
    Thanks a lot!
    Timo

  • Exporting pdfs to word and excel file formats  and translating

    Hello, I am new to this forum and came here because I am a professional translator. Although we should be given documents in their original file format, in the real world translators have to convert pdfs such as manuals or annual reports into word or excel files. Given the fact we often work for agencies, and/or do not work directly with the people who created the original files inthe first place, with the best will in the world we normally have to make do with converting the pdf file, or lose the job.
    I would like advice on the best way to learn more about  pdf to word and excel conversion and ways of keeping formatting when it is helpful and removing what is not.
    The general problem is (well the problem is really ignorance on my part!) of course getting the "look and feel" similar in the converted document and knowing more about manipulating the formating and elements which get converted.
    Any help or pointers to online tutorials whether multimedia or text much appreciated.
    David Hardisty (david1610)

    Thank you Lori, this is so clear! I am a teacher as well and there are clear presentations and wonderfully clear presentations and this is in the latter category.
    A tiny suggestion. You would not believe how many pdf files exported to word I have received that are Portuguese content and the sender has not set the language to Portuguese! So in your text entry you might want to mention the language setting. I know it is obvious, but as we know sometimes we cannot see the obvious!
    I will need to look far more carefully at the final things in your video.
    Are there any special considerations for exporting pdf files as Excel? My original doubt was I had to translate some accounting documents. 95% of the document was numbers which did not changing (except for commas to periods and vice versa due to different separator conventions). I did not now how to just select e.g. the vertical column with text. I will go back and try with this suggestion because in this case the look and feel of the numbers was important and the precise fonts etc. seemed to cause problems. But now I am getting out of my depth!
    Thank you again!
    DavidHardisty

  • When I select the file to export from pdf to word, thens click the Export button, nothing happens.

    When I select the file to export from pdf to word, thens click the Export button, nothing happens.

    Firefox 19 was just released.  You may want to consider upgrading, then trying again.
    Glad to hear IE worked though!
    -David

  • It concerns adobe export pdf program. When we open  this program, it appears on the right of the screen." recognize the text in english"but. we would like to change it for french language. Because when we export the document under word program , it uses

    It concerns adobe export pdf program. When we open  this program, it appearsq on the right of the screen." recognize the text in english"but. we would like to change it for french language. Because when we export the document under word program , it uses english dictonnary to correct the text. thanks for your answer..

    [topic moved from Developers to Acrobat.com forum]

  • I just bought lightroom 5. I had lightroom 3. Now when I export my photos from lightroom 5 and upload them into my photoshop elements program to edit the photo files are at 100% zoom percentage. When I upload photos from my old lightroom 3 program they co

    I just bought lightroom 5. I had lightroom 3. Now when I export my photos from lightroom 5 and upload them into my photoshop elements program to edit the photo files are at 100% zoom percentage. When I upload photos from my old lightroom 3 program they come into photoshop at 14% zoom percentage which is what I want them to come in at so I can zoom them in to detail the skin. What might have changed settings wise between the 2 programs, I cannot figure it out.

    I just bought lightroom 5. I had lightroom 3. Now when I export my photos from lightroom 5 and upload them into my photoshop elements program to edit the photo files are at 100% zoom percentage. When I upload photos from my old lightroom 3 program they come into photoshop at 14% zoom percentage which is what I want them to come in at so I can zoom them in to detail the skin. What might have changed settings wise between the 2 programs, I cannot figure it out.

  • Office 365 installed, can't choose Word 2007 as the default program for docx and doc files

    I have a client who just installed Office 365 on his Windows 7 PC. He still has Office 2007 installed. He's struggling with the changes in Word 2013 and wants me to uninstall Office 365. I thought I'd just set the default program association for .docx and
    .doc programs to Word 2007 but that doesn't seem possible. I can choose Default Programs, Associate a file type etc., and find the .docx extension. The current default is Word (desktop). I highlight the .docx extension and choose Change Program. The older
    version of Word isn't listed so I click Browse and find Program Files\Microsoft Office\Office12\winword.exe. Click OK, OK, OK, etc, but .docx files still open in Word 2013. The Default Program applet evidently sees all versions of Word as the same and refuses
    to change the association. How do I accomplish this ridiculously simple task?

    Fixed. Used a great little app from NirSoft called
    FileTypesMan. The built-in Windows utilities are getting worse by leaps and bounds.

  • Run bdc program when flat file comes

    Hi friends
       I want to schedule my bdc program such that it automatically runs as soon as the flat file comes into application server.
    Please help me.
    Cheers
    Vamshi

    HI,
    Follow this procedure, it might help you.
    In the program, use following logic.
    IF SY-BATCH = 'X'. * This is for checking
                                   whether   program is set for back ground
                                    processing.
    open dataset .....
    if sy-subrc =0.
    process data.
    else.
    continue.
    endif.
    if you write this logic, as the background job will be scheduled for repetition at a certain interval thenautomatically the flat file will be checked and when it encounters, SY-SUBRC =0 ,the process starts , else no process will be  done.
    Hope this solves the problem.
    Reward points if helpful.
    Thanks and Regards.
    Edited by: Ammavajjala Narayana on May 29, 2008 11:36 AM

Maybe you are looking for