Application Development and Automation 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: 
Read only

interaction report with external subroutine

Former Member
0 Likes
560

Hi all,

I am new in ABAP.I have used external subroutine in the interactive report but it wont work plz any one can help me.

Main program

tables vbak.

select-options x for vbak-vbeln.

types : begin of ty,

a type vbak-vbeln,

b type vbak-ernam,

end of ty.

types : begin of ty1,

c type vbap-posnr,

d type vbap-matnr,

end of ty1.

data : itab type table of ty,

wa type ty,

itab1 type table of ty1,

wa1 type ty1.

perform exsub(znava) tables x.

at line-selection.

case sy-lsind.

when '1'.

select posnr matnr from vbap into table itab1 where vbeln = wa-a.

loop at itab.

write 😕 wa1-c,wa1-d.

endloop.

endcase.

Next Program

report znava.

form exsub tables x.

select vbeln ernam from vbak into table itab where vbeln = x.

loop at itab.

write 😕 wa-a,wa-b.

hide wa.

endloop.

endform.

the above main program output shows only primary report.

plz guide me.

by,

nava

Hi all,

I am new in ABAP.I have used external subroutine in the interactive report but it wont work plz any one can help me.

Main program

tables vbak.

select-options x for vbak-vbeln.

types : begin of ty,

a type vbak-vbeln,

b type vbak-ernam,

end of ty.

types : begin of ty1,

c type vbap-posnr,

d type vbap-matnr,

end of ty1.

data : itab type table of ty,

wa type ty,

itab1 type table of ty1,

wa1 type ty1.

perform exsub(znava) tables x.

at line-selection.

case sy-lsind.

when '1'.

select posnr matnr from vbap into table itab1 where vbeln = wa-a.

loop at itab.

write 😕 wa1-c,wa1-d.

endloop.

endcase.

Next Program

report znava.

form exsub tables x.

select vbeln ernam from vbak into table itab where vbeln = x.

loop at itab.

write 😕 wa-a,wa-b.

hide wa.

endloop.

endform.

the above main program output shows only primary report.

plz guide me.

by,

nava

3 REPLIES 3
Read only

Former Member
0 Likes
521

Write as :

tables vbak.

select-options x for vbak-vbeln.

types : begin of ty,

a type vbak-vbeln,

b type vbak-ernam,

end of ty.

types : begin of ty1,

c type vbap-posnr,

d type vbap-matnr,

end of ty1.

data : itab type table of ty,

wa type ty,

itab1 type table of ty1,

wa1 type ty1.

DATA : VIEW_REPID LIKE T582V-REPID.

at line-selection.

case sy-lsind.

when '1'.

select posnr matnr from vbap into table itab1 where vbeln = wa-a.

loop at itab.

write 😕 wa1-c,wa1-d.

endloop.

endcase.

start-of-selection.

VIEW_REPID = 'ZNAVA'.

perform exsub in program (VIEW_REPID) tables x.

Read only

Former Member
0 Likes
521

Hi,

write the perform statement after the at line selection.

that should come in start -of -selection area if u giv that perform before start of selection it will take it as at line selection event only. Hope u solve ur issue ..

Regards,

Sana.

Reward points if found helpful..!

Read only

Former Member
0 Likes
521

the answer as follows :

tables vbak.

select-options x for vbak-vbeln.

types : begin of ty,

a type vbak-vbeln,

b type vbak-ernam,

end of ty.

types : begin of ty1,

c type vbap-posnr,

d type vbap-matnr,

end of ty1.

data : itab type table of ty,

wa type ty occurs 0 with header line,

itab1 type table of ty1,

wa1 type ty1.

perform exsub(znava) tables x wa.

at line-selection.

case sy-lsind.

when '1'.

select posnr matnr from vbap into table itab1 where vbeln = wa-a.

loop at itab.

write 😕 wa1-c,wa1-d.

endloop.

endcase.

Next Program

report znava.

form exsub tables x wa like itab.

select vbeln ernam from vbak into table itab where vbeln = x.

loop at itab.

write 😕 wa-a,wa-b.

hide wa.

endloop.

endform.