2013 May 27 2:46 PM
Hi,
I've created a matchcode and I'm using it on an abap program.
parameters: myparameter like zmytable-myfield matchcode object zmymatchcode default 'myparam'.
My question is, how can I get that my matchcode can't be written? I mean, the user only must select the available values of the matchcode.
Thanks in advance.
Regards.
2013 May 27 3:17 PM
If there are not too many values, you could define the PARAMETERS myparameter AS LISTBOX VISIBLE LENGTH 30.
Else disable the input-ability of the parameter in the PBO (AT SELECTION-SCREEN OUTPUT) using a MODIF ID value to identify field. Manage the F4 in POV (AT SELECTION-SCREEN ON VALUE-REQUEST) and store the selected value in a global variable or no-display parameter (to be stored in variant) that you will copy in PBO back to the parameter, also trigger a PAI/PBO cycle after the F4 execution using a tool like FM SAPGUI_SET_FUNCTIONCODE or static method CL_GUI_CFW=>SET_NEW_OK_CODE.
Regards,
Raymond
2013 May 27 3:17 PM
If there are not too many values, you could define the PARAMETERS myparameter AS LISTBOX VISIBLE LENGTH 30.
Else disable the input-ability of the parameter in the PBO (AT SELECTION-SCREEN OUTPUT) using a MODIF ID value to identify field. Manage the F4 in POV (AT SELECTION-SCREEN ON VALUE-REQUEST) and store the selected value in a global variable or no-display parameter (to be stored in variant) that you will copy in PBO back to the parameter, also trigger a PAI/PBO cycle after the F4 execution using a tool like FM SAPGUI_SET_FUNCTIONCODE or static method CL_GUI_CFW=>SET_NEW_OK_CODE.
Regards,
Raymond
2013 May 28 7:54 AM
Hello Raymond,
Please, could you give an example in abap? My list has only two values and I want to avoid that the field could be changed.
Thanks again.
2013 May 28 8:13 AM
Create a domain via SE11 and give the two allowed values, use this domain in one data element affected to the dynpro field and define the
PARAMETERS: parametername TYPE datalementname AS LISTBOX VISIBLE LENGTH 60.
Use of FM likeVRM_SET_VALUES. Use same syntax for the parameter, but fill "manullay" the value list and attach it to field with this FM.
INITIALIZATION.
* LISTBOX values
DATA: vrm_id TYPE vrm_id,
vrm_values TYPE vrm_values,
vrm_value LIKE LINE OF vrm_values.
CLEAR vrm_value.
vrm_value-key = 'V01'.
vrm_value-text = text-v01.
APPEND vrm_value TO vrm_values.
vrm_value-key = 'V02'.
vrm_value-text = text-v02.
APPEND vrm_value TO vrm_values.
vrm_id = 'PARAMETERNAME'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = vrm_id
values = vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
Define your prameter as NO-DISPLAY. Create a radiobutton group with one button for each value. put the radiobutton in a group without frame, and fill the hidden parameter in a AT SELECTION-SCREEN ON GROUP, you could also insure coherence, set/unset radiobutton depending on value of parameter (e.g. when your report is called via SUBMIT)
And many, many other solutions, just try.
Regards,
Raymond
2013 May 28 8:21 AM