Skip to Content
-2

Can i Submit the report with SELECTION-TABLE and Variant.

hi,

I have a Small Requirement, IE. I am executing the report me2L from me28.
In Every line of me28 one material Code is there i am passing this to me2L report.

By using the code.SUBMIT RM06EL00 WITH SELECTION-TABLE it_selection AND RETURN.

My question is I want to show some columns in ME2L Report.

Can i Submit the Report with SELECTION-TABLE and Variant.

How Can i do this.I Tried, In ME2L Report user specific variant i was created,
if i open ME2L directly Variant executing, But columns Restrcited.
if i open with
SUBMIT RM06EL00 WITH SELECTION-TABLE it_selection AND RETURN
All Columns are displaying.

I need to Submit with report with Variant, and select field i am passing dynamically.
any solutions is there.

Add comment
10|10000 characters needed characters exceeded

  • Small question i would like to ask.

    Again saying: Opening Me2l report passing material code and layout type is ALV.
    Now I would like to see how variant is passing. but Variant is not taking. but in output it is taking Default variant or User Specific Variant.

    me2lvaraint.png (121.1 kB)
  • Get RSS Feed

6 Answers

  • Mar 03, 2017 at 07:11 AM

    The selection screen parameters of SUBMIT are not exclusive.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 03, 2017 at 07:00 AM

    Did you try to use the two options in your SUBMIT statement?

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 03, 2017 at 09:06 AM

    Maybe you can Add (or have already defined) a Custom List Output? These would be maintained / Stored in Table "T160L" ...

    In the Program Routine "PERFORM FM06LF01_LISTUMFANG" is Called for Parameter "LISTU".

    With that you might want to try SUMITTING Prgr. "RM06EL00" with the Addition "WITH LISTU = <YourListOutput> ...

    Something like ...

    SUBMIT RM06EL00 WITH LISTU = 'ZBEST' "Some Specific List Output
                    WITH SELECTION-TABLE it_selection 
                    AND RETURN.

    ... Haven't tried this myself though ...

    Hope this helps

    Nic T.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 03, 2017 at 12:13 PM

    If the provided solution from Raymond doesn't do it, you could try the following :

    • SUBMIT report as BGround ...
    • Get the Results ...
    • Enable a "limited" column-list, either via Specific Layout from your 'ME2L' OR via editing the FieldCatalog for " MEREP_OUTTAB_PURCHDOC" ...
    • Call Output for your Report, including the FieldCatalog and a Possible Layout ...

    The below 'rough' example seems to work for me :

    REPORT ztmp_test.
    
    TABLES: ekko, ekpo, eket, t160t.
    DATA:
      lr_result   TYPE REF TO data,
      lt_fieldcat TYPE lvc_t_fcat,
      ls_variant  TYPE disvariant.
    FIELD-SYMBOLS <resulttab> TYPE STANDARD TABLE.
    
    *---> SelScreen
    SELECT-OPTIONS:
      el_ekorg FOR ekko-ekorg OBLIGATORY DEFAULT '1000',
      s_werks  FOR ekpo-werks OBLIGATORY DEFAULT '1000',
      s_ekgrp  FOR ekko-ekgrp OBLIGATORY,
      selpa    FOR t160t-selpa,
      s_eindt  FOR eket-eindt OBLIGATORY DEFAULT sy-datum.
    PARAMETERS:
      listu   TYPE listu DEFAULT 'BEST',
      variant TYPE disvariant-variant.
    
    START-OF-SELECTION.
    
      cl_salv_bs_runtime_info=>set(
        EXPORTING display = abap_false
                  metadata = abap_true
                  data = abap_true ).
    
      SUBMIT rm06el00 WITH listu = listu
                      WITH selpa IN selpa
                      WITH el_ekorg IN el_ekorg
                      WITH s_werks IN s_werks
                      WITH s_ekgrp IN s_ekgrp
                      WITH s_eindt IN s_eindt
    *                 WITH SELECTION-TABLE it_selection
                      AND RETURN.
    
      TRY.
          cl_salv_bs_runtime_info=>get_data_ref(
            IMPORTING r_data = lr_result ).
    
        CATCH cx_salv_bs_sc_runtime_info.
      ENDTRY.
      cl_salv_bs_runtime_info=>clear_all( ).
      
      "Get FieldCatalog
      REFRESH lt_fieldcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'MEREP_OUTTAB_PURCHDOC'
    *     I_INTERNAL_TABNAME     = I_INTERNAL_TABNAME
        CHANGING
          ct_fieldcat            = lt_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
        "Msg ...
      ENDIF.
    
    * "Use the FieldCatalog to Enable / Disable view ...?
    * LOOP AT lt_fieldcat ASSIGNING FIELD-SYMBOL(<fieldcat>).
    *   CASE <fieldcat>-fieldname.
    *     WHEN 'EBELN'.
    *       <fieldcat>-tech = abap_true.
    *   ENDCASE.
    * ENDLOOP.
    * UNASSIGN <fieldcat>
    
        UNASSIGN <resulttab>.
      ASSIGN lr_result->* TO <resulttab>.
      CHECK <resulttab> IS ASSIGNED.
    
      "Add Your Specific Layout ...
      CLEAR ls_variant.
      ls_variant-report  = 'RM06EL00'.
      ls_variant-handle  = '0001'.
      ls_variant-variant = variant.
    
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program = 'SAPLMEREP'
          i_save             = 'A'
          is_variant         = ls_variant
          it_fieldcat_lvc    = lt_fieldcat
        TABLES
          t_outtab           = <resulttab>
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        "Msg ...
      ENDIF.

    Found most of the inner workings in the Program "RM06EL00" and the Overarching "SAPLMEREP" report ... You could probably make it work with "CL_SALV_TABLE" but I just 'peeked' and copied the logic from the "ME2L"-logic ...

    Ofcourse, it would be nicer if you got the results you wanted directly using Scope Of List without having to define and pass the Layout ...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 06, 2017 at 11:11 AM

    Hi,

    Use below syntax,

    SUBMIT RM06EL00 USING SELECTION-SET '/POP' WITH SELECTION-TABLE i_selection AND RETURN.

    Here selection-set is your variant.System will call program with union of values - <your varient> + <selection-table>.

    Regards,

    Narendra Patel

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 03, 2017 at 10:41 AM

    Raymond Giuseppi

    I Changed it like below no syntax error.

    SUBMIT RM06EL00 WITH LISTU = 'DEFAULT5' WITH SELECTION-TABLE it_selection AND
    RETURN.
    but Me2l is not Running.

    SUBMIT RM06EL00 WITH LISTU = 'DEFAULT5' WITH SELECTION-TABLE it_selection AND
    RETURN.

    In the above Default5 is my Alv output layout name, Report is not Executed. because in the list the value is not avilable.


    Add comment
    10|10000 characters needed characters exceeded