2008 Feb 19 11:21 AM
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
2008 Feb 19 12:50 PM
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.
2008 Feb 19 12:44 PM
2008 Feb 19 12:50 PM
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.
2008 Feb 19 12:55 PM
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.