How to download a ABAP report to text file

Hi Experts,
  I want to save a ABAP report to a local file in my PC (*txt format).  Since it uses a lot of includes, I have to download those ones too..   Is there is quickway to save the main program and all it's subprograms to a text file ?
Regards
Shibu

Hi,
Try this report, it will solve u r problem,
TABLES:TRDIR.
SELECT-OPTIONS: PGMNAME FOR TRDIR-NAME.
CONSTANTS:  LINESIZE value 2048.
PARAMETERS:
             HEADING AS CHECKBOX DEFAULT 'X',
             FGROUP AS CHECKBOX,
             USER LIKE TRDIR-CNAM DEFAULT '*',
             DOWNLOAD AS CHECKBOX default 'X',
             pa_TEXTP AS CHECKBOX,
             DOWNDIR(80) DEFAULT 'C:\temp\',
             chg_date(8) default '19000101',
             chg_time(6) default '000000'.
            PGMNAME like TRDIR-NAME.
DATA:
     W_TEXT(128),
     W_FILENAME(128),
     W_PROGRAM_LOW(8),
     W_PROGRAM_HIGH(8).
DATA:
    _texttab type textpool,
     texttab type standard table of textpool initial size 0
       with header line,
    BEGIN OF TEXTTAB OCCURS 0,
                    ID(1),
                    KEY(8),
                    ENTRY(70),
    END         OF TEXTTAB,
     BEGIN OF ABAPTAB OCCURS 500,
                    LINE(72),
                      line(LINESIZE),
     END         OF ABAPTAB,
     BEGIN OF TRTAB OCCURS 0,
                     NAME LIKE         TRDIR-NAME,
                     ENTRY LIKE       TEXTTAB-ENTRY,
                     CDAT LIKE         TRDIR-CDAT,
                     UDAT LIKE         TRDIR-UDAT,
     END                 OF TRTAB,
     BEGIN OF TRFTAB OCCURS 0,
                     NAME LIKE         TRDIR-NAME,
                     ENTRY LIKE       TEXTTAB-ENTRY,
                     CDAT LIKE         TRDIR-CDAT,
                     UDAT LIKE         TRDIR-UDAT,
     END OF TRFTAB.
START-OF-SELECTION.
     IF FGROUP = ' '.
                     PERFORM LOAD_TRDIR_PROGRAM.
                     PERFORM PROCESS_PROGRAM.
     ELSE.
                     PERFORM LOAD_TRDIR_FGROUP.
                     PERFORM PROCESS_FGROUP.
     ENDIF.
*&                                         form load_trdir_program.
FORM LOAD_TRDIR_PROGRAM.
     SELECT * FROM TRDIR
                     WHERE NAME IN PGMNAME
                       and sdate >= chg_date
                       and stime >= chg_time.
                     IF USER <> '*'.
                                     CHECK TRDIR-UNAM = USER OR
                                     TRDIR-CNAM = USER.
                     ENDIF.
                     CLEAR: TEXTTAB.
                     REFRESH: TEXTTAB.
                     CLEAR: TRTAB.
                     READ TEXTPOOL TRDIR-NAME INTO TEXTTAB LANGUAGE 'E'.
                     IF SY-SUBRC = 0.
                                     READ TABLE TEXTTAB WITH KEY 'R'.
                                     MOVE TEXTTAB-ENTRY TO TRTAB-ENTRY.
                     ENDIF.
                     MOVE TRDIR-NAME         TO TRTAB-NAME.
                     MOVE TRDIR-CDAT         TO TRTAB-CDAT.
                     MOVE TRDIR-UDAT         TO TRTAB-UDAT.
                     APPEND TRTAB.
                     CLEAR: TEXTTAB.
     ENDSELECT.
