Line number in Classical Report

Hi All,
How to get current line number in Classical Report?
i want to show that in my o/p.
regards,
Anuj

Hi Anuj
Please try like this
there are 2 ways.
READ CURRENT LINE FIELD VALUE <fieldname>.
READ CURRENT LINE.
first statement does'nt work on numeric type fields especially when there are commas ',' like 5,600,00.
it'll give you dump.
but always works on CHAR type.
so in your case use second statement. though you're reading entire row but use only single field what ever you want.
check this example.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
AT LINE-SELECTION.
READ CURRENT LINE.
WRITE :/ itab-menge.
START-OF-SELECTION.
SELECT matnr menge INTO TABLE itab FROM eban UP TO
10 ROWS WHERE matnr NE space.
LOOP AT itab.
WRITE :/ itab-matnr, itab-menge.
HIDE : itab-matnr, itab-menge.
ENDLOOP.
Thanks
venkat

Similar Messages

  • How  2 increase line size of  classical report displayed thru  modular prog

    Hi guys,
    I have displayed a classical report through a modular program using LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 130.
    But now i want to increase the line-size of my classical report as only half of the report is getting displayed.
    I tried the following thing:-
    SY-LINSZ = 125.
    perform f_report_pass.
    *Print repost showing records which were not saved
    perform f_report_fail.
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 130.
    but that did not work.
    Please help me increase the line size.
    Regards
    Rahul Gambhir

    Hi Vasanth
    I am using a modular program hence there isnt any statement :-
    REPORT ZXXX NO STANDARD PAGEHEADING LINE-SIZE 255
    This is the code that I am using :-
    SY-LINSZ = 200.
    perform f_report_pass.
    *Print repost showing records which were not saved
    perform f_report_fail.
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 130.
    Regards
    Rahul

  • Lines truncated in classical report when called from an interactive alv rep

    hi experts,
      i have an alv report after clicking a field in that alv report it has to go another screen(interactive) which is shown in classical format.
    the problem is when i am moving to classical format the columns  are getting truncated ...i tried increasing the line size of the report but no use.can any one guide me?
    with thanks in advance,
    syed

    Hi,
        The only option what you have is to write like below ...
    loop at itab.
    if v_count = 0.
       perform write_top_of_page.
    endif.
    ".... write your report ...
    v_count = v_count + 1.
    if v_count = 60. "<-- you want top-of-page after 60 lines (60 records per page.)
      clear v_count.
    endif.
    endloop.
    Regards,
    Srini.

  • Increase line width in classical report

    Hi
    I am customizing the ME2N  transaction, here I want to increase the line width and add few more fields to the output.
    How to do this?
    ..urgent help requiered please......

    Hello there,
    Make the changes as folows :::
    REPORT <Report Name> no standard page heading line-size 1023.
    This will solve your problem.
    Bu 1023 isthe maximum. Cannot go beyond this.
    reward if useful.
    regards,

  • OnMouseOver displays Tooltip from hidden column of classic report

    What: The Goal:
    Make easily available more information than fits on one line of the screen without using multiple fixed lines.
    Background:
    Classic report with 18 data items (columns) visible. Has Search box and user can choose number of rows displayed.
    A couple data items can be long (20-30 characters) compared to the screen width. The right-most data item might run 100 characters.
    Proposed Strategy:
    1) Display the first n characters of the long item(s) on the report.
    2) On onMouseOver display the entire item.
    Proposed Approach:
    1) For each column with long data, hold the entire value in a hidden item.
    2) Display long (hidden) value in tooltip (bubble?/balloon?) upon onMouseOver of that value.
    Note: This is not ToolTip/Help for a column but display of the long value for a specifc item in the row of a column.
    Sought After Feature:
    1) To reduce maintenance, would like to implement for multiple columns using a single common block of code.
    Question:
    Given other approaches you know, is this a good approach to achieve the goal? Alternative approaches?
    Howard

    Well it took a while and you really made me work for this. :)
    For the end result hover on the Job Ln Nm column.
    http://apex.oracle.com/pls/apex/f?p=991202:1
    I added some old code I had laying around. It adds a bubble that will stay up for 5 sec or until you click away or hover on another record.
    What I would do at this point is just truncate (with a substr) the length of the Long Nm to something short. Use whatever indicator you want for the hover. Like for example these glasses <img src="#IMAGE_PREFIX#Fndview1.gif"> It's really up to you.
    You'll see there's an AJAX Callback PLSQL where you can retreive and format the content of the popup to whatever you want. You could make it real pretty.
    Here's what I did:
    1. New ShowJob javascript procedure.
    function ShowJob(pThis,pId){
         this.dTimeout;
         clearTimeout(this.dTimeout);
         this.dGet = dGet;
         this.dShow = dShow;
         this.dCancel = dCancel;
         var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=FULL_LONG_NAME',$v('pFlowStepId'));
         this.dGet();
         return;
         function dGet(){
               this.dTimeout = setTimeout("this.dCancel()",6500);
              get.addParam('x01',pId);
               get.GetAsync(dShow);
         function dShow(){
               $x_Hide('rollover');
               if(p.readyState == 1){
               }else if(p.readyState == 2){
               }else if(p.readyState == 3){
               }else if(p.readyState == 4){
                     $x('rollover_content').innerHTML = p.responseText;
                     $x_Show('rollover');
                var l = findPosX(pThis)+pThis.offsetWidth+5;
                     var t = findPosY(pThis);
                $x_Style('rollover','left',l + 'px');
                     $x_Style('rollover','top',t + 'px');
    // This math would center on the vertical           
    //                 $x_Style('rollover','left',findPosX(pThis)+pThis.offsetWidth+5);
    //                 $x_Style('rollover','top',findPosY(pThis)-($x('rollover').offsetHeight/2)+($x(pThis).offsetHeight/2));
                   document.onclick = function(e){
                   dCheckClick(e);
               }else{return false;}
         function dCheckClick(e){
              var elem = html_GetTarget(e);
              try{
                        var lTable = $x_UpTill(elem,"DIV");
                        if(lTable.id!='rollover_content'){dCancel();}
                        else{}
              }catch(err){dCancel();}
         function dCancel(){
               $x_Hide('rollover');
              document.onclick = null;
               get = null;
    }2. Rollover div on the page footer (div id="rollover"...). Of course this could be a region also.
    &lt;div id="rollover" style="display:none;color:black;background:#FFF;border:2px solid #369;width:290px;position:absolute;padding:4px;">
    &lt;div id="rollover_content">&lt;/div>
    &lt;/div>
    3. PLSQL AJAX Callback. : FULL_LONG_NAME
    -- select your value with apex_application.g_x01
    htp.p('You hover over ' || apex_application.g_x01 || '<br>');
    htp.p('Here is the Full Long Name: XXXXXXX XXXXXXX XXXXXXX 1234565');4. Changed Long Nm column to be a link with the onmouseover call that calls the new procedure ShowJob. I made the assumption that with the NUM parameter you could fetch the full record of what you need.
    onmouseover="ShowJob(this,#NUM#)"
    That should be it.
    Let me know what you think.
    -Jorge
    Edited by: jrimblas on Apr 22, 2013 1:05 PM: Added code to post for completion

  • How to set the number of rows displayed in a classical report at runtime?

    Hi,
    Our customer has several standard client hardware configuration and would like to enable end users to choose their 'display profile' at login time. This 'display profile' would contain predefined values for these hardware configurations and supposed to set various paramters that should define the number of rows displayed in a classical report region.
    I tried to provide parameters on the report region but it refused to accept anything but numerical values. Is it possible to do this?
    Regards, Tamas

    The link is to the closest linkable point in the documentation to the description of the Number of Rows (Item) attribute.
    It sounds like you have been trying to enter&mdash;unsuccessfully&mdash;an item name or substitution string into the Number of Rows attribute. The Number of Rows (Item) attribute is the one that actually allows you to do this. Click on the flashlight icon beside it to get a list of items from the application.

  • Classic Report limit the number of rows displayed

    Hi All,
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G database
    My question is: How can I limit the maximum number of rows in a classic SQL Report.

    Hamertje16 wrote:
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.And did you do so?
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G databaseHow did it not do what you want? Displayed an error? Displayed no rows? Displayed 15 rows? Displayed some other number of rows? We can only help if we fully understand the nature of the problem.
    My question is: How can I limit the maximum number of rows in a classic SQL Report.To display 5 rows per page set the report's Number of Rows attribute to *5*.
    However, pagination settings get cached for the duration of the session. For this change to be instantly visible, either log out, restart the brower, and log in again, or manually re-request the page from the browser address bar, adding 'RP' in the ClearCache position in the URL.

  • Dynamic setting of line count and footer in classical report

    Hi all,
    In classical report,we can set line count and footer at the beginning of the report  as Line-count 6(2), here out of 6 lines 4 lines is for content and 2 lines is for footer (assume no standard heading), but if my report produces less content than 4 say 3 at run time ,then footer will not be displayed .Here again i have to set line count and footer as 5(2) in order to get the footer to be displayed ,so How can i achieve dynamic setting of the line count and footer,
    Thanks,
    Avinash

    Use RESERVE,
    START-OF-SELECTION.
    RESERVE 6 LINES.           "at the last of your code
    This will trigger a page-break & footer will be displayed.

  • What is the color number in HTML of the result line in the web reports

    Hi guys,
    what is the color number in HTML of the result line in the web reports, its like a yellow, but i m looking for the exactly number color to make some modifications, please

    the same should correspond to a CSS class definition. You execute the report - view source and ideally you should be able to find the class associated with the result cells. You can also go an check out the CSS directly.

  • Count from Cross TAB1 should add to Line Number in Cross TAB 2 in 1 report

    Hello Friends I have 2 cross Tab1 based on 2 query data providers. I need to feed calculate the Count of Items in Cross Tab1 and add that to line Number in Cross TAB2 which sit below cross tab1
    So if there are 21 items in Cross TAB1 then Line Number in Cross TAB 2 shall be 22
    so do this i Created a count variable
    =Count([Item ID]) In Report
    which give me 21 in cross tab1 but when I drag that to cross tab2 it give junk value 179
    so How do I fix this Line number Count in Cross Tab 2
    Please help with code to say Count([Item ID]) In Report from cross tab1 and add Line Number to it = 22
    thanks
    soniya

    Hello Friends I have cross Tab1 and Cross Tab2 based on 2 query data providers. I need to feed calculate the Count of Items in Cross Tab1 and DISPLAY In cross Tab2
    Dimension name is ITEM ID
    So if there are 21 items in Cross TAB1 then in Cross TAB 2
    I want to display "Number of Item" = 21
    so do this i Created a count variable
    =Count([Item ID]) In Report
    which give me 21 in cross tab1 but when I drag that to cross tab2 it give me count of Item in Cross Tab2 = 87 which is wrong since i want 21
    so How do I fix this Count in Cross Tab 2
    Please help with code to say Count([Item ID]) In Report from cross tab1
    thanks
    Soniya

  • Vertical Lines in Classical Report

    Hi,
    I am doing a Classical Report and I need a vertical line to be drawn between the fields. i.e. I want the coloumns to be separated by vertical lines but not the rows. Hope I am clear with my requirement. This is urgent please advice.
    Rgds,
    Manju

    Hi
    write sy-vline statement where u want vertical line.
    loop at it_kna1 into wa_kna1.
        write:/1 sy-vline,
              3 wa_kna1-kunnr,
              20 sy-vline,
              30 wa_kna1-name1,
              100 sy-vline.
      endloop.
    Edited by: Chaithanya A on Mar 19, 2008 8:15 AM

  • Classic Report with a two-line row, the second one as a drop down?

    Hi,
    Using APEX 4.0 is it possible to make a classic report layout that has row items sorted in 2 rows? The first row for each SQL record set row looks like the classic report 'normal' row, while the second one contains just one single column value. This second row is supposed to be hidden and should be displayable by clicking a small '+' sign at the beginning of the row.
    I remember having seen this done, but I simply seem not to be able to formulate my query correctly to let Google display me the expected result. Although I am not sure if was APEX+jQuery or ExtJs. I hope though it is not ExtJS, since I do not plan to use that one.
    Thank you in advance.
    Tamas

    Is this for Verizon landline internet? If so, you should ask your question in the Verizon Residential forums. http://forums.verizon.com

  • Classical Report on clicking button on ALV Report

    I have a requirement where I have to display a classical report based on the user-click on a "custom button" on my ALV. I am unable to display the classical report. Please help with code example..

    Hi,
    See the example.Change the code according to your requirement.
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Pls. reward if useful...

  • Print LOGO in classical report printout

    Hi GURUS,
    Is it possible to take print of logo in classical report.

    refer this link:[click|http://tinyurl.com/5s22vp]
    the code is copied from that link.
    Make the changes in the code as given below.
    REPORT  zgb_prog06.
    * START OF DO NOT CHANGE***********************************
    DATA: docking TYPE REF TO cl_gui_docking_container,
          picture_control_1 TYPE REF TO cl_gui_picture,
          url(256) TYPE c .
    DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
          html_table LIKE w3html OCCURS 1,
          return_code LIKE  w3param-ret_code,
          content_type LIKE  w3param-cont_type,
          content_length LIKE  w3param-cont_len,
          pic_data LIKE w3mime OCCURS 0,
          pic_size TYPE i.
    * END OF DO NOT CHANGE*************************************
    DATA : sum(4) , num1(4) , num2(4).
    PARAMETERS: p_dummy(4) DEFAULT '4' .
    PARAMETERS: p_dummy1(4) DEFAULT '5' .
    AT SELECTION-SCREEN OUTPUT.                 "Remove this event
    START-OF-SELECTION.
    write 'Testing picture printing in classic report'.
    PERFORM show_pic.                                      "Add it here
    end-of-selection.
    *& Form show_pic
    FORM show_pic.
      DATA: repid LIKE sy-repid.
      repid = sy-repid.
      CREATE OBJECT picture_control_1 EXPORTING parent = docking.
      CHECK sy-subrc = 0.
      CALL METHOD picture_control_1->set_3d_border
        EXPORTING
          border = 5.
      CALL METHOD picture_control_1->set_display_mode
        EXPORTING
          display_mode = cl_gui_picture=>DISPLAY_MODE_FIT.
      CALL METHOD picture_control_1->set_position                      "change positions
        EXPORTING
          height = 70
          left   = 800
          top    = 20
          width  = 190.
    *CHANGE POSITION AND SIZE ABOVE***************************
      IF url IS INITIAL.
        REFRESH query_table.
        query_table-name  = '_OBJECT_ID'.
    *CHANGE IMAGE NAME BELOW UPLOADED IN SWO0******************
        query_table-value = 'ZLOGO'.
        APPEND query_table.
        CALL FUNCTION 'WWW_GET_MIME_OBJECT'
          TABLES
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          CHANGING
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          EXCEPTIONS
            object_not_found    = 1
            parameter_not_found = 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.
        CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          TABLES
            data     = pic_data
          CHANGING
            url      = url
          EXCEPTIONS
            OTHERS   = 1.
      ENDIF.
      CALL METHOD picture_control_1->load_picture_from_url
        EXPORTING
          url = url.
    *Syntax for URL
    *url = 'file://D:\corp-gbanerji\pickut\cartoon_184.gif'.
    *url = 'http://l.yimg.com/a/i/ww/beta/y3.gif'.
    ENDFORM.                    "show_pic

  • How to save classical report as pdf file

    hi all,
    i have created a classical report and now the requirement is to save that report as a pdf .
    is there any FM or any other method to do so?
    regards
    vijay

    Hi Vijay,
    Here is what I did for the same requirement:
    Calling for the PDF File name and path to save the file
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = 'Quote Bom PDF File'
          default_file_name    = l_file_name
          initial_directory    = l_fullpath
          prompt_on_overwrite  = 'X'
        CHANGING
          filename             = l_file
          path                 = l_path
          fullpath             = g_path
          user_action          = l_user
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF l_user = 0.
    Please follow the following order for the subroutines which is creating the Spool Number, writing the* 
    statements on to the screen and then create the PDF file*
        PERFORM get_spool_created.
        PERFORM write_lines.
        NEW-PAGE PRINT OFF.
        g_spool_no = sy-spono.
        PERFORM download_as_pdf.
    Spool Number is getting created in this routine*
    FORM get_spool_created .
      DATA: pripar TYPE pri_params,
              arcpar TYPE arc_params,
              lay    TYPE pri_params-paart,
              lines  TYPE pri_params-linct,
              rows   TYPE pri_params-linsz.
      DATA: val(1), val1(1).
      DATA: dest TYPE pri_params-pdest VALUE 'LP01'.
      DATA: name TYPE pri_params-plist VALUE 'Testing'.
      DATA: i_pdf TYPE STANDARD TABLE OF tline.
      DATA: spono TYPE tsp01-rqident.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination              = dest
          no_dialog                = 'X'
          immediately              = ' '
        IMPORTING
          out_archive_parameters   = arcpar
          out_parameters           = pripar
          valid                    = val
          valid_for_spool_creation = val1
        EXCEPTIONS
          archive_info_not_found   = 1
          invalid_print_params     = 2
          invalid_archive_params   = 3
          OTHERS                   = 4.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      pripar-linsz = '132'.
      pripar-paart = 'X_65_132'.
      pripar-prdsn = 'LP01'.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          in_archive_parameters    = arcpar
          in_parameters            = pripar
          no_dialog                = 'X'
          list_name                = name
        IMPORTING
          out_archive_parameters   = arcpar
          out_parameters           = pripar
          valid                    = val
          valid_for_spool_creation = val1
        EXCEPTIONS
          archive_info_not_found   = 1
          invalid_print_params     = 2
          invalid_archive_params   = 3
          OTHERS                   = 4.
      IF sy-subrc EQ 0.
        NEW-PAGE NO-TITLE NO-HEADING PRINT ON
        NEW-SECTION
        PARAMETERS pripar
        ARCHIVE PARAMETERS arcpar
        NO DIALOG.
      ELSE.
        WRITE:/ 'Unable to create spool'.
        EXIT.
      ENDIF.
    ENDFORM.                    " GET_SPOOL_CREATED
    Write all your statements in this routine*
    *&      Form  WRITE_LINES
          text
    -->  p1        text
    <--  p2        text
    FORM write_lines .
    CALL THE ROUTINE WHICH WRITES ALL LINES TO THE SCREEN
    ENDFORM.                    " WRITE_LINES
    *Download the file as PDF
    *&      Form  DOWNLOAD_AS_PDF
          text
    -->  p1        text
    <--  p2        text
    FORM download_as_pdf .
      DATA:
              l_no_of_bytes TYPE i,
              l_pdf_spoolid LIKE tsp01-rqident,
              l_jobname     LIKE tbtcjob-jobname,
              l_jobcount    LIKE tbtcjob-jobcount,
              i_pdf         TYPE TABLE OF tline,
              i_cpdf        TYPE TABLE OF tline,
              l_spono       TYPE tsp01_sp0r-rqid_char,
              l_fullpath    TYPE string.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid              = g_spool_no
          no_dialog                = ' '
        IMPORTING
          pdf_bytecount            = l_no_of_bytes
          pdf_spoolid              = l_pdf_spoolid
          btc_jobname              = l_jobname
          btc_jobcount             = l_jobcount
        TABLES
          pdf                      = i_pdf
        EXCEPTIONS
          err_no_abap_spooljob     = 1
          err_no_spooljob          = 2
          err_no_permission        = 3
          err_conv_not_possible    = 4
          err_bad_destdevice       = 5
          user_cancelled           = 6
          err_spoolerror           = 7
          err_temseerror           = 8
          err_btcjob_open_failed   = 9
          err_btcjob_submit_failed = 10
          err_btcjob_close_failed  = 11
          OTHERS                   = 12.
      l_spono = g_spool_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
        EXPORTING
          spoolid = l_spono.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize            = l_no_of_bytes
          filename                = g_path
          filetype                = 'BIN'
        TABLES
          data_tab                = i_pdf
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6.
    ENDFORM.                    " DOWNLOAD_AS_PDF
    Thanks.
    Respond if you need any more help.

Maybe you are looking for