03-03-2017 5:03 AM
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.
03-03-2017 7:00 AM
03-03-2017 7:39 AM
hi, Thanks for you reply.
Variant means Alv layout i would like to Select .
03-03-2017 8:12 AM
03-03-2017 8:45 AM
Hi,
thanks for your reply.
In me2l there is no variable p_alv = 'x" or Radio button.
03-03-2017 10:17 AM
03-03-2017 7:11 AM
03-03-2017 9: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.
03-03-2017 9:29 AM
03-03-2017 9:38 AM
03-03-2017 10:22 AM
03-03-2017 9:47 AM
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.
03-03-2017 10:41 AM
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.
03-03-2017 11:12 AM
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).
03-03-2017 11:19 AM
03-03-2017 12:13 PM
If the provided solution from Raymond doesn't do it, you could try the following :
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 ...
03-03-2017 12:57 PM
Ok I will check it. I am checking What he suggested, Hope it will give the result.Thank you.
03-06-2017 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