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

Global method for table update.

Hi Folks,

I have scenario like to update bunch of ztables.

Thus i decided to build a class globally to minimize the efforts of developers.

I have created importing parameter(ZTB_PR_001) type any for which table to be updated another importing table parameter (type any table GT_FINAL) to import matrix data to be inserted in ztable.

WHILE NOT GT_FINAL IS INITIAL.

APPEND LINES OF GT_FINAL FROM 1 TO 100000 TO LT_FINAL_TMP. <---- I can not able to define temporary table here due to type any table
DELETE GT_FINAL FROM 1 TO 100000.

"modify data in clusters
MODIFY ZTB_PR_001 FROM TABLE LT_FINAL_TMP.


ENDWHILE.

Can I know alternate solution.

-Amit

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 22, 2015 at 06:42 AM

    DATA data TYPE REF TO data.

    CREATE DATA data LIKE GT_FINAL.

    FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

    ASSIGN data->* TO <table>.

    APPEND LINES OF GT_FINAL FROM 1 TO 10 TO <TABLE>.

    Add a comment
    10|10000 characters needed characters exceeded

    • Dear Amit,

      Intead of defining your Table into any.

      Define below way,

      field-symbol <gt_final> type standard table .

      then all the modify and append statement will work for you.

      Because if you can define the <gt_final> any , at runtime it could be of any type. That why compiler doesn't allow you to perform operation.

      Thanks and Regards,

      Nishant

  • Posted on Sep 22, 2015 at 11:34 AM

    Main problem in ANY TABLE: you cant use index access on it.

    There some ways to fix it:

    1) change type from ANY TABLE to STANDARD TABLE ( no problem if you don't use sorted/hashed tables)

    2) use LOOP with counter to copy N records.

    3) use field symbol with type STANDARD TABLE. But it also can cause problems if you use sorted/hashed tables.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2015 at 12:40 PM

    Hi Guys,

    Problem solved.

    Just I wanted to mark question answered but unfortunately I am not able to see answered question...

    -Amit


    Capture.JPG (29.6 kB)
    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.