2009 Jul 15 9:55 AM
Hi Experts,
I developed a search help with 'F4IF_INT_TABLE_VALUE_REQUEST' FM and when I am clicking on the field name of the search help its going to dump. Please help me with that.
The code I developed is :
IF t_dfies_final IS INITIAL.
*-update the user define header of search help for casnum
t_dfies_final-fieldname = 'CASNUM'.
t_dfies_final-position = 0001.
t_dfies_final-offset = 000000.
t_dfies_final-intlen = 000264.
t_dfies_final-leng = 000132.
t_dfies_final-outputlen = 000132.
t_dfies_final-scrtext_s = t_dfies_final-fieldname.
t_dfies_final-scrtext_m = t_dfies_final-fieldname.
t_dfies_final-scrtext_l = t_dfies_final-fieldname.
t_dfies_final-reptext = t_dfies_final-fieldname.
APPEND t_dfies_final.
*-update the user define header of search help for casnam
t_dfies_final-fieldname = 'SUBSTANCENAME'.
t_dfies_final-position = 0002.
t_dfies_final-offset = 000264.
t_dfies_final-intlen = 000132.
t_dfies_final-leng = 000132.
t_dfies_final-outputlen = 000132.
t_dfies_final-scrtext_s = t_dfies_final-fieldname.
t_dfies_final-scrtext_m = t_dfies_final-fieldname.
t_dfies_final-scrtext_l = t_dfies_final-fieldname.
t_dfies_final-reptext = t_dfies_final-fieldname.
APPEND t_dfies_final.
ENDIF.
*to get the value help
IF NOT t_value_cas IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CASNUM'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_CNUM1'
value_org = 'S'
TABLES
value_tab = t_value_cas
field_tab = t_dfies_final
DYNPFLD_MAPPING = T_DSELC
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.
CLEAR T_DFIES_FINAL[].
ENDIF.
Regards,
Srikanth.
Hi Experts,
I developed a search help with 'F4IF_INT_TABLE_VALUE_REQUEST' FM and when I am clicking on the field name of the search help its going to dump. Please help me with that.
The code I developed is :
IF t_dfies_final IS INITIAL.
*-update the user define header of search help for casnum
t_dfies_final-fieldname = 'CASNUM'.
t_dfies_final-position = 0001.
t_dfies_final-offset = 000000.
t_dfies_final-intlen = 000264.
t_dfies_final-leng = 000132.
t_dfies_final-outputlen = 000132.
t_dfies_final-scrtext_s = t_dfies_final-fieldname.
t_dfies_final-scrtext_m = t_dfies_final-fieldname.
t_dfies_final-scrtext_l = t_dfies_final-fieldname.
t_dfies_final-reptext = t_dfies_final-fieldname.
APPEND t_dfies_final.
*-update the user define header of search help for casnam
t_dfies_final-fieldname = 'SUBSTANCENAME'.
t_dfies_final-position = 0002.
t_dfies_final-offset = 000264.
t_dfies_final-intlen = 000132.
t_dfies_final-leng = 000132.
t_dfies_final-outputlen = 000132.
t_dfies_final-scrtext_s = t_dfies_final-fieldname.
t_dfies_final-scrtext_m = t_dfies_final-fieldname.
t_dfies_final-scrtext_l = t_dfies_final-fieldname.
t_dfies_final-reptext = t_dfies_final-fieldname.
APPEND t_dfies_final.
ENDIF.
*to get the value help
IF NOT t_value_cas IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CASNUM'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_CNUM1'
value_org = 'S'
TABLES
value_tab = t_value_cas
field_tab = t_dfies_final
DYNPFLD_MAPPING = T_DSELC
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.
CLEAR T_DFIES_FINAL[].
ENDIF.
Regards,
Srikanth.
2009 Jul 15 10:01 AM
Hi,
Wats the dump ur getting .Which Exception is getting trigerred.
Chk whether ur passing right values to the FM or not.
Regards,
Lakshman.
2009 Jul 15 10:06 AM
Hi Lakshman,
Thanks for your quick response.
Its not triggering any exceptions the only runtime error is ASSIGN_CAST_WRONG_TYPE.
Regards,
Srikanth.
2009 Jul 15 10:06 AM
2009 Jul 15 10:06 AM
to me it seems trouble happening is that u r not checking [] body tag while using initial check.
2009 Jul 15 10:18 AM
Hi Srikanth,
In FM - tables where is the return table ?
there would be value_tab and return_tab. in return_tab only u need to get your values. check the FM once again.
check the below code,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_region-low.
v_fname = c_fname01.
v_dynfield = c_dynfield01.
perform f_get_help using v_fname v_dynfield.
FORM f_get_help USING fp_v_fname TYPE fieldname
fp_v_dynfield TYPE dynfnam.
TYPES: BEGIN OF ty_f4_tab,
desc TYPE char30,
data TYPE char4,
END OF ty_f4_tab.
DATA: l_it_return TYPE STANDARD TABLE OF ddshretval,
l_wa_return TYPE ddshretval,
l_it_f4_tab TYPE STANDARD TABLE OF ty_f4_tab,
l_wa_f4_tab TYPE ty_f4_tab,
l_v_program TYPE sy-repid,
l_v_dynnr TYPE sy-dynnr.
CONSTANTS: c_s TYPE char1 VALUE 'S'.
* Populate the hardcoded values here
l_wa_f4_tab-data = 'ANZ'.
l_wa_f4_tab-desc = 'AUST/NZ'.
APPEND l_wa_f4_tab TO l_it_f4_tab.
l_wa_f4_tab-data = 'BJ'.
l_wa_f4_tab-desc = 'BEIJING SALES'.
APPEND l_wa_f4_tab TO l_it_f4_tab.
l_wa_f4_tab-data = 'FM'.
l_wa_f4_tab-desc = 'SINGAPORE SALES'.
APPEND l_wa_f4_tab TO l_it_f4_tab.
l_v_program = sy-repid.
l_v_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = fp_v_fname
dynpprog = l_v_program
dynpnr = l_v_dynnr
dynprofield = fp_v_dynfield
value_org = c_s
TABLES
value_tab = l_it_f4_tab
return_tab = l_it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc NE 0.
CLEAR l_it_f4_tab.
ELSE.
READ TABLE l_it_return INTO l_wa_return INDEX 1.
IF sy-subrc = 0.
fp_v_fname = l_wa_return-fieldval.
ENDIF.
ENDIF.
ENDFORM.
Regards,
Satkhi.
2009 Jul 15 10:31 AM
SY-CPROG holds the name of first main program (Caller in external procedures) while SY-REPID holds the name of current program.
This may be the reason for dump. So kindly use SY-REPID and check if your problem still exists.
2009 Jul 15 10:36 AM
Hi,
first of all you need to check the type declaration all the declaration are of same kind as in fm imoprt or export parameter...
second take a varaible of type sy-repid and sy-dynnr and then assign value of sy-repid and sy-dynnr and then pass these variable to fm...
i hope u will get the solution....
thanks & Regards
Ashu Singh
2009 Jul 15 10:46 AM
Hi All,
I am trying to change the fieldname heading in the search help thats where the Error is poping up. could you please tell me any alternative to change the fieldname.
Regards,
Srik