‎2009 May 11 4:51 AM
Hi expertz..
can anyone give me any idea or any reason why i want to print the error message appear " Update YISO failed"
the program like this
SELECT SINGLE * FROM yiso
WHERE gsber = caufvd-gsber
AND aufnr = caufvd-aufnr.
IF sy-subrc = 0.
PERFORM call_update_yiso.
ELSE.
PERFORM call_insert_yiso.
ENDIF.
so the YISO exist then go to function call_update_yiso
_____________________________________________________________
FORM call_update_yiso.
DATA: ta_yiso LIKE yiso OCCURS 1 WITH HEADER LINE.
CONSTANTS: cn_fail(11) TYPE c VALUE 'YISO failed'.
CLEAR: ta_yiso.
REFRESH ta_yiso.
ta_yiso-mandt = sy-mandt. " client no
ta_yiso-gsber = caufvd-gsber.
ta_yiso-aufnr = yiso-aufnr. " IN A TABLE
ta_yiso-dtcrea = caufvd-erdat. " create on
ta_yiso-control = yiso-control.
"tp_control_no. " KEEP NEW CONTROL NO
ta_yiso-icappv = yiso-icappv.
ta_yiso-dtappv = yiso-dtappv.
ta_yiso-vsttxt = yiso-vsttxt.
ta_yiso-ernam = yiso-ernam.
ta_yiso-txappv = yiso-txappv.
APPEND ta_yiso.
CLEAR yiso.
SELECT SINGLE * FROM yiso
WHERE aufnr = caufvd-aufnr
AND gsber = caufvd-gsber.
IF sy-subrc = 0. i debug got sy-subrc = 0
CALL FUNCTION 'Y_I_UPDATE_YISO'
TABLES
t_yiso = ta_yiso
EXCEPTIONS
update_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE e709 WITH cn_fail.
ENDIF.
ENDIF.
ENDFORM.
________________________________________________
then its go to functin CALL FUNCTION 'Y_I_UPDATE_YISO'
FUNCTION y_i_update_yiso.
UPDATE yiso FROM TABLE t_yiso.
IF sy-subrc NE 0. - its return 4 but t_
MESSAGE a900(yi) WITH 'YISO' 'with service order'
t_yiso-aufnr RAISING update_failed.
ENDIF.
ENDFUNCTION.
__________________________________________
please anyone....
dunno why ...
its exist but when to update got error
‎2009 May 11 4:54 AM
hi,
use 'modify'.
it will create a new row if no similar key fields or it will update the row if the there is a row with the same key fields.
regds,
Madan..
‎2009 May 11 4:54 AM
hi,
use 'modify'.
it will create a new row if no similar key fields or it will update the row if the there is a row with the same key fields.
regds,
Madan..
‎2009 May 11 5:06 AM
‎2009 May 11 5:15 AM
Hi,
Pls check with the customized FM source code again.
Regards,
Naveen M.
‎2009 May 11 5:02 AM
Hi Fidah,
As this FM 'Y_I_UPDATE_YISO' is customised one need to check wht is in tht FM.
regards,
Suneel G