‎2006 Mar 12 4:35 PM
Guys,
I have copied some standard code to automatically assign a variant via the Initialisation section (see RIAUFK20).
However, the client wants a popup to display all variants for the user so that they can choose the appropriate variant before the selection-screen is displayed.
Is there a suitable function module for this?
‎2006 Mar 12 4:43 PM
Hi Peter,
You can use this FM <b>RS_VARIANT_CONTENTS</b> to retrieve all variants fo a program.
Hope this will help.
Regards,
Ferry Lianto
‎2006 Mar 12 8:11 PM
Do you mean:
PARAMETERS p_var LIKE disvariant-variant
DEFAULT '/STANDARD'.
DATA: g_variant LIKE disvariant.
DATA: gx_variant LIKE disvariant.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.
PERFORM variant_inputhelp_f14 USING p_var.
*---------------------------------------------------------------------*
* FORM VARIANT_INPUTHELP_F14 *
*---------------------------------------------------------------------*
FORM variant_inputhelp_f14 USING p_variant LIKE g_variant-variant.
DATA h_exit.
CLEAR gx_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
* I_TABNAME_HEADER =
* I_TABNAME_ITEM =
* IT_DEFAULT_FIELDCAT =
i_save = g_variant_save
IMPORTING
e_exit = h_exit
es_variant = gx_variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc IS INITIAL AND h_exit IS INITIAL.
g_variant-variant = gx_variant-variant.
p_variant = gx_variant-variant.
ELSE.
MESSAGE ID sy-msgid TYPE 'S'
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.Rob
‎2006 Mar 12 9:37 PM
Hi,
If you want to get the variant for ALV display then use the above solution. If you want to use the ABAP program variant then use function module
CALL FUNCTION 'RS_VARIANT_CATALOG'
EXPORTING
REPORT = Report Name
DYNNR = Blank
INTERNAL_CALL = 'X'
variant = If you want to pass a
pattern
POP_UP = 'X' is you want popup
for selecting variant
IMPORTING
SEL_VARIANT = variant name passed back
TABLES
BELONGING_DYNNR = BELONGING_DYNNR
EXCEPTIONS
NO_REPORT = 01
REPORT_NOT_EXISTENT = 02
REPORT_NOT_SUPPLIED = 03.
You can try calling it at Initialization Event. Good luck
thanks
‎2006 Mar 13 5:40 AM
‎2006 Mar 13 6:28 AM
hi
Use following Function module
RS_F4_INFO_VARIANT
RS_PROGRAM_POPUP_VARIANT
RS_ALL_VARIANTS_4_1_REPORT
RS_GET_SCREENS_4_1_VARIANT
RS_VARIANT_DISPLAY
regards
vinod
‎2006 Mar 13 9:37 AM
Guys,
I'd already checked most of these...
I was trying to get a list of those variants <b>ONLY</b> for the user who is currently logged-on.
I've seen this function somewhere before - but I can't remember where!!!
Message was edited by: Peter Atkin
‎2006 Mar 13 9:41 AM
‎2006 Mar 13 2:31 PM
Peter - check the documentation for the FM I mentioned (REUSE_ALV_VARIANT_F4). It has a parameter (IS_VARIANT) that allows you to enter the user name.
Rob
‎2006 Mar 13 3:32 PM
Hi,
I think this is what is needed by you. Use function module "RS_VARIANT_FETCH",
Importing
FUNCTION - 'GET'
REPORT - 'PROGRAM NAME'
RKEY - This is a structure please fill in the
program name
SUBMODE - Blank
DYNNR - Normally this is 1000 but if you are
calling this for ur own defined selection
screen then use that number
INTERNAL_CALL - Blank
The output for the selected variant will be in P_VARI table.
Hope this was helpful.
thanks