05-21-2009 2:04 PM
Hi all,
There is a FM to convert sao format date to oracle format date?
Like: 20090521
To: 21-MAY-2009
Or, help me to made this update works:
vl_date = sy-datum.
TRY.
EXEC SQL.
UPDATE SAP_MUDANCA_MARGEM@DBLINK_63
SET SM_FLAG_LEITURA =: vl_err
SM_DATA_SAP =: TO_DATE(vl_date, 'YYYYMMDD')
WHERE SM_ID_SM =: wl_trlogic-chave
ENDEXEC.
CATCH cx_sy_native_sql_error INTO vl_excref.
vl_error_text = vl_excref->get_text( ).
MESSAGE vl_error_text TYPE 'I'.
ENDTRY.
05-21-2009 2:06 PM
Hi,
Try this function module.
CONVERSION_EXIT_LDATE_OUTPUT
DATA:input TYPE sy-datum VALUE '20090521',
output TYPE string.
START-OF-SELECTION.
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
input = input
IMPORTING
output = output.
WRITE output.
05-21-2009 2:37 PM
Hi,
DATA:input TYPE sy-datum VALUE '20090521',
output TYPE string,
month_names TYPE t247.
START-OF-SELECTION.
SELECT SINGLE * FROM t247 INTO month_names WHERE spras = sy-langu
AND mnr = input+4(2).
IF sy-subrc EQ 0.
CONCATENATE input+6(2) '-' month_names-ltx '-' input+0(4) INTO output.
ENDIF.
WRITE output.
05-21-2009 2:16 PM
Try Moving it to character field variable by using offset for date month and year . then concatenate it using '-'
05-21-2009 2:41 PM
Hi,
Try the following code.
DATA: X_MONTH(12).
START-OF-SELECTION.
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
input = sy-datum
IMPORTING
output = x_month.
concatenate x_month(2) '-' x_month4(3) '-' x_month8(4) into x_month.
WRITE:/ x_month.
Thanks
Ramana
05-21-2009 6:24 PM