‎2008 Feb 11 11:39 AM
Hi,
I am using ALV OOPs. In my requirement the program need to run in background using varient that is created by user. My question is, does the program takes varient default or we need to pass any function module in our program to consider varient.
Thanks in advance,
Naseer.
‎2008 Feb 11 11:44 AM
Hi,
Just pass value to IS_VARIANT in grid_display fn.module
Reward if useful
‎2008 Feb 11 11:45 AM
If you are creating the background job by calling FMs like JOB_OPEN, JOB_SUBMIT, JOB_CLOSE then you can pass the variant name in the inport VARIANT of FM JOB_SUBMIT.
‎2008 Feb 11 11:49 AM
ji naseer,
to pass the default variant, you need to pass this FM
'REUSE_ALV_VARIANT_DEFAULT_GET'
CODE:
Structure to display variants for improt and export
DATA : IT_VARIANT LIKE DISVARIANT,
IT_VARIANT1 LIKE DISVARIANT.
Constants: C_SAVE TYPE C VALUE 'A'.
IT_VARIANT1-REPORT = SY-REPID.
Search default variant for the report
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = C_SAVE "all user/default
CHANGING
CS_VARIANT = IT_VARIANT1
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0. "if succesful set as default.
P_VAR = IT_VARIANT1-VARIANT.
ENDIF.
reward points if helpful
Rohan Malik