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

Error in modify statement

former_member199650
Participant
0 Likes
3,292

Hi,

When i am trying to update a z table by using modify statement, i am getting the following error:

Short text

SQL error in the database when accessing a table.

What happened?

When writing a data record to the database (i.e. when

updating the database), only part of the data field was

written (updated). The rest was truncated.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in

procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The problem has arisen because, within the database interface,

one of the data buffers made available for the INSERT (UPDATE)

is longer than the maximum defined in the database.

On the other hand, it may be that the length in the NAMETAB

does not match the maximum length defined in the database.

(In this case, the length in the NAMETAB is longer.)

Please guide me how this error can be resolved.

Thanks and Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,672

Hi,

Check the length of the fields that u r using in your table and also check whether the values which you are entering thru your program is not larger(in respect to length).

This will solve ur problem.

14 REPLIES 14
Read only

Former Member
0 Likes
2,671

HI,

Check this link

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm

if it doesn't solve your problem paste the code.

Regards and Best wishes.

Read only

0 Likes
2,671

Hi,

LOOP AT i_outputfile INTO wa_outputfile.

READ TABLE i_tab3 INTO wa_tab3 WITH KEY w_id =

wa_outputfile-ablbelnr.

IF sy-subrc = 0.

i_zdm_upload-mandt = sy-mandt.

i_zdm_upload-ablbelnr = wa_tab3-w_id.

i_zdm_upload-partner = wa_tab3-w_consumer.

i_zdm_upload-zwnummer = wa_tab3-w_reg.

i_zdm_upload-equnr = wa_tab3-w_device.

i_zdm_upload-v_zwstand = wa_tab3-w_reading.

i_zdm_upload-n_zwstand = wa_tab3-w_reading1.

i_zdm_upload-ablhinw = wa_tab3-w_remark.

i_zdm_upload-zmeter = wa_tab3-w_new_dev.

  • i_zdm_upload-adat = wa_tab3-w_rd_date.

concatenate wa_tab3-w_rd_date4(4) wa_tab3-w_rd_date2(2)

wa_tab3-w_rd_date+0(2) into i_zdm_upload-adat separated by '.'.

  • i_zdm_upload-adat = v_adat.

  • condense i_zdm_upload-adat.

i_zdm_upload-atim = wa_tab3-w_rd_time.

i_zdm_upload-portion = wa_tab3-w_portion.

i_zdm_upload-ernam = sy-uname.

i_zdm_upload-erdat = sy-datum.

i_zdm_upload-uzeit = sy-uzeit.

APPEND i_zdm_upload.

CLEAR: wa_tab3, i_zdm_upload.

ENDIF.

ENDLOOP.

CALL FUNCTION 'ENQUEUE_E_TABLEE'

EXPORTING

mode_rstable = 'E'

tabname = 'ZDM_UPLOAD'

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

MODIFY zdm_upload FROM TABLE i_zdm_upload.

Please guide.

Thanks and Regards

Read only

0 Likes
2,671
The problem has arisen because, within the database interface, 
one of the data buffers made available for the INSERT (UPDATE) 
is longer than the maximum defined in the database. 
On the other hand, it may be that the length in the NAMETAB 
does not match the maximum length defined in the database. 
(In this case, the length in the NAMETAB is longer

Check the data decleration part for length assigned. Its mismatching somewhere.

Read only

Former Member
0 Likes
2,671

Hi MP Vashishth

This problem might be the internal table or work area which you are using and the data base table(Z table ) structure is not matching,first check whether they are matching are not and if possible send snap shot of data declaration and modify statement block code.

regards,

ameen

Read only

Former Member
0 Likes
2,673

Hi,

Check the length of the fields that u r using in your table and also check whether the values which you are entering thru your program is not larger(in respect to length).

This will solve ur problem.

Read only

0 Likes
2,671

Hi,

Following is the data declaration:

TYPES : BEGIN OF t_tab3,

w_consumer(10) TYPE c,

w_reg TYPE eabl-zwnummer,

w_device TYPE eabl-gernr,

w_reading(17) TYPE c,

w_reading1(14) TYPE c,

w_remark TYPE eabl-ablhinw,

w_new_dev TYPE eabl-gernr,

w_rd_date TYPE zdm_upload-adat,

w_rd_time TYPE eabl-atim,

w_id TYPE eabl-ablbelnr,

w_portion(4) TYPE c,

END OF t_tab3.

DATA : BEGIN OF i_zdm_upload OCCURS 0,

mandt LIKE zdm_upload-mandt,

ablbelnr LIKE zdm_upload-ablbelnr,

partner LIKE zdm_upload-partner,

zwnummer LIKE zdm_upload-zwnummer,

equnr LIKE zdm_upload-equnr,

v_zwstand LIKE zdm_upload-v_zwstand,

n_zwstand LIKE zdm_upload-n_zwstand,

ablhinw LIKE zdm_upload-ablhinw,

zmeter LIKE zdm_upload-zmeter,

adat LIKE zdm_upload-adat,

atim LIKE zdm_upload-atim,

portion LIKE zdm_upload-portion,

ernam LIKE zdm_upload-ernam,

erdat LIKE zdm_upload-erdat,

uzeit LIKE zdm_upload-uzeit,

END OF i_zdm_upload.

Please guide me. Thanks.

Edited by: MP Vashishth on May 1, 2010 10:53 AM

Read only

0 Likes
2,671

Instead of creating internal table like that why dont u declare your internal table like this

data: i_zdm_upload type table of zdm_upload with header line.

this will solve u r problem

Read only

0 Likes
2,671

Hi,

I tried that way, but still the error is coming.

Please guide.

Thanks and Regards

Edited by: MP Vashishth on May 1, 2010 11:20 AM

Read only

0 Likes
2,671

If you tried that way (data: i_zdm_upload type table of zdm_upload with header line.)

what is the error it is giving the same dump? or some other error?

Read only

0 Likes
2,671

Hi,

I am still getting the same error.

Please guide.

Thanks and Regards

Read only

0 Likes
2,671

send u r screen shot of the Z table to ameenshaik at gmail dot com

Read only

0 Likes
2,671

Hi,

The error message is as follows:

Short text

SQL error in the database when accessing a table.

What happened?

When writing a data record to the database (i.e. when

updating the database), only part of the data field was

written (updated). The rest was truncated.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in

procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The problem has arisen because, within the database interface,

one of the data buffers made available for the INSERT (UPDATE)

is longer than the maximum defined in the database.

On the other hand, it may be that the length in the NAMETAB

does not match the maximum length defined in the database.

(In this case, the length in the NAMETAB is longer.)

Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of dump

Edited by: Rob Burbank on May 1, 2010 5:59 PM

Read only

0 Likes
2,671

See SAP Say to Do any Data Base Operations there are some pre requesties:

<< Cut and paste without attribution from http://www.thaiabap.com/index.php?option=com_content&view=article&id=2890 removed >>

Edited by: Rob Burbank on May 1, 2010 6:07 PM

Read only

former_member199650
Participant
0 Likes
2,671

Error has been resolved.

Thanks everyone. It was a great help from all of you. Thank you so much for all your kind help.

Thanks and Regards

MP Vashishth