Skip to Content
author's profile photo Former Member
Former Member

inserting into a database table using field symbols?

Hi.

If I have a database table that I do not know the name at design-time, how do i insert records into that database table at run-time?

****************************************************************************************

Do i use field-symbols, as follow:

FIELD-SYMBOLS <TABLE_NAME> TYPE TABLE.

INSERT <TABLE_NAME> FROM ITAB.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 19, 2007 at 10:45 AM

    I dont think this will work.

    You have to put the DB table's name into the fieldsymbol. Maybe you have to try the next code.

    data: l_dbname(30) type c value 'VBAK'.

    field-symbols: <fs>.

    assign (l_dbname) to <fs>.

    check sy-subrc eq 0.

    insert <fs> from itab.

    regards,

    hans

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2007 at 10:56 AM

    .

    Message was edited by:

    Kian Keong

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2007 at 11:09 AM

    while declaring field symbol try :

    FIELD-SYMBOLS <TABLE_NAME> TYPE ANY.

    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.