2012 Dec 22 6:30 PM
Dear Friends,
I have a small question. Please consider the following two piece of code from an actual ABAP program in R/3: 'rqdses20':
****
IMPORT prlst_tmp
qmhutab TO g_qmhutab
i_qals TO qals
i_first_print TO g_first_print
i_print_message TO g_print_message FROM MEMORY ID 'QM_PRT01'.
PERFORM badi_set_qals USING qals.
****
'qals' is a Transparent global table.
My questions are:
1. When the data / information is IMPORTED from the Memory ID as mentioned above, is it being read into the actual database qals table. Does this update the actual database ?
2. The perform statement passes the table qals to the function module badi_set_qals. Is the entire table getting passed to the FM ?
When the table is already a global transparent entity, why does the PERFORM statement need to pass it ?
I am quite new to ABAP and therefore request you assistance to understand some basics of such code.
Please accept my heartist greetings for the Festive Season. Merry Christmas and Happy New Year to all
Kind Regards
SG
2012 Dec 24 7:34 AM
Hi,
The Import or Export statements didn't access the data base tables, instead they access the memory area called as 'ABAP Memory' where the internal sessions of a program can communicate with each other. For Memory structure of ABAP Memory see the following link..
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm
You are passing data to abap memory so that in future you can access to that memory area and use it in anoter inernal session.
For example say you are having two programs p1 and p2 with T1 and T2 as transaction code assigned to it.
In P1 i'm Exporting a internal table ITAB1 to ABAP Memory area. Inside the Program P1 I'll call the transaction T2, In turn it'll executes program P2. In-fact I'll import the ITAB1 from ABAP Memory for some calculations. After the execution of the Tcode T2, the control will come back to the execution of Program P1 to execute the remaining code of P1.
The sample code looks like
REport P1.
Data: Itab1 <some internal table>.
Export itab to MEMORY ID <some memory id>.
call transaction T2.
Remaing code...
2012 Dec 24 6:35 AM
Hi,
Use the f1 key when you need it...
1. When the data / information is IMPORTED from the Memory ID as mentioned above, is it being read into the actual database qals table. Does this update the actual database ?
Import is importing to internal memory.
Note the use of TABLES: at RQDSES20 .
2. The perform statement passes the table qals to the function module badi_set_qals. Is the entire table getting passed to the FM ?
When the table is already a global transparent entity, why does the PERFORM statement need to pass it ?
It seems as design consideration since this form is used in many programs (click on the form name) so the developer choose to use parameter even though QALS is global (I personally dislike global variables. see http://en.wikipedia.org/wiki/Global_variable)
2012 Dec 24 6:54 AM
Hi ,
1) For he First ques , data may or may not be read from the DB, Depends upon from where its being exported.And NO UPDATE of DB table QALS is happening in this.
2) badi_set_qals is passing only the structure of the table QALS is being passed.
Hope this will help.
Regards,
Amit
2012 Dec 24 7:34 AM
Hi,
The Import or Export statements didn't access the data base tables, instead they access the memory area called as 'ABAP Memory' where the internal sessions of a program can communicate with each other. For Memory structure of ABAP Memory see the following link..
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm
You are passing data to abap memory so that in future you can access to that memory area and use it in anoter inernal session.
For example say you are having two programs p1 and p2 with T1 and T2 as transaction code assigned to it.
In P1 i'm Exporting a internal table ITAB1 to ABAP Memory area. Inside the Program P1 I'll call the transaction T2, In turn it'll executes program P2. In-fact I'll import the ITAB1 from ABAP Memory for some calculations. After the execution of the Tcode T2, the control will come back to the execution of Program P1 to execute the remaining code of P1.
The sample code looks like
REport P1.
Data: Itab1 <some internal table>.
Export itab to MEMORY ID <some memory id>.
call transaction T2.
Remaing code...