Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function Module for F4 Help for stext ( table Hrp000 ) type field

Hello all,

I have defined one selection parameter as "Event_NAME FOR HRP1000-STEXT" .

But while running the program, system does not provide any drop down for Event_Name,just displaying it as a text field. I wanted a drop down that contains all entries of STEXT in Hrp1000.

For that I have written following code to make drop down available for event name in selection screen.The code is working fine.But the issue is that i can just select one value from the list on selection screen.I need multiple selections.How can i do that??

*****************

PARAMETERS : EV_NAME LIKE HRP1000-STEXT AS LISTBOX VISIBLE LENGTH 50.

PARAMETERS : EV_GRP LIKE HRP1000-STEXT AS LISTBOX VISIBLE LENGTH 50.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR EV_NAME.

SELECT STEXT FROM HRP1000 INTO TABLE F4_EV_NAME WHERE OTYPE = 'E'.

SORT F4_EV_NAME BY EV_NAME.

DELETE ADJACENT DUPLICATES FROM F4_EV_NAME.

LOOP AT F4_EV_NAME.

LWA_VRM2-KEY = F4_EV_NAME-EV_NAME.

APPEND LWA_VRM2 TO L_VRM_VALUES2.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'EV_NAME'

VALUES = L_VRM_VALUES2

EXCEPTIONS

ID_ILLEGAL_NAME = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

          • For Event Group*************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR EV_GRP.

SELECT STEXT FROM HRP1000 INTO TABLE F4_EV_GRP WHERE OTYPE = 'L'.

SORT F4_EV_GRP BY EV_GRP.

DELETE ADJACENT DUPLICATES FROM F4_EV_GRP.

LOOP AT F4_EV_GRP.

LWA_VRM3-KEY = F4_EV_GRP-EV_GRP.

APPEND LWA_VRM3 TO L_VRM_VALUES3.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'EV_GRP'

VALUES = L_VRM_VALUES3

EXCEPTIONS

ID_ILLEGAL_NAME = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

******************************************************************

Regards,

Aisha Ishrat

ICI Pakistan Ltd.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question