cancel
Showing results for 
Search instead for 
Did you mean: 

Variants in Module Pool

Former Member
0 Kudos

Hello everyone,

I am working on a Module Pool application. It was built from scratch. For the initial screen, the variants and variant handling were developed manually. That means that the application actually saves a variant in DB (transparent) tables.

I need to create two new screens which will will reuse most of the apps functionality. However, some initial screen parameters are different.

So, my question is:

Do you know if there is a way to save variants in a Module Pool as in a Report???

Best regards,

Jaime

PS: I could extend the current DB tables for handling the variants of the two new initial screen (apps) but if there is a better way I would like to give it a try.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi everyone,

just a short note. It is possible to have variants / parameters in module pools.

In order to use the memory, one must enter a parameter ID on the screen element, in the screen painter.

If youd ouble click on a screen element the attribute window pops up. One of these attributes is a parameter ID.

Best regards,

Jaime

Former Member
0 Kudos

Jaime,

Can you please elaborate , how did you manage to have variants in module pool ?

Didn't you write any code for that ?

Is it just a setting in the dynpro ?

Regards,

Subramanian V.

nablan_umar
Active Contributor
0 Kudos

Hi Jamie,

Parameter id you use in dynpro field attributes are not the same as variant in a report program. In variant you can save the values in several variants. Parameter id are keep in memory once for the session you are working on. Depending on your requirements, both can be good.

From my previous experience, if you want to use variant in your screen/dynpro program, you should create your program as a report not module pool. Your selection sreen can be as good as the module pool selection screen, then do 'call screen' to do module pool programming.

This way, you can have the good features of variant in a module pool programming.

Former Member
0 Kudos

Hi,

Take a look at CL_ALV_VARIANT class. I don't think it is necessarily meant for screens with ALV. I debugged through normal selection-screen reports and it also uses the CL_ALV_VARIANT class.

Let me know if it was useful and if it was, do share the code.

Subramanian V.

Former Member
0 Kudos

Hi,

I took a look at the class you mentioned. I made a simple normal report and saved a variant but I never came into this class (breakpoints / debugging). It does seem to be more ALV specific.

However, while debugging I did run into a function pool which seems to contain some nice routines:

SAPLSVAR - Function Group for Variant Maintenance.

I would recommend taking a closer look at it before deciding wheather to reuse something or not.

If I were starting from scratch I would probably follow that line. However, I currently do have an alternative solution which could be reused if extended.

Thanks for your answers and I hope that both the class and the function group may be useful for someone.

Best regards,

Jaime