Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member196331
Active Contributor
0 Kudos

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.

17 REPLIES 17

raymond_giuseppi
Active Contributor

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

0 Kudos

hi, Thanks for you reply.

Variant means Alv layout i would like to Select .

0 Kudos

Try to add WITH p_alv = 'X'

0 Kudos

Hi,

thanks for your reply.

In me2l there is no variable p_alv = 'x" or Radio button.

0 Kudos

NO-DISPLAY

horst_keller
Product and Topic Expert
Product and Topic Expert

The selection screen parameters of SUBMIT are not exclusive.

NTeunckens
Active Contributor

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.

0 Kudos

I will try give me some time. I will update to you.

0 Kudos

Nic Teunckens
Not working.

You must use two WITH options in the SUBMIT statement

former_member196331
Active Contributor
0 Kudos

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.

former_member196331
Active Contributor
0 Kudos

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.


Scope of List expects values like BEST or DEFAULT. Manage with SM30 on view V_160L. So you can force the ALV display and then use standard default variant rule for ALV (or find some enhancement).

0 Kudos

Noted, I will Check it.

NTeunckens
Active Contributor

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 ...

0 Kudos

Ok I will check it. I am checking What he suggested, Hope it will give the result.Thank you.

narendra_patel
Explorer

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