Juan Morales
Juan Morales

Reputation: 33

Selection screen parameter with a dynamic matchcode

I have a serie of entry parameters where there a match code, I need that this field (matchcode) will be dependent of a text parameter. For example, something like that :

SELECTION-SCREEN BEGIN OF BLOCK block02 WITH FRAME TITLE text-002.
  PARAMETERS:
    p_mona   TYPE ZTIPOSOL GROUP rad1 MATCHCODE OBJECT ZFIMC002, 
    p_fcomp  TYPE SY-DATUM MODIF ID A OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block02
ABAP Development

Upvotes: 1

Views: 10190

Answers (1)

Suncatcher
Suncatcher

Reputation: 10621

No, you cannot. However, you can populate search help values dynamically in AT SELECTION-SCREEN ON VALUE-REQUEST event:

DATA: LT_VBAK TYPE STANDARD TABLE OF VBAK.

PARAMETER P_VBELN TYPE VBELN.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
       RETFIELD       = 'VBELN'
       DYNPPROG       = SY-REPID
       DYNPNR         = SY-DYNNR
       DYNPROFIELD    = 'P_VBELN'
       VALUE_ORG      = 'S'
      TABLES
       VALUE_TAB      = LT_VBAK
      EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3.

  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

where LT_VBAK is a internal table you need to populate with values. If your values are dependent on another selection screen parameter, use DYNP_VALUES_READ FM to read them from screen.

Another approach is not to dynamically fill values but to create a single Search Help in DDIC and create Search Help exit which will control SHELP behavior depending on some conditions.

Upvotes: 0

Related Questions