Standard Report RM07MLBB output  in internal Table

Hi Experts  ,
i want Standard Report output  which is in basic List    to internal table  .
standard report  RM07MLBB . i don't want  to use enhancement   nor Export /import 
is there any other way  .
regards
Deepak.

hi JACk  ,
It was a perfect solution of using Include   and  using internal table of that report
i have done certain modification  in  calling Program such as
include rm07mlbb.
at selection-screen output.
  perform hide_fields.                         " in order to hide screen of  include rm07mlbb  .
loop at screen.
    if screen-name = 'LIFNR-LOW'  or
       screen-name = 'LIFNR-HIGH' or
       screen-name = 'MATNR-LOW'  or
       screen-name = 'MATNR-HIGH' or
       screen-name = 'WERKS-LOW'  or
       screen-name = 'WERKS-HIGH'  or
       screen-name = 'BUKRS-LOW'  or
       screen-name = 'BUKRS-HIGH'  or
       screen-name = '%_LIFNR_%_APP_%-TEXT' or
       screen-name = '%_LIFNR_%_APP_%-OPTI_PUSH' or
       screen-name = '%_LIFNR_%_APP_%-TO_TEXT' or
       screen-name = '%_LIFNR_%_APP_%-VALU_PUSH' or
       screen-name = '%_MATNR_%_APP_%-TEXT' or
       screen-name = '%_MATNR_%_APP_%-OPTI_PUSH' or
       screen-name = '%_MATNR_%_APP_%-TO_TEXT' or
       screen-name = '%_MATNR_%_APP_%-VALU_PUSH' or
       screen-name = '%_WERKS_%_APP_%-TEXT' or
       screen-name = '%_WERKS_%_APP_%-OPTI_PUSH' or
       screen-name = '%_WERKS_%_APP_%-TO_TEXT' or
       screen-name = '%_WERKS_%_APP_%-VALU_PUSH' or
       screen-name = '%_BUKRS_%_APP_%-TEXT' or
       screen-name = '%_BUKRS_%_APP_%-OPTI_PUSH' or
       screen-name = '%_BUKRS_%_APP_%-TO_TEXT' or
       screen-name = '%_BUKRS_%_APP_%-VALU_PUSH'  or
       screen-name = '%B002006_BLOCK_1000' or
       screen-name = '%B001000_BLOCK_1000' or
       screen-name = '%_ALV_DEF_%_APP_%-TEXT' or
       screen-name = 'ALV_DEF' or
       screen-name = 'NULLS'   or
       screen-name = '%_NULLS_%_APP_%-TEXT' .
     screen-invisible = 1.
      screen-active = 0.
      modify screen.
    endif.
  endloop.
  if not p_werks is initial .
    werks-low = p_werks.
    append werks.
  endif.
  if not p_bukrs is initial .
    bukrs-low = p_bukrs.
    append bukrs.
  endif.
  delete adjacent duplicates from werks comparing low.
  delete adjacent duplicates from bukrs comparing low.
endform  " hide_fields
Regards
Deepak.

