Application Development 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: 

multiple selection in F4

Former Member
0 Kudos
1,614

hi,

i use this code to f4 help and its working o.k. what i wont is multiple selection like to choose 3 or more employee

how i can do that?

REPORT ZV_SMART_SEND1.

TABLES: PA0002.

*DATA: ITAB LIKE PA0002 OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF ITAB OCCURS 0,

PERNR TYPE PA0002-PERNR,

END OF ITAB.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS P_TABLE FOR PA0002-PERNR NO INTERVALS.

DATA BEGIN OF IT_RETN OCCURS 0.

INCLUDE STRUCTURE DDSHRETVAL.

DATA END OF IT_RETN.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_TABLE-LOW.

SELECT *

FROM PA0002

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE BEGDA LE SY-DATUM

AND ENDDA GE SY-DATUM

AND GESCH = '2'.

" Add this line

DATA: LV_REPID LIKE SY-REPID.

LV_REPID = SY-REPID.

" Add this line

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'PERNR'

DYNPPROG = LV_REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_TABLE'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

RETURN_TAB = IT_RETN.

LOOP AT IT_RETN WHERE RETFIELD = 'PERNR'.

P_TABLE = IT_RETN-FIELDVAL.

EXIT.

ENDLOOP.

regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
80

Hi,

Please refer to the below code:


DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERKS-LOW.
SELECT WERKS NAME1 INTO CORRESPONDING FIELDS OF TABLE KUNNSO_ITAB FROM T001W.
DELETE ADJACENT DUPLICATES FROM KUNNSO_ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_WERKS'
VALUE_ORG = 'S'
multiple_choice = 'X'
TABLES
VALUE_TAB = KUNNSO_ITAB
return_tab = return.
IF SY-SUBRC 0.
SORT return BY fieldval DESCENDING.
LOOP AT return.
S_WERKS-low = return-fieldval.
S_WERKS-option = 'EQ'.
S_WERKS-sign = 'I'.
S_WERKS-high = space.
APPEND S_WERKS.
ENDLOOP.
SORT S_WERKS BY low.
ENDIF.

Thanks,

Sriram Ponna.

3 REPLIES 3

Former Member
0 Kudos
80

hi ,

maybe some one can help?

Regards

Former Member
0 Kudos
81

Hi,

Please refer to the below code:


DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERKS-LOW.
SELECT WERKS NAME1 INTO CORRESPONDING FIELDS OF TABLE KUNNSO_ITAB FROM T001W.
DELETE ADJACENT DUPLICATES FROM KUNNSO_ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_WERKS'
VALUE_ORG = 'S'
multiple_choice = 'X'
TABLES
VALUE_TAB = KUNNSO_ITAB
return_tab = return.
IF SY-SUBRC 0.
SORT return BY fieldval DESCENDING.
LOOP AT return.
S_WERKS-low = return-fieldval.
S_WERKS-option = 'EQ'.
S_WERKS-sign = 'I'.
S_WERKS-high = space.
APPEND S_WERKS.
ENDLOOP.
SORT S_WERKS BY low.
ENDIF.

Thanks,

Sriram Ponna.

Former Member
0 Kudos
80

hi i just tried out.

check this .

try whether this changes work

TABLES: pa0002.

*DATA: ITAB LIKE PA0002 OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF itab OCCURS 0,

pernr TYPE pa0002-pernr,

END OF itab.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS p_table FOR itab-pernr . "NO INTERVALS.

DATA BEGIN OF it_retn OCCURS 0.

INCLUDE STRUCTURE ddshretval.

DATA END OF it_retn.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_TABLE-low.

SELECT *

FROM PA0002

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE BEGDA le sy-datum

AND ENDDA ge sy-datum

AND GESCH = '2'.

" Add this line

DATA: LV_REPID LIKE SY-REPID.

LV_REPID = SY-REPID.

" Add this line

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'PERNR'

DYNPPROG = LV_REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_TABLE'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

RETURN_TAB = IT_RETN.

LOOP AT IT_RETN WHERE RETFIELD = 'PERNR'.

P_TABLE = IT_RETN-FIELDVAL.

EXIT.

ENDLOOP.