ENDFORM.     "         load_trdir_program
*&                                         Form load_trdir_fgroup
FORM LOAD_TRDIR_FGROUP.
     SELECT * FROM TRDIR
                     WHERE NAME BETWEEN 'SAPLYYYY' AND 'SAPLZZZZ'.
                     CHECK TRDIR-UNAM = USER OR TRDIR-CNAM = USER.
                     CLEAR: TEXTTAB.
                     CLEAR: TRTAB.
                     REFRESH: TEXTTAB.
                     READ TEXTPOOL TRDIR-NAME INTO TEXTTAB LANGUAGE 'E'.
                     IF SY-SUBRC = 0.
                                     READ TABLE TEXTTAB WITH KEY 'R'.
                                     MOVE TEXTTAB-ENTRY TO TRTAB-ENTRY.
                     ENDIF.
                     MOVE TRDIR-NAME TO TRTAB-NAME.
                     MOVE TRDIR-CDAT TO TRTAB-CDAT.
                     MOVE TRDIR-UDAT TO TRTAB-UDAT.
                     APPEND TRTAB.
                     CLEAR: TEXTTAB.
     ENDSELECT.
     LOOP AT TRTAB.
                     MOVE-CORRESPONDING TRTAB TO TRFTAB.
                     APPEND TRFTAB.
                     MOVE TRTAB-NAME+3(5) TO W_PROGRAM_LOW.
                     MOVE '%' TO W_PROGRAM_LOW+5(1).
                     MOVE TRTAB-NAME+3(5) TO W_PROGRAM_HIGH.
                     MOVE 'MMMMMMMM' TO W_PROGRAM_HIGH.
                     SELECT * FROM TRDIR
                                     WHERE NAME LIKE W_PROGRAM_LOW.
*where name between w_program_low and w_program_high.
                                     CHECK TRDIR-NAME+5(1) <> '$'.
                                     CHECK TRDIR-NAME(5) =
                                     TRTAB-NAME+3(5).
                                     READ TEXTPOOL TRDIR-NAME INTO
                                     TEXTTAB LANGUAGE 'E'.
                                     READ TABLE TEXTTAB WITH KEY 'R'.
                                     MOVE TEXTTAB-ENTRY TO TRFTAB-ENTRY.
                                     MOVE TRDIR-NAME TO TRFTAB-NAME.
                                     MOVE TRDIR-CDAT TO TRFTAB-CDAT.
                                     MOVE TRDIR-UDAT TO TRFTAB-UDAT.
                                     APPEND TRFTAB.
                     ENDSELECT.
     ENDLOOP.
ENDFORM.     " load_trdir_fgroup.
                                                FORM PROCESS_PROGRAM
FORM PROCESS_PROGRAM.
     LOOP AT TRTAB.
                     READ REPORT TRTAB-NAME INTO ABAPTAB.
                     IF DOWNLOAD = 'X'.
                         PERFORM DOWNLOAD_PROGRAMS USING TRTAB-NAME.
                     ELSE.
                         PERFORM LIST_PROGRAMS USING TRTAB-NAME.
                     ENDIF.
                     IF pa_TEXTP = 'X'.
                          READ TEXTPOOL TRTAB-NAME INTO TEXTTAB LANGUAGE
                          'E'.
                             IF SY-SUBRC = 0 AND DOWNLOAD = 'X'.
                                 PERFORM DOWNLOAD_TEXTPOOL USING
                                 TRTAB-NAME.
                             ENDIF.
                                 LOOP AT TEXTTAB.
                                     WRITE:/
                                     TEXTTAB-ID,
                                     TEXTTAB-KEY,
                                     TEXTTAB-ENTRY.
                                 ENDLOOP.
                     ENDIF.
     ENDLOOP.
ENDFORM.
                                                FORM PROCESS_fgroup
FORM PROCESS_FGROUP.
     LOOP AT TRFTAB.
                     READ REPORT TRFTAB-NAME INTO ABAPTAB.
                     IF DOWNLOAD = 'X'.
                         PERFORM DOWNLOAD_PROGRAMS USING TRFTAB-NAME.
                     ELSE.
                         PERFORM LIST_PROGRAMS         USING TRFTAB-NAME
                     ENDIF.
                     IF pa_TEXTP = 'X'.
                         READ TEXTPOOL TRFTAB-NAME INTO TEXTTAB LANGUAGE
                         'E'.
                             IF SY-SUBRC = 0 AND DOWNLOAD = 'X'.
                                  PERFORM DOWNLOAD_TEXTPOOL USING
                                  TRFTAB-NAME.
                                  LOOP AT TEXTTAB.
                                           WRITE:/
                                           TEXTTAB-ID,
                                           TEXTTAB-KEY,
                                           TEXTTAB-ENTRY.
                                  ENDLOOP.
                             ENDIF.
                     ENDIF.
     ENDLOOP.
