Is it possible in report program

Hi ,
I have one report program with some ' WRITE ' statement (Write : /   ' This is SAP world ' .)..For this report program i have got the output as  ( This is SAP world ) .
My requirement is i want to edit this statement (This is SAP world ) in the out put screen ,after that i want to perform some other steps...
For Eg: write : / ' This is SAP world ' .
Output : This is SAP world..
After the execution of the report program i have got the output
(This is SAP world ). then i need to edit this line for further requirement...Please help me out for this
Regards,
Ambili B

Hi,
try like below
write 'NORMAL FIELD'.
write / 'EDITABLE FIELD' input on.
Example
DATA lv_comment TYPE char80.
MOVE 'Enter ur comment here' TO lv_comment.
WRITE: / 'Comment : ',lv_comment INPUT ON.
AT LINE-SELECTION.
  CLEAR lv_comment.
  READ LINE sy-curow FIELD VALUE lv_comment.
  WINDOW STARTING AT 10 10
         ENDING   AT 40 15.
  WRITE 'COMMENT'.
  SKIP.
  WRITE lv_comment.
Cheers,
Jose.
Edited by: Jose on May 12, 2008 8:40 AM

Similar Messages

  • Itz possible to call one report program into another program

    hi guys,
                i had a doubt that can i call a report program into another report program by declaring their name into the second program like as we calling Includes ,function modules and like class and their methods .
    if  anybody done this or know how to do this,  give me the details and explination about this  friends
    if it possible with screenshots and codings
    Thanks & Regards
    Saigijeo

    Please search before posting, do not ask basic questions here.
    Always do your own work before turning to the community with specific problems.
    Thread locked.
    Thomas
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]

  • A report program

    hello,
    i hav created report program ....in which i hav printing data in two colums(sections)
    of a page....im printing first 'first column'...n then 'second one' ( i.e. im printing left side of page and then right side of page )  n  i hav declaired <b>line-count 60</b> ...while printing on left side if page ends due to line-count is set.....im not able to print on right of that page because page is set to next page( and it start printing from next page on right side as it is changed)...i want know that .... is it posiible to come back to previous page while printing in report program .....(as i hav mentioned problem ).....i want to know the code for that if possible....
    Regards,
    Gajanan Galande

    You can print first the right and then the left, using the BACK or  SKIP TO LINE <n>.  BACK can be used with or without RESERVE.   Also don't forget about POSITION <n> to set the output column.
    BACK returns to the first line of the current page after TOP-OF-PAGE
    You will have to monitor the number lines you print because once you overflow, you cannot BACK to a prior page.
    I hope this helps. 
    Look up in the ABAP help for examples of using these.
    Bob
    (Points are appreciated)

  • Calling a Report Program In Web Dynpro Using Submit statment

    Hi all,
             Can any one suggest how can i call a report program form Web Dynpro using Submit statment. I tried to call it its showing Field symbols not defined error. Is their any other ways to call Report in a Web Dynpro?. I have posted the error message when i tried using SUBMIT ZRR AND RETURN CONTROL
    Field symbol has not yet been assigned.
    The error occurred on the application server mnghcmsap_HRS_00 and in the work process 1 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Form: CHECKBOX_OUT of program SAPLKKBL
    Form: GEN_LINE_OUT of program SAPLKKBL
    Form: DATA_OUT_SIMPLE of program SAPLKKBL
    Form: LIST_OUTPUT_NEW of program SAPLKKBL
    Form: FIRST_LIST_DISPLAY of program SAPLKKBL
    Module: LIST_DISPLAY of program SAPLKKBL
    Function: K_KKB_LIST_DISPLAY of program SAPLKKBL
    Method: PRINT_BACKEND of program CL_GUI_ALV_GRID===============CP
    Method: SET_TABLE_FOR_FIRST_DISPLAY of program CL_GUI_ALV_GRID===============CP
    Form: PBO of program SAPLSLVC_FULLSCREEN
    Edited by: VINMANO on Jul 22, 2009 2:54 PM

    HI,
    Its possible to call report program from Web dunpro...
    chk out dis link,
    calling report(se38) in webdynpro abap
    By the way are using field symbol anywhere and left it unassigned?
    Thanks,
    Divya.S

  • How to reverse the changes made in a report program

    Hi Friends,
        I want to change a report program,but this report program is locked under one tp which is not yet released and it is in development only .I want to change the same report program but don't want to keep the changes done in the existing tp.I want to keep only changes which i will do.
    Please help me to achieve this task.
    Thanks in advance.
    Regards,
    Rajesh

    hi
    if u have done<b> Version Management</b> then u can retrieve the previous version of ur report
    <b>Version Management is done in utilities -> versions ->Version Management</b>
    otherwise its not possible.
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • How to do the Validations in Report Programming?

    How to do the Validations in Report Programming?
    how to do screen Validations and Field Validations if posssible can any one send the code regarding the Validation ....
    Tks
    Durusoju

    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr.
    Alternative 1
    ... OUTPUT
    Effect
    This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.
    Note
    The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
    Alternative 3
    ... ON END OF selcrit
    Effect
    This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked.
    Alternative 4
    ... ON BLOCK block
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database.
    With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.
    Example
    In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.

  • Using Text module in report programs

    Hi All,
    Is it possible to use Text modules created in Smartforms in our report programs. if yes, please share some details on the same.
    Regards,
    Booma Ganesan

    i am giving you a test data for READ_TEXT.
    pass as per your requirements.
    Function module              READ_TEXT
      Import parameters               Value
      CLIENT                          400
      ID                              F29
      LANGUAGE                        EN
      NAME                            320000128500003
      OBJECT                          EKPO
      Export parameters               Value
      HEADER                             EKPO      320000128500003                      F29 EN
      Tables                          Value
      LINES                              0 Entries
                       Result:           1 Entry

  • Auto selection of a value on selection screen field of a report program

    Dear Gurus,
    I have encountered a case in a report program, if i select a vendor code in selection screen, simultaneously the region code of that vendor should come automatically to the next parameter(ie region code). Is it possible..if then how?
    Thanks in Advance
    Saif

    Hi Saifur,
      write the code in the at selection-screen output.
    Try this logic.
    TABLES :
      SCARR ,
      SPFLI ,
      SFLIGHT ,
      SBOOK .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME .
    PARAMETERS :
      P_FLIGHT RADIOBUTTON GROUP R1 ,
      P_BOOK RADIOBUTTON GROUP R1 .
    SELECTION-SCREEN END OF BLOCK B1 .
    SELECT-OPTIONS S_FLDATE FOR SFLIGHT-FLDATE DEFAULT '20090101' TO
    '20090131'.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME .
    PARAMETERS :
      P_TEMP1 RADIOBUTTON GROUP R2 MODIF ID SC1 ,
      P_TEMP2 RADIOBUTTON GROUP R2 MODIF ID SC1 .
    SELECT-OPTIONS S_CARRID FOR SCARR-CARRID MODIF ID SC1 .
    SELECTION-SCREEN END OF BLOCK B2 .
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.
    PARAMETERS :
      P_TEMP01 RADIOBUTTON GROUP R3 MODIF ID SC2 ,
      P_TEMP02 RADIOBUTTON GROUP R3 MODIF ID SC2 .
    SELECT-OPTIONS S_BOOKID FOR SBOOK-BOOKID MODIF ID SC2 .
    SELECTION-SCREEN END OF BLOCK B3 .
    AT SELECTION-SCREEN OUTPUT .
    IF P_FLIGHT = 'X' .
    FL_FLAG = 1 .
    LOOP AT SCREEN .
    IF SCREEN-GROUP1 = 'SC2' .
    SCREEN-ACTIVE = 0 .
    MODIFY SCREEN .
    ENDIF.
    ENDLOOP.
    ELSEIF P_BOOK = 'X' .
    FL_FLAG = 2 .
    LOOP AT SCREEN .
    IF SCREEN-GROUP1 = 'SC1'.
    SCREEN-ACTIVE = 0 .
    MODIFY SCREEN .
    ENDIF.
    ENDLOOP.
    ENDIF .
    On pressing Enter use sy-ucomm value onli to do that and then write the above logic for another select-option.
    Much Regards,
    Amuktha.
    Edited by: Amuktha Naraparaju on Mar 12, 2009 1:24 PM

  • How to Link Organizational Structure to a report program

    Hi All,
              Can anyone pls help me out with my requirement. How can we link a organizational structure created in transaction PPOMW to a report program. Basically i want to send the report output as an XLS attachment to an external email id. For that i need to link Organizational Structure to the report program.
          There are many ways of doing it but i want it to be done by linking Organization structure to the report program. Pls help me as soon as possible as its a bit urgent for me.

    Hi,
    Please follow the below function modules and the paramters for reading archived data:
    CALL FUNCTION 'ARCHIVE_OPEN_FOR_READ'
      EXPORTING
        OBJECT                   = archiving object name
    IMPORTING
       ARCHIVE_HANDLE           = archive read handle
    Then in the loop(DO-ENDDO), use this FM:
    DO.
      CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'
           EXPORTING
                archive_handle          = archive read handle
    Then records from the data objects using this FM:
      CALL FUNCTION 'ARCHIVE_GET_TABLE'
           EXPORTING
                archive_handle        = archive read handle
                record_structure      = 'TABLENAME'
                all_records_of_object = 'X'
                automatic_conversion  = 'X'
           TABLES
                table                 = internal table for which you want to retrieve records.
    ENDDO.
    Then close the archive file using this FM:
    CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
         EXPORTING
              archive_handle = archive read handle
    This will help u in reading archived data from archive file.
    may give some idea also on how to code the read prgram.
    Thanks,
    Shamim

  • Check box before select option in a report program.

    Hi All..
    I have a report program with select options..I want to put a checkbox before the select option, aligned with it...Is it possible..
    Regards
    Rudra

    Hi Rudra,
    Take the below help program. In the below program I am disabling the text fields....
    Take the refrence and do it will fix the problem
    &***************************Reward Point if helpful***************************&
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-003.
    PARAMETERS: P1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND Z1.
    SELECT-OPTIONS: S_PMNUX FOR S076-PMNUX MODIF ID MI1.
    PARAMETERS:     P_WENUX LIKE S076-WENUX MODIF ID MI1.
    PARAMETERS: P5 TYPE CHAR15 AS LISTBOX  VISIBLE  LENGTH 15 MODIF ID MI1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 7.
    PARAMETERS: P3 RADIOBUTTON GROUP G2 MODIF ID MI1.
    SELECTION-SCREEN COMMENT 10(10) TEXT-001 MODIF ID MI1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 7.
    PARAMETERS: P4 RADIOBUTTON GROUP G2 MODIF ID MI1.
    SELECTION-SCREEN COMMENT 10(10) TEXT-002 MODIF ID MI1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: P_FILE TYPE RLGRAP-FILENAME MODIF ID MI1.
    PARAMETERS: P2 RADIOBUTTON GROUP G1.
    SELECT-OPTIONS: S_PMNUX1 FOR S076-PMNUX MODIF ID MI2.        " Product Group
    PARAMETERS:     P_WENUX1 LIKE S076-WENUX MODIF ID MI2.       " Plant
    PARAMETERS: P6(15) TYPE C AS LISTBOX VISIBLE LENGTH 10 MODIF ID MI2.
    *PARAMETERS: P_EMAIL(255) TYPE C MODIF ID MI2.
    PARAMETERS: P_EMAIL TYPE SOMLRECI1-RECEIVER.    " Email Address
    SELECTION-SCREEN END OF BLOCK B1.
    *      AT SELECTION-SCREEN OUTPUT                        *
    AT SELECTION-SCREEN OUTPUT.
      IF P1 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF P2 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Triggering a report program

    Hi experts,
          Let me to have a scenario such as follows,
    I want to trigger a report program with data when an event occurs in a third party tool. In the meanwhile the third party tool should through some input, following by the input will be given to sap. Can anyone give me  some suggestions to make it possible.
    Useful points will be rewarded.
    Regards,
    Sankar.

    Hi,
    Whenever third part tool wants to trigger the report to be run in SAP, should generate a file in a specific folder. In SAP You should have a small program in ABAP running in background at a specirfic interval, depending on requirement, once this program senses a file in thie specific folder it should trigger the SAP report by passing the content of that file to the report program, Once report is thru report program should move the file generated by the third party toll in the fixed folder to another folder say 'XXX' so that same data wont' be processed again.
    I hope this helps,
    Regards
    Raju chitale
    Edited by: Raju Chitale on May 5, 2008 7:28 AM

  • Variant calling in the report program.

    Hi,
    I got a report program to be called using the submit statement mentioned below.
    SUBMIT... [USING SELECTION-SET <var>].
    The Variant is saved in the Tcode. How can i get the Variant programatically rather than harcoding the variant name?.i mean any table it will be stored or any Function module available?.
    The variants are stored in the TVARV table, but still i need to pass the variant name to get the entries from the table.Any other alternative.
    Thanks,
    Neslin.

    Hi Vijay,
    In the table i find a possibility of getting multiple variants for a single report pgm name. any way to get a unique variant..
    Thanks,
    Neslin

  • Report program creation

    Hi,
    I would like to know if its possible to create a report
    program from a function module instead of going to SE38?
    I want to write a function module which takes Report Pgm
    Name and the Source Code as its input parameters and
    create the report pgm.
    Is any function available in SAP for creating a report
    program? If so wat is it?
    Ps: I do not want to generate a sub-routine pool.
    Thanks in advance.

    Hi anandaraja,
    1. Simple.
    2. we have to use the command
       INSERT REPORT 'ZPROG' from itab.
    3. just copy paste in new program.
      It will create a new program
      'ZAM_TEMP05'.
      (this new program will just print amit)
    4. U can use this code in the code of your FM.
      (by passing programname, and source in the form
      on internal table thru TABLES parameter)
    5.
    REPORT ABC.
    DATA : BEGIN OF ITAB OCCURS 0,
           F(72) TYPE C,
           END OF ITAB.
    ITAB-F = 'REPORT ABC.'.
    APPEND ITAB.
    ITAB-F = 'WRITE '' AMIT '' .'.
    APPEND ITAB.
    INSERT REPORT 'ZAM_TEMP05' FROM ITAB.
    regards,
    amit m.

  • Performance of Big Report Programs

    Hi SAP Experts,
    I want to know whether we can put the trace on the Report Programs which are taking on almost around 10 hours to execute or how can we put a trace on background jobs.
    Thanks and Regards,
    Harsh Goel

    Hi Harsh,
    The problem with the report will be mostly due to the select queries.
    So better do one thing, execute your program in debug mode, keep a break point before the select query, activate the trace in ST05 transaction and after executing the select query deactivate the trace
    Now look in display trace for the time it takes for the query.
    you can follow the same method for each query and check which query takes a long time and rectify that.
    To reduce ABAP/4 program runtime, always follow the ABAP/4 program optimization techniques given below:
    1. Avoid 'SELECT *'. Instead use select with field names i.e. SELECT f1 f2 f3 and so on.
    2. Use table (primary) keys (as far as possible) in the WHERE clause of the select statements. Else, check for secondary indexes.
    3. Avoid nested selects or nested loops.
    4. Use binary search wherever possible.
    5. Avoid use of joins in the select queries.
    5. You can evaluate the performance using GET RUN TIME command for small pieces of program. Try using this statement for SELECT queries to know how much time your SELECT query takes to execute.
    Example
    DATA: gv_runtime1       TYPE i,
          gv_runtime2       TYPE i,
          gv_final          TYPE i.
    GET RUN TIME FIELD gv_runtime1.
    SELECTu2026u2026
    GET RUN TIME FIELD gv_runtime2.
    gv_final = gv_runtime2 - gv_runtime1.
    WRITE: 'Execution time=', gv_final.
    If you still have any doubts please let me know.
    Regards,
    Shobana.K
    Edited by: Shobana k on Sep 18, 2008 8:27 AM

  • DOWNLOADING A REPORT PROGRAM CODE IN TO TEXT FILE

    I HAVE ONE SIMPLE REPORT PROGRAM SAY,
    *& Report  ZTEST25
    REPORT  ZTEST25.
    DATA : A(8) TYPE C.
    A = 'ANDHRA'.
    WRITE  A.
    THE ABOVE MENTIONED REPORT PROGRAM SHOULD BE DOWNLOADED TO A TEXT FILE USING ANOTHER REPORT PROGRAM BY USING PARAMETER.
    THE OUTPUT IN THE FLAT FILE SHOULD BE:
    REPORT  ZTEST25.
    DATA : A(8) TYPE C.
    A = 'ANDHRA'.
    WRITE  A.

    here is complete code for  that
    report  z11dpk_assign1
            no standard page heading
            message-id z11dpk
            line-size  200                 "page width
            line-count 65(0).              "page length.
    T  A  B  L  E S  D  E  C  L  A  R  A  T  I  O  N                  *
    tables:  trdir,     " System Table TRDIR
             trdirt.    " Title texts for programs in
    D  A  T  A  D  E  C  L  A  R  A  T  I  O  N                       *
    Types
    Structure declaration for system table
    types: begin of struct_sys,
           name(40) type c,       " ABAP program name
           clas(4)  type c,       " Program class
           subc(1)  type c,       " Program type
           cnam(12) type c,       " Author
           cdat     type dats,    " Created on
           rstat(1) type c,       " status
           text     type repti,   " Report title
           c_box(1) type c,       " for check box
           end of struct_sys.
    Structure for internal table for report data
    types: begin of struct_report,
           line(500),
           end of struct_report.
    C  O  N  S  T  A  N  T  S  D  E  C  L  A  R  A  T  I  O  N  S
    data     : c_name(50)        type c,               " Program Name
               c_filename        like ibipparms-path,  " File name
               c_filename1       type string,          " File name
               c_ext(5)          value '.TXT',         " File extension
               c_textline(150)   type c,               " downloading status
               c_count           type c,               " no of pgm downlded
               c_count_text(100) type c.               " Text pgm downlded
    The CONSTANTS statement defines global and local constants.
    By using constants, you can read statically declared data objects,
    constants: c_const(8)        value 'UNTITLED'.
    I  N  T  E  R  N  A  L  T  A  B  L  E  D  E  C  L  A  R  A  T  I  O N
    data: it_sys    type standard table of struct_sys, " Itab for sys data
          it_report type standard table of struct_report with
          non-unique default key initial size 1000.    " Itab for rep data
    W  O  R  K  A  R  E  D  E  C  L  A  R  A  T  I  O  N  S
    data: wa_sys    type struct_sys,          " Work area for sys data
          wa_report type struct_report.       " Work area for report data
    I  N  I  T  I  A  L  I  Z  T  I  O  N
    initialization.
      clear  : wa_sys.
      refresh: it_sys,
               it_report.
      c_count = 0.
    S  E  L  E  C  T  I  O  N  -  S  C  R  E  E  N
      selection-screen  : begin of block blk3 with frame title text-015.
      selection-screen  : begin of block blk1 with frame title text-001.
      select-options    : s_name for trdir-name.              " Program name
      selection-screen  : end of block blk1.
      selection-screen  : begin of block blk2 with frame title text-002.
      parameters        : p_file type rlgrap-filename. " Path for loc folder
      selection-screen  : end of block blk2.
      selection-screen  : end of block blk3.
    A  T  S  E  L  E  C  T  I  O  N  -  S  C  R  E  E  N
    *The possible entries pushbutton for F4 appears beside the appropriate
    *fld (p_file) When the user activates this pushbutton or presses F4 for
    *the fld, the event is executed You can thus implement a self-programmed
    *possible entries routine for the input/output fields of the selection
    *screen
    at selection-screen on value-request for p_file.
    Value of Local file for upload/download is obtained by using this FM
      call function 'F4_FILENAME'
        importing
          file_name = p_file.
    S  T  A  R  T  -  O  F  -  S  E  L  E  C  T  I  O  N
    start-of-selection.
    CONCATENATE p_name '%' INTO z_name.
      select name
             clas
             subc
             cnam
             cdat
             rstat into table it_sys
                   from trdir
    *Sorts the selected records in ascending order by the specified column
    *references f1 ... fn (name)
                  where name in s_name order by name.
                  WHERE name LIKE 'Z11%'.
      if sy-subrc = 0.
        sort it_sys by name.
        clear wa_sys.
        loop at it_sys into wa_sys.
          select single text
                 into wa_sys-text
                 from trdirt
                 where name  = wa_sys-name and
                       sprsl = sy-langu.
          modify it_sys from wa_sys index sy-tabix.
          clear wa_sys.
        endloop.
      endif.
      set pf-status 'MENU_ASSIGN1'.
      uline.
      write:/    sy-vline ,
             8   sy-vline,  text-009 color 4,         " Name of the Program
             55  sy-vline,  text-003 color 4,         " Class
             62  sy-vline,  text-004 color 4,         " Type
             68  sy-vline,  text-005 color 4,         " Created By
             80  sy-vline,  text-006 color 4,         " Created On
             92  sy-vline,  text-007 color 4,         " Status
             100 sy-vline,  text-008 color 4,         " Program text
             180 sy-vline.
      clear wa_sys.
      loop at it_sys into wa_sys.
        uline.
        write:/ sy-vline,
               5   wa_sys-c_box as checkbox,
               8   sy-vline,  wa_sys-name,
               55  sy-vline,  wa_sys-clas,
               62  sy-vline,  wa_sys-subc,
               68  sy-vline,  wa_sys-cnam,
               80  sy-vline,  wa_sys-cdat,
               92  sy-vline,  wa_sys-rstat,
               100 sy-vline,  wa_sys-text,
               180 sy-vline.
      endloop.
    at user-command.
      case sy-ucomm.
        when 'BACK'.
          leave screen.
        when 'EXIT'.
          leave program.
        when 'DOWN'.
          clear wa_sys.
          do.
            clear wa_sys.
            read line sy-index field value wa_sys-c_box wa_sys-name.
            if sy-subrc <> 0.
              exit.
            endif.
    *if check box is selected.....
            if wa_sys-c_box = 'X'.
              clear c_textline.
    *Assigns the contents of the source field to the target field as a new
    *value
              write text-010    to c_textline.         " Downloading
              write wa_sys-name to c_textline+12.
              write text-011    to c_textline+53.      "to
              write c_filename1 to c_textline+56.      " file name
    FM returns the Text to be displayed on screen
              call function 'SAPGUI_PROGRESS_INDICATOR'
                exporting
                  text = c_textline.
              c_count = c_count + 1.
    Reads the program prog from the database into the internal table itab.
    The line length of table itab should be at least 72 characters
              read report wa_sys-name into it_report.
              if sy-subrc <> 0.
                exit.
              endif.
    *p_file contains the character string untitiled
    This comparison is not case sensitive
              if p_file cs c_const.        " Untitled
    the string ''(space) replaces the untitled occurrence of the search
    ignore case is used as this search is case sensitive
                replace c_const in p_file with '' ignoring case.
              endif.
    Places the fields f1 to fn (n >= 2) after g (target field).
              concatenate p_file wa_sys-name  c_ext into c_filename1.
    *Data transmission of an internal table from the server to a file on the
    PC is done by this FM.
              call function 'GUI_DOWNLOAD'
                exporting
                  filename = c_filename1
                  filetype = 'ASC'
                tables
                  data_tab = it_report.
              if sy-subrc <> 0.
                message id sy-msgid type sy-msgty number sy-msgno
                        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              endif.
            endif.
          enddo.
          clear c_count_text.
          write c_count  to c_count_text+1.
          write text-030 to c_count_text+4.
    Nos Of Pgms downlded successfully
          message i205 with c_count_text.
      endcase.
    T  O  P -  O  F  -  P  A  G  E
    top-of-page.
      uline.
      write:/   sy-vline,
             10 text-020 color 2,  " Fujitsu India Limited
             70 text-021 color 2.  " List of ABAP Programs
      write:/   sy-vline,
             10 text-022 color 3, sy-datum color 3,    " Date
             70 text-023 color 3, sy-pagno color 3.    " Page No
    plz reward if helpful
    vivek

Maybe you are looking for

  • Problem in filling field catalog as table is dynamic

    Hi All,     I have to populate the data using the below function module and i am passing dynamic internal table <f_list> in place of list.    i have to populate the field catalog fc_hier which is getting field by standard program but i have to add ad

  • Background color missing

    I'm a newbie just working on the Adobe Dreamweaver tutorial. It instructs me to go to modify>page properties> click on the background color box and select black (#000000). I did this and the background color is still without color. When I open the pa

  • Unsolved ABAP keyword documentation failure

    Hi everybody, I already posted this in the other "ABAP keyword documentation" threads, but because those are solved I think nobody sees that there´s still a problem (unfortunately all those solutions didn´t work for me or I should say that "my" probl

  • Screen Numbers required for object links

    i am unable to add few object links to a document type as i dont have the screen number for the object links.  Can anyone give me the screen numbers of the following object links L     Object     Object Desc.     Screen Number EN     AENR     Change

  • Seeing only the photos you import

    One of the features I liked in Photoshop Elements 3 was that when I would import a new bunch of photos, it would show me ONLY those photos, giving me a chance to tag them before they got mixed up with everything else.  Is that feature still available