‎2006 Jan 19 2:58 PM
HI,
I am using fm F4IF_FIELD_VALUE_REQUEST to dislay Search Help.
I've got a problem with Search Help 'MRM_HELP_RBKP'.
This search help must retrun me 2 data (invoice number and year).
The function F4IF_FIELD_VALUE_REQUEST retruns me only the invoice number...!!!!
how can I get the the year of the invoice number
Thanks you
‎2006 Jan 19 3:13 PM
Hi Joeseph,
You can use the FM DYNP_UPDATE_FIELDS to update the field. As the invoice number is returned, you would be able to identify the year. You can pass the corresponding field name for the year and its value to this FM.
Regards,
Srikanth
‎2006 Jan 19 3:03 PM
Hi joseph,
1. One option is :
Instead of search help, use
F4IF_INT_TABLE_VALUE_REQUEST
(with some important parameters)
and we can achieve what u want.
2. I have created one sample program,
in which there is a parameter for BUKRS.
As soon as we selecte it,
the remaining parameters
ie company name, Location, Currency
get filled AUTOMATICALLY.
3. Try this code (just copy paste)
( i have marked IMPORTANT lines also)
It works fantastic.
4.
REPORT abc.
*----
DATA : dd LIKE TABLE OF dselc WITH HEADER LINE. "*--- IMPORTANT
DATA : ft LIKE TABLE OF dfies WITH HEADER LINE.
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
*----
PARAMETERS : bukrs LIKE t001-bukrs .
PARAMETERS : butxt LIKE t001-butxt.
PARAMETERS : ort01 LIKE t001-ort01.
PARAMETERS : waers LIKE t001-waers.
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR bukrs.
SELECT * FROM t001 INTO TABLE t001.
*----
IMPORTANT
REFRESH dd.
dd-fldname = 'BUTXT'.
dd-dyfldname = 'BUTXT'.
APPEND dd.
dd-fldname = 'ORT01'.
dd-dyfldname = 'ORT01'.
APPEND dd.
dd-fldname = 'WAERS'.
dd-dyfldname = 'WAERS'.
APPEND dd.
*------- IMPORTANT
REFRESH ft.
ft-tabname = 'T001'.
ft-fieldname = 'BUTXT'.
APPEND ft.
ft-tabname = 'T001'.
ft-fieldname = 'WAERS'.
APPEND ft.
ft-tabname = 'T001'.
ft-fieldname = 'ORT01'.
APPEND ft.
*----
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = 'T001' "*----- IMPORTANT IF STANDARD STRUCT
retfield = 'BUKRS'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'BUKRS'
value_org = 'S'
TABLES
field_tab = ft "*---- IMPORTANT
value_tab = t001
dynpfld_mapping = dd "* IMPORTANT
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
regards,
amit m.
‎2006 Jan 19 3:09 PM
Your solution is good if you don't have search help.
If I use whant you did I loose all the collective search help link to a field (like mara-matnr).
‎2006 Jan 19 3:08 PM
‎2006 Jan 19 3:11 PM
‎2006 Jan 19 3:13 PM
Hi Joeseph,
You can use the FM DYNP_UPDATE_FIELDS to update the field. As the invoice number is returned, you would be able to identify the year. You can pass the corresponding field name for the year and its value to this FM.
Regards,
Srikanth
‎2006 Jan 19 3:16 PM
How Can you identify the year?
invoice number can be allocated to more than 1 year.
‎2006 Jan 19 3:22 PM
Hi joseph,
I created an example that works for me for searchhelp H_VBKPF from which I get back BELNR and GJAHR, code is below,
REPORT ZSRITEST59.
TYPE-POOLS: shlp.
DATA: lt_return TYPE STANDARD TABLE OF ddshretval.
PARAMETERS: p_belnr LIKE vbkpf-belnr,
p_gjahr LIKE vbkpf-gjahr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'VBKPF'
fieldname = 'BELNR'
searchhelp = 'H_VBKPF'
shlpparam = 'BELNR'
dynpprog = 'ZSRITEST59'
dynpnr = sy-dynnr
dynprofield = 'P_BELNR'
* STEPL = 0
* VALUE = ' '
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = 'ZSRITEST59'
CALLBACK_FORM = 'HANDLE_F4'
TABLES
return_tab = lt_return[]
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
START-OF-SELECTION.
*---------------------------------------------------------------------*
* FORM handle_f4 *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> LT_DATA *
* --> LS_SHLP *
* --> LS_CALLCONTROL *
*---------------------------------------------------------------------*
FORM handle_f4 TABLES lt_data STRUCTURE seahlpres
****The following TYPE SHLP_DESCR_T is replaced with
****SHLP_DESCR from 4.7 onwards
CHANGING ls_shlp TYPE shlp_descr_t
ls_callcontrol LIKE ddshf4ctrl.
DATA: lwa_interface LIKE LINE OF ls_shlp-interface.
lwa_interface-valtabname = ''.
lwa_interface-valfield = 'P_GJAHR'.
MODIFY ls_shlp-interface FROM lwa_interface
TRANSPORTING valtabname valfield
WHERE shlpfield = 'GJAHR'.
ENDFORM.Hope this helps..
Sri
‎2006 Jan 19 3:29 PM