‎2008 Mar 25 2:16 PM
select-options : werks for marc-werks default '1000' no intervals no-extension,
matnr for marc-matnr,
mtart for mara-mtart,
mmsta for marc-mmsta.
here i want matnr according to werks =1000 on F4 help.
how to do it?
‎2008 Mar 25 2:26 PM
Hi,
For this you need to design your own search help
by going in SE11 u can design that.
then u need to attach this search help to ur select-option matnr .
you can attach ur own search help to the select-option by using additions
14. ... VALUE-REQUEST
15. ... VALUE-REQUEST FOR LOW/HIGH
16. ... HELP-REQUEST
17. ... HELP-REQUEST FOR LOW/HIGH
that are given in the help ( F1 ) .
<REMOVED BY MODERATOR>
Edited by: Ashish Paliwal on Mar 25, 2008 3:29 PM
Edited by: Alvaro Tejada Galindo on Mar 25, 2008 11:05 AM
‎2008 Mar 25 2:30 PM
‎2008 Mar 25 2:38 PM
HI,
Please refer below code:
DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MATNR-LOW.
select matnr from marc into table itab where werks = '1000'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATNR'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'MATNR'
VALUE_ORG = 'S'
multiple_choice = 'X'
TABLES
VALUE_TAB = itab
return_tab = return.
IF SY-SUBRC 0.
SORT return BY fieldval DESCENDING.
LOOP AT return.
MATNR-low = return-fieldval.
MATNR-option = 'EQ'.
MATNR-sign = 'I'.
MATNR-high = space.
APPEND MATNR.
ENDLOOP.
SORT MATNR BY low.
ENDIF.
Thanks,
Sriram Ponna.
‎2008 Mar 25 2:30 PM
Hi,
Refer below code :
DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
"write select statement using 1000 in where condition.
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 Mar 25 2:50 PM
Hi Javed,
In the program under AT SELECTION-SCREEN ON FIELD MATNR use the call the function module DYNP_VALUES_READ to read the value of WERKS in the selection screen. then call the the function module 'F4IF_INT_TABLE_VALUE_REQUEST' to display the materials in the plant 1000.
AT SELECTION-SCREEN ON FIELD MATNR.
call the the function module DYNP_VALUES_READ and pass the Program name and Screen number as 1000.
then u can read the WERKS entered in the screen. keep that value in GV_WERKS and.
SELECT matnr werks
INTO TABLE i_matnr
FROM MARC.
IF sy-subrc = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'matnr'
value_org = 'S'
TABLES
value_tab = i_matnr
return_tab = i_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ELSE.
READ TABLE i_return INTO wa_return INDEX 1.
IF sy-subrc = 0.
matnr = wa_return-fieldval.
ENDIF.
ENDIF.
u can use this code will small modifications.
Regards,
Sagar
‎2008 Mar 25 2:57 PM
Hi javed parvez,
Please refer below code for it..
DATA: BEGIN OF WA_MARC ,
MATNR LIKE MARC-MATNR,
END OF WA_MARC.
DATA: ITAB_MARC LIKE STANDARD TABLE OF WA_MARC.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATNR-LOW.
SELECT MATNR
FROM MARC
INTO TABLE ITAB_MARC
WHERE WERKS IN WERKS. " here werks after IN is for ur select-option
IF SY-SUBRC EQ 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'Material ID'
* PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'MATNR' " ur Select-Option field name on which u need F4 help
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = ITAB_MARC
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
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.
ENDIF.
Similar code for MATNR-HIGH
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATNR-HIGH.
Hope it will solve your problem..
<REMOVED BY MODERATOR>
Thanks & Regards
ilesh 24x7
Edited by: Alvaro Tejada Galindo on Mar 25, 2008 11:09 AM