‎2009 May 28 9:56 AM
Hi experts,
I'm facing a problem when I try to show a matchcode of dates. I get the date records on the value_tab internal table, the matchcode window says that there are entries but it does not show the values.
Maybe it's a silly mistake, but I can't find it.
PARAMETERS: p_waid TYPE ccihe_waid OBLIGATORY,
p_fecha TYPE ESEUPDDAT OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fecha.
DATA lt_fechas TYPE STANDARD TABLE OF eseupddat.
DATA lt_fechas_ret TYPE STANDARD TABLE OF ddshretval.
DATA wa_fechas_ret TYPE ddshretval.
TYPE-POOLS: cih02.
DATA: wa_recn_waid TYPE cih02_recn_waid_wa_type,
lt_recn_waid TYPE cih02_recn_waid_tab_type.
CLEAR wa_recn_waid.
wa_recn_waid-waid = p_waid.
APPEND wa_recn_waid TO lt_recn_waid.
CALL FUNCTION 'CBIH_WA40_TRANS_WAIDS_TO_RECNS'
EXPORTING
i_valdat = sy-datum
TABLES
x_recn_waid_tab = lt_recn_waid.
READ TABLE lt_recn_waid INTO wa_recn_waid INDEX 1.
IF sy-subrc <> 0 OR
wa_recn_waid-recn IS INITIAL.
MESSAGE i208(00) WITH text-000.
ENDIF.
SELECT upddat
INTO TABLE lt_fechas
FROM cciht_erh
WHERE recntwah = wa_recn_waid-recn. "lv_wah_recn.
IF sy-subrc <> 0.
MESSAGE i208(00) WITH text-001.
ELSE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'ESEUPDDAT'
* PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_FECHA'
* STEPL = 0
window_title = text-003
* VALUE = ' '
value_org = 'S'
TABLES
value_tab = lt_fechas
* FIELD_TAB =
return_tab = lt_fechas_ret
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0 AND
lt_fechas_ret IS NOT INITIAL.
READ TABLE lt_fechas_ret INDEX 0 INTO wa_fechas_ret.
p_fecha = wa_fechas_ret-fieldval.
ELSE.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Thanks in advance.
Regards,
Jordi
Edited by: Rob Burbank on May 28, 2009 11:49 AM
‎2009 May 28 10:32 AM
Hi,
*Add the below code and check
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fecha.
DATA :it_dynpread TYPE TABLE OF dynpread,
wa_dynpread TYPE dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
request = 'A'
TABLES
dynpfields = it_dynpread.
READ TABLE it_dynpread INTO wa_dynpread WITH KEY fieldname = 'P_WAID'.
wa_recn_waid-waid = wa_dynpread-fieldvalue.
‎2009 May 28 11:35 AM
Hi Sai,
my problem is not to read the value from de selections screen. I want create a matchcode for a date field.
I use the F4IF_INT_TABLE_VALUE_REQUEST function module as I do on other fields of the selection screen, filling the values from an internal table, but I can't see why does not show the value even if the internal table has records.
Regards.
‎2009 May 28 1:08 PM
Hi ,
I hope this ill help you
*Fm to get the list of selected valuse in F4
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'OBJID' " ref Field name
value_org = 'S'
window_title = l_title
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = l_field
TABLES
value_tab = it_value_source
field_tab = it_field_tab
return_tab = it_return_values
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.
ELSE.
READ TABLE it_return_values INTO wa_return_values INDEX 1.
l_value = wa_return_values-fieldval.
ENDIF.
‎2009 May 28 1:27 PM
Hi,
Why are you using the fm 'F4IF_INT_TABLE_VALUE_REQUEST' in else of selecting data lt_fechas.But lt_fechas is passed as parameter.Check that part.
‎2009 May 28 4:34 PM
Hi all,
solved myself.
The problem is solved using the fieldtab parameter of fm F4IF_INT_TABLE_VALUE_REQUEST.
Thanks to all for your answers.
Regards,
Jordi