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

reports

Former Member
0 Likes
638

hi guru's,

here iam giving the sample code.i need an explantion how it's going to work in details.if it's clear to me full points.

thnx loki.

tables : kna1,vbak,vbap,mara.

select - optins : cust for kna1 - kunnr.

data : begin of i_kna1 occurs 0,

kunnr like kna1-kunnr,

name1 like kna1-name1,

end of i_kna1.

data : begin of i_vbak occurs 0,

vbeln like vbak-vbeln,

netwr like vbak-netwr,

end of i_vbak.

data : begin of i_vbap occurs 0,

posnr like vbap-posnr,

matnr like vbap-matnr,

end of -_vbap.

data : fnam(10) , fval(10).

strat-of-selection.

select kunnr name1 from kna1 into table i_kna1 where kunnr in cust.

loop at i_kna1.

write : / i_kna1-kunnr hotspot , itab-name1.

hide i_kna1-kunnr.

endloop.

at line-selection.

case sy-lsind.

when 1.

select vbeln netwr from vbak into table i_vbak where kunnr = i_vbak-kunnr.

loop at i_vbak.

write : / i_vbak-vbeln hotspot , i_vbak-netwr.

hide i_vbak-vbeln.

endloop.

when 2.

select vbapposnr maramatnr into i_vbap from vbap inner join mara on vbap~matnr where vbeln = i_vbap-vbeln.

append i_vbap.

end select.

loop at i_vbap.

write: / i_vbap-posnr , i_vbap-matnr hotspot.

hide i_vbap-matnr.

endloop.

when 3.

get curssor field fnam value fval.

set parameters id 'mat' field fval.

call transaction 'mm02' and skip first screen.

end case.

top-of-page.

write : / 'customer details'.

top-of-page during line-selection.

case sy-lsind.

when 1.

write : / 'sales details'.

when 2.

write : / 'item details'.

endcase.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
613

Hi

first based on the customer entered on selection screen it fetches the customer name from kna1 table and displays it on the first list/report.

then when you double click on customer field on the first list output it fetch the data from the table VBAK and fetches the related sales orders for that customer and displays those details.

Next on this 2nd list output when you double click on VBELN field it fetch the Item details of that sales order and material no from mara for that sales order and displays as another list

finally when you double click on the material no it displays the Material master transaction MM03 for that Material.

hope it is clear

reward points

regards

Anji

5 REPLIES 5
Read only

Former Member
0 Likes
613

I think the best way to learn or understand is start debugging...u will get to know how ur code works...:-)

Put a break point on the select statement and execute it. You will go to the debugger.Then press F6 or F5 to move to the next step or statement. Check out ur internal tables whether the data is coming correctly or not...

Read only

0 Likes
613

hi swathi,

i don't h've sap in my system.tht's why iam asking pls help me.if use full,full points

thanx

loki

Read only

Former Member
0 Likes
614

Hi

first based on the customer entered on selection screen it fetches the customer name from kna1 table and displays it on the first list/report.

then when you double click on customer field on the first list output it fetch the data from the table VBAK and fetches the related sales orders for that customer and displays those details.

Next on this 2nd list output when you double click on VBELN field it fetch the Item details of that sales order and material no from mara for that sales order and displays as another list

finally when you double click on the material no it displays the Material master transaction MM03 for that Material.

hope it is clear

reward points

regards

Anji

Read only

0 Likes
613

hi anji,

in the above code i've used mm02 not mm03.any how thanx

loki

Read only

Former Member
0 Likes
613

u r getting the customer number & displaying the sales details.

1.first u willl get the customer number through select option.

if u execute u will get a interactive list output with customer number & customer name.

here hotspot is set for customer number so when u click the customer number it fetchs the corresponding sales header details

The output screen will have sales document number & netwr.Here hotspot is set for sales document number.

2.If u click the sales document number it fetchs the corresponding item details from iten table.

the screen will have item number & material number.Here hotspot is set for material number.

3.Last hotspot is set for materila number. if u click the material number it directly takes to MM02 ( material change tcode).

The details in top of page is used for heading purpose.

Dont specify that i will reward full points. This site is used to help pepoles not to gain points. Our aim is to clear ur doubts