01-09-2008 7:36 AM
Hi all,
I wanted to know that I have a selection-screen in which i have a select-option for company code where i m going for F4 help, so what i need is once F4 help is triggered i need customer number should come hard coded in the popup screen. But the problem is for one company code there are N number of customer , so is there any way to get a particular customer.
Neccesary help is appreciated.
Thanks,
satish
01-09-2008 9:45 AM
Hi,
U need to call a function module for F4 help(dont remember the name)
u can populate the internal table of this FM using your logic.
this ensures that when u press f4 it displays only those values which u want user to see.
tc
saji
01-09-2008 10:14 AM
Hi,
gothorugh the below sample code.
TABLES: mara.
DATA:
BEGIN OF x_matnr OCCURS 0,
matnr LIKE mara-matnr,
maktx like makt-maktx,
END OF x_matnr.
DATA:
l_dynprofld TYPE help_info-dynprofld,
l_matnr(7) TYPE c VALUE 'P_MATNR',
l_prog TYPE sy-repid,
l_dynnr TYPE sy-dynnr.
PARAMETERS: p_matnr LIKE mara-matnr,
p_maktx like makt-maktx.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_maktx.
PERFORM f_get_values.
*&----
*
*& Form F_GET_VALUES
*&----
*
text
*----
*
--> p1 text
<-- p2 text
*----
*
FORM f_get_values.
DATA: i_return LIKE ddshretval OCCURS 0,
i_dynpfields like DYNPREAD occurs 0 with header line,
l_repid like sy-repid.
l_repid = sy-repid.
i_dynpfields-fieldname = 'P_MATNR'.
APPEND I_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_repid
dynumb = '1000'
tables
dynpfields = i_dynpfields .
IF sy-subrc = 0.
READ TABLE I_DYNPfields INDEX 1.
IF SY-SUBRC = 0.
CALL FUNCTION 'CONVERSION_EXIT_MATN2_INPUT'
EXPORTING
input = I_DYNPfields-FIELDVALUE
IMPORTING
OUTPUT = I_DYNPfields-FIELDVALUE.
select matnr maktx from makt into table x_matnr
where matnr = I_DYNPfields-FIELDVALUE.
ENDIF.
ENDIF.
IF NOT X_MATNR[] IS INITIAL.
l_prog = sy-repid.
l_dynnr = sy-dynnr.
l_dynprofld = l_matnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MAKTX'
dynpprog = l_prog
dynpnr = l_dynnr
dynprofield = l_dynprofld
value_org = 'S'
TABLES
value_tab = x_matnr
return_tab = i_return.
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.
ENDFORM. " F_GET_VALUES
Reward if useful.
Thanks,
Ashok.