Skip to Content

Internal table

My internal table has 5 fields. I would like to hardcode the value for one field in internal table how would i do that.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 01:40 PM

    hi Karthik,

    lets say your internal table is ITAB with fields F1, F2, F3, F4 and F5.

    and W_TAB is the work area defined for ITAB having the same structure.

    Let me assume that F2 is to be hard-coded with a value 2000 .

    1) if you would like all records to have the same value for F2,

    loop at itab into w_tab.

    w_tab-f2 = 2000.

    modify itab from w_tab transporting f2.

    endloop.

    2) if you want a particular record to have the hardcoded value 2000. fetch that record by say condition c2(this condition is based on your selection).

    read table itab into w_tab where <c2>.

    w_tab-f2 = 2000.

    modify itab from w_tab transporting fw where <c2>.

    <b>Reward points for helpful answers.</b>

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 01:45 PM
    loop at itab.
     itab-field1 = 'VALUE'.
     append itab.
    endloop.
    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.