ENDFORM.
*&                                       Form DOWNLOAD_PROGRAMS
FORM DOWNLOAD_PROGRAMS USING NAME.
     W_TEXT = 'Downloading'.
     W_TEXT+15(8) = NAME.
     CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
                TEXT = W_TEXT
          EXCEPTIONS
                OTHERS = 1.
     clear w_filename.
     MOVE DOWNDIR TO W_FILENAME(80).
    MOVE NAME TO W_FILENAME+20(8).
    MOVE '.txt' TO W_FILENAME+28(4).
    CONDENSE W_FILENAME NO-GAPS.
     concatenate w_filename name '.doc' into w_filename.
     condense w_filename no-gaps.
     CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
               FILENAME = W_FILENAME
               FILETYPE = 'ASC'
          TABLES
               DATA_TAB = ABAPTAB
          EXCEPTIONS
               FILE_OPEN_ERROR = 1
               FILE_WRITE_ERROR = 2
               INVALID_FILESIZE = 3
               INVALID_TABLE_WIDTH = 4
               INVALID_TYPE = 5
               NO_BATCH = 6
               UNKNOWN_ERROR = 7
               OTHERS = 8.
ENDFORM.   " DOWNLOAD_PROGRAMS
*&                                         Form LIST_PROGRAMS
FORM LIST_PROGRAMS         USING NAME.
     LOOP AT ABAPTAB.
                     WRITE:/ NAME, ABAPTAB-LINE.
     ENDLOOP.
ENDFORM.     " LIST_PROGRAMS
*&                                       Form DOWNLOAD_TEXTPOOL
FORM DOWNLOAD_TEXTPOOL                 USING NAME.
     W_TEXT = 'Textpool...'.
     W_TEXT+15(8) = NAME.
     CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
            EXPORTING
                    TEXT = W_TEXT
            EXCEPTIONS
                    OTHERS = 1.
     MOVE DOWNDIR TO W_FILENAME(80).
     MOVE TRTAB-NAME TO W_FILENAME+20(8).
     MOVE '.tpl' TO W_FILENAME+28(4).
     CONDENSE W_FILENAME NO-GAPS.
     CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
               FILENAME = W_FILENAME
               FILETYPE = 'ASC'
          TABLES
               DATA_TAB = TEXTTAB
          EXCEPTIONS
               FILE_OPEN_ERROR = 1
               FILE_WRITE_ERROR = 2
               INVALID_FILESIZE = 3
               INVALID_TABLE_WIDTH = 4
               INVALID_TYPE = 5
               NO_BATCH = 6
               UNKNOWN_ERROR = 7
                OTHERS = 8.
ENDFORM.             " DOWNLOAD_TEXTPOOL
TOP-OF-PAGE.
     IF HEADING = 'X'.
        Place your heading here:
                call function 'Z_WRITE_HEADER_FOOTER'
                        exporting
                          type = 'H'
                        exceptions
                          others = 1.
        skip 1.
     ENDIF.
Regards
Nilesh

