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

Maintaining variants for dynpro application

AlexGiguere
Contributor
0 Likes
771

Hi guys, question for the pro!

I have created a transaction called ZMB21 similar to MB21. I have only one screen and instead of using a step loops for the items, I used a table control. Now I want to add a functionnality to save variants, this will save the header fields and items fields of my transaction, user will be able to delete, save, manage variants like in standard report. Is it possible using the standard FM RS_VARIANT*. I did some research, I know is it possible but I don't know for the table control (items) if we could save this kind of data into the variant. How can I do that or is it possible using SAP standard FM?

thanks

Alex

Hi guys, question for the pro!

I have created a transaction called ZMB21 similar to MB21. I have only one screen and instead of using a step loops for the items, I used a table control. Now I want to add a functionnality to save variants, this will save the header fields and items fields of my transaction, user will be able to delete, save, manage variants like in standard report. Is it possible using the standard FM RS_VARIANT*. I did some research, I know is it possible but I don't know for the table control (items) if we could save this kind of data into the variant. How can I do that or is it possible using SAP standard FM?

thanks

Alex

4 REPLIES 4
Read only

Former Member
0 Likes
724

Interesting idea. It wouldn't be my first choice of option, and my instinct is that you'd run into problems down the track...

For example, you'd probably have to invent a naming convention for the "selname" column for the TC rows that you want to poke into the variants i.e. in reports you only have 8-bytes for a parameter / select-option field name, so you'd need to mirror this limit in your code, plus handle the columns and rows. And of course you can't expect SAP to write the values into the dynpro screen for you automatically since you are using a variant with a module pool & TC and not just report. Another thing to be careful of is the 45 character limit for variable values in some places around variants... also, I think some of the RSVARIANT functions may chuck a wobbly if you try to retrieve a variant from a program that does not have a selection screen - e.g. something will abend with a message like:

The program "RSDBRUNT" is meant to execute an external PERFORM,  
namely the routine "%_INIT-MOVE" of the program "SAPMZ_X123 ", but
this routine does not exist.                                    

If it was me, I'd probably just have couple of "Z" tables to capture the user's screen defaults - a "header" table with an ID, description, and some control data (userid, date, time etc), and a "detail" one where you can have any number of values held per header entry ID.

Jonathan

Read only

0 Likes
724

Thanks Jonathan, that is what I intended to do!

Alex

Read only

0 Likes
724

I finally find a way to use standard SAP coding for variants saving with dynpro screen, I had to add some custom coding also. If someone is interresting, I will give the solution!

Alex

Read only

0 Likes
724

Hi Alex,

I am facing the same issue. Can you please let me know how you have solved this.

Subhashini