2006 Dec 20 5:18 AM
Hi on the requirement of my report i have developed more internal tables so i want to reduce the usage of number of internal tables so can any one suggest any suggestion for reducing internal tables. Is there any loss by using this many internal tables in a program if yes can any one suggest me how to solve this problem
2006 Dec 20 5:22 AM
Hi,
Try to deifne an internal table where you can accomodiate max of your fields , but this may not be the best solution because this may result in comlex seelct statements and other processing.
So better continue with the program the way are currently doing.
Regards
Arun
Hi on the requirement of my report i have developed more internal tables so i want to reduce the usage of number of internal tables so can any one suggest any suggestion for reducing internal tables. Is there any loss by using this many internal tables in a program if yes can any one suggest me how to solve this problem
2006 Dec 20 5:22 AM
Hi Pavan,
There is no loss in Using IT when you require them.But if two internal tables have same data and to be taken from different DBtables then you can use appending the same internal table with the values needed.
-Priyanka.
2006 Dec 20 5:36 AM
already i had defined 5 r 6 internal tables in a program but i think it will increase the complexity of the program so can u say how to define an internal table in another internal table the problem here is i had defined an internal table for alv grid format and after that i had declared so many internal tables but now i have to transfer one of the internal tables into alv grid internal table but it was showing an error in that conversation i had tried like this
MOVE-CORRESPONDING IZNEW1 TO RTAB_ALV.
in which RTAB_ALV is internal table for alv grid and IZNEW1 is another internal table in which i had transfered ZNEW1 values to the internal table IZNEW1 and ZNEW1 is a database view i had created by comparing two tables EKKO,EKPO
2006 Dec 20 5:22 AM
Hi,
Try to deifne an internal table where you can accomodiate max of your fields , but this may not be the best solution because this may result in comlex seelct statements and other processing.
So better continue with the program the way are currently doing.
Regards
Arun
2006 Dec 20 5:35 AM
already i had defined 5 r 6 internal tables in a program but i think it will increase the complexity of the program so can u say how to define an internal table in another internal table the problem here is i had defined an internal table for alv grid format and after that i had declared so many internal tables but now i have to transfer one of the internal tables into alv grid internal table but it was showing an error in that conversation i had tried like this
MOVE-CORRESPONDING IZNEW1 TO RTAB_ALV.
in which RTAB_ALV is internal table for alv grid and IZNEW1 is another internal table in which i had transfered ZNEW1 values to the internal table IZNEW1 and ZNEW1 is a database view i had created by comparing two tables EKKO,EKPO
2006 Dec 20 5:41 AM
Hi ,
Please rember that move-corrsponding does not work on tables it just works on structure.
So you will have to loop on table , then move corresponding and then anppend..
E.G.
Loop at IZNEW1 into wa1.
MOVE-CORRESPONDING wa1 TO wa2.
append wa2 to RTAB_ALV.
clear wa2.
endloop.Regards
Arun
2006 Dec 20 6:07 AM
HERE ONE ERROR IS COMING LIKE BELOW WHILE TRANSFERING DATA FROM ONME INTERNAL TABLE TO ANOTHER INTERNAL TABLE
KTAB AND RTAB ARE NOT MUTUALLY NOT CONVERTIBLE IN A UNICODE PROGRAME.
ACTUALLY WE R HAVING ONE DATABASE VIEW FROM VIEW WE R TAKNIG DATA AND WE WANT TO TRANSFER THAT DATA INTO INTERNAL TABLE
AND IN THIS REPORT WE R ALSO DOING SOME CALCULATION THAT CALCULATION ALSO NEED IN INTERNAL TABLE ALONG WITH VIEW DATA I
MEAN DATA BASE VIEW DATA AND CALCULATION DATA ALSO COMBINE IN ONE INTERNAL TABLE HOW CAN I DO IT.
SO PLEASE HELP ME.
THANKS IN ADVANCED.
2006 Dec 20 6:26 AM
2006 Dec 20 5:27 AM
hi,
instead of reducing no of internal table try releasing memory space occupied by internal table once u finished using it.
for freeing memory use
<b>FREE itab.</b>
statement.
i hope this will help u
2006 Dec 20 5:36 AM
already i had defined 5 r 6 internal tables in a program but i think it will increase the complexity of the program so can u say how to define an internal table in another internal table the problem here is i had defined an internal table for alv grid format and after that i had declared so many internal tables but now i have to transfer one of the internal tables into alv grid internal table but it was showing an error in that conversation i had tried like this
MOVE-CORRESPONDING IZNEW1 TO RTAB_ALV.
in which RTAB_ALV is internal table for alv grid and IZNEW1 is another internal table in which i had transfered ZNEW1 values to the internal table IZNEW1 and ZNEW1 is a database view i had created by comparing two tables EKKO,EKPO
2006 Dec 20 5:39 AM
same structure...
itab1[] = itab2[].
Different structures....
data: v_tabix like sy-tabix.
sort itab1 by key fields.
sort itab2 by key fields.
loop at itab1.
v_tabix = sy-tabix.
read table itab2 with key <keys>
if sy-subrc = 0.
itab1-field = itab2-field.
modify itab1 index v_tabix.
endif.
clear: itab1, itab2.
endloop.
2006 Dec 20 6:33 AM
2006 Dec 20 7:08 AM
Hi Mr. Vickram keeping aside this internal tables for some time i have a doubt in internal tables
Actually i have created a interanl table for the output in the format of rtab_alv and after that i had created another internal table as iznew1 in which i had transfered all the values of a database view into that internal table iznew1 after that while i was trying to move the values of iznew1 to rtab_alv its not accepting it was showing an error as
rtab_alv and iznew1 are not mutually convertible in a unicode program so can u explain me what is the possible error in this and how to resolve it
2006 Dec 20 9:44 AM
2006 Dec 20 10:27 AM
Please check the definition of both the internal table rtab_alv and iznew1..Or can you please paste the structure of both.
Regards
Anurag
2006 Dec 20 10:34 AM
This is for iznew1
DATA: IZNEW1 TYPE VECTOR,
RTAB_ALV LIKE IZNEW1 WITH HEADER LINE,
ED1 LIKE IZNEW1,
JTAB LIKE IZNEW1 WITH HEADER LINE.
and this is for rtab_alv
DATA:BEGIN OF RTAB_ALV OCCURS 30,
LIFNR LIKE EKKO-LIFNR,
EBELN LIKE EKKO-EBELN,
VGABE LIKE EKBE-VGABE,
EBELP LIKE EKBE-EBELP,
BELNR LIKE EKBE-BELNR,
MATNR LIKE EKPO-MATNR,
TXZ01 LIKE EKPO-TXZ01,
PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
KOSTL LIKE EKKN-KOSTL,
NAME1 LIKE LFA1-NAME1,
NAME2 LIKE LFA1-NAME2,
WERKS LIKE EKPO-WERKS,
NETWR LIKE EKPO-NETWR,
KNUMV LIKE EKKO-KNUMV,
GJAHR LIKE EKBE-GJAHR,
ED1(10) TYPE N,
END OF RTAB_ALV.
2006 Dec 20 11:19 AM
Define your JTAB similar to RTAB_ALV, thereby you would be able to move data between them.
Regards
Anurag
2006 Dec 20 11:27 AM
BUT HERE JTAB IS HAVING VALUES OF IZNEW1 SO I HAVE DECLARED JTAB IN IZNEW1 IT SELF
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |