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

Not allow to write on a matchcode

Former Member
0 Likes
1,078

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.


1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
880

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

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
881

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

Read only

0 Likes
880

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.

Read only

0 Likes
880
No coding with ddic

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.

Coding

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.

Radiobuttons

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

Read only

0 Likes
880

Ok,

thanks a lot.