Skip to Content

How to insert a record to the z-table.

Hi Experts,

I have created one z-tabe with fields

refnum, and

status.

if the refnum is >200 ; Status field should get the value as "TRUE" else "FALSE".

could any one help me on this.

regards,

Sunil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Dec 05, 2007 at 12:12 PM

    hi,

    DO like this

    data : wa type ztable

    if return > 200

    wa-return = 'TRUE'.

    else

    wa-return = 'FALSE'.

    endif.

    update ztable from wa.

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:15 PM

    go se16, enter the table name & press F5

    enter new records & save

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:15 PM

    check the condition when u insert data.

    eg.

    if refnum > 200.

    zemp-refnum = refnum.

    zemp-status = 'true'.

    else.

    zemp-refnum = refnum.

    zemp-status = 'false'.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:18 PM

    hi,

    do it this way:

    data : wa type ztable.

    if refnum > 200.

    wa-refnum = refnum.

    wa-status = 'true'.

    else.

    wa-refnum = refnum.

    wa-status = 'false'.

    endif.

    insert into ztable values wa.

    regards,

    sohi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:25 PM

    firstly tell me how you are going to insert records in table?

    through zprogram or directly or have you created any maintenance view for the same?

    if yes you can change code in maintenance view's code and put this particular condition there.

    hope it helps you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:31 PM

    hi,

    try this.

    data : itab type standard table of (name of ur ztable) with header line.

    select * from (ztable) into table itab.

    loop at itab.

    if itab-refnum > 200.

    itab-status = 'true'.

    else.

    itab-status = 'false'.

    endif.

    modify table itab[] from itab index sy-tabix.

    endloop.

    update (ztable) from table itab.

    hope this gives some idea.

    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.