09-22-2015 7:28 AM
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
09-22-2015 7: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>.
09-22-2015 12:02 PM
Hi,
My GT_FINAL table is type any table and hence it is giving below error.
-Amit
09-22-2015 12:49 PM
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
09-22-2015 12:34 PM
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.
09-23-2015 1:40 PM
Hi Guys,
Problem solved.
Just I wanted to mark question answered but unfortunately I am not able to see answered question...
-Amit
09-23-2015 1:52 PM