Skip to Content
-2

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

Mar 03, 2017 at 05:03 AM

595

avatar image

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.

10 |10000 characters needed characters left 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)
0
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Horst Keller
Mar 03, 2017 at 07:11 AM
1

The selection screen parameters of SUBMIT are not exclusive.

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Mar 03, 2017 at 07:00 AM
1

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

Show 4 Share
10 |10000 characters needed characters left characters exceeded

hi, Thanks for you reply.

Variant means Alv layout i would like to Select .

0

Try to add WITH p_alv = 'X'

0

Hi,

thanks for your reply.

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

0

NO-DISPLAY

0
Nic Teunckens Mar 03, 2017 at 09:06 AM
1

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.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

0

Nic Teunckens
Not working.

notworking.png (89.9 kB)
0

You must use two WITH options in the SUBMIT statement

1
Nic Teunckens Mar 03, 2017 at 12:13 PM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

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

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

Share
10 |10000 characters needed characters left characters exceeded
Kali Charan Mar 03, 2017 at 10:41 AM
0

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.



save25.png (8.6 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

1

Noted, I will Check it.

0