‎2010 Oct 26 1:00 PM
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.
‎2010 Oct 26 1:05 PM
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.
‎2010 Oct 26 1:05 PM
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.
‎2010 Nov 02 3:08 PM
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.
‎2010 Nov 02 4:01 PM
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
‎2010 Nov 02 4:27 PM
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.
‎2010 Nov 02 4:08 PM
Hi ..
How do you set your value? SET PARAMETER ID : 'RAC' FIELD racer? or what?..
Bye,
‎2010 Nov 02 4:12 PM
I set the value when i declare the parameter:
PARAMETERS: p_kokrs TYPE kokrs OBLIGATORY MEMORY ID cac.
‎2010 Nov 02 4:18 PM
Did you try field symbols?.. They are in the dynamic memory so they should always be visible..
‎2010 Nov 02 4:35 PM
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?..
‎2010 Nov 02 4:53 PM
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?
‎2010 Nov 02 5:04 PM
OK...If the fm returns no value for the field in question...I do a get memory id and that returns the needed value.
‎2010 Nov 02 5:21 PM
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 ?
‎2010 Nov 02 5:07 PM
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.