2009 Dec 31 9:54 AM
Hi Gurus,
In my ALV report there are two Layout variants.
a) Default Layout - /DEFAULT created by someone else earlier.
b) User specific - created and saved by me (name CS Layout)
I am using this function module
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'U'
CHANGING
cs_variant = xalv_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = xalv_variant-variant.
ENDIF.PROBLEM: Even though I am passing user specific information to this FM, but it is returning me the Default layout, but
I want the user specific layout(CS Layout) which I created and saved.
Please help !
Hi Gurus,
In my ALV report there are two Layout variants.
a) Default Layout - /DEFAULT created by someone else earlier.
b) User specific - created and saved by me (name CS Layout)
I am using this function module
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'U'
CHANGING
cs_variant = xalv_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = xalv_variant-variant.
ENDIF.PROBLEM: Even though I am passing user specific information to this FM, but it is returning me the Default layout, but
I want the user specific layout(CS Layout) which I created and saved.
Please help !
2009 Dec 31 10:01 AM
In selection screen output set the default variant using REUSE_ALV_VARIANT_DEFAULT_GET
Provide value request help using REUSE_ALV_VARIANT_F4
Set the display variant before calling ALV display using REUSE_ALV_VARIANT_SELECT
2009 Dec 31 10:06 AM
2009 Dec 31 10:13 AM
2009 Dec 31 10:16 AM
2009 Dec 31 10:19 AM
Im sorry i didnt get your question clearly before
Can you check it with 'A' and see whether it returns all the layouts.
2009 Dec 31 10:25 AM
2009 Dec 31 10:27 AM
The source code inside FM is
case i_save.
when 'A' or 'U'.------------>'A' or 'U'
l_user_specific = 'X'.
when 'X' or space.
l_user_specific = space.
when others.
message e533(0k) with i_save raising wrong_input.
endcase.
Its the same whether you pass U or A
Regards,
Lakshman.
2009 Dec 31 10:42 AM
Ignore my reply..
Edited by: Pawan Kesari on Dec 31, 2009 4:13 PM
2009 Dec 31 10:45 AM
2009 Dec 31 11:29 AM
Hi Chandan,
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'U'
CHANGING
cs_variant = xalv_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = xalv_variant-variant---------->What does this variable contain.
ENDIF.
You are not populating any value to the variable xalv_variant,again you are passing it again to p_vari.
Check this link once.
[REUSE_ALV_GRID_DISPLAY - layout variant|;
Have a look at rich's reply
Regards,
Lakshman.
2009 Dec 31 11:39 AM
That FM will return LAYOUT.....
P_vari will contain the Layout and Layout text along with report name.
That is the issue, the FM is returning DEFAULT layout and not the one I created.
2009 Dec 31 10:05 AM
Hi Chandan,
Do not pass the program name using sy-repid. Hard code the value of the program and then pass.
The problem here is sy-repid changes once it enters into the function module.
Go through this standard program once BCALV_GRID_09
Regards,
Lakshman.
Edited by: Lakshman N on Dec 31, 2009 11:07 AM
2009 Dec 31 10:10 AM
sy-repid is okay. I checked . It is not changing.
I guess the issue is somewhere else.
Please help
Edited by: chandan sinha on Dec 31, 2009 11:10 AM
2009 Dec 31 10:13 AM
You are populating the variable alv_variant and passing xalv_varaint to the FM.
Is it correct?
Regards,
Lakshman
2009 Dec 31 10:15 AM
2009 Dec 31 11:59 AM
Hi Chandan ,
When you created the user specific variant , did you set it the default varaint for the user . if not please set it as the default varaint for the user and check if it works fine.
Regards,
Arun
2009 Dec 31 12:28 PM
2009 Dec 31 12:38 PM
Hi Chandan ,
If i remember it correctly , when you create the varaint , in the screen where you enter the varaint name and other details there is a check box ,to set the varaint as default ,please check if this is correct or not.
Regards,
Arun
2009 Dec 31 12:44 PM
I have awarded points to Lakshman.
Issue solved.
Reason: Need to SAVE layouts with DEFAULT SETTINGS. Only then the FM will return user specific layout variants.
Anyways thanks a lot to all you folks.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |