Problem in Auto Mail of ALV Report :  Urgent

Hello All ,
I have created one ALV Report contain 240 Columns . This report is need to schedule for auto mail in HTML Format.
My Problem is when I am sending this report manually the html output displays all the columns in the mail attachment.  While it is scheduled thro' SM36 in background mode the HTML format displays only restricted columns (say upto 132 columns)
Also, we have tried to create new page format  X_65_512/2 to accomodate the output.  However this option did not work.
Any solution to resolve the same is most welcome !
Regards
Swati Namdeo

Hi
   This problem was not resolved. I tried few things but not good. So what we did we created a few profile like MM/SD/FICA and we executed report based on profile and sent them only the column relevant to them.
Regards,
Atul Joshi

Similar Messages

  • Problem to send text file to mail from ALV report

    Hi Friends,
    I have a problem in my ALV report with text file.  As per the requirment, when we execute the program then text attachment should go to the particual email.
    When i am using file type as XLS i am getting attachment with all 4 recoreds( input for 4 records) in mail. But all 4 records are coming in SAME ROW. It should come 4 records in 4 rows. when I use file type as TXT and separated by pipe symble in code, it is showing only one recored for same above input.
    When i use file type as XLS and click the attachment in email, it will triggire one popul with three options like SAVE, OPEN, CANCEL.
    But when i click on text file attachment, it is directly showing ony one recored.
    Please correct me on this.
    my code is
    PERFORM send_file_as_email_attachment
                                   tables i_message
                                          i_attach
                                    using v_email
                                          'User last log on details'
                                          'XLS'
                                          'User log on list'
                                 changing v_error
                                          v_reciever.
    FORM send_file_as_email_attachment tables pi_message
                                              pi_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: l_error    TYPE sy-subrc,
              l_reciever TYPE sy-subrc,
              l_mtitle LIKE sodocchgi1-obj_descr,
              l_email LIKE  somlreci1-receiver,
              l_format TYPE  so_obj_tp ,
              l_attdescription TYPE  so_obj_nam ,
              l_attfilename TYPE  so_obj_des ,
              l_sender_address LIKE  soextreci1-receiver,
              l_sender_address_type LIKE  soextreci1-adr_typ,
              l_receiver LIKE  sy-subrc.
      l_email   = p_email.
      l_mtitle = p_mtitle.
      l_format              = p_format.
      l_attdescription      = p_attdescription.
      l_attfilename         = p_filename.
      l_sender_address      = p_sender_address.
      l_sender_address_type = p_sender_addres_type.
    Fill the document data.
      v_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      v_doc_data-obj_langu = sy-langu.
      v_doc_data-obj_name  = 'SAPRPT'.
      v_doc_data-obj_descr = l_mtitle .
      v_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR v_doc_data.
      READ TABLE i_attach INDEX v_cnt.
      v_doc_data-doc_size =
         ( v_cnt - 1 ) * 255 + STRLEN( i_attach ).
      v_doc_data-obj_langu  = sy-langu.
      v_doc_data-obj_name   = 'SAPRPT'.
      v_doc_data-obj_descr  = l_mtitle.
      v_doc_data-sensitivty = 'F'.
      CLEAR i_attachment.
      REFRESH i_attachment.
      i_attachment[] = pi_attach[].
    Describe the body of the message
      CLEAR i_packing_list.
      REFRESH i_packing_list.
      i_packing_list-transf_bin = space.
      i_packing_list-head_start = 1.
      i_packing_list-head_num = 0.
      i_packing_list-body_start = 1.
      DESCRIBE TABLE i_message LINES i_packing_list-body_num.
      i_packing_list-doc_type = 'RAW'.
      APPEND i_packing_list.
    Create attachment notification
      i_packing_list-transf_bin = 'X'.
      i_packing_list-head_start = 1.
      i_packing_list-head_num   = 1.
      i_packing_list-body_start = 1.
      DESCRIBE TABLE i_attachment LINES i_packing_list-body_num.
      i_packing_list-doc_type   =  l_format.
      i_packing_list-obj_descr  =  l_attdescription.
      i_packing_list-obj_name   =  l_attfilename.
      i_packing_list-doc_size   =  i_packing_list-body_num * 255.
      APPEND i_packing_list.
    Add the recipients email address
      CLEAR i_receivers.
      REFRESH i_receivers.
      i_receivers-receiver = l_email.
      i_receivers-rec_type = 'U'.
      i_receivers-com_type = 'INT'.
      i_receivers-notif_del = 'X'.
      i_receivers-notif_ndel = 'X'.
      APPEND i_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = v_doc_data
                put_in_outbox              = 'X'
                sender_address             = l_sender_address
                sender_address_type        = l_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = v_sent_all
           TABLES
                packing_list               = i_packing_list
                contents_bin               = i_attachment[]
                contents_txt               = i_message
                receivers                  = i_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      l_error = sy-subrc.

    Hi,
    declare the following constant in u r program and concatenate at the end of each and every record in your internal table.
    CONSTANTS : LV_CRLF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
    for eg.
    if u internal table has values like
    row1
    row2
    row3
    concatenate the 1st record lv_crlf into first record.
    conactenate second record lv_crlf into second record.
    concatenate third record lv_crlf into third record.
    now attach  the internal table to the FM which u use for sending email. Each and every row will come in new line. The LV_CRLF will hold nothing but a line feed character (#).
    Hope it will solve u r problem
    Regards,
    Rose.

  • Auto Scheduling of ALV Report

    Dear Expert,
    Can anyone help as how to schedule the ALV report, for Auto Emailing to respective person.
    Or what is the way so as to schedule report for auto emailing.
    Need solution urgently....
    Regards.

    Hi,
    you can schedule your report in SM36.
    First get all the data (which is to want to show in ALV) in one file of csv/xls/tab delimiter format....
    then use it as an attachment in the mail.
    For sending your report thru email ...you can write a code in the program...and then check in SCOT for testing....
    Thanks
    RK
    Edited by: Rahul Keshav on Nov 20, 2009 3:21 PM

  • Cant send an e-mail in ALV report for background executaion

    Hello friends,
    I am displaying ALV report using container.
    Now when i run this report in background, an e-mail should be go with an EXCEL attachment of report.
    I am  able to send e-mail and attachment in foreground .
    I am also able to run alv report in background.
    now, only problem is that i am am not able to send e-mail in background.
    any sujjetions ?
    Points will rewarded if little bit useful.
    Regards,
    nimesh
    if  cl_gui_alv_grid=>offline( ) is initial.
    Create custom container
      CREATE OBJECT g_r_cust_container
        EXPORTING
          container_name = gv_ctrl_custom.
    Create TOP-Document
      CREATE OBJECT g_r_dd_document
        EXPORTING
          style = 'ALV_GRID'.
    Create Splitter for custom_container
      CREATE OBJECT g_r_splitter
        EXPORTING
          parent  = g_r_cust_container
          rows    = 2
          columns = 1.
    Split the grid in two parts- top and grid
      CALL METHOD g_r_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = g_r_parent_top.
      CALL METHOD g_r_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = g_r_parent_grid.
    Set height for g_parent_html
      CALL METHOD g_r_splitter->set_row_height
        EXPORTING
          id     = 1
          height = 1.
    Create grid object
      CREATE OBJECT g_r_alvgrid
        EXPORTING
          i_parent = g_r_parent_grid. "g_r_cust_container.
    else .
    Create grid object
    CREATE OBJECT g_r_alvgrid
        EXPORTING
          i_parent = or_doc. "g_r_cust_container.
    endif .
    Create object handler object (of type local class)
      CREATE OBJECT g_r_handler.
      SET HANDLER g_r_handler->top_of_page FOR g_r_alvgrid.
      SET HANDLER g_r_handler->print_top_of_page FOR g_r_alvgrid.
      w_disvariant-report  = sy-repid.
      w_disvariant-variant = p_vari.
      CALL METHOD g_r_alvgrid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ysds_sox_price_change'
          is_layout        = w_layout
          is_variant       = w_disvariant
          i_save           = yc_chara
        CHANGING
          it_outtab        = t_st_result
          it_fieldcatalog  = t_fieldcat[]
          it_sort          = t_sortinfo[].
      CALL METHOD g_r_dd_document->initialize_document
        EXPORTING
          background_color = cl_dd_area=>col_textarea.

    no i am using container for ALV.
    In above code i have mantioned If.......ELSE.....Condition.
    which give me allow to run ALV in background mode but my problem is that  i am not able to send e-mail with attachment in background mode.
    DATA : or_doc  type ref to cl_gui_docking_container .
    My report is working fine in foreground but not able to send email in background.
    so anybody can solve it?

  • Problem with Page Break In ALV Report

    Hi
    I have got a problem in my ALV report. I have a checkbox in the user input screen where users decide whether they want a page break or not in the print preview (or print) page. Now i also have the option to have layout name in the input screen. so If i leave the layout box empty the check or not check of page break works fine. but if use a save layout name in the layout box the add check box doesn't work anymore. If i have a layout name in the layout box it doesn't matter whether i have checked for page break or not it does the same thing.(in one report it always puts the page breaked)
    Any ideas where to look for the error?
    here is the code for the page break. Opt5 is the check box.
      perform build_sort tables pt_sort changing ls_sort.
      ls_sort-fieldname = 'PERNR'.
      ls_sort-subtot    = 'X'.
    IF OPT5 = 'X'.
       ls_sort-GROUP = '*'.
      ENDIF.
      append ls_sort to pt_sort.
      ls_sort-subtot    = ' '.
      ls_sort-GROUP = ''.

    Never mind it was acting like the page break was not working because the layout was saved with the page break on/OFF.

  • Problem in Print Out of ALV report

    Dear All..
    I am trying to take print out of an ALV report. there are 36 columns in my report. when i try to take print out, warning appears which says system cannot print the last 277 columns of report.
    i have tried using different formats for printer like :
    Format                  Description
    X_PAPER                 ABAP/4 list: Default list formatting
    X_SPOOLERR          ABAP list: Spooler problem report
    ZX_65_284               65 Rows and 285 Columns
    X_65_255                ABAP/4 list: At least 65 rows with a maximum number of c
    X_65_200                ABAP list: at least 65 lines with 200 columns (not for a
    X_58_170                ABAP/4 list: At least 58 rows by 170 columns
    X_65_132                ABAP list: At least 65 rows by 132 columns
    X_90_120                ABAP list: At least 90 rows by 120 columns
    X_44_120                ABAP/4 list: At least 44 rows by 120 columns
    X_65_80                 ABAP/4 list: At least 65 rows by 80 columns
    but every time the same message appears even on A3 size paper..
    i am using REUSE_ALV_GRID_DISPLAY to display ALV.
    Please help to to take out prints(can be in condensed mode) so that all columns appear on the print out..

    HI sujeet,
    Thanks for ur response. i had already checked the printer settings.. i think there is no problem with this. Can u Please suggest something else. thanks
    Hiii jyojit..
    Thanks for reply. I had already checked the said check box in spool admin. but the problem still exists. Please suggest something to get rid of the problem.

  • Automatically send mail from ALV reports

    hi experts,
        I have created an ALV report for overtime calculation.The report will be generated on weekly basis in the background and will display calculated  overtime worked by employees in the previous week. I want the Report to run background and send the report in the HR dept concened officer in excel format automatically on weekly basis for his approval.
    how do i go about.
    regards,
    aero

    hi,
    <b>1</b>. u can prepare the output in an internal table ITAB.
    <b>2</b>. and then u can fill mail content with the help of ITAB data
    <b>3</b>. and then call function <b>'SO_NEW_DOCUMENT_SEND_API1'</b> if u have no attachement to be sent, but only normal mail with content in it.
    The sample code is below.
    FORM header_of_mail.
      CLEAR g_s_object_content.
      REFRESH g_t_object_content.
    Get an empty line
      MOVE space TO g_s_object_content+0(81).
      APPEND g_s_object_content TO g_t_object_content.
    Print partner number and description
      CLEAR g_s_object_content.
      MOVE text-t13 TO g_s_object_content.  " WMS
      MOVE sy-uline TO g_s_object_content+15(1).
      MOVE g_f_wms_descr TO g_s_object_content+30.
      APPEND g_s_object_content TO g_t_object_content.
    Print Division for which the mail is meant for
      CLEAR g_s_object_content.
      MOVE text-t14 TO g_s_object_content.  " Material with division
      MOVE sy-uline TO g_s_object_content+25(1).
      MOVE g_t_y16m_rcp_par-spart TO g_s_object_content+30.
      APPEND g_s_object_content TO g_t_object_content.
    Get an empty line
      CLEAR g_s_object_content.
      MOVE space TO g_s_object_content+0(81).
      APPEND g_s_object_content TO g_t_object_content.
    Get a dotted line.
      CLEAR g_s_object_content.
      MOVE sy-uline TO g_s_object_content+0(120).
      APPEND g_s_object_content TO g_t_object_content.
    Print column headings
      CLEAR g_s_object_content.
      MOVE text-t04 TO g_s_object_content+3(16). " IDoc number
      MOVE text-t05 TO g_s_object_content+27(18). " Material number
      MOVE text-t07 TO g_s_object_content+63(6). " Length
      MOVE text-t08 TO g_s_object_content+81(5). " Width
      MOVE text-t09 TO g_s_object_content+97(6). " Height
      MOVE text-t10 TO g_s_object_content+109(11). " Brut Weight
      APPEND g_s_object_content TO g_t_object_content.
    Get a dotted line.
      CLEAR g_s_object_content.
      MOVE sy-uline TO g_s_object_content+0(120).
      APPEND g_s_object_content TO g_t_object_content.
    ENDFORM.                    " HEADER_OF_MAIL
    FORM body_of_mail.
    Print contents such as IDoc number, material no. and measures
      LOOP AT g_t_mail_for_division.
        CLEAR g_s_object_content.
        MOVE g_t_mail_for_division-docnum TO g_s_object_content+3(16).
        MOVE g_t_mail_for_division-matnr TO g_s_object_content+27(18).
        MOVE text-t11 TO g_s_object_content+49(4).
        MOVE g_t_mail_for_division-laeng_from_sap TO
                                            g_s_object_content+57(13).
        MOVE g_t_mail_for_division-breit_from_sap TO
                                            g_s_object_content+74(13).
        MOVE g_t_mail_for_division-hoehe_from_sap TO
                                            g_s_object_content+91(13).
        MOVE g_t_mail_for_division-brgew_from_sap TO
                                            g_s_object_content+108(13).
        APPEND g_s_object_content TO g_t_object_content.
        CLEAR g_s_object_content.
        MOVE text-t12 TO g_s_object_content+49(4).
        MOVE g_t_mail_for_division-laeng_from_idoc TO
                                            g_s_object_content+57(13).
        MOVE g_t_mail_for_division-breit_from_idoc TO
                                            g_s_object_content+74(13).
        MOVE g_t_mail_for_division-hoehe_from_idoc TO
                                            g_s_object_content+91(13).
        MOVE g_t_mail_for_division-brgew_from_idoc TO
                                            g_s_object_content+108(13).
        APPEND g_s_object_content TO g_t_object_content.
      ENDLOOP.
    ENDFORM.                    " BODY_OF_MAIL
    FORM send_mail USING  p_y16m_rcp_par STRUCTURE y16m_rcp_par.
    Have a subject for the mail
      g_s_document_data-obj_name = text-t02.
      g_s_document_data-obj_descr = text-t03.
    Fill receiver information
      CLEAR g_s_receivers.
      REFRESH g_t_receivers.
      g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.
      g_s_receivers-receiver = p_y16m_rcp_par-rec_id.
      g_s_receivers-express = 'X'.
      APPEND g_s_receivers TO g_t_receivers.
    Call function to send mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = g_s_document_data
               document_type              = 'RAW'
             PUT_IN_OUTBOX              = ' '
        IMPORTING
             SENT_TO_ALL                =
             NEW_OBJECT_ID              =
           TABLES
             OBJECT_HEADER              =
               object_content             =  g_t_object_content
             CONTENTS_HEX               =
             OBJECT_PARA                =
             OBJECT_PARB                =
                receivers                  = g_t_receivers
          EXCEPTIONS
               too_many_receivers         = 1
               document_not_sent          = 2
               document_type_not_exist    = 3
               operation_no_authorization = 4
               parameter_error            = 5
               x_error                    = 6
               enqueue_error              = 7
               OTHERS                     = 8
      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.                    " SEND_MAIL
    hope this helps.
    pls reward if useful...
    Message was edited by:
            pawan ambadas

  • Problem in excel download of ALV report

    Hi All,
    I have created an ALV report with 87 fields in it. Whenever I am trying to download that report into excel the number of column breaks into 2 rows. In this case, The downloaded file contains 57 Columns in 1 row and remaining 29 Columns in second row. Can anyone please help me in understanding why this is happening while downloading this report into excel file and what will be the solution to correct it.
    To download the file I am using the icon placed at application toolbar or ( Cntrl + Shift + F9 ).
    Waiting for your response.
    Regards.
    Pravesh

    HI Parvesh,
          If you want to download the ALV result to you local file however you can follow the below coding.
    DATA:  l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = SPACE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME                     = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'ASC'
      TABLES
        DATA_TAB                        = T_DOWNL
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    ENDIF.

  • Problem with subtotal calculation in ALV reports

    Hi All,
       I am doing one program for calculating subtoals in ALV . For this i want to display subtotal text at each envey subtotal 's row.
    For that i have created one form 'SUB_SUBTOT_TEXT' and it has given to IT_EVENTS-FORM. But SUB_SUBTOT_TEXT Form is not called by IT_EVENTS event.
    what are all the mandatories for displaying subtotal text.
    Can any one please help me.
    Thanks in Advance.

    Hi Sree,
    *& Table declaration
    &----TABLES: ekko.&----
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV&----
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.&----
    *& Type declaration
    &----* Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.&----
    *& Internal table declaration
    DATA:* Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    Internal table for ALV Display events
      i_events TYPE slis_t_event,
    Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.&----
    *& Work area declaration
    &----DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.&----
    *& Constant declaration
    &----CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.&----
    *& Start-of-selection event
    &----START-OF-SELECTION.* Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material
             matnr " Material
             werks " Plant
             werks " Plant
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.  IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.* To build the Page header
      PERFORM sub_build_header.* To prepare field catalog
      PERFORM sub_field_catalog.* Perform to populate the layout structure
      PERFORM sub_populate_layout.* Perform to populate the sort table.
      PERFORM sub_populate_sort.* Perform to populate ALV event
      PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
          To build the header
          No Parameter
    FORM sub_build_header .* Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.* Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
          Build Field Catalog
          No Parameter
    FORM sub_field_catalog .*  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:     '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',     '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',     '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',     '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.                    " sub_field_catalog&----
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.* Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.  wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table  IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog&----
    *&      Form  sub_populate_layout
          Populate ALV layout
          No Parameter
    FORM sub_populate_layout .  CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM.                    " sub_populate_layout&----
    *&      Form  sub_populate_sort
          Populate ALV sort table
          No Parameter
    FORM sub_populate_sort .* Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.* Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort&----
    *&      Form  sub_get_event
          Get ALV grid event and pass the form name to subtotal_text
          event
          No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.  DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.* Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.ENDFORM.                    " sub_get_event&----
    *&      Form  sub_alv_report_display
          For ALV Report Display
          No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .* This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
       MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.ENDFORM.                    " sub_alv_report_display&----
          FORM sub_alv_top_of_page
          Call ALV top of page
          No parameter
    ----FORM sub_alv_top_of_page.                                   "#EC CALLED* To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page&----
    *&      Form  subtotal_text
          Build subtotal text
          P_total  Total
          p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.* Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Hopes its helpful.
    Regards,
    Raj.

  • Problem with User Command in alv report

    Hi
    I have developed a ALV grid report with drill down capability to transaction code for user command. I am having a trouble with this.
    CASE ucomm.
        WHEN '&IC1'.
          CLEAR: wa_import.
          IF selfield-fieldname EQ 'ANLN1'.
            READ TABLE t_import INTO wa_import INDEX selfield-tabindex.
            SET PARAMETER ID 'BUK' FIELD wa_import-bukrs.
            SET PARAMETER ID 'ANl' FIELD wa_import-anln1.
            CALL TRANSACTION 'AW01N'.
          ENDIF.
    here my parameter ids are showing the values but when i call the transaction i am not getting the actual asset numbers.
    Can someone help me out this
    Thanks

    Hi,
    add the AND SKIP FIRST SCREEN...addition..
    CALL TRANSACTION 'AW01N' AND SKIP FIRST SCREEN.
    Thanks
    Naren

  • Problem in Back Button in ALV report

    Hi Team,
    I have created a report which has a selection screen. Based on the input I am showing an ALV OO grid in my custom screen 0100. Now In the system toolbar on my 0100 screen I have enabled back, up and exit button. On click of which I am wrting 'LEAVE TO SCREEN 0. '
    But it doesn't take me to the selection screen. Rather it throws me out of the transaction. Can anybody
    suggest me a command so that when I click on back button it will take to the selection screen.
    Thanks,
    Mainak

    Hi,
    Go through given program it is very usefull for you,
    ***Correct your program as follows...
    PROGRAM rsolett1 MESSAGE-ID sy.
    TYPE-POOLS: slis.
    data: repid like sy-repid.
    DATA: w_fieldcat TYPE slis_fieldcat_alv,
    t_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: w_listheader TYPE slis_listheader,
    t_listheader TYPE slis_t_listheader.
    DATA: BEGIN OF t_output OCCURS 0,
    slno TYPE char10,
    name TYPE char10,
    lino TYPE char10,
    prof TYPE char10,
    addr TYPE char10,
    fanm TYPE char10,
    plbu TYPE char10,
    END OF t_output.
    w_fieldcat-col_pos = 1.
    w_fieldcat-fieldname = 'SLNO'.
    w_fieldcat-seltext_m = 'SERIAL NUMBER'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 2.
    w_fieldcat-fieldname = 'NAME'.
    w_fieldcat-seltext_m = 'NAME'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 3.
    w_fieldcat-fieldname = 'LINO'.
    w_fieldcat-seltext_m = 'LICENCE NUMBER'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 4.
    w_fieldcat-fieldname = 'PROF'.
    w_fieldcat-seltext_m = 'PROFESSION'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 5.
    w_fieldcat-fieldname = 'ADDR'.
    w_fieldcat-seltext_m = 'ADDRESS'.
    w_fieldcat-do_sum = 'X'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 6.
    w_fieldcat-fieldname = 'FANM'.
    w_fieldcat-seltext_m = 'FATHER NAME'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 7.
    w_fieldcat-fieldname = 'PLBU'.
    w_fieldcat-seltext_m = 'PLACE OF BUSSINESS'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    *PUPULATING TOP-OF-PAGE.
    w_listheader-typ = 'H'.
    w_listheader-info = 'FORMA'.
    APPEND w_listheader TO t_listheader.
    CLEAR w_listheader.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = ' '
    i_callback_top_of_page = 'SUB_TOP_OF_PAGE'
    it_fieldcat = t_fieldcat
    i_default = 'X'
    TABLES
    t_outtab = t_output.
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZPFSTATUS'.
    ENDFORM.
    Edited by: Ganesh Modhave on Aug 12, 2008 1:06 PM
    Thanks&Regards,
    Naresh kumar

  • Sending mail of ALV Report automatically

    Hi All,
    Don't we have one funtional module to send the report output automatically when it is executed.
    I want to give userID only for input.
    Please tel me as soon as possible.
    Regards,
    Rohit

    Hi,
    Try this
    SELECT U~BNAME
             A~SMTP_ADDR
             INTO TABLE T_MAILID
        FROM USR21 AS U INNER JOIN
             ADR6 AS A
          ON APERSNUMBER = UPERSNUMBER AND
             AADDRNUMBER = UADDRNUMBER
       WHERE U~BNAME IN S_UNAME.
    from this you can get the Mail id :
    then you use the function module SO_NEW_DOCUMENT_SEND_API1.

  • Problem in auto mail forwarding SO36

    Hi,
    I had setup in SO36 for a user, but she's going on leave and would all her messages to go to another user for one week. I tried it in SO36, but the system told me 'Activation time already exists'. How do I deactivate the original forwarding or change the forwarding period?
    Many thanks,

    Hi
       This problem was not resolved. I tried few things but not good. So what we did we created a few profile like MM/SD/FICA and we executed report based on profile and sent them only the column relevant to them.
    Regards,
    Atul Joshi

  • Problem in Submit Statement of Alv Report

    Hi All Experts,
    i make one report,my requirement is when i execute my report then it displays 100 records, i select 20 records from 100 records
    then based upon 20 records  execute the another report with out slection screen. i know the process through the submit statement,but it doesn't give exact output 20 of 20 based upon selected entries.
    my Code is:SUBMIT ZPS_PROJ_CN41N USING SELECTION-SCREEN '1000' WITH SELECTION-TABLE RSPAR_TAB
                                                            AND RETURN.
    give suggistions and correct syntax of submit statement.
    Thanks.

    Hi,
    = 'EQ ' for parameters
    In for range or selct-options
    SUBMIT  <Report name>
             WITH r_budat IN s_budat           " Selection screen parameters
             WITH kostl   IN s_kostl
             WITH kstar   IN s_kstar
             AND RETURN.
    "With Variant
      SUBMIT <Report Name>
         USING SELECTION-SET 'BPC TEST'             "BPC set is Varaint name for report
               EXPORTING LIST TO MEMORY AND RETURN.
    "capturing the output to another report
    SUBMIT  <Report name>
             WITH r_budat IN s_budat           " Selection screen parameters
             WITH kostl   IN s_kostl
             WITH kstar   IN s_kstar
            EXPORTING LIST TO MEMORY AND RETURN.    
    Prabhudas

  • Alv report*urgent

    diff erence between list and grid display.
    difference between occurs 0 and occurs 10

    Hi Sunil
    When you give OCCURS 0,
    the incremented memory in Internal table will be : 8KB by default.
    when you give occurs 10 ,
    the incremented memory in Internal table will be : ten records of memory.
    Means,
    Initially, the internal table has 8 KB of memory.
    if that is filled out with data, then the memory will be incremented according to OCCURS parameter.(wat i gave in the above).
    Coming to performance: If you know the no. of records your fetching into the Internal table you use OCCURS <no. of records>. It would perform well than OCCURS 0.
    Occurs 0 keeps on incrementing 8kb when there is a value. But Occurs 10 will assign 10 records space even though there is no value.
    Lets suppose you did not get any values from the DB after a select, in this case if you write Occurs 0 it will not allocate any single space in the memory. If you write OCCURS 10 it will pre allocates some memory.
    Reward if helpful
    Regards
    Lakshman

Maybe you are looking for

  • Help me with my JFileChooser() please

    How can I set the directory to start inn, not use det default??

  • Error in Form16 taken through ESS.

    Experts, While accessing Form16 through ESS, system shows an error. The error key is as follows: Screen output without connection to user.                           , error key: RFC_ERROR_SYSTEM_FAILURE   I check the Java connections and its working

  • Access ApplicationBean from servlet

    My project uses both JSF generated pages as well as servlets. I would like to be able to access an Application Bean from a servlet in the same project. The java files for the servlet are in the same directory as the package that holds the generated j

  • Edit view not representitive of filmstrip view

    I am trying to edit backgrounds. I can see a background in the filmstrip view but not on the stage in edit view.. Whats up? I have included a screen shot.

  • Why am I unable to sign in after purchasing Export PDF ?????

    Why do I get an error message, that "there is an error in signing in" when I try to use a newly purchased Export PDF????