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

Selection screen values as form params...

Former Member
0 Likes
1,219

Hi all: I want to pass my selection screen values into my forms as a parameter...maybe as a structure. What is the best way to accomplish? Thanks. Mat.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
1,176

I just use


PARAMETERS: p1 TYPE matnr,
           p2 TYPE i,
           p3 TYPE bukrs.

PERFORM my_sub USING P1 P2.
...
FORM my_sub USING i1 TYPE matnr
                 i2 TYPE i
                 i3 TYPE bukrs.

Is that what you're asking, or something deeper in program design.

12 REPLIES 12
Read only

matt
Active Contributor
0 Likes
1,177

I just use


PARAMETERS: p1 TYPE matnr,
           p2 TYPE i,
           p3 TYPE bukrs.

PERFORM my_sub USING P1 P2.
...
FORM my_sub USING i1 TYPE matnr
                 i2 TYPE i
                 i3 TYPE bukrs.

Is that what you're asking, or something deeper in program design.

Read only

Former Member
0 Likes
1,176

I've created a custom structure which includes a field for each of the fields on my selection screen. I use the function module RS_REFRESH_FROM_SELECTOPTIONS to retrieve the current values of my selection screen fields and assign to my structure. Trouble is the function module shows some selection screen fields as having no value when I set the value via a MEMORY ID. Why is it the function module returns no values for those fields but you can see the actual values on the selection screen...and how do I capture those values? Thanks. Mat.

Read only

Former Member
0 Likes
1,176

Hi,

Are you passing your program name to this FM. Please verify it once and more thing try to call this FM after the statment START-OF-SELECTION and make sure that the IMPORT MEMORY statment is before the FM is called and check the return of the IMPORT statement.

Let me know if any.

Regards,

Srinivas

Read only

Former Member
0 Likes
1,176

Function module picks all values accept those set when I declare the parameter with the MEMORY ID extension as follows:

PARAMETERS: p_kokrs TYPE kokrs OBLIGATORY MEMORY ID cac.

Seems odd...doesn't it.

Read only

roberto_vacca2
Active Contributor
0 Likes
1,176

Hi ..

How do you set your value? SET PARAMETER ID : 'RAC' FIELD racer? or what?..

Bye,

Read only

0 Likes
1,176

I set the value when i declare the parameter:

PARAMETERS: p_kokrs TYPE kokrs OBLIGATORY MEMORY ID cac.

Read only

roberto_vacca2
Active Contributor
0 Likes
1,176

Did you try field symbols?.. They are in the dynamic memory so they should always be visible..

Read only

roberto_vacca2
Active Contributor
0 Likes
1,176

With memory ID instruction you're linking your report with your parameter.. You have to "break the chain between report's memory and function's memory.. the only way is a virtual bridge between the two..

Could you write much more abap code about this question?..

Read only

0 Likes
1,176

The only code that is pertinent is the declaration of the parameter ID:

PARAMETERS: p_kokrs TYPE kokrs OBLIGATORY MEMORY ID cac.

And the call to the fm:

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

curr_report = sy-cprog

TABLES

selection_table = lt_rsparams

EXCEPTIONS

not_found = 1

no_report = 2

OTHERS = 3.

For instance...when I run the program I can see the value set on the selection screen for p_kokrs. If I select F4 help for another field on the selection screen I immediatly call the fm to collect current values set for fields on the selection screen. I notice any values set by a MEMORY ID are not returned in the call to the fm...any value set manually is picked up. If I run the program and then F3 back up to the selection screen...and then select F4 help for the same field...I do get all the values returned in the fm. Why is that?

Read only

0 Likes
1,176

OK...If the fm returns no value for the field in question...I do a get memory id and that returns the needed value.

Read only

0 Likes
1,176

If I select F4 help for another field on the selection screen I immediatly call the fm to collect current values set for fields on the selection screen. I notice any values set by a MEMORY ID are not returned in the call to the fm

Will you please make this some more clear

How are you collecting the current value set ? - Are you using DYNP_VALUES_READ ?

Read only

roberto_vacca2
Active Contributor
0 Likes
1,176

I'm looking for an explanation... instead you can try this...

I noticed there are a lot of submit in the function module...Try to put, after CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'..

this..

If sy-subrc EQ 0.

COMMIT WORK AND WAIT.

ENDIF.