Convert Tree output of IH01 transaction to simple ALV list output

Hi,
We have immediate requirement of changing the ALV TREE output of transaction IH01 to general ALV LIST display (with rows and columns) . To match with the requirement, I have to analyze the standard program first, copy the code to custom program and then do the changes which will consume lot of time.
Request your suggesttions if there are any simple ways to get the desired output so that i can quickly complete the development.
Murthy

Hi,
ALV Tree uses a different class and added logic. What logic is common is fetching and building of internal tables from data perspective. You can re-use this logic by calling the subroutine in the program and passing required values. It would be fast but in this case would take a bit of time, as you still need to analyse the code to make sure everything is right.
Regards,
Arnab.

Similar Messages

  • ALV List output limits

    Hello,
    I have a problem with my ALV List, I use a simple ALV List with much fields and I can't change with ALV Grid, on a specific client works correctly but on another client of the same system I've a dump.
    Is it possible to set a client dependent limits for fields/characters to display for output?
    Thanks
    Antonio

    It's a strange problem because if program runs on '100' client, runs correctly but on '200' client I have a dump but the system is the same...
    If field catalog is wrong I should have the problem with all clients...
    I've tried to remove/change some fields and works but with all fields I've dump only on one client...
    I think there are limits on layout... is it possible?
    Edited by: Aristoteles92 on Nov 23, 2009 5:22 PM

  • Is it possible to display LOGO in simple ALV list?

    Hi Guys,
    Is it possible to display LOGO in simple ALV list. If yes plz explain in details.
    Thanks
    Sharat

    Yes it is possible to display logo at the top of the page.
    TYPE-POOLS: slis.
    *     Data Decalaration
    DATA: it_vbak TYPE TABLE OF vbak.
    DATA: g_repid TYPE sy-repid.
    DATA: it_listheader TYPE slis_t_listheader,
           wa_listheader TYPE slis_listheader.
    *     START-OF-SELECTION
    START-OF-SELECTION.
       g_repid = sy-repid.
       SELECT * FROM vbak INTO TABLE it_vbak.
       PERFORM build_alv_header.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           i_callback_program     = g_repid
           i_callback_top_of_page = 'TOP_OF_PAGE'
           i_structure_name       = 'vbak'
         TABLES
           t_outtab               = it_vbak.
    *&      Form  BUILD_ALV_HEADER
    FORM build_alv_header .
    *  Type H is used to display headers i.e. big font
       wa_listheader-typ  = 'H'.
       wa_listheader-info ='Flight Details'.
       APPEND wa_listheader TO it_listheader.
       CLEAR wa_listheader.
    *  Type S is used to display key and value pairs
       wa_listheader-typ = 'S'.
       APPEND wa_listheader TO it_listheader.
       CLEAR wa_listheader.
    *  Type A is used to display italic font
       wa_listheader-typ = 'A'.
       wa_listheader-key = 'Date    :' .
       wa_listheader-info ='SAP ALV Report'.
       APPEND wa_listheader TO it_listheader.
       CLEAR wa_listheader.
    ENDFORM.                    " BUILD_ALV_HEADER
    *&      Form  top_of_page
    FORM top_of_page.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
           it_list_commentary = it_listheader
           i_logo         = 'PARI'.
    ENDFORM.                    "top_of_page

  • End of page in alv list output.

    Hi All,
    Can any body help me out for how to show end of page in alv list output.
    Thanks,
    Rakesh Singh

    Refer this link:
    http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
    Regards,
    Ravi

  • Hide columns for ALV list output in SAP Query SQ01/SQ02

    Hi All,
    I have a requirement to hide the columns which are empty in sap query SQ01 alv list output.
    Please let me know this functionality available in Query (SQ01) like normal reports
    Regards,
    Venkat

    Hi,
    We just can't make changes in this case as this are all system generated programs.
    WE have to write our own reports to make things flexible to match our requirements.
    Things you are asking is not possible.
    Regards,
    Suvendu

  • Simple report list output sent as attachment thru email

    Hi All,
    Here's my task : I need to schedule a bi-weekly report that obviously runs in the background and produces output. From that output, I want to capture (with no manual intervention) the list output to an attachment and email a recipient. I've looked over code snippets and understand most of the <b>LIST</b> functions, but most deal with uploading a file from the frontend, which I do not want. Any ideas? Thx in advance.
    Jim

    Hi
    see the sample report to send mail as attachement
    modify it as per your requirement
    Mailing with Attachment by ABAP Coding  
    Refer this link:
    Mail with attachment.
    FORM send_list_to_basis .
      DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
            lt_index    TYPE sy-tabix,
            doc_type(3) TYPE c,
            descr       LIKE it_objpack_basis-obj_descr,
            temp_data   LIKE w_path,
            temp1       TYPE string,
            tab_lines   TYPE i,
            langu(15)   TYPE c,
            expirydate  TYPE so_obj_edt,
            L_FILE1(100).
      CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
      W_PATH-FILENAME = L_FILE1.
      APPEND w_path.
      CLEAR w_path.
      wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
      wa_doc_chng-obj_langu  = 'E'.
      wa_doc_chng-obj_expdat = sy-datum.
      CLEAR w_subject.
      CONCATENATE 'Please find attached document with list of users'
                  'not logged on for 180 days for client' sy-mandt
                  INTO w_subject SEPARATED BY space.
      it_objtxt_basis-line = w_subject.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      it_objtxt_basis-line = text-004.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      CLEAR w_tab_line.
      DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
      READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
      wa_doc_chng-doc_size =
       ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
      CLEAR it_objpack_basis-transf_bin.
      it_objpack_basis-head_start = 1.
      it_objpack_basis-head_num   = 0.
      it_objpack_basis-body_start = 1.
      it_objpack_basis-body_num   = w_tab_line.
      it_objpack_basis-doc_type   = 'RAW'.
      APPEND it_objpack_basis.
      CLEAR it_objpack_basis.
      LOOP AT w_path.
        temp1 = w_path.
        descr = w_path.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '\'
            string    = descr
          IMPORTING
            head      = descr
            tail      = temp_data.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '.'
            string    = descr
          IMPORTING
            head      = temp_data
            tail      = doc_type.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename      = temp1
            filetype      = 'BIN'
            header_length = 0
            read_by_line  = 'X'
            replacement   = '#'
          TABLES
            data_tab      = it_upload.
        DESCRIBE TABLE it_upload LINES tab_lines.
        DESCRIBE TABLE it_objbin_basis LINES lt_index.
        lt_index = lt_index + 1.
        LOOP AT it_upload.
          wa_objbin_basis-line = it_upload-line.
          APPEND wa_objbin_basis TO it_objbin_basis.
          CLEAR wa_objbin_basis.
        ENDLOOP.
        it_objpack_basis-transf_bin = 'X'.
        it_objpack_basis-head_start = 0.
        it_objpack_basis-head_num   = 0.
        it_objpack_basis-body_start = lt_index.
        it_objpack_basis-body_num   = tab_lines.
        it_objpack_basis-doc_type   = doc_type.
        it_objpack_basis-obj_descr  = descr.
        it_objpack_basis-doc_size   = tab_lines * 255.
        APPEND it_objpack_basis.
        CLEAR it_objpack_basis.
      ENDLOOP.
      it_reclist_basis-receiver = '[email protected]'.
      it_reclist_basis-rec_type = 'U'.
      APPEND it_reclist_basis.
      CLEAR it_reclist_basis.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = it_objpack_basis
          contents_txt               = it_objtxt_basis
          contents_bin               = it_objbin_basis
          receivers                  = it_reclist_basis
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
      ENDIF.
    ENDFORM.                    " send_list_to_basis
    Reward points if useful
    Regards
    Anji

  • I wnat to add new fieldtext in the alv list output plz tell me

    hi,
    i whant add new fieldtext in the list output, plz tell me where can i modify it.
    CORRECTIONS
    DATE       CORRECTION NOTE    AUTHOR DESCRIPTION
    09.03.2001 L9CK045451 0388404 XSC    Wrong list output for multiple Os
    05.06.2001 AL0K023393 0410219 Lud    Wrong keydate for search with
                                         Pchbegda and pchendda.
    22.04.2004 S6BK024775 730486  PS     Too many selection parameters in
                                         header
    19.06.2006 S6BK035494 956731  JF     No sorting by qualification
    REPORT RHPK_FIND_PERS_WITH_EXPIRED_QU MESSAGE-ID PQ.
    DATA  AUFRUF(8).
    TABLES : OBJEC, GDSET.
    DATA  LIST.
    DATA  MARKFIELD(1) TYPE C.
    ALV_POOL
    TYPE-POOLS SLIS.
    INCLUDES
    INCLUDE .
    INCLUDE RHPEINI0.
    TABLES
    DATA: orgeh_BUFFER like hrobject OCCURS 1 WITH HEADER LINE.
    DATA: OBJECTS    LIKE HRSOBID    OCCURS 1 WITH HEADER LINE.
    DATA: h_OBJEC    LIKE objec    OCCURS 0 WITH HEADER LINE.
    DATA: pers_objects LIKE HRSOBID    OCCURS 1 WITH HEADER LINE.
    DATA: QUALI_TAB LIKE QUALI_PROF OCCURS 1 WITH HEADER LINE.
    DATA: PERSONS LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA: H_PERSONS LIKE HRPE_PROFL OCCURS 1 WITH HEADER LINE.
    DATA: LIST_OUTPUT LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA: BOOK_EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA: PLAN_EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA H_SUITED LIKE DYNP_PCRIT-SUITED.
    DATA: O_COLOR LIKE STREEATTR-COLOR.
    DATA: O_INTENSIV LIKE STREEATTR-INTENSIV.
    DATA  SHOW_KEY.
    DATA EVENT.
    DATA: HTEXT LIKE P1000-STEXT.
    DATA: EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA: COLLECTED_EVENTS LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
    DATA: SUBTY_TAB LIKE HRPE_OTYPE_SUBTY OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF  HIDE_STRU,
            PERSTYPE LIKE HROTYPE-OTYPE,
            PERSOBID LIKE HRSOBID-SOBID,
            PERSTXT LIKE PERSQ_PROF-STEXT,
            SCALE_ID LIKE HRPE_PROFQ-SCALE_ID,
            TRAININGTYPE LIKE HRP1000-OTYPE,
            TRAININGID   LIKE HRP1000-OBJID,
            TRAININGSTXT LIKE HRP1000-STEXT,
            QUALID LIKE QUALI_PROF-QUALID,
            QUALTEXT LIKE QUALI_PROF-QUALSTXT,
          END OF HIDE_STRU.
    DATA: BEGIN OF EXTAB OCCURS 10,
             FCODE LIKE RSMPE-FUNC,
          END OF EXTAB.
    DATA:  CURRENT_QUALID LIKE QUALI_PROF-QUALID.
    DATA:  CURRENT_TRAININGSID LIKE HRP1000-OBJID.
    DATA:  CURRENT_TRAININGTYPE LIKE HRP1000-OTYPE.
    DATA: SUBRC LIKE SY-SUBRC.
    VARIABLES
    DATA: OBJID LIKE P1000-OBJID.
    DATA: H_LINE_COUNT TYPE I.
    DATA: H_TABIX1 LIKE SY-TABIX.
    ALV-Variables
    DATA: alv_events_line    TYPE slis_alv_event.         "header line
    DATA ALV_EVENTS TYPE SLIS_T_EVENT.
    DATA GT_ALV_LIST_TOP_OF_LIST TYPE SLIS_T_LISTHEADER.
    DATA: gt_events TYPE SLIS_T_EVENT.
    DATA G_REPID LIKE SY-REPID.
    DATA G_VARIANT LIKE DISVARIANT.
    DATA ALV_USERCOMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
    DATA G_USERCOMMAND_FOR_RANKINGLIST TYPE SLIS_FORMNAME VALUE
    'USER_COMMAND_FOR_RANKINGLIST'.
    DATA ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: ALV_OUTPUT  LIKE HRPDV_EXPIRED_Q OCCURS 0 WITH HEADER LINE.
    DATA: Help_OUTPUT LIKE HRPDV_EXPIRED_Q OCCURS 0 WITH HEADER LINE.
    begin of Dynpro 5020 - POPUP: WEITER
    DATA: OK_CODE_5020   LIKE SY-UCOMM.
    DATA: NO_ORG.                          "if no org selected
    DATA: H_TABIX LIKE SY-TABIX.
    begin of Dynpro 20nn - Header
    TABLES: DYNP_RHPP.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-005.
    PARAMETERS:
       H_EVENTS LIKE DYNP_RHPP-GEN_TRAIN,  "with training sugg
       H_QUAL   LIKE DYNP_RHPP-EXPIRED_QUAL. "with Qual
    SELECTION-SCREEN END OF BLOCK B3.
    INITIALIZATION
    INITIALIZATION.
      PERFORM READ_T77S0_PARAMETERS_FOR_PE.
    get user parameters/Planvariante und Beginndatum setzen:
      PCHOTYPE = $ORGEH.
      CALL FUNCTION 'RHP0_USER_PARAMETERS_GET'
           EXPORTING
                FILL_IF_INITIAL = 'X'
           IMPORTING
                PLVAR           = PCHPLVAR
                BEGDA           = PCHBEGDA
                endda           = Pchendda    "Correction 0410219
                WITH_KEY        = SHOW_KEY
              SUBSTITUTE      =
              ESSENTIAL       = only_essential
                ORG_UNIT        = PCHOBJID-LOW
          EXCEPTIONS
                OTHERS     = 0.
    PCHBEGDA = LOW_DATE.   "Correction note: 0410219 / AL0K023393
    get menu text for key on/off
      PERFORM USER_MENU_TEXT_KEY(SAPLRHP0) USING G_MENU_TEXT_KEY.
    start-of-selection
    START-OF-SELECTION.
    terminate the selection if objid isn't given
      READ TABLE PCHOBJID INDEX 1 TRANSPORTING NO FIELDS.
      IF SY-SUBRC <> 0
      AND PCHOBJID IS INITIAL.
        PCHOBJID-SIGN   = 'I'.
        PCHOBJID-OPTION = 'EQ'.
        PCHOBJID-LOW    = '00000001'.
        APPEND PCHOBJID.
        NO_ORG = TRUE.
      ELSE.
        NO_ORG = FALSE.
      ENDIF.
    GET OBJEC.
    terminate the selection if objid isn't given
      IF NO_ORG = TRUE.
        EXIT.
      ENDIF.
      OBJECTS-PLVAR = PCHPLVAR.
      OBJECTS-OTYPE = PCHOTYPE.
      OBJECTS-SOBID = OBJEC-REALO.
      APPEND OBJECTS.
    Für das lesen der Organisationseinheit
      h_OBJEC-PLVAR = OBJEC-PLVAR.
      h_OBJEC-OTYPE = OBJEC-OTYPE.
      h_OBJEC-OBJID = OBJEC-objid.
      append h_objec.
      Read table h_objec index 1 transporting no fields.
      if sy-subrc = 0.
    Fill Buffer
        orgeh_BUFFER = h_OBJEC.
        orgeh_BUFFER[] = h_OBJEC[].
        CALL FUNCTION 'RH_TEXT_BUFFER_FILL'
          TABLES
            OBJECTS = orgeh_BUFFER.
        Loop at h_OBJEC.
          H_TABIX = SY-TABIX.
    Read text of organisation
          CALL FUNCTION 'RH_READ_OBJECT'
               EXPORTING
                    PLVAR     = h_OBJEC-plvar
                    OTYPE     = h_OBJEC-otype
                    OBJID     = h_OBJEC-OBJID
               IMPORTING
                  OBEG      = h_objec-begda
                  OEND      = h_objec-endda
                   SHORT     = short
                    STEXT     = h_OBJEC-stext
              EXCEPTIONS
                    NOT_FOUND = 1
                    OTHERS    = 2.
          IF SY-SUBRC = 0.
            modify h_OBJEC index H_TABIX.
          ENDIF.
        endloop.
      endif.
    end-of-selection
    END-OF-SELECTION.
    read objects of the organizational unit
      OBJID = OBJECTS-SOBID.
      CALL FUNCTION 'RHPH_PICK_UP_PERSONS'
          EXPORTING
               BEGDA      = PCHBEGDA    "Correction 0410219
               ENDDA      = PCHENDDA    "Correction 0410219
             STATUS     = '1'
               WITH_STEXT = 'X'
           TABLES
                OBJECTS    = OBJECTS
                PERSONS    = H_PERSONS
          EXCEPTIONS
               UNDEFINED  = 1
               OTHERS     = 2.
      IF SY-SUBRC = 0.
    prepare objects !
        objects-otype = h_persons-ttype.
        objects-sobid = h_persons-tobid.
        append objects.
      ELSE.
        EXIT.
      ENDIF.
    CLEAR OBJECTS. REFRESH OBJECTS.
    prepare sel_objects !
      pers_objects-PLVAR = PCHPLVAR.
      LOOP AT H_PERSONS.
        pers_objects-OTYPE = H_PERSONS-TTYPE.
        pers_objects-SOBID = H_PERSONS-TOBID.
        APPEND pers_objects.
      ENDLOOP.
    sort objects and delete adjacent duplicates
      SORT Pers_OBJECTS BY PLVAR OTYPE SOBID.
      DELETE ADJACENT DUPLICATES FROM Pers_OBJECTS COMPARING PLVAR OTYPE
    SOBID.
      CALL FUNCTION 'RHPK_FIND_PERS_WITH_EXPIRED_Q'
           EXPORTING
               PLVAR            = PCHPLVAR
               CHECK_BEGDA      = PCHBEGDA
               CHECK_ENDDA      = PCHENDDA
               SUBTY            = $ownsb                        "'B032'
             only_essential   =
             target_otype     =
             target_ap_iea    =
           TABLES
                IMP_PER_TAB     = pers_objects
                QUALI_TAB       = QUALI_TAB
                PERSONS         = LIST_OUTPUT
            altq_tab          =
          EXCEPTIONS
               NO_QUALIFICATION = 1
               NO_PERSON_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.
    100% case
      READ TABLE pers_objects INDEX 1 TRANSPORTING NO FIELDS.
      IF SY-SUBRC = 0.
        sort pers_objects by otype sobid.
      check the selected persons: if org.unit was selected !
        Loop at pers_objects.
          H_TABIX = SY-TABIX.
          READ TABLE LIST_OUTPUT WITH KEY  OTYPE = pers_objects-OTYPE
                                           SOBID = pers_objects-SOBID
                                           BINARY SEARCH.
          IF SY-SUBRC <> 0.
          person doesn't belong to the selected org.unit
          DELETE LIST_OUTPUT INDEX H_TABIX.
          ENDIF.
        ENDLOOP.
      ENDIF.                               "org.unit check needed ?
    end-of-selection.
      sort h_objec by otype objid.
      sort list_output by otype sobid.
      sort h_persons by ttype tobid.
    ALV-Liste aufbauen
      loop at h_objec.
        loop at h_persons where otype = h_objec-otype     "XSC
                          and   sobid = h_objec-objid.    "XSC
          Read table list_output with key
                                 otype = h_persons-ttype
                                 sobid = h_persons-tobid
                                 binary search.
          if sy-subrc = 0.
            h_tabix1 = sy-tabix.
            while sy-subrc = 0.
              clear alv_output.                            "XSC
              ALV_OUTPUT-otype    = h_objec-otype.
              ALV_OUTPUT-sobid    = h_objec-objid.
              ALV_OUTPUT-stext    = h_objec-stext.
              ALV_OUTPUT-Ptype    = LIST_OUTPUT-otype.
              ALV_OUTPUT-pobid    = LIST_OUTPUT-sobid.
              ALV_OUTPUT-pshort   = LIST_OUTPUT-short.
              ALV_OUTPUT-ptext    = LIST_OUTPUT-stext.
              ALV_OUTPUT-qualid   = LIST_OUTPUT-qualid.
              ALV_OUTPUT-qualstxt = LIST_OUTPUT-qualstxt.
              ALV_OUTPUT-expbegda = LIST_OUTPUT-vbegda.
              ALV_OUTPUT-expendda = LIST_OUTPUT-vendda.
          PERFORM FIND_TRAINING TABLES QUALI_TAB EVENT_TAB COLLECTED_EVENTS
                    USING $PLVAR $GDATE H_EVENTS H_QUAL.
              IF NOT EVENT_TAB[] IS INITIAL.
                READ TABLE COLLECTED_EVENTS WITH KEY
                                     QUALID = LIST_OUTPUT-QUALID.
                IF SY-SUBRC = 0.
                  ALV_OUTPUT-ICON_S_EVENTS = ICON_BOOKEVENT.
                endif.
              ENDIF.
              Append ALV_OUTPUT.
              h_tabix1 = h_tabix1 + 1.
              READ TABLE list_output INDEX h_tabix1
                         COMPARING otype sobid.
            endwhile.
          endif.
        endloop.
      endloop.
    check if indicator for qualification view is set
      IF h_qual = 'X'.                                          "note 956731
        SORT alv_output by qualid OTYPE SOBID ptype pobid       "note 956731
        expbegda expendda.                                      "note 956731
      ELSE.                                                     "note 956731
        SORT alv_output by OTYPE SOBID ptype pobid qualid expbegda expendda.
      ENDIF.                                                    "note 956731
      DELETE ADJACENT DUPLICATES FROM ALV_OUTPUT COMPARING OTYPE SOBID ptype
        pobid qualid expbegda expendda.
    stext_AQ und icon-Feld noch nicht gefüllt
        perform PREPARE_TOP_OF_LIST.
        perform Build_FIELDCAT using GT_FIELDCAT[] H_EVENTS.
        perform ALV_LAYOUT USING alv_layout.
        G_REPID          = SY-REPID.
        G_VARIANT-REPORT = G_REPID.
        PERFORM EVENTTAB_BUILD USING GT_EVENTS.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
        I_INTERFACE_CHECK        = 'X'
            I_CALLBACK_PROGRAM       = G_REPID
        I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
            I_CALLBACK_USER_COMMAND  = ALV_USERCOMMAND
            I_STRUCTURE_NAME         = 'HRPDV_EXPIRED_Q'
            IS_LAYOUT                = ALV_LAYOUT
            IT_FIELDCAT              = GT_FIELDCAT[]
        IT_EXCLUDING             =
        IT_SPECIAL_GROUPS        =
        IT_SORT                  =
        IT_FILTER                =
        IS_SEL_HIDE              =
            I_DEFAULT                = 'X'
            I_SAVE                   = 'A'
            IS_VARIANT               = G_VARIANT
            IT_EVENTS                = GT_EVENTS
        IT_EVENT_EXIT            =
        IS_PRINT                 =
        IS_REPREP_ID             =
        I_SCREEN_START_COLUMN    = 0
        I_SCREEN_START_LINE      = 0
        I_SCREEN_END_COLUMN      = 0
        I_SCREEN_END_LINE        = 0
        IMPORTING
          E_EXIT_CAUSED_BY_CALLER  =
          ES_EXIT_CAUSED_BY_USER   =
          TABLES
            T_OUTTAB                 = ALV_OUTPUT
          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.
    *&      Form  FIND_TRAINING
          text
         -->P_QUALI_TAB  text
         -->P_EVENT_TAB  text
         -->P_$PLVAR  text
         -->P_GDATE  text
         -->P_H_EVENT  text
         -->P_H_QUAL  text
    FORM FIND_TRAINING TABLES  P_QUALI_TAB STRUCTURE QUALI_TAB
                               P_EVENT_TAB STRUCTURE EVENT_TAB
                               P_COLLECTED_EVENTS STRUCTURE COLLECTED_EVENTS
                       USING   VALUE(P_$PLVAR) LIKE P1000-PLVAR
                               VALUE(P_GDATE) LIKE P1000-GDATE
                               VALUE(P_H_EVENT) TYPE ANY
                               VALUE(P_H_QUAL) TYPE ANY.
      IF NOT P_H_EVENT IS INITIAL.
        READ TABLE EVENT_TAB INDEX 1 TRANSPORTING NO FIELDS.
        IF SY-SUBRC <> 0.
          CLEAR P_EVENT_TAB. REFRESH EVENT_TAB.
          CLEAR P_COLLECTED_EVENTS. REFRESH P_COLLECTED_EVENTS.
          IF EVENT = FALSE.
            EVENT = TRUE.
          ELSE.
            EVENT = FALSE.
          ENDIF.
          CALL FUNCTION 'RHPH_FIND_TRAINING_FOR_QUAL'
               EXPORTING
                    PLVAR            = PCHPLVAR
                    GDATE            = SY-DATUM
                  GET_NAME         = 'X'
               TABLES
                    QUALI_TAB        = QUALI_TAB
                    TO_Q_TAB         = EVENT_TAB
              EXCEPTIONS
                   NO_QUALIFICATION = 1
                   NO_OBJECT_FOUND  = 2
                   TECHNICAL_ERROR  = 3
                   OTHERS           = 4.
          IF SY-SUBRC = 0.
    the found qualifications are picked up into table event_tab
          ENDIF.
          IF SY-SUBRC = 1.
            MESSAGE S015.   "Zu den Eingaben wurden keine Daten gefunden
          ENDIF.
          IF SY-SUBRC > 2.
            EXIT.
          ENDIF.
    collect events when there are double.
    Veranstaltungen kollektieren, Können mehrfach auftauchen, da
    verschiedenen Qualifikationen von gleichen Veranstaltungen vermittelt
          LOOP AT P_EVENT_TAB INTO P_COLLECTED_EVENTS.
            APPEND P_COLLECTED_EVENTS.
          ENDLOOP.
          SORT P_COLLECTED_EVENTS BY QUALID STEXT.
        ENDIF.
      ENDIF.
    ENDFORM.                               " FIND_TRAINING
    *&      Form  PREPARE_TOP_OF_LIST
          text
    -->  p1        text
    <--  p2        text
    FORM PREPARE_TOP_OF_LIST.
      DATA ALV_TOP_OF_LIST TYPE SLIS_LISTHEADER.  "typ, key, info
      DATA STEXT LIKE HRPDV_SUCCESSOR_VIEW-TTEXT.
      DATA P_SUBRC LIKE SY-SUBRC.
      DATA P_STEXT LIKE T777O-OTEXT.
      DATA l_tabix like sy-tabix value 0.
      DATA: h_counter TYPE i.                             "note 730486
      ALV_TOP_OF_LIST-TYP = 'H'.
      ALV_TOP_OF_LIST-INFO = TEXT-REQ.
      APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
    Organisationseinheit
      ALV_TOP_OF_LIST-typ = 'S'.
    Read text for organisationunit
      PERFORM READ_TEXT_OTYPE_T777O(SAPLRHP0) USING SY-LANGU $ORGEH
                                                    P_STEXT P_SUBRC.
      ALV_TOP_OF_LIST-key = P_STEXT.
    fill buffer for read organisation-text
      CALL FUNCTION 'RH_TEXT_BUFFER_FILL'
         EXPORTING
              CHECK_STRU_AUTH = 'X'
              WITH_EXTINT     = ' '
           TABLES
                OBJECTS         = OBJECTS.
    loop at objects for multipleselection
      clear h_counter.                          "note 730486
      LOOP AT OBJECTS.
        $OBJID = OBJECTS-SOBID.
        CALL FUNCTION 'RH_READ_OBJECT'
             EXPORTING
                PLVAR           = OBJECTS-PLVAR
                OTYPE           = OBJECTS-OTYPE
                OBJID           = $OBJID
             IMPORTING
              SHORT           = short
                STEXT           = STEXT
             EXCEPTIONS
                NOT_FOUND       = 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.
        IF h_counter >= 15.                               "note 730486
          MOVE '( ... )' TO ALV_TOP_OF_LIST-INFO.         "note 730486
          APPEND ALV_TOP_OF_LIST TO gt_alv_list_top_of_list.
          "note 730486
          EXIT.                                           "note 730486
        ENDIF.                                            "note 730486
        CONCATENATE $ORGEH OBJECTS-SOBID STEXT INTO
        ALV_TOP_OF_LIST-INFO SEPARATED BY SPACE.
        APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
        CLEAR ALV_TOP_OF_LIST.
        ALV_TOP_OF_LIST-typ = 'S'.
        l_tabix = l_tabix + 1.
        ADD 1 TO h_counter.                         "note 730486
      ENDLOOP.
    CLEAR ALV_TOP_OF_LIST.
      ALV_TOP_OF_LIST-TYP  = 'S'.
      ALV_TOP_OF_LIST-key = TEXT-003.
      WRITE PCHBEGDA TO ALV_TOP_OF_LIST-INFO.
      APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
      clear ALV_TOP_OF_LIST-INFO.
      ALV_TOP_OF_LIST-key = TEXT-004.
      WRITE PCHENDDA TO ALV_TOP_OF_LIST-INFO.
      Append ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
    ENDFORM.                               " PREPARE_TOP_OF_LIST
    *&      Form  BUILD_FIELDCAT
          text
         -->P_GT_FIELDCAT[]  text
    FORM BUILD_FIELDCAT USING  P_GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV
                               P_H_EVENTS.
      DATA: WA_FIELDCAT LIKE LINE OF P_GT_FIELDCAT.
      DATA: P_REPNAME LIKE SY-REPID,
            L_TABIX LIKE SY-TABIX.         "local variable for sy-tabix.
      P_REPNAME = SY-REPID.
    Erstellen des Feldkataloges
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
               I_PROGRAM_NAME         = P_REPNAME
               I_INTERNAL_TABNAME     =
               I_STRUCTURE_NAME       = 'HRPDV_EXPIRED_Q'
               I_CLIENT_NEVER_DISPLAY = 'X'
               I_INCLNAME             = PRONAME
         CHANGING
               CT_FIELDCAT            = P_GT_FIELDCAT
         EXCEPTIONS
               INCONSISTENT_INTERFACE = 0
               PROGRAM_ERROR          = 0
               OTHERS                 = 0.
      LOOP AT P_GT_FIELDCAT INTO WA_FIELDCAT.
        l_tabix = sy-tabix.
        CASE WA_FIELDCAT-FIELDNAME.
          when 'OTYPE'.
            WA_FIELDCAT-DDICTXT = 'L'.
          when 'SOBID'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'STEXT'.
            WA_FIELDCAT-DDICTXT = 'L'.
          when 'PTYPE'.
            WA_FIELDCAT-DDICTXT = 'L'.
          when 'POBID'.
            WA_FIELDCAT-DDICTXT = 'L'.
          when 'PSHORT'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'PTEXT'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'QUALID'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'QUALSTXT'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'EXPBEGDA'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'EXPENDDA'.
            WA_FIELDCAT-DDICTXT = 'L'.
          WHEN 'ICON_S_EVENTS'.
            IF P_H_EVENTS IS INITIAL.
              WA_FIELDCAT-NO_OUT = 'X'.
            else.
              WA_FIELDCAT-DDICTXT = 'X'.
            endif.
        ENDCASE.
        MODIFY P_GT_FIELDCAT FROM WA_FIELDCAT INDEX l_tabix.
      ENDLOOP.
    ENDFORM.                               " BUILD_FIELDCAT
    *&      Form  ALV_LAYOUT
          text
         -->P_L_ALV_LAYOUT  text
    FORM ALV_LAYOUT USING    P_ALV_LAYOUT  TYPE slis_layout_alv.
    build layout
    P_LAYOUT-BOX_FIELDNAME = 'MARK_X'.   "fieldname for checkbox
      P_ALV_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      P_ALV_LAYOUT-BOX_TABNAME   =  ALV_OUTPUT.   "tabname for checkbox
      p_ALV_layout-info_fieldname = 'ALV_COLOR'.
    ENDFORM.                               " ALV_LAYOUT
    FORM eventtab_build USING
    FORM EVENTTAB_BUILD USING RT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      MOVE 'TOP_OF_PAGE' TO LS_EVENT-NAME.
      MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
      APPEND LS_EVENT TO RT_EVENTS.
    ENDFORM.                    "EVENTTAB_BUILD
    *FORM TOP_OF_PAGE
    FORM TOP_OF_PAGE.                                           "#EC CALLED
      NEW-PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = GT_ALV_LIST_TOP_OF_LIST[].
    ENDFORM.                    "TOP_OF_PAGE
          FORM USER_COMMAND                                             *
    USER_COMMAND for the list of successor view                         *
    -->  r_ucomm                                                       *
    -->  rs_selfield                                                   *
    FORM USER_COMMAND USING ALV_UCOMM LIKE SY-UCOMM
          RS_SELFIELD TYPE SLIS_SELFIELD.                       "#EC CALLED
      DATA: SELECTED_LINE LIKE HRPDV_expired_q.
      DATA: SOBID_QUA LIKE P1000-OBJID.
      DATA: LT_PERS_TAB LIKE HRSOBID OCCURS 0 WITH HEADER LINE.
      CASE ALV_UCOMM.
        WHEN '&IC1'.                       "per Doppelklick auswählen
          READ TABLE ALV_OUTPUT INDEX
          RS_SELFIELD-TABINDEX INTO SELECTED_LINE.
          CASE RS_SELFIELD-FIELDNAME.
            WHEN 'POTYPE' or 'POBID' or 'PTEXT' or 'OTYPE' or 'SOBID' or
    'STEXT' or 'QUALID' or 'QUALSTXT' or 'EXPBEGDA' or 'EXPENDDA'.
              READ TABLE ALV_OUTPUT INDEX RS_SELFIELD-TABINDEX INTO
                    Help_output.
              IF SY-SUBRC <> 0.
                MESSAGE S027.               "Bitte gültige Zeile auswählen
                EXIT.
              Endif.
         IF ALV_OUTPUT-SOBID IS INITIAL.
           MESSAGE S015.  "Zu den Eingaben wurden keine Daten gefunden
         ELSE.
         converte the variable because of the different types
         SOBID_QUA = SELECTED_LINE-SOBID_QUA.
              CALL FUNCTION 'RHPP_SHOW_PROFILE'
                EXPORTING
                  PLVAR        = pchplvar
                  OTYPE        = SELECTED_LINE-PTYPE       "XSC
                  OBJID        = SELECTED_LINE-POBID       "XSC
                  BEGDA        = PCHBEGDA
                  ENDDA        = PCHENDDA
                  MAINTAIN     = ' '
                EXCEPTIONS
                  NO_AUTHORITY = 1
                  NOT_FOUND    = 2
                  OTHERS       = 3.
              CASE SY-SUBRC.
                WHEN 0.
                All right.
                WHEN 1.
                  MESSAGE S015.
                Zu Ihren Eingaben konnten keine Daten gefunden werden!
                WHEN 2.
                  MESSAGE E000.
                Dazu haben sie keine berechtigung!
                WHEN OTHERS.
                  MESSAGE E008.
                Es ist ein unvorhergesehener Fehler aufgetreten.
              ENDCASE.                     "sy-subrc.
              CLEAR ALV_OUTPUT.
       ENDIF.    "IF ALV_OUTPUT-SOBID IS INITIAL.
       CLEAR ALV_OUTPUT-SOBID.
            when 'ICON_S_EVENTS'.
              IF SELECTED_LINE-ICON_S_EVENTS IS INITIAL.
                MESSAGE S027.              "Bitte gültige Zeile auswählen
                EXIT.
              ENDIF.
              CLEAR LT_PERS_TAB.
              REFRESH LT_PERS_TAB.
              LT_PERS_TAB-PLVAR = pchPLVAR.
              LT_PERS_TAB-OTYPE = SELECTED_LINE-PTYPE.          "XSC
              LT_PERS_TAB-SOBID = SELECTED_LINE-POBID.          "XSC
              APPEND LT_PERS_TAB.
              SOBID_QUA = SELECTED_LINE-QUALID.
              CALL FUNCTION 'RHPP_SHOW_SUGGEST_EVENTS'
              EXPORTING
                P_PLVAR      = pchPLVAR
                P_SOBID_QUA  = SOBID_QUA
              P_PROFCY_REQ = SELECTED_LINE-RATING_REQ
                P_GDATE      = sy-datum
              TABLES
              EVENT_TAB    =
                PERS_TAB     = LT_PERS_TAB.
          endcase.
          CLEAR SELECTED_LINE.
      ENDCASE.                             "case sy-ucomm
    CLEAR SY-UCOMM.
    ENDFORM.                    "USER_COMMAND

    Pls be more specific in your question. If you want to include an extra field in your alv output, then read the field catalog table you created through "Reuse_alv_fieldcatalog_merge" and then add an extra entry in it giving the details of the field you want to add.. and then call the "resuse_alv_grid_display",
    Hope this helps. To be able to help you in a better way, kindly revert with any specific issue.
    Reward if helpful,
    Karan

  • ALV List Output: How to avoid data statistics from printing in Background

    Hi,
    I am running an ALV list display in Background mode and the output is showing the data statistics first and then the actual output of the ALV...
    I dont want the data statistics to be printed..
    How to avoid that.. is there any to do it...

    Hi Neela
    If you are using the good old REUSE_ALV_GRID_DISPLAY function module, you should be able to suppress the List Info if SY-BATCH is 'X' using the IS_PRINT parameter.
      MOVE 'X' TO is_print-no_print_listinfos .
    Presumably there is a similar parameter using classes.
    Cheers
    Lyal

  • ALV list output to smartforms (Urgent)

    Hello Friends,
    I have a requirement as below.
    i have to copy standard report to Z-report(Customer Line Items). on the output of the report i have to add two pushbuttons(not on the Application tool bar or MENU bar) but on the body of the output list. these buttons are labelled as PRINT1 and PRINT2. this report displays all the line items for a customer with a checkbox at the begining of each item.
    Now my requirement is
    when the button PRINT1 is clicked all the selected line items (for which checkbox is clicked) should be printed in a smartform.
    when the button PRINT2 is clicked each line item should be printed separately in the smartform. that is for each line item smartform should be called once.
    And also how to create pushbuttons on the body of the list output. is it possible?
    Any help in this regard is highly appreciated and rewarded.

    Your requirement seem to be achievable.
    When you click PRINT1 your ALV program needs to accumulate the selected lines into a table, you need to create a smartform that has this table in its interface and call the form.
    When you click PRINT2 your ALV program needs either to loop through the entries and call a smartform one for each loop or pass the whole table to the smartform and let the smartform perform the loop.
    Not sure about putting a push buuton on an ALV grid, you may have to create some sort of hotspot.
    Regards,
    Nick

  • Want to call transactions from ALV list output

    Hi Guru's,
    I have a report which displays Open PR's, open PO's n their details with respect to material. wat i want to do is call transactions from this out put i.e i want a interactive output. if i click on particular PR i want the system to call that PR screen. how can i do this?? Plz help.

    REFER THIS
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = 'USER_COMMAND '
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      TABLES
        T_OUTTAB                       =
    IF SY-SUBRC <> 0.
    ENDIF.
    AND THEN
                     rs_lineinfo type slis_lineinfo.
    FORM user_command5 USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    data : lv_date type char4.
    CLEAR : LV_DATE .
    CASE r_ucomm.
    WHEN '&IC1'.
          IF rs_selfield-fieldname = 'BELNR'.
        read table it_e into wa_e index rs_selfield-tabindex.
        if sy-subrc = 0.
        lv_date = wa_e-budat(4).
        endif.
        SET PARAMETER ID 'BLN' FIELD rs_selfield-value.
        SET PARAMETER ID 'BUK' FIELD s_bukrs-low.
        SET PARAMETER ID 'GJR' FIELD lv_date.
        call TRANsaction 'FB03' AND SKIP FIRST SCREEN.
        endif.
        ENDCASE.
    ENDFORM. "user_comm

  • LIST_TOO_MANY_LPROS error for alv list output

    Hi All,
    we are displaying two lists in one output by using resue_alv_list_output by passing  list_append = 'X'  to l  IS_LAYOUT   parameter.
    when we are using like this we are getting the LIST_TOO_MANY_LPROS  error.please suggest.
    please find the below error.
    Runtime Errors         LIST_TOO_MANY_LPROS
    Date and Time          08.09.2009 21:06:33
    Short text
    No further list processing possible.
    What happened?
    You requested too many consecutive nested call screens.
    What can you do?
    If possible, leave the current screen level before making a further
    selection (function Back=F3 or Cancel=F12).
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    At present, the maximum permitted number of nested screen levels is
    restricted to 50.
    How to correct the error
    If possible, unnecessary screens should be suppressed beforehand.
    Remember that you can also output a list at the same screen level as
    the details list.
    In some cases, it is better to create a new screen level stack by
    switching to another program or transaction.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "LIST_TOO_MANY_LPROS" " "
    "SAPLKKBL" or "LKKBLU01"
    "K_KKB_LIST_DISPLAY"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.

    Just want to give a hit in relevance to what Sandra suggested. You can set a breakpoint in one of callback subroutine but skip first 49 its calls. This means that only when it is called 50th time, processing will stop at this breakpoint. To do that, in debugger set a breakpoint -> go to Breakpoints tab -> enter 49 in Skip field. You will avoid counting number of calls yourself, system will do that for you.
    Regards
    Marcin

  • Display ALV list output in PDF format

    Hi All,
    My requirement is :
    I am displaying output using Function module 'REUSE_ALV_LIST_DISPLAY'. then i will click one button which placed in application tool bar say 'Download to PDF' when i click this button it will display the output in PDF format. I tried with exsting threads but i unable to get suitable solution.Anybody can send me the sample code please.
    Thanks in advance.
    Maheedhar

    please go throuh the below procedure and sample Code, this might help you.
    Procedure
    When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
    “Environment => Function Module_Name” . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is “ /1BCDWB/SF00000152 ”. In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be ‘X’. Setting this field will activate the OTF field in smartform.
    In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
    In every Smartform output in OTF format, TDPRINTCOM begins and ends with ‘//’. ‘EP’ represents the end-of-page value for TDPRINTCOM field.
    In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
    Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method “cl_gui_fronted_services=>file_save_dialog” to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
    Here is a sample code of program to perform the function.
    SAMPLE CODE
    *& Report ZAMIT_SMART_FORM_PDF *
    REPORT ZAMIT_SMART_FORM_PDF .
    data: carr_id type sbook-carrid,
    cparam type ssfctrlop,
    outop type ssfcompop,
    fm_name type rs38l_fnam.
    DATA: tab_otf_data TYPE ssfcrescl,
    pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
    tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
    file_size TYPE i,
    bin_filesize TYPE i,
    FILE_NAME type string,
    File_path type string,
    FULL_PATH type string.
    parameter: p_custid type scustom-id default 1.
    select-options: s_carrid for carr_id default 'LH' to 'LH'.
    parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
    data: customer type scustom,
    bookings type ty_bookings,
    connections type ty_connections.
    start-of-selection.
    suppressing the dialog box for print preview****************************
    outop-tddest = 'LP01'.
    cparam-no_dialog = 'X'.
    cparam-preview = SPACE.
    cparam-getotf = 'X'.
    select single * from scustom into customer where id = p_custid.
    check sy-subrc = 0.
    select * from sbook into table bookings
    where customid = p_custid
    and carrid in s_carrid
    order by primary key.
    select * from spfli into table connections
    for all entries in bookings
    where carrid = bookings-carrid
    and connid = bookings-connid
    order by primary key.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting formname = p_form
    variant = ' '
    direct_call = ' '
    importing fm_name = fm_name
    exceptions no_form = 1
    no_function_module = 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.
    exit.
    endif.
    calling the generated function module
    call function fm_name
    exporting
    archive_index =
    archive_parameters =
    control_parameters = cparam
    mail_appl_obj =
    mail_recipient =
    mail_sender =
    output_options = outop
    user_settings = SPACE
    bookings = bookings
    customer = customer
    connections = connections
    importing
    document_output_info =
    job_output_info = tab_otf_data
    job_output_options =
    exceptions formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    others = 5.
    if sy-subrc 0.
    error handling
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    tab_otf_final] = tab_otf_data-otfdata[.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    IMPORTING
    bin_filesize = bin_filesize
    BIN_FILE =
    TABLES
    otf = tab_otf_final
    lines = pdf_tab
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = FILE_NAME
    path = FILE_PATH
    fullpath = FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    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.
    ************downloading the converted PDF data to your local PC*******
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = bin_filesize
    filename = FULL_PATH
    filetype = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    IMPORTING
    filelength = file_size
    TABLES
    data_tab = pdf_tab
    FIELDNAMES =
    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
    IF sy-subrc 0.
    ENDIF.
    Check this link it will help you.
    https://forums.sdn.sap.com/click.jspa?searchID=5950895&messageID=2375150
    Reward points if useful.

  • ALV List output to Excel file

    Hi Friends,
      I want to save the ALV output as a excel file on local drive.
    From the ALV output, I am using menu path :  Views  --> Microsoft Excel (Ctrl + Shift + F7) to switch  from ALV to Excel mode.
    It is switched to excel mode but not showing any data in the columns?
    If I use the Path: List --> Export  --> Local File --> Spread Sheet --> Gave excel file name.
    Here, I am not able get data for all columns. Some columns are not being displayed.
    What is the problem in this? Is this coding error? Do we need to apply any OSS notes?
    Thanks in advance,
    Sreeni

    Hi soumya,
    I want to download from standard functionality only, that means I want to download using standard menu paths only.
    I have tried giving .csv file also, but not able to download all fields. It is missing first 4 fields and downloading all the remaining
    fields.
    Please try to through some light on it.
    Thanks in advance,
    Sreenivas reddy

  • Reg ALV List output save

    Hi All,
    I have developed a report using ALV Grid but I want save the layout with some variant name but by default the option setting->Layout->save is disabled how to enable this?.
    Thanks&Regards
    Mahesh

    Hi Mahesh,
    set I_SAVE with 'A'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = PROGNAME
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                IS_LAYOUT               = LAYOUT
                IT_FIELDCAT             = FIELDCAT
    <b>            I_SAVE                  = 'A'</b>
                IT_EVENTS               = GT_EVENTS
                IT_EVENT_EXIT           = EVENT
                IS_PRINT                = PRINT
           TABLES
                T_OUTTAB                = IT_MARA
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
    regards, Dieter

  • How to convert the alv list data into pdf format

    Hi Expersts,
                      Is it possible to convert the alv list output data into PDF format? if yes, then please help me with this issue.
    thanks in advance,
    Regards,
    Samad

    hii samad,
    you can go through these link.i hope it ll solve your purpose
    How to convert list output to PDF
    Display ALV list output in PDF format
    regards,
    Shweta

Maybe you are looking for