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

Program performance.

Hi all,

I want to change the following code which is using MOVE command into INSERT command.it_datatab is an internal table contains 3 fields col1,col2,col3 and it_writetab is same structure as it_datatab.

MOVE: it_datatab-col1 TO it_writetab-col1,

it_datatab-col2 TO it_writetab-col2,

'X' TO it_writetab-create.

APPEND it_writetab.

How I can convert this MOVE statement to INSERT statement.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 02:17 PM

    IF YOU WANT TO INSERT THE DATA INTO THE DATABASE TABLE THEN USE

    <b>MODIFY DATABASETABLE WITH INTERNAL TABLE</b>

    USE THIS STAMENT

    modifying datbase table useing internal table

    advises before updating this datbase table plz lock that table to avoid incosistency

    write the logic for modifying

    • Modify the database table as per new dunning procedure

    MODIFY fkkvkp FROM TABLE lt_fkkvkp .

    and finally unlock the table

    example

    *To lock table for further operations

    constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP

    CALL FUNCTION 'ENQUEUE_E_TABLE'

    EXPORTING

    tabname = lc_tabname

    EXCEPTIONS

    foreign_lock = 1

    system_failure = 2

    OTHERS = 3.

    IF sy-subrc EQ 0.

    • To fetch all the contract accounts for customers of the segment

    • Households/SME.

    PERFORM fetch_contract_accounts using lc_tabname .

    ENDIF. " IF sy-subrc EQ 0.

    *wrote the logic

    • Modify the database table as per new dunning procedure from internal table

    MODIFY fkkvkp FROM TABLE lt_fkkvkp .

    *unlock the tbale

    CALL FUNCTION 'DEQUEUE_E_TABLE'

    EXPORTING

    TABNAME = uc_tabname .

    Reward if usefull

    Add a comment
    10|10000 characters needed characters exceeded

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

    hi

    good

    go through this link ,hope this would help you to solve yo ur problem

    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/insert_d.htm

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 02:20 PM

    Create a temp workarea (wa_itab) of structure it_writetab.

    First move all the values from it_datatab to wa_itab.

    Then use the statement

    INSERT wa_itab INTO it_writetab INDEX index.

    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.