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: 

Variants functionality for a custom made report

MarkusKlein
Active Contributor
0 Kudos
298

Hello everybody,

i want to integrate the variant functionality we all know from reports in a custom made report (Dynpro). Is there any kinda generic functionality available you can hook up with? Like FMs or something?

best regards,

Markus

1 ACCEPTED SOLUTION

Former Member
0 Kudos
77

Hi markus,

1. custom made report

If the custom made report u are talking about

is se38 report,

then this variant functinoality

is AUTOMATICALLY applicable there !

2. (we don't have to do anything extra for it)

regards,

amit m.

9 REPLIES 9

Former Member
0 Kudos
78

Hi markus,

1. custom made report

If the custom made report u are talking about

is se38 report,

then this variant functinoality

is AUTOMATICALLY applicable there !

2. (we don't have to do anything extra for it)

regards,

amit m.

0 Kudos
77

If you are doing a module pool program(dynpro), the screen variant is not available. I would suggest trying to use a selection-screen in a report to get the variant functionality.

Regards,

Rich Heilman

0 Kudos
77

Hello,

maybe i should start from the very beginning. I am developing an application/report which has besides standard input fields a table (editable Grid Control) as selection fields.

I started off using the selection-screen functionality and integrated the Grid Control as a subscreen. Working great. But as it come to developing the functionaility "variant saving" i went into a problem. The standard input field were covered by the SAP standard functionalities, but not the table (grid control).

What i managed to implement using the possibility of custom code at the standard events AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT was when you click on the save button in a report to save my table content in a own database table with the link to the name of the standard variant. (Systemfield VARI hold the data). I even was able to load my saved table data, when loading a variant. This worked only on the first run (event initialization), as clicking on the load variant button in a report does NOT give me any return-code, like pressing the save button. It just raises the event PBO, as does pressing the enter button. So my problem is, i do not have the info at runtime, whether someone has pressed the load variant button and selected a variant or whether someone just pressed the return key, both do invoke PBO and i cant tell the difference.

So i had the idea of instead of using a report, developing a own dynpro application (Module pool).

best regards,

Markus

0 Kudos
77

if my understanding is right, what you want is to capture the click of get variant menu in your program and load your own variants saved in custom table.

if yes.

for this scenario, set your own PF-STATUS in at selection-screen output event and capture the click of the button in at selection screen event to get data from your custom table holding the variant details.

Raja

0 Kudos
77

Hello Durairaj,

yes, thats basically what im trying to achive. Will try what you suggested

Thank you

regards,

Markus

0 Kudos
77

it should work. just to test it i created a pf status and called it on at selection screen output .

and at selection-screen

i wrote

if sy-ucomm eq 'myfcode from pf status' .

<selscreenparameter> = <some value> .

endif .

and this works.

Raja

0 Kudos
77

Hello Raja,

just to get sure. I do not want to completely exchange the variant handling with my own, but to use a mix. I want to have my inputfields on the selection screen handled by the standard variant functionality, and to use my own handling just for the input table i have defined on my selection screen. Not sure if this is still possible with your solution, as it seems it does completely disable the standard variant handling.

regards,

Markus

0 Kudos
77

just copy the GUI status "%_00" of program RSSYSTDB to your custom program (form SE80)

and in the new gui status add a new button for handling variants for the table.

please note that in this case, the user has to use two menus to fill all variants.

1. to use the standard variant functionality to fill the parameters and select-options

2. click the custom button to fill the table.

Hope this is clear.

Regards

Raja

former_member188685
Active Contributor
0 Kudos
77

Hi,

If it is a report Program then there is no need of any extra coding or extra FM calling. the Variant Functionality will automatically available with the Report Programs, In se38 it self you can run the Program with the <b>Variants</b> option or <b>Run with Variant.</b>

Regards

Vijay