Similar Messages

  • Save report painter output into internal table

    Hi,
      i have created a report painter for vendor aging report. got output in drill down format.
    i need to show the data in smartform as well. so need to save the report painter output into an internal table. can anyone please help me resolving this.
    regards,
    sudha.m

    Hi Sudha
    You can use sample below:
    DATA: list_tab TYPE TABLE OF ABAPLIST.
    SUBMIT NROWS EXPORTING LIST TO MEMORY
                  AND RETURN VIA SELECTION-SCREEN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Best regards

  • Get ALV Report's Result Into Internal Table

    Hello everyone,
    is there a way to get a alv reports result into an internal table?
    For example: is it possible to get the values from transaction S_ALR_87012078.
    I mean i want to write a function an it will give you the alv reports result as internal table, so  you won't have to dig the reports code in.
    thanks to any answers from now. bye.

    Hi
    This is a wrapper program which will execute the standard program and capture the output as we are using list to memory
    Then after we will be using LIST_FROM_MEMORY and 'LIST_TO_ASCI'
    submit rhrhaz00 exporting list to memory
    and return
    with pchplvar = pchplvar
    with pchotype = pchotype
    with pchobjid in pchobjid
    with pchsobid in pchsobid
    with pchseark = pchseark
    with pchostat = pchostat
    with pchistat = pchistat
    with pchztr_d = pchztr_d
    with pchztr_a = pchztr_a
    with pchztr_z = pchztr_z
    with pchztr_m = pchztr_m
    with pchztr_p = pchztr_p
    with pchztr_y = pchztr_y
    with pchztr_f = pchztr_f
    with pchobeg = pchobeg
    with pchoend = pchoend
    with pchtimed = pchtimed
    with pchbegda = pchbegda
    with pchendda = pchendda
    * with pchwegid = pchwegid
    * with pchsvect = pchsvect
    * with pchdepth = pchdepth
    with infty in infty
    with subty in subty
    with vdata = vdata
    with info = info.
    data: list like abaplist occurs 0 with header line.
    data: txtlines(1024) type c occurs 0 with header line.
    clear list.
    refresh list.
    clear tbl_reportlines.
    refresh tbl_reportlines.
    call function 'LIST_FROM_MEMORY'
    tables
    listobject = list
    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.
    call function 'LIST_TO_ASCI'
    * EXPORTING
    * LIST_INDEX = -1
    * WITH_LINE_BREAK = ' '
    * IMPORTING
    * LIST_STRING_ASCII =
    * LIST_DYN_ASCII =
    tables
    listasci = txtlines
    listobject = list
    exceptions
    empty_list = 1
    list_index_invalid = 2
    others = 3
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    tbl_reportlines[] = txtlines[].
    call function 'LIST_FREE_MEMORY'.
    endif.
    Here is the simple example program
    *Example Code (Retrieving list from memory)
    DATA BEGIN OF itab_list OCCURS 0.
    INCLUDE STRUCTURE abaplist.
    DATA END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
    filler1(01) TYPE c,
    field1(06) TYPE c,
    filler(08) TYPE c,
    field2(10) TYPE c,
    filler3(01) TYPE c,
    field3(10) TYPE c,
    filler4(01) TYPE c,
    field4(3) TYPE c,
    filler5(02) TYPE c,
    field5(15) TYPE c,
    filler6(02) TYPE c,
    field6(30) TYPE c,
    filler7(43) TYPE c,
    field7(10) TYPE c,
    END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = itab_list
    EXCEPTIONS
    not_found = 4
    OTHERS = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
    list_index = -1
    TABLES
    listasci = vlist
    listobject = itab_list
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    IF sy-subrc NE '0'.
    WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.
    Re: alv to internal table

  • Report output into internal table and going ahead

    Hi Folks,
    We have a report MB51.It is showing some details.Now along with these details I wanna fetch some more detail and show it in the same report.
    One way is I can copy this into Z and then go ahead with the changes.But I would like to know can we SUBMIT MB51  program in my ZPROGRAM and then get the output into an internal table and then again populate this internal table with the rest of the data and again display it as final output.
    To be precise,is it possible to get the final output of MB51 into an internal table by using submit.
    K.Kiran.

    dear kian
    pls check the below code for example:
    DATA LIST_TAB TYPE TABLE OF ABAPLIST.
    DATA: BEGIN OF olist OCCURS 0,
            filler1(1500)   TYPE c,
          END OF olist.
    SUBMIT YTEST04 WITH MATNR EQ 't000001'
                     EXPORTING LIST TO MEMORY
                     AND RETURN.
    BREAK-POINT.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        LISTOBJECT = LIST_TAB
      EXCEPTIONS
        NOT_FOUND  = 1
        OTHERS     = 2.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX         = -1
        TABLES
          LISTASCI           = oLIST
          LISTOBJECT         = LIST_TAB
        EXCEPTIONS
          EMPTY_LIST         = 1
          LIST_INDEX_INVALID = 2
          OTHERS             = 3.
      BREAK-POINT.
    ENDIF.

  • Retrieve Filtered ALV output into Internal Table in Program

    Guys,
    I want to update my internal table with the filtered output that the user has selected in the output.
    Lets say my internal table had 6 entries which was outputted.
    Now the the user filters that output ( say where material is initial ) so that there are only 2 entries left on the output.
    How can i know which 2 entries are left on the output screen ?
    ( i need to know as i am deleting entries from a table )
    I came across this slis_filter_alv0 but could not use it in my user exit command routine.
    Any ideas would be very helpful.
    Cheers.....

    Try the method get_filtered_entries
    This method teturns a table with all indexes that are currently hidden on the screen using the standard "filter" function.
    CALL METHOD
    <ref.var. to CL_GUI_ALV_GRID>->get_filtered_entries
       IMPORTING
          ET_FILTERED_ENTRIES  = <int tbl of type LVC_T_FIDX >.
    Then by using this internal table you can find out the entries which are shown in the output.
    Hope this helps.
    Thanks,
    Balaji

  • Hierarchial list output to internal table

    Hi Folks,
    REPORT  ZMB51                                   .
    DATA LIST_TAB TYPE TABLE OF ABAPLIST.
    <b>DATA: BEGIN OF olist OCCURS 0,
            filler1(1500)   TYPE c,
          END OF olist.</b>
    submit RM07DOCS EXPORTING LIST TO MEMORY
                     AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        LISTOBJECT = LIST_TAB
      EXCEPTIONS
        NOT_FOUND  = 1
        OTHERS     = 2.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX         = -1
        TABLES
          <b>LISTASCI           = oLIST</b>    
         LISTOBJECT         = LIST_TAB
        EXCEPTIONS
          EMPTY_LIST         = 1
          LIST_INDEX_INVALID = 2
          OTHERS             = 3.
    BREAK-POINT.
    write:/ sy-subrc.
    ENDIF.
    The above program is getting the MB51 output into an internal table.So far it is fine but this internal table can't  be used for further processing.I want to get the MB51 output into an internal table which can be used for further processing.
    data:begin of itab1 occurs 0,
         matnr  like mara-matnr,
         maktx like makt-maktx,
         werks like vbrp-werks,
         sloc like zmmstoragebin-storage,
         bwart like mseg-bwart,
         mblnr like mseg-mblnr,
         zeile like mseg-zeile,
         budat like bkpf-budat,
         menge like mseg-menge,
         meins like mara-meins,
         end of itab1.
    If I delcare an internal table as above and given itab1 instead of olist it is going for dump.How to achieve this?
    Thanks,
    K.Kiran.

    Hi Kiran,
    You will be getting all the fields in the concatenation form into the string of oLIST.
    Is there any delimitor like space or Tab between the fields or not?
    so try to use Split the oLIST-filler1 into different fields at the delimiter
    or you have to offet oLIST-filler1  to different fields
    like example 
    itab1-matnr = oLIST-filler1+0(18)
    itab1-werks = oLIST-filler1+19(4) like that
    based on the fields data in oLIST-filler1   you have to do it
    Regards
    Anji

  • Output of intern table xyz as List

    Hi Experts,
    I want to show my intern table gt_xyz as list.
    What have I to do?
    Regards,
    Mike

    hi,
    For a Simple List:
    If the table consists of multiple records.
    Loop at <itab>.
      write: / 2 itab-field1,
                12 itab-field2,
                & so on...
    endloop.
    For an ALV list use the function module 'REUSE_ALV_LIST_DISPLAY'
    DATA: REPID LIKE SY-REPID.
    DATA: XFIELD TYPE SLIS_T_FIELDCAT_ALV.
    DATA: X_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: GT_XEVENTS TYPE SLIS_T_EVENT.
    XDATA is the internal table which holds the data for output.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = REPID
                IT_FIELDCAT        = XFIELD
                IS_LAYOUT          = X_LAYOUT
                IT_EVENTS          = GT_XEVENTS
           TABLES
                T_OUTTAB           = XDATA.
    regards,
    Sireesha

  • REPORT OUTPUT to Internal table

    Hi,
    I order to achieve my requirement i need to know if this can happen:
    Q: I want to write a report REP1 (which has ITAB1) in which I want to run an already existing report REP2 and direct the result of the REP2 to ITAB1. So that upon this ITAB1 contents i will again perform some queries.
    Is this possible? If YES can anyone please let me know how?
    Thanks in advance,
    Karuna.

    Hi,
    Try using the command
    SUBMIT report_name AND RETURN EXPORTING LIST TO MEMORY.
    This will call the report and store the output of called report in momory. Then you can retrieve it in your main program by FM 'LIST_FROM_MEMORY'.
    See Below Sample Code.
    Hope it Helps. Reward points if useful.
        SUBMIT zefl_soff_update_single
                           WITH so_objid IN fin_tran
                          AND RETURN
                          EXPORTING LIST TO MEMORY.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = t_list
          EXCEPTIONS
            not_found  = 1.
        REFRESH t_ascii.
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listasci           = t_ascii " list converted to ASCII
            listobject         = t_list
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
    Regards,
    Shailesh Jadhav

  • Emailing SAP standard report using output device ZPDF1

    I have two questions regarding the ability to email a standard SAP report.
    The user community has been using the action box in tran QM02 to create a corrective action (8D) report. The action box triggers FM QM06_FM_TASK_REQUEST_8DREPORT and QM06_REQUEST_8D_REPORT_STEP2. This process not only creates the report but creates a task in the notification that the report has been generated. The process pops up the PRINT options box to choose various setting including output device. They will then print the report, scan this hardcopy report and email it to the vendor.
    We recently showed them a more streamlined process to emailing the report. When the PRINT popup appears, they fill in the output device with ZPDF1 and hit enter. This brings in an email address line that can be filled with the vendor’s email. By specifying the ZPDF1 output device, the report is generated as a PDF attachment and sent along to the vendor via email.
    The two questions I have are:
    1. Is there any way to bring over the print parameters needed for the popup screen and eliminate this screen from appearing?
    The subject line on the email is populated with the system and spool number even if the title line is filled in on the print popup. Also, the email body has is created with generic text.
    2. How can the email subject and body information be changed?
    Sorry for the lengthy post but I am not very technical and I wanted to describe the issues as best as possible.
    thanks

    Hi,
    This is possible please configure the Message determination the Output should poin to Outlook
    Please take the help of BASIS people to configure this
    G.Ganesh Kumar

  • Help on ALV GRID display outputting format for 2 internal tables

    Hi,
        I have requirement in ALV GRID where I need to display the data from 2 internal tables. The first internal table has the content of Delivery due list data and second the internal table has the corresponding stock transfer data of the Delivery Due list. I have a checbox on my selection screen, when unchecked it should output the 1st internal table data, i.e for Delivery due list. When it is checked then it should output 1st Internal table data + 2nd internal table data of stock transfer. For example, 1 document delivery due list data and 2nd line for that document should show the stock transfer data. You can also check the transaction code VL10E for that will show a delivery due list...and for stock tranfer,you need to check with Purchase order in in the USer Role tabstrip. Pls suggest.
    Regards,
    Mira

    Hi,
    U can try out this code
    REPORT zzz_test NO STANDARD PAGE HEADING
                           MESSAGE-ID zz.
    The Data Declarations
    INCLUDE zzm_test_alv_data.
    The Selection Screen Definition
    INCLUDE zzm_test_alv_selscrn.
    The definition and implementation of the event reciever class
    INCLUDE zzm_test_alv_class.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM f1000_load_itabs.
    END-OF-SELECTION
    END-OF-SELECTION.
      IF NOT cb_disp IS INITIAL.
        CALL SCREEN 9001.
      ENDIF.
    Include for getting data
      INCLUDE zzm_test_alv_forms.
    Include for PAI and PBO of screen
      INCLUDE zzm_test_alv_screen.
      INCLUDE ZZM_TEST_ALV_DATA                                          *
    This include has all the data declaration defined
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    Table Declarations:
    TABLES: mara,
            makt.
    Internal Tables:
    The following structure type must be defined in the data dictionary
    DATA:  i_fieldcat  TYPE lvc_t_fcat,
           i_fieldcat1 TYPE lvc_t_fcat,
           i_output1   TYPE STANDARD TABLE OF mara,
           i_output2   TYPE STANDARD TABLE OF makt,
    Work Areas:
           w_output1   TYPE STANDARD TABLE OF mara,
           w_output2   TYPE STANDARD TABLE OF makt.
    Variable:
    DATA: lv_repid    LIKE sy-repid.
    lv_repid = sy-repid.
      INCLUDE ZZM_TEST_ALV_SELSCRN                                       *
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: cb_disp AS CHECKBOX.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN END OF BLOCK b_main.
      INCLUDE ZZM_TEST_ALV_CLASS                                         *
    This include has all the data declaration defined for ALV
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    INCLUDE <icon>.
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    DATA : o_alvgrid1 TYPE REF TO cl_gui_alv_grid ,
           o_alvgrid2 TYPE REF TO cl_gui_alv_grid ,
           cont_for_cognos1   TYPE scrfname VALUE 'BCALC_GRID_01_9100',
           cont_for_cognos2   TYPE scrfname VALUE 'BCALC_GRID_01_9200',
           custom_container1 TYPE REF TO cl_gui_custom_container,
           custom_container2 TYPE REF TO cl_gui_custom_container,
          Work Area
           w_layout TYPE lvc_s_layo ,
           w_variant TYPE disvariant.
          Constants
    CONSTANTS : c_lay(1) TYPE c VALUE 'A' .                  " All Layouts
    CONSTANTS: BEGIN OF c_main_tab,
               tab1 LIKE sy-ucomm VALUE 'MAIN_TAB_FC1',   "
               tab2 LIKE sy-ucomm VALUE 'MAIN_TAB_FC2',   "
               END OF c_main_tab.
      INCLUDE ZZM_TEST_ALV_FORMS                                         *
    This Include has the various forms used in the program
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    *&      Form  f9001_build_field_cat
          To Build Field Catalog
         -->P_I_FIELDCAT  text
         -->P_0021   text
    FORM f9001_build_field_cat TABLES   p_fieldcat STRUCTURE lvc_s_fcat
                          USING value(p_structure).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name       = p_structure
           CHANGING
                ct_fieldcat            = p_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH 'Error in ALV field catalogue creation'.
                                                                " text-e05.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " f9001_build_field_cat
    *&      Form  f9000_objects_create
          For creating Custom Containers
    -->  p1        text
    <--  p2        text
    FORM f9000_objects_create.
      CREATE OBJECT custom_container1
          EXPORTING
              container_name = cont_for_cognos1
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT custom_container2
          EXPORTING
              container_name = cont_for_cognos2
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc NE 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'The control could not be created'(510).
      ENDIF.
      CREATE OBJECT o_alvgrid1
           EXPORTING i_parent = custom_container1.
      CREATE OBJECT o_alvgrid2
           EXPORTING i_parent = custom_container2.
    ENDFORM.                    " f9000_objects_create
    *&      Form  f9003_layout
          To define the layout
         -->P_SY_TITLE  text
         -->P_0030   text
         -->P_0031   text
         -->P_0032   text
    FORM f9003_layout USING  value(ptitle)
                             value(pzebra)
                             value(pmode)
                             value(pwidth).
      w_layout-grid_title  = ptitle.
      w_layout-zebra       = pzebra.
      w_layout-sel_mode    = pmode.
      w_layout-cwidth_opt  = pwidth.
      w_variant-report     = sy-repid.
    ENDFORM.                    " f9003_layout
    *&      Form  f9006_error_handle
         To handle event
         -->P_PTEXT  text
    FORM f9006_error_handle USING value(ptext).
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = text-e03 " Error Note
                  txt2  = sy-subrc
                  txt1  = ptext.
      ENDIF.
    ENDFORM.                    " f9006_error_handle
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD custom_container1->free.
      CALL METHOD custom_container2->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in FLush'(500).
      ENDIF.
    ENDFORM.
    *&      Form  f1000_load_itabs
          Select from Database
    -->  p1        text
    <--  p2        text
    form f1000_load_itabs.
      SELECT * FROM mara
               INTO TABLE i_output1
               UP TO 50 rows.
      SELECT * FROM makt
               INTO TABLE i_output2
               UP TO 50 rows.
    endform.                    " f1000_load_itabs
      INCLUDE ZZM_TEST_ALV_SCREEN                                        *
    2/ Description / Include functions
    This include contains PBO and PAI events for the screen of report
    ZZZJJ_TEST_ALV
    3/ Responsibility
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    DATA FOR TABSTRIP 'MAIN_TAB'
    CONTROLS:  main_tab TYPE TABSTRIP.
    DATA:      BEGIN OF i_main_tab,
                 subscreen   LIKE sy-dynnr,
                 prog        LIKE sy-repid VALUE
                                  'ZZZ_TEST',
                 pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
               END OF i_main_tab.
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE status_9001 OUTPUT.
    IF custom_container1 IS INITIAL.
      SET PF-STATUS 'ZSTATUS'.
      SET TITLEBAR 'ZTITLE'.
      Creating Object
        PERFORM f9000_objects_create.
      Building the field catalog
        PERFORM f9001_build_field_cat TABLES i_fieldcat
                                USING 'MARA'.
        PERFORM f9001_build_field_cat TABLES i_fieldcat1
                                USING 'MAKT'.
      Modifying the field catalog
       PERFORM f9002_modify_field_cat TABLES i_fieldcat.
      For Layout
        PERFORM f9003_layout USING sy-title 'X' 'B' 'X'.
    ENDIF.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  MAIN_TAB_ACTIVE_TAB_SET  OUTPUT
          Call method to display in the output grid
    MODULE main_tab_active_tab_set OUTPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
      To display report
         i_main_tab-subscreen = '9100'.
          CALL METHOD o_alvgrid1->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output1[]
             it_fieldcatalog               = i_fieldcat[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
        WHEN c_main_tab-tab2.
      To display report
          i_main_tab-subscreen = '9200'.
          CALL METHOD o_alvgrid2->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output2[]
             it_fieldcatalog               = i_fieldcat1[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
    WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET OUTPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_GET INPUT
          Check & Process the selected Tab
    MODULE main_tab_active_tab_get INPUT.
      CASE sy-ucomm.
        WHEN c_main_tab-tab1.
          i_main_tab-pressed_tab = c_main_tab-tab1.
        WHEN c_main_tab-tab2.
          i_main_tab-pressed_tab = c_main_tab-tab2.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_GET INPUT
    *&      Module USER_COMMAND_9001 INPUT
          User Command
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          PERFORM exit_program.
          SET SCREEN '0'.
        WHEN 'EXIT' OR  'CANC'.
          PERFORM exit_program.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 “USER_COMMAND_9000 INPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_SET INPUT
          Set sunscreen
    MODULE main_tab_active_tab_set INPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
            i_main_tab-subscreen = '9100'.
        WHEN c_main_tab-tab2.
            i_main_tab-subscreen = '9200'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET INPUT
    Thanks & Regards,
    Judith.

  • How to store output of SQ01 into internal table.

    Hello Experts
    How to store output of SQ01 into internal table.
    Thanks,
    Umesh

    You can't store the sq01 output into internal table.
    Once you create the query it will generate the abap program, in that program you can see the contents.
    Regards
    Sasi

  • Reading values from standard report in custom report dynamically

    Hello Gurus,
    I have a strange requirement, We have some standard reports which displays output in drop down blocked data. I want to create a custom report which will get that data in my internal tables.
    Just to elaborate this requirement, I will give you a example:
    I have a standard report which output as first line 'A' and second line as 'B'. Now when I press drop down in 'A', it displays line items say 1,2,3,4,5.... Similarly block 'B' once when pressed displays line items 6,7,8,9,10.
    Here I want a custom report which directly read data from this standard report and gives us the values of line items 1,2,3,4,5 in one internal table and similarly items 6,7,8,9,10 in another internal table.
    Hope the question clarifies the requirement now.
    Request you to please provide the resolution.
    Thanks,
    Harjeet

    Hi Harjeet,
    Use sumit statement for standard program and export the list to  memory. and then read list from memory and use in your custom program.
    Use below code for reference.
    DATA: t_list TYPE abaplist OCCURS 0.
    SUBMIT rfdopr10
                    ************** your options
                    AND RETURN
                    EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject       = t_list
      EXCEPTIONS
        NOT_FOUND        = 1
        OTHERS           = 2.
    BR,
    Vijay

  • Including Vendor Name in Standard report 'MB51' transaction

    Hi Friends,
    I have a requirement of Displaying the Vendor Name in the standard report 'MB51', after the vendor No.
    I checked the report and it is really confusing ..... ( i ve seen something like when i double click the document number it is going to 'Display material Document - 147404608' something !! ........
    I want the same report with vendor name included ... is that possible ????
    One more doubt .... i actually copied the Program 'RM07DOCS' with the includes to a name 'ZRM07DOCS' but when i execute with plant '0020' iam getting an error 'Selection was not restricted' though iam not getting the error when i give the same selection criteria in the Standard report....
    Expecting ur replies :-|
    Thanks in advance
    Cheers,
    R.Kripa.

    Hi,
    I did similar requirement but in my case the tr code was mb5b but anyway approach would be same ,please check steps below.
    1) Copy standard report to a Zreport. copy everything including includes , texts etc.
    2) Now put a break point at REUSE_ALV_LIST_DISPLAY , it might be possible that its used multiple times. so just cross check which list display is showing results.comment out this REUSE_ALV_LIST_DISPLAY.
    3) Now say you have to add 2 extra fields to report.define you own internal table with all the fields you needed.move the final internal table to your internal table.
    4) build your own field catalog for your internal table.
    4) using select queries fetch field values of those 2 extra fields for each record.and then use resue_alv_list_display  or resue_alv_grid_display in place of original list_display. pass fieldcatalog and your final internal table to it so as to get output desired.

  • How to create Dynamic Internal table in ALV?

    Hi all,
    I have to create a ALV report based on dynamic internal table. The requirement is that when I enter the months in my selection screen I should get the data relevant to those many months only. For eg if in selection I have given January to March, I should get an ALV output with columns from January to March only.
    Please help me with the coding part as I find it a bit confusing.
    Please reply immediately.
    Regards,
    Bhavani.

    Hi BHAVANI,
    first you have to prapare a field catalog [(see this)|http://help.sap.com/saphelp_470/helpdata/en/52/5f060de02d11d2b47d006094192fe3/frameset.htm]
    and than you can use a Method cl_alv_table_create=>create_dynamic_table
    I hope that help a little.
    Regards Bogdan

  • Dynamic Internal Table creation and population

    Hi gurus !
    my issue refers to the slide 10 provided in this slideshow : https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
    My example is gonna sound dumb, but anyway: I want to dynamically select from a table into a dynamically created itab.
    Letu2019s use only EKPO, and only field MENGE.
    For this, I use Classes cl_abap_elemdescr, cl_sql_result_set and the Data Ref for table creation. But while fetching the resultset, program dumps when fields like MENGE, WRBTR are accessed. Obviously their type are not correctly taken into account by my program.
    Here it comes:
    DATA: element_ref             TYPE REF TO cl_abap_elemdescr,
          vl_fieldname               TYPE string,
                 tl_components         TYPE abap_component_tab,
                 sl_components         LIKE LINE OF tl_components_alv,
    linetype_lcl               TYPE REF TO cl_abap_structdescr,
    ty_table_type            TYPE REF TO cl_abap_tabledescr,
    g_resultset             TYPE REF TO cl_sql_result_set
    u2026
    CONCATENATE sg_columns-table_name '-' sg_columns-column_name INTO vl_fieldname.
    * sg_columns-table_name contains 'EKPO'
    * sg_columns-column_name contains 'MENGE'
    * getting the element as a component
    element_ref ?= cl_abap_elemdescr=>describe_by_name( vl_fieldname ).
    sl_components-name  = sg_columns-column_name.
    sl_components-type ?= element_ref.
    APPEND sl_components TO tl_components.
    * dynamic creation of internal table
    linetype_lcl = cl_abap_structdescr=>create( tl_components ).
    ty_table_type = cl_abap_tabledescr=>create(
                      p_line_type = linetype_lcl ).
    u2026
    * Then I will create my field symbol table and line. Code has been cut here.
    CREATE DATA dy_line LIKE LINE OF <dyn_table>.
    u2026
    * Then I will execute my query. Here itu2019s: Select MENGE From EKPO Where Rownum = 1.
      g_resultset = g_stmt_ref->execute_query( stmt_str ).
    * Then structure for the Resultset is set
      CALL METHOD g_resultset->set_param_struct
        EXPORTING
          struct_ref = dy_line.
    * Fetching the lines of the resultset  => Dumpu2026
      WHILE g_resultset->next( ) > 0.
        ASSIGN dy_line->* TO <dyn_wa>.
        APPEND <dyn_wa> TO <dyn_table>.
      ENDWHILE.
    Anyone has any clue to how prevent my Dump ??
    The component for MENGE seems to be described as a P7 with 2 decimals. And the resultset wanna use a QUAN type... or something like that !

    Hello
    I have expanded your sample coding for selecting three fields out of EKPO:
    *& Report  ZUS_SDN_SQL_RESULT_SET
    *& Thread: Dynamic Internal Table creation and population
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1375510"></a>
    *& NOTE: Coding for dynamic structure / itab creation taken from:
    *& Creating Flat and Complex Internal Tables Dynamically using RTTI
    *& https://wiki.sdn.sap.com/wiki/display/Snippets/Creating+Flat+and+
    *& Complex+Internal+Tables+Dynamically+using+RTTI
    REPORT  zus_sdn_sql_result_set.
    TYPE-POOLS: abap.
    DATA:
    go_sql_stmt       TYPE REF TO cl_sql_statement,
    go_resultset      TYPE REF TO cl_sql_result_set,
    gd_sql_clause     TYPE string.
    DATA:
      gd_tabfield      TYPE string,
      go_table         TYPE REF TO cl_salv_table,
      go_sdescr_new    TYPE REF TO cl_abap_structdescr,
      go_tdescr        TYPE REF TO cl_abap_tabledescr,
      gdo_handle       TYPE REF TO data,
      gdo_record       TYPE REF TO data,
      gs_comp          TYPE abap_componentdescr,
      gt_components    TYPE abap_component_tab.
    FIELD-SYMBOLS:
      <gs_record>   TYPE ANY,
      <gt_itab>     TYPE STANDARD TABLE.
    START-OF-SELECTION.
    continued.

Maybe you are looking for

  • Error while using BAPI BAPI_GOODSMVT_CREATE for Momvent type 321

    Hi Guys, We trying to transfer material from Inspection to Un.Stock by using momvent type 321...In SAP we do QVM1 and do stock postion. We are using BAPI BAPI_GOODSMVT_CREATE getting this error " E QA 495 Change the inspection stock of material 11036

  • Epress website not working correctly in Internet E...

    I have been reading newspapers at www.epress.fi for some time without a problem on my lumia 1020. After I installed the Lumia Cyan update reading is not possible anymore. I usually read: Vasabladet and Hufvudstadsbladet. After the update it does open

  • Most videos do not play in FF; work fine in Chrome. Maybe started when I was having a FB video repeat and clicked on something to make it stop.

    Some time back I clicked on a video on FaceBook. It kept repeating. I got tired of it and clicked on something on FB that stopped it. Since then Firefox does not play vids. For example http://senateconservatives.com/site/post/1160/video-new-scf-ad-pr

  • Apache vulnerabilities

    We've recently had some security consultants go through our environment and the report they've provided has advised that some high priority upgrades are required on our NetWare servers around the Apache versions. We are running NW65sp7, and the repor

  • Ldap in solaris 11-11-11

    Does ldap works in solaris 11 ? I am configuring a solaris 11 system to connect with ldap. But i am finding out that the configuration files "nsswitch.conf" cant be edit. edits will be lost. Can you help me seting up the ldap client on this system "s