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

Former Member
0 Likes
775

Fellows, i got the following problem.

I've been developing a model pool, wich have a transparent table called 'x'. i've declared in the data area the 'x' table as :

<b>TYPES : BEGIN OF TY_U.

INCLUDE STRUCTURE 'x'

TYPES : END OF TY_U.

DATA: TI_U TYPE STANDARD TABLE OF TY_U WITH HEADER LINE.

DATA : WA_U LIKE LINE OF TI_U.</b>

Then i have a runtime that fills the work area correctly, but when the program stops at :

<b>CLEAR wa_u.

LOOP AT ti_u INTO wa_u.

UPDATE 'x' FROM wa_u.

ENDLOOP.</b>

<b>returns '4', it didn't make the commit</b>. i've declared all the fields of table 'x' as a key fields, as a reference for the lifeguards of this problem. Could anybody help me please. let me say that i've already try to unmark the fields as a key fields, it returns the same error : Nothing, allways '4'.

Message was edited by: Steve Cook

Message was edited by: Steve Cook

6 REPLIES 6
Read only

Former Member
0 Likes
740

Hi,

Instead of declaring a type and creating a table..use the transparent table directly..

1)

Example.

DATA: TI_U TYPE STANDARD TABLE OF X WITH HEADER LINE.

DATA: WA_U TYPE X.

2)

Check if there is data in the table for key..

3)

Instead of updating each row..Do it one statement..

UPDATE X FROM TABLE TI_U.

Thanks,

Naren

Read only

0 Likes
740

Fellow, it returns the same, i've declared the table in many different ways, and it returns the same. 4 didn't save anything. I don't understand. i'm gonna show you the structure.

MANDT X X MANDT CLNT 3

RSNUM X X RSNUM NUMC 10

KOSTL X X KOSTL CHAR 10

ZGLIB X X WEMPF CHAR 12

ZLIB1 X X ZLIB CHAR 1

ZLIB2 X X ZLIB CHAR 1

ZLIB3 X X ZLIB CHAR 1

ZSTAT X X ZSTA CHAR 1

ZLIDT X X BLDAT DATS 8

ZLIUD X X PSODT DATS 8

The table it's type 'A' and allows modifications and inserts.

I really appreciate your help.

Regards.

Read only

Former Member
0 Likes
740

Hi,

Did you check if there is any data in the table with the key combination..

Thanks,

Naren

Message was edited by: Narendran Muthukumaran

Read only

Former Member
0 Likes
740

Hi,

Did you check if there is any data in the table with the key combination..

Thanks,

Naren

Read only

0 Likes
740

When i ran it the firs time, the fields lib2 and lib3 were empty. but then i fill them just for see the behavior and returns the same. I've unmarked those fields lib1 lib2 and lib3 as a key fields too, but i got the same answer. Tnks for your assistance.

Read only

former_member186741
Active Contributor
0 Likes
740

THE ONLY THING THAT i CAN THINK OF IS THAT MAYBE THE RECORD YOU'RE TRYING TO 'UPDATE' DOES NOT YET EXUST.

If that is the case use the MODIFY statement insted. That will insert or update as appropriate.