Application Development and Automation 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: 
Read only

varient for background processing

Former Member
0 Likes
1,108

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.

3 REPLIES 3
Read only

Former Member
0 Likes
474

Hi,

Just pass value to IS_VARIANT in grid_display fn.module

Reward if useful

Read only

Former Member
0 Likes
474

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.

Read only

Former Member
0 Likes
474

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