Application Development 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: 

in alv's

Former Member
0 Kudos

hi

in reuse_alv_grid_display , what is the use of parameters

i_callbackprogram,

i_save

is_variant

i_default

how i_save , is_variant , i_default are related to each other

7 REPLIES 7

Former Member
0 Kudos

Hi,

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'Prog.name'

I_STRUCTURE_NAME = 'I_ITAB'

I_DEFAULT = 'X'

I_SAVE = 'A'

TABLES

T_OUTTAB = I_ITAB.

IF SY-SUBRC <> 0.

WRITE: 'SY-SUBRC: ', SY-SUBRC .

ENDIF.

ENDFORM. " GET_FINAL_DATA

i_callbackprogram,

this is for giving the program name for the function module

i_save this is for saving the layout that you had created

is_variant this is for creating a varient in the alv

do you know where all these r use ful is i had a program with a certain layout which shows 6 fields but i need to display 4 fields with out changing the code and if i wanted the 2 fields have to get back..then i will change the layout using the button change layout in the alv and i will save with a name using the i_save functionality..

Former Member
0 Kudos

hi

i_callbackprogram: Program from which the function module is called and that contains the exit routines.The program should always be a report, function group, module pool or form routine pool (it should not be an include).

always pass SY-REPID directly at the interface. If field SY-REPID contains the desired program name, you must absolutely assign this name to an auxiliary variable and pass this variable to the interface.

i_save = Variants can be saved

Description

Controls the save mode

Prerequisite:

Parameter IS_VARIANT is filled accordingly.

See also the documentation on IMPORTING parameter IS_VARIANT.

Value Range

' ' = Display variants cannot be saved

Defined display variants (such as delivered display variants) can be selected for presentation regardless of this indicator. However, changes cannot be saved.

'X' = Standard save mode

Display variants can be saved as standard display variants.

Saving display variants as user-specific is not possible.

'U' = User-specific save mode

Display variants can only be saved as user-specific.

'A' = Standard and user-specific save mode

Display variants can be saved both as user-specific and as standard

variants. Users make their choice on the dialog box for saving the

display variant.

Default

SPACE

Return ->

Variants can be saved

is_variant: Variant information

Description

This structure is only relevant if display variants are to be saved and/or read.

Variant information including the name of the list variant that is used to output the list.

To allow display variants to be read within the ALV, you must specify the acess path using fields REPORT (required field), HANDLE (optional field) and/or LOG_GROUP (optional field).

If you also want to allow display variants to be saved, you must additionally fill parameter I_SAVE accordingly.

See also the documentation on IMPORTING parameter I_SAVE.

A variant is uniquely described through:

The program to which the variant is assigned (REPORT)

The handle (HANDLE), if, for example, multiple lists with different structures and data are called in a program (I_CALLBACK_PROGRAM).

The handle is a CHAR(4) field that must be uniquely defined and describes the assignment of the call to the current structure of the internal output table.

Example:

Depending on the user interaction, several types of lists can be output in program x.

The user should be able to define display variants for each type of list.

You provide this function to the user by assigning a HANDLE to each list. If variants for the program and the handle are saved, the handle must not be modified any more.

The logical group, if, for example, the same list is created with different settings through various transactions (LOG_GROUP).

The logical group is a CHAR(4) that must be uniquely defined and specifies the assignment.

Example:

Program x is called through transactions T1 and T2. Depending on the transaction code, the fields available to the user through the field catalog differ in their assignment to different logical groups.

If variants for the program and the logical group are saved, the logical group must not be modified any more.

The user name, if user-specific variants are saved (USERNAME).

You do not have to fill this parameter manually since the variant name is unique.

The variant name (VARIANT).

You only have to fill this parameter if this structure is to be used to read a concrete variant and the list is to be output with this variant.

Value Range

To call a list with a variant, you must specify the above fields.

Default

If the structure is initial, but saving is active (I_SAVE is not initial), then IS_VARIANT-REPORT = I_CALLBACK_PROGRAM is set.

For a possible entries help for variants, function module REUSE_ALV_VARIANT_F4 is available.

Return ->

Variant information

i_default : Description

Initial variant maintenance active/inactive. .

Prerequisite:

Parameter IS_VARIANT is filled accordingly.

See also the documentation on the IMPORTING parameter IS_VARIANT.

Value Range

SPACE = Definition of initial variants not allowed

'X' = Definition of initial variants allowed

Default

SPACE

reward points if usefull

snehi chouhan

Former Member
0 Kudos

hi

i_callbackprogram,

this is for giving the program name for the function module

i_save this is for saving the layout that you had created

is_variant this is for creating a varient in the alv

do you know where all these r use ful is i had a program with a certain layout which shows 6 fields but i need to display 4 fields with out changing the code and if i wanted the 2 fields have to get back..then i will change the layout using the button change layout in the alv and i will save with a name using the i_save functionality..

regards,

venkat.

Former Member
0 Kudos

Hi,

i_callback_program - program name

i_save - to save layout variant

is_variant - to have layout variant

i_default - to have one layout variant as default.

U can check with the documentation.

reward if helpful.

regards,

Ramya

Former Member
0 Kudos

i_callback program defines name of the calling program.

i_save defines variantrs saving conditions..like A , U.

i_default defines initial variant (default variant) active/inactive.

is_variant defines specific variant(layout) information which is available on the output.

Reward if it useful.

Dara.

venkat_o
Active Contributor
0 Kudos

Hi jyothsna, Simple understanding. 1.i_callbackprogram: If you use reuse_alv_grid_display function module in ur program, your program name needs to be passed for this parameter. 2.I_SAVE = 'X' or 'U' or 'A' . This gives u an option to save ur list output as a variant. Suppose you have a report with 10 columns. but u dont want to see 2 fields. You can hide them on the output by creating variant. to save that u have to pass i_save parameter. 3.is_variant as I said above, once u saved variant, if u want to use the created variants previously, we can pass that variant through function module. On the output selected variant output is displayed. 4.i_default .After creating variants , if u want one of them as default value , pass 'X'. I hope that it helps u. Regards, Venkat.O

Former Member
0 Kudos

Hi,

I_callbackprogram- is used to dispaly the interactive report and inorder to trigger the events.

It demotes from which program we are calling that function module.

I_save- is used when we del with variants.

When we pass i_save as 'x' then the the function codes in the layout will appear otherwise the function codes for save layout and change layout will hide.

is_variant- This hold a the variant internal table which is of type disvariant.

By using this internal table we can select a layout from a list of layouts using the function module reuse_alv_variant_f4

i_default- this will be 'x' or space. If we want to allow the dafault layouts then we can pass it as 'x'. Otherwise it is space.

I think it is useful for you.