Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Submitting table to a custom program from a BADI

Former Member
0 Kudos

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[].

3 REPLIES 3

Former Member
0 Kudos

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.***

0 Kudos

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........

0 Kudos

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.***