Skip to Content
-1

Work Area 'ITAB' is not long enough ?

Hello Gurus,

i have an internal table ITAB, which has all the fields of DB table ZDESC which has all total 6 fields ( 3-key fields).

I am fetching 4 fields from scrren to ITAB including the key fields.

and then saving these data into ZDESC table .

But here the error is - work area 'ITAb' is not long enough.

whats the reason and how to solve this ?

here is my code , its so simple

.

PAI include.

-


case ok_code.

when 'enter'

  IT_HEAD-CCODE = S_CCODE .                                   * s_code = screen field.
  IT_HEAD-PCODE = S_PCODE .                                    *  first three field are key fields except c_name
   IT_HEAD-BCODE = S_BCODE .
  IT_HEAD-CNAME = S_CNAME .  

when 'save'.

modify zdesc from table it_head.

endcase.

dats it.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2009 at 10:22 AM

    Do check if your table is deinfed as:

    you are confusing between table and work area.

    1. Have clear distiction between table and work area.

    DATA: it_head type table of ZDESC.

    DATA: wa_head type ZDEC.

    MODIFICATION TO DB TABLE:

    From Table:

    MODIFY ZDESC FROM TABLE IT_HEAD

    From Workarea:

    MODIFY ZDESC FROM WA_HEAD.

    Moreover your work area seems to be not of same type as your table.

    In that case you have to use UPDATE ,

    CHEERS !

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 10, 2009 at 01:40 PM

    does it also have the mandt field?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 10, 2009 at 01:43 PM

    The internal table record must be at least as long as the database structure, look at online help with F1. (or [Work Areas in Open SQL Statements |http://help.sap.com/abapdocu/en/ABENOPEN_SQL_WA.htm]) (except: client/mandt)

    If you don't have the whole data to update you MUST either

    - read the actual database, update an internal table of same length/field order and then update database

    - use syntax like [UPDATE dbtab SET expr1 WHERE expr2|http://help.sap.com/abapdocu/en/ABAPUPDATE_SOURCE.htm#!ABAP_ALTERNATIVE_1@1@]

    NB 1: you must not only have every field of the database table, but they must be in the same sequence and have the same definition, so the same internal length (so you must have field MANDT, even if you left the field initial)

    NB 2 : i hope some lines are not copied here from your program. Else whet if user press SAVE and not ENTER first time, where is the APPEND, is IT_HEAD actually an internal table ?

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2009 at 05:34 AM

    thnks for all ur knoweledge

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Diwakar Gandhi

      You can start with BC courses if you are new to ABAP, for example BC400 or BC430 ABAP Dictionary.

      as for your question it depends where you want to add MANDT field, in ABAP Dictionary or in a Defined type via TYPES in your program.

      If you want to add new field in ABAP dictionary use Se11 if in your program use SE38, there type TYPES: put your cursor on it and press F1 and read the docu.

  • Posted on Mar 26, 2013 at 02:40 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2016 at 12:28 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.