Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

update table failed

Former Member
0 Likes
920

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

1 ACCEPTED SOLUTION
Read only

madan_ullasa
Contributor
0 Likes
762

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..

4 REPLIES 4
Read only

madan_ullasa
Contributor
0 Likes
763

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..

Read only

0 Likes
762

this is customize

Read only

0 Likes
762

Hi,

Pls check with the customized FM source code again.

Regards,

Naveen M.

Read only

Former Member
0 Likes
762

Hi Fidah,

As this FM 'Y_I_UPDATE_YISO' is customised one need to check wht is in tht FM.

regards,

Suneel G