Similar Messages

  • How To download a idoc to a text file

    Hi Gurus,
    Can anyone let me know how to download  idoc to  a text  file (Local).
    Thanks  in advance
    B S B.

    Hi,
    Check the code below...
    Reads an existing Idoc and dispays the contents in a spreadsheet format
    REPORT Z_DISPLAY_IDOC_AND_DATA line-size 275.
    * This tool reads an existing Idoc and dispays the contents in a       *
    * spreadsheet format. The spreadsheet (MS-EXCEL) will be automatically *
    * created if D_EXCEL = 'X'.                                            *
    data: idoc_control like EDIDC,
          NUMBER_OF_DATA_RECORDS like sy-dbcnt,
          NUMBER_OF_STATUS_RECORDS like sy-dbcnt,
          INT_EDIDS like edids occurs 0 with header line,
          INT_EDIDD like edidd occurs 0 with header line.
    TYPE-POOLS :  LEDID.
    data: STRUCT_TYPE TYPE  LEDID_STRUCT_TYPE ,
          IDOC_STRUCT TYPE  LEDID_T_IDOC_STRUCT,
          SEGMENTS TYPE  LEDID_T_SEGMENT,
          SEGMENT_STRUCT TYPE  LEDID_T_SEGMENT_STRUCT,
          excel_tab(2000) occurs 0 with header line.
    parameter: DOCNUM like edidc-docnum obligatory, ""Idoc Number
               sap_rel like SY-SAPRL default SY-SAPRL obligatory,
               pi_ver like EDI_VERREC-VERSION default '3' obligatory,
               d_excel as checkbox default 'X'. ""Download ?
    start-of-selection.
      perform read_idoc.
      perform process_idoc.
      if d_excel = 'X'.
        perform download_to_excel.
      endif.
    end-of-selection.
    FORM read_idoc.
      CALL FUNCTION 'IDOC_READ_COMPLETELY'
           EXPORTING
                DOCUMENT_NUMBER          = docnum
           IMPORTING
                IDOC_CONTROL             = idoc_control
                NUMBER_OF_DATA_RECORDS   = NUMBER_OF_DATA_RECORDS
                NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS
           TABLES
                INT_EDIDS                = INT_EDIDS
                INT_EDIDD                = INT_EDIDD
           EXCEPTIONS
                DOCUMENT_NOT_EXIST       = 1
                DOCUMENT_NUMBER_INVALID  = 2
                OTHERS                   = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "" read_idoc
    FORM process_idoc.
      perform read_idoc_structure.
      perform display_data_records.
    ENDFORM.                    "" process_idoc
    FORM display_data_records.
      data: PE_seg_HEADER like EDI_SAPI01,
            segname like EDI_IAPI12-SEGMENTTYP,
            prev_segname like EDI_IAPI12-SEGMENTTYP value ' ',
            pt_fields2 like EDI_IAPI12 occurs 0 with header line,
            PT_FVALUES2 like EDI_IAPI14 occurs 0 with header line,
            byte_first type i,
            byte_last type i,
            field_val(50),
            tmp_str(15),
            tmp_str3(15),
            seg_repeats type i value 0,
            tmp_str2(15),
            tab_cr(1) type x value '09',
            tot_ctr type i value 0,
            ctr type i value 0,
            msg(40) type c.
      data: IDOC_STRUCT_wa TYPE  LEDID_IDOC_STRUCT.
      sort int_edidd by segnum.
      describe table int_edidd lines tot_ctr.
      loop at int_edidd.
        move int_edidd-segnam to segname.
        clear msg.
        concatenate 'Reading segment ' segname
                    into msg separated by space.
        if tot_ctr <> 0.
          ctr = ( 100 * sy-tabix ) / tot_ctr.
        endif.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
             EXPORTING
                  PERCENTAGE = ctr
                  TEXT       = msg.
        add 1 to seg_repeats.
        clear tmp_str2.
        if int_edidd-segnam <> prev_segname.
          seg_repeats = 1.
          clear: pe_seg_header, pt_fields2, pt_fvalues2.
          refresh: pt_fields2, pt_fvalues2.
          CALL FUNCTION 'SEGMENT_READ_COMPLETE'
               EXPORTING
                    PI_SEGTYP                 = segname
                    PI_RELEASE                = sap_rel
                    PI_VERSION                = pi_ver
               IMPORTING
                    PE_HEADER                 = pe_seg_header
               TABLES
                    PT_FIELDS                 = pt_fields2
                    PT_FVALUES                = pt_fvalues2
               EXCEPTIONS
                    SEGMENT_UNKNOWN           = 1
                    SEGMENT_STRUCTURE_UNKNOWN = 2
                    OTHERS                    = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          prev_segname = int_edidd-segnam.
        endif.
        read table idoc_struct into idoc_struct_wa with key
                               segment_type = int_edidd-segnam.
        if sy-subrc = 0.
          IF IDOC_STRUCT_WA-SYNTAX_ATTRIB-MUSTFL = 'X'.
            TMP_STR = 'Mandatory'.                  ""Mandatory
          ELSE.
            TMP_STR = 'Optional'.                  ""Optional
          ENDIF.
          if IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-QUALIFIER = 'X'.
            tmp_str3 = 'Qualified'.
          else.
            tmp_str3 = 'Non-Qualified'.
          endif.
          shift IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
                                     left deleting leading '0'.
          move seg_repeats to tmp_str2.
          condense: IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX, tmp_str2.
          concatenate tmp_str2 'of'  IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
              into tmp_str2 separated by space.
          write :/ IDOC_STRUCT_wa-SEGMENT_TYPE,
               tmp_str,
               TMP_STR3,
               tmp_str2,
               IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP.
          if d_excel = 'X'.
            concatenate 'Segment Name' tab_cr
                        'Mand / Opt ' tab_cr
                        'Qual / non-Qual' tab_cr
                        'Seq of Max' tab_cr
                        'Level' tab_cr
                        'Owner' tab_cr
                        'Description'
                        into excel_tab.
            append excel_tab.
            concatenate IDOC_STRUCT_wa-SEGMENT_TYPE tab_cr
                  tmp_str tab_cr
                  TMP_STR3 tab_cr
                  tmp_str2 tab_cr
                  IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP
                  into excel_tab.
            append excel_tab.
            concatenate tab_cr
                        'Field Nma' tab_cr
                        'Type' tab_cr
                        'Length' tab_cr
                        'Byte From' tab_cr
                        'Byte To' tab_cr
                        'Description' tab_cr
                        'Value' tab_cr
                        'Qualifier Meaning'
                        into excel_tab.
            append excel_tab.
          endif.
        endif.
        sort pt_fields2 by field_pos.
        byte_first = 0.
        loop at pt_fields2.
          clear: field_val.
          byte_last = pt_fields2-EXTLEN.
          write int_edidd-sdata+byte_first(byte_last) to
                field_val left-justified.
          shift pt_fields2-EXTLEN left deleting leading '0'.
          shift pt_fields2-byte_first left deleting leading '0'.
          shift pt_fields2-byte_last left deleting leading '0'.
          write:/ '   ', pt_fields2-fieldname,
                  pt_fields2-datatype,
                  pt_fields2-EXTLEN,
                  pt_fields2-byte_first ,
                  pt_fields2-byte_last,
                  pt_fields2-descrp,
                  field_val.
          read table pt_fvalues2 with key fieldname = pt_fields2-fieldname
                        fldvalue_l = field_val.
          add byte_last to byte_first.
          if sy-subrc = 0.
            write : pt_fvalues2-descrp.
          else.
            clear pt_fvalues2-descrp.
          endif.
          if d_excel = 'X'.
            concatenate tab_cr pt_fields2-fieldname tab_cr
                    pt_fields2-datatype tab_cr
                    pt_fields2-EXTLEN tab_cr
                    pt_fields2-byte_first tab_cr
                    pt_fields2-byte_last tab_cr
                    pt_fields2-descrp tab_cr
                    field_val tab_cr
                    pt_fvalues2-descrp
                    into excel_tab.
            append excel_tab.
          endif.
        endloop.
      endloop.
    ENDFORM.                    "" display_data_records
    FORM read_idoc_structure.
      data: idoctype type LEDID_IDOCTYPE.
      if not idoc_control-cimtyp is initial.
        STRUCT_TYPE = 'E'. ""Extended
        idoctype = idoc_control-cimtyp.
      else.
        STRUCT_TYPE = 'B'. ""Basic
        idoctype = idoc_control-idoctp.
      endif.
      CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
           EXPORTING
                RELEASE              = sap_rel
                STRUCT_TYPE          = STRUCT_TYPE
                IDOCTYPE             = idoctype
                VERSION              = pi_ver
    *       IMPORTING
    *            IDOC_TYPE            = idoctype
           TABLES
                IDOC_STRUCT          = idoc_struct
                SEGMENTS             = segments
                SEGMENT_STRUCT       = segment_struct
           EXCEPTIONS
                IDOCTYPE_UNKNOWN     = 1
                IDOCSTRUCT_UNKNOWN   = 2
                SEGMENT_DATA_MISSING = 3
                ILLEGAL_STRUCT_TYPE  = 4
                OTHERS               = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "" read_idoc_structure
    FORM download_to_excel.
      data: name like RLGRAP-FILENAME.
      shift docnum left deleting leading '0'.
      concatenate docnum '-' idoc_control-idoctp '.xls'
                  into name.
      CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
       EXPORTING
         DATA_NAME                 = name
         DATA_TYPE                 = 'ASC'
         WAIT                      = ' '
       TABLES
         DATA_TAB                  = excel_tab
       EXCEPTIONS
         NO_BATCH                  = 1
         EXCEL_NOT_INSTALLED       = 2
         WRONG_VERSION             = 3
         INTERNAL_ERROR            = 4
         INVALID_TYPE              = 5
         CANCELLED                 = 6
         DOWNLOAD_ERROR            = 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.
    ENDFORM.                    "" download_to_excel
    Cheers
    VJ

  • How to download the SAP client into text file

    Hi,
    I want to download a SAP client to a text file for backup and then upload it again for restoration when needed. Can this be done?

    Hi,
    Regarding which data you want to export, you have to select the corresponding profiles in SCC8:
    If you want to export transaction data & master data (this is together known as application data), then you have to select the appropriate profile. Alongwith application data, customizing data would also be there, because it cant be transferred alone. ALso, you can choose whether to export user data or not.
    But please note that repository data (programs etc) would not be part of this export.
    The transaction is SCC8 for client export.
    For importing you can import like any other transport request.
    For details you could refer to the below link:
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c24c824ba111d189750000e8322d00/frameset.htm
    Thanks & Regards,
    Kunal.

  • How to generate reports in text file without totals

    Hi!!!
    Does anybody knows how can I generate a report in text file
    (separated by |), but without the lines with totalizations ?
    In my application, the user can choose if he wants the output
    in HTML,PDF or a text file. So, the solution to this question
    must be implemented in code.
    Thanks a lot,
    Anderson.

    If you put a formatting trigger on any item or frame and return FALSE, it will disappear.
    So the totals need to be within a frame which has a trigger which returns false if text file is chosen.

  • Download data to Fixed Length Text File

    Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?

    One way i would advice is to declare a text variable and move values using offset.
    Eg:
      move: <struc>-fld1 to l_text(8),
            <struc>-fld2 to l_text+8(3),
            <struc>-fld3 to l_text+11(15).
      transfer l_text to <file>.
    Try this approch and see the result.
    Kind Regards
    Eswar

  • How to send an abap report to an HTML file?

    hello this a two part question and This is the first question and I will post the next question after I am done with this.
    So here goes.
    My question is how do I send/download an abap report and convert it to an HTML file?
    Thanks guys take care!

    Hi Chand,
    This code will help.
    Generate an HTML file from a Report in ABAP  
    data: begin of itab occurs 0,
          matnr type mara-matnr,
          mtart type mara-mtart,
          matkl type mara-matkl,
          groes type mara-groes,
          end of itab.
    data: ifields type table of w3fields with header line.
    data: ihtml   type table of w3html   with header line.
    select * into corresponding fields of table itab
              from mara up to 100 rows.
    call function 'WWW_ITAB_TO_HTML'
    EXPORTING
    *   TABLE_ATTRIBUTES       = 'BORDER=1'
    *   TABLE_HEADER           =
        ALL_FIELDS             = 'X'
      tables
        html                   = ihtml
        fields                 = ifields
    *   ROW_HEADER             =
        itable                 = itab
    check sy-subrc = 0.
    call function 'GUI_DOWNLOAD'
         exporting          filename = 'c:test.html'
         tables          data_tab = ihtml

  • How to call  an abap report in BSP..

    hi all,
    Please can anybody tell me how to call an abap report in BSP application.....since I am new to BSP....
    with regards,
    Santosh

    check this thread
    Urgent!!  How to call a custom transaction or an ABAP program in BSP?

  • How do I generate a report in text format

    How do I generate a report in text format and send it to both a file and to a printer?
    Solved!
    Go to Solution.

    I run a series of tests on multiple stations and I need to generate a report, both electronic and one to be printed for a DHR (device history record), for each station. If I use file i/o as you suggested is the preferred approach to generate an electronic file and make the report from that, or generate both the electronic and hard copy report from arrays as the measurement data is acquired. Note that the electronic data is more detailed than the data in the hardcopy report.

  • How to download the custom Reports to xls from the system?

    Hi
    How to download the custom Reports to xls from the system?
    I know the t code SE38 for reports.
    Vijay

    Hi
    Here the programa name is nothing but a report name???
    Vijay

  • How to shedule an abap report to run paralely in more background session

    I wander how to shedule an abap report to run paralely in more background session.
    I am afraid of parallel locking.

    Hi,
    You can schedule different jobs with same program name.
    Use ENQUEUE_ & DEQUEUE_ to lock/unlock the records being process. The lock objects can be created in SE11.
    Best regards,
    Prashant

  • How to create a ABAP report off of SRM box for live data?

    How to create a ABAP report off of SRM box for live data?
    Thanks in advance.
    York.

    you can try infoset query:
    STEP - A:
    1. Go to T Code RSQ02 and give the InfoSet name & select CREATE.
    2. Provide the Name(Description) and Data Source i.e. for eg here i take "DIRECT READ OF TABLE" = /BIC/AODS100. Then CONTINUE.
    3. Select what to Include in the 3 options available with the POPUP, here "INCLUDE ALL TABLE FIELDS". Then Check the fields and click GENERATE(one RED and WHITE round icon).
    4. Now provide the PACKAGE for the INFOSET. Come Back(F3).
    STEP - B: optional(If u want to create a new user group)
    1. Select ENVIRONMENT -> USER GROUPS. Provide the User Group name and CREATE.
    2. Provide Description and SAVE.
    3. Provide PACKAGE and SAVE. Come Back (F3) to the Initial Screen.
    4. Click Role/User Group Assignment. Select Newly Created User Group or an existing one. Then SAVE (CTRL + S). F3.
    STEP - C:
    1. Select ENVIRONMENT -> Queries. Provide the query name and CREATE.
    2. Select the INFOSET u have created and assigned the user group.
    3. Provide the Title and Select BASIC LIST. There you have to select (check) the fields you want to display, SAVE and then TEST. It will ask for Variant, just CONTINUE.

  • How to find existed abap reports?

    how to find existed abap reports?

    Hi abapdoubts,
    on wich time do you want to find?
    In runtime? Than sy-repid.
    on dialog?  take F1 with further Infoemation.
    On the GUI on the riht_button corner, there are somw Information too.
    regards, Dieter

  • How to get summary columns in delimited text file

    How to get summary columns in delimited text file
    I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.

    Sorry there were a typos :
    When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
    Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ?

  • Print report into TEXT file format

    How am I going to produce a text file report from report builder?
    -- I want all the layout header, page number, time as preview windows.
    -- I use charactor mode to build the report, then use option "generate to file - delimited".(but the layout was messy)
    -- After save the file, the layout is totally different from preview window.
    How can I overcome this problem. Thank you for helping.

    hello Tan Chin Chye,
    if you create your report in character mode, then if you pass/set parameter mode to character, then you can create text file by supplying values for parameters destype (file), desformat (selected printer file - you may customize some for yourself - number of characters per line, number of lines pre page, some control sequences ...) and desname (name of file to create). not sure about creating such file from previewer, but you can try print and then print to file option ... in character mode this should produce plain text ...
    hth
    petr valouch, brainbench mvp for oracle programming, http://www.brainbench.com

  • How to download the script data into pdf file

    how to download the script data into pdf file
    i have one option to download the script data to pdf file --->rstxpdft4 program.
    i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
    Thanks and regards,
    Sri.

    Hi      Sri Sai,
    I know one method to convert the sapscript to pdf file :
    first generate a Spool Request for the required Sapscript
    then goto transaction SP01 and copy the generated Spool Request number
    now execute the SAP report RSTXPDFT4
    here enter the copied Spool request number and the target directory into the parameters
    execute the report
    required pdf file will be generated into the target directory
    i hope it will help you out
    Please refer this simple program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Reward points if found helpful....
    Cheers,
    Eshwar.

Maybe you are looking for