2007 Apr 21 12:25 PM
I have successfully submit and return table from a program to another program. Ex : just as the below two program. It is working fine.
But i am getting problem for submitting from BADI in the same way. it is displaying error for the following line :
EXPORT itab1 TO MEMORY id '001'.
syntax error : this statement does not supported by oops. And they are suggesting something like :
EXPORT param p1 from var v1 ...... param p2 from var v2... TO MEMORY . Something like this. now i am not able to understand this.....
can anyone give me some light??????
REPORT Z_82235_TEST1 .
types: begin of tab1,
a(1),
b(1),
end of tab1.
types: begin of tab2,
c(1),
d(1),
end of tab2.
data: itab1 type table of tab1,
wa1 like line of itab1,
itab2 type table of tab2,
wa2 like line of itab2.
wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.
wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.
EXPORT itab1 TO MEMORY id '001'.
EXPORT itab2 TO MEMORY id '002'.
SUBMIT Z_82235_TEST2 and return EXPORTING list TO MEMORY .
loop at itab2 into wa2.
write : wa2-c.
endloop.
*********************************************************************************************
REPORT Z_82235_TEST2 .
types: begin of tab1,
a(1),
b(1),
end of tab1.
types: begin of tab2,
c(1),
d(1),
end of tab2.
data: itab1 type table of tab1,
wa1 like line of itab1,
itab2 type table of tab2,
wa2 like line of itab2.
IMPORT itab1 FROM MEMORY id '001'.
IMPORT itab2 FROM MEMORY id '001'.
itab1[] = itab2[].
I have successfully submit and return table from a program to another program. Ex : just as the below two program. It is working fine.
But i am getting problem for submitting from BADI in the same way. it is displaying error for the following line :
EXPORT itab1 TO MEMORY id '001'.
syntax error : this statement does not supported by oops. And they are suggesting something like :
EXPORT param p1 from var v1 ...... param p2 from var v2... TO MEMORY . Something like this. now i am not able to understand this.....
can anyone give me some light??????
REPORT Z_82235_TEST1 .
types: begin of tab1,
a(1),
b(1),
end of tab1.
types: begin of tab2,
c(1),
d(1),
end of tab2.
data: itab1 type table of tab1,
wa1 like line of itab1,
itab2 type table of tab2,
wa2 like line of itab2.
wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.
wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.
EXPORT itab1 TO MEMORY id '001'.
EXPORT itab2 TO MEMORY id '002'.
SUBMIT Z_82235_TEST2 and return EXPORTING list TO MEMORY .
loop at itab2 into wa2.
write : wa2-c.
endloop.
*********************************************************************************************
REPORT Z_82235_TEST2 .
types: begin of tab1,
a(1),
b(1),
end of tab1.
types: begin of tab2,
c(1),
d(1),
end of tab2.
data: itab1 type table of tab1,
wa1 like line of itab1,
itab2 type table of tab2,
wa2 like line of itab2.
IMPORT itab1 FROM MEMORY id '001'.
IMPORT itab2 FROM MEMORY id '001'.
itab1[] = itab2[].
2007 Apr 21 12:44 PM
Hi Abhishek,
Export doesnt work in object oriented context, and BADI are by origin object oriented base.
Otherway round i believe , data can be inserted in Ztable and from then it can be retrieved via receiver program ( where import is written )..
Hope that helps.
Regards
Mr Kapadia
***Assigning points is the way to say thanks in SDN.***
2007 Apr 22 9:17 AM
Mr Kapadia,
<b> I want to know how and by which command i can submit internal tables to a custom report from a badi.
</b>
My doubt is not solved........
2007 Apr 24 5:59 AM
Hi Abhishek,
Create 2 Z table ztab1 , ztab2. Original code is commented and new code is written below the line which will achieve exactly same functionality.
*EXPORT itab1 TO MEMORY id '001'.
delete from ZTAB1.
Modify ztab1 from table itab1.
*EXPORT itab2 TO MEMORY id '002'.
delete from ZTAB2.
Modify ztab2 from table itab2.
*********************************************************************************************
REPORT Z_82235_TEST2 .
*IMPORT itab1 FROM MEMORY id '001'.
select * from ztab1 into corresponding fields of itab1.
*IMPORT itab2 FROM MEMORY id '001'.
select * from ztab2 into corresponding fields of itab2.
itab1[] = itab2[].
Hope that helps.
Regards
Mr Kapadia
***Assigning points is the way to say thanks in SDN.***
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |