2008 Feb 28 8:44 AM
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
2008 Feb 28 8:56 AM
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.
2008 Feb 28 9:01 AM
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..!
2008 Mar 01 9:51 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |