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

DYNP_VALUES_READ in tabstrip

Former Member
0 Likes
1,892

Hi

I'm writing a program that involves several screens, and in each screen there are some fields where I added my own value-request modules & forms. For these forms I use FM DYNP_VALUES_READ to get the current values of other screen fields. The problem is that two of the screens have tabstrips in them, and I can't get the FM to read the data from the tabstrips. I tried listing the all fields within one call to the FM, and I tried calling the FM for each subscreen - neither worked. Calling the FM for a subscreen results in a dump.

Suggestions?

Hi

I'm writing a program that involves several screens, and in each screen there are some fields where I added my own value-request modules & forms. For these forms I use FM DYNP_VALUES_READ to get the current values of other screen fields. The problem is that two of the screens have tabstrips in them, and I can't get the FM to read the data from the tabstrips. I tried listing the all fields within one call to the FM, and I tried calling the FM for each subscreen - neither worked. Calling the FM for a subscreen results in a dump.

Suggestions?

8 REPLIES 8
Read only

Former Member
0 Likes
1,633

Try with SET PARAMETER and GET PARAMETER

Read only

0 Likes
1,633

Nice try, but no, that's completely irrelevant. If we could count on the users hitting enter after every field they filled in, we would have no problem. Since they don't, we need to read the current values from the screen.

Read only

brad_bohn
Active Contributor
0 Likes
1,633

I guess my question would be why do you need to call DYNP_VALUES_READ for a tabstripped subscreen that isn't currently displayed? DYNP_VALUES_READ is merely a screen scraper helper function to get the values of fields for which field transport (current screen field to program variable) hasn't happened yet. The fact that there are values on other subscreens that you need presumes that either the tab/screen has been visited and the field transport has happened or the tab/screen has not been visited and the program has defaulted a value in the field(s). Either way, you should be able to obtain the values directly in the code.

Read only

Former Member
0 Likes
1,633

I don't need to read all the tabs, just the one currently showing - and I can't.

Read only

Former Member
0 Likes
1,633

Seems to be your Function type for Tabstrip is 'P', as otherwise whenever user switches the tab the screen value flows to the program variable. And these variable could be used for restricting other value helps.

However, looking at the case of reading values from the same sub screen, hope you have tried all the options in DYNP_VALUES_READ related to the subscreens and screen stack postion options.

Regards

Ranganath

Read only

Former Member
0 Likes
1,633

No, function type is blank ( I used the wizard to create the tabstrip, and that's what it offered.)

And no, I didn't try all the options of the function. I'm not much of a hacker; I like documentation (which SAP tends not to provide...) Do you have any experience with the options?

Read only

brad_bohn
Active Contributor
0 Likes
1,633

I don't need to read all the tabs, just the one currently showing - and I can't.

Perhaps you should post your code then? I've used the function quite often in tabstrips and don't have any problems with reading data on displayed tabs...

Read only

Former Member
0 Likes
1,633

Here's the code:

form read_screen using pgrp.

refresh t_dyn.

clear t_dyn.

case l_dyn.

when '0100'.

t_dyn-fieldname = 'L_VALID'. append t_dyn.

t_dyn-fieldname = 'L_INSUR'. append t_dyn.

t_dyn-fieldname = 'L_INNUM'. append t_dyn.

...

case G_TABXX-PRESSED_TAB.

when 'TABXX_FC1'. "subscreen 101

t_dyn-fieldname = 'L_TRANS'. append t_dyn.

t_dyn-fieldname = 'L_TECH'. append t_dyn.

...

endcase.

when '0200'.

...

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = 'ZICAR002'

DYNUMB = l_dyn

PERFORM_CONVERSION_EXITS = 'X'

START_SEARCH_IN_CURRENT_SCREEN = ' '

START_SEARCH_IN_MAIN_SCREEN = ' '

START_SEARCH_ON_SCR_STACKPOS = ' '

SEARCH_OWN_SUBSCREENS_FIRST = 'X'

TABLES

DYNPFIELDS = t_dyn

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

OTHERS = 11.

check sy-subrc = 0.

without the section between case G_TABXX-PRESSED_TAB. and endcase it works, with it I get sy-subrc 2.

And yes, I checked that the field names are all identical to the ones on the screen.