Skip to Content
0
Former Member
Mar 08, 2008 at 01:28 AM

Problem with Update Statement

56 Views

Hi Experts,

I am updating a custome table by using following statement.

*----


Update Ztable

gt_trgt-werks = it_werks-werks.

gt_trgt-mmyy = sy-datum(6).

gt_trgt-trgt = target.

PERFORM check_exits1 USING s_flag .

IF s_flag EQ 'X'.

UPDATE zpv_target FROM gt_trgt.

ELSE.

INSERT zpv_target FROM gt_trgt.

ENDIF.

ENDIF.

*--End of UPDATE ZTABLE

Here PERFORM check_exists check values exist or not. I am facing a problem in Update statement as it is not updating the custome table. While debugging in foun that i have new values in gt_targt but zpv_target is having the same values as it was. Means values are not updated in custome table.

It seems to me tht the problem is with custome table, as it is inserting values properly but not updating it.

Settings for the table is as follows:

-Fields

FIELD DATAELEMENT

Aufnr Aufnr

Cut char1

Probl char40

-Data Class APPL1

-size 5

-Delievery Class C

-Display/Maintainance Allowed.

-Buffering not allowed

-Log data changes.

-Maintainance generator is also created with authorization to all.

& one screen.

Please tell me Do i need to change anything in table or there in the Update statement?

Regards,

Nik