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

interactive reporting

Former Member
0 Likes
614

please help me to Create interactive report which contains

Customer Details in the Basic List like Customer Number, Name 1, House number and street, City, Country Key.

Sales Order Details in the Secondary List like Sales Document, Document Date (Date Received/Sent), Sales Document Type, and Net Value of the Sales Order in Document Currency.

Sales Order Item Details in the Second Secondary List like Sales Document Item, Material Number, Batch Number, Material Group, Base Unit of Measure.

Flow logic:

§ Design a selection screen where user can enter range of Customer Number.

§ Based on the given customer number get the relevant data from table KNA1 to display in the basic list.

§ When the user clicks on any customer number in the basic list get its sales order details from table VBAK to display in the secondary list.

§ When user clicks on any sales order number in the secondary list get its sales order item details from table VBAP to display in the second secondary list.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
597

hi ravinder,

i hope this wil help u..here i have created a kunnr(Customer Number) in selection screen..and according to ur selection in selection screen it wil fetch the data and the particular data wil display in basic list..if u select a kuunr in the basic list..this wil fetch the related data in VBAK table and the related data wil be dispayed in secondary list and if u select vbeln in the secondary list ..this wil fetch the data in next screen and the related data wil be dispayed...i thing this ur need...

TABLES: kna1,vbak,vbap.

SELECT-OPTIONS: kunnr FOR kna1-kunnr.

DATA: BEGIN OF itab OCCURS 0,

kunnr like kna1-kunnr,

name1 LIKE kna1-name1,

STRAS LIKE kna1-stras,

ORT01 LIKE kna1-ORT01,

land1 LIKE kna1-land1,

END OF itab.

DATA: BEGIN OF itab1 OCCURS 0,

vbeln LIKE vbak-vbeln,

erdat LIKE vbak-erdat,

END OF itab1.

DATA: BEGIN OF itab2 OCCURS 0,

vbeln LIKE vbap-vbeln,

POSNR LIKE vbap-POSNR,

matnr LIKE vbap-matnr,

END OF itab2.

select * FROM kna1 into CORRESPONDING FIELDS OF TABLE itab WHERE kunnr IN kunnr.

LOOP AT itab.

WRITE: itab-kunnr,itab-name1,itab-stras,itab-ort01,itab-land1.

ENDLOOP.

HIDE: itab-kunnr.

at LINE-SELECTION.

CASE sy-lsind.

WHEN '1'.

SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE itab1 WHERE kunnr = itab-kunnr.

LOOP AT itab1.

WRITE: / itab1-vbeln,itab1-erdat.

ENDLOOP.

HIDE: itab1-vbeln.

WHEN '2'.

SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE itab2 WHERE vbeln = itab1-vbeln.

LOOP AT itab2.

WRITE: / itab2-vbeln,itab2-posnr.

ENDLOOP.

WHEN OTHERS.

ENDCASE.

regards,

dhaya.

if its useful,

plz reward points.

5 REPLIES 5
Read only

Former Member
0 Likes
597

R u generating an ALV report or Standard one.

Read only

Former Member
0 Likes
597

If ur using ALV use the SLIS-SELFIELD to find the records from initial to secondary screen.

if it is standard report use HIDE statement to do so.

Read only

Former Member
0 Likes
597

Hi,

tables: zpassengerdetail.

selection-screen: begin of block b1.

select-options: busno for zpassengerdetail-busno.

selection-screen: end of block b1.

data: begin of itab occurs 0,

busserno like zpassengerdetail-busserno,

pasnam like zpassengerdetail-pasnam,

end of itab.

data: begin of jtab occurs 0,

busserno like zresconfirm-busserno,

dest like zresconfirm-dest,

buscat like zresconfirm-buscat,

end of jtab.

data: begin of ktab occurs 0,

busserno like zbusdetails-busserno,

buscat like zbusdetails-buscat,

end of ktab.

select busserno pasnam from zpassengerdetail into table itab where busserno in busno.

loop at itab.

write: / itab-busserno, itab-pasnam.

hide: itab-busserno.

format HOTSPOT on.

endloop.

at line-selection.

case sy-lsind.

when '1'.

select busserno buscat dest from zresconfirm into table jtab where busserno = itab-busserno.

loop at jtab.

write: / jtab-busserno, jtab-dest, jtab-buscat.

hide: jtab-busserno.

format HOTSPOT on.

endloop.

when '2'.

select busserno buscat from zbusdetails into table ktab where busserno = jtab-busserno.

loop at ktab.

write: / ktab-busserno, ktab-buscat.

endloop.

endcase.

This is the similar requirement for what you have asked.

I have used ZTables.

I think it is useful for you.

Read only

Former Member
0 Likes
597

Hi,

Firstly u got to prepare a selection screen wid the relevant "selection criterio"

Start of selection:

Select the data by givin the conditions on which u wud like to fetch the data Ex: in ur case it wud be the customer no.

Validation:

Validate the data u ve selected.

Ex: u can throw some message if data is not present.

then dispaly the basic list.

for interactive lists, u can use

At line-selection.

Case SY-LSIND

when 1.

Interactive list 1.

when 2.

interactive list 2.

endcase.

Hope thsi helps u.If u ve any doubts,u can always revert back.

Thanks & Regards,

Ramya Shree M R

Read only

Former Member
0 Likes
598

hi ravinder,

i hope this wil help u..here i have created a kunnr(Customer Number) in selection screen..and according to ur selection in selection screen it wil fetch the data and the particular data wil display in basic list..if u select a kuunr in the basic list..this wil fetch the related data in VBAK table and the related data wil be dispayed in secondary list and if u select vbeln in the secondary list ..this wil fetch the data in next screen and the related data wil be dispayed...i thing this ur need...

TABLES: kna1,vbak,vbap.

SELECT-OPTIONS: kunnr FOR kna1-kunnr.

DATA: BEGIN OF itab OCCURS 0,

kunnr like kna1-kunnr,

name1 LIKE kna1-name1,

STRAS LIKE kna1-stras,

ORT01 LIKE kna1-ORT01,

land1 LIKE kna1-land1,

END OF itab.

DATA: BEGIN OF itab1 OCCURS 0,

vbeln LIKE vbak-vbeln,

erdat LIKE vbak-erdat,

END OF itab1.

DATA: BEGIN OF itab2 OCCURS 0,

vbeln LIKE vbap-vbeln,

POSNR LIKE vbap-POSNR,

matnr LIKE vbap-matnr,

END OF itab2.

select * FROM kna1 into CORRESPONDING FIELDS OF TABLE itab WHERE kunnr IN kunnr.

LOOP AT itab.

WRITE: itab-kunnr,itab-name1,itab-stras,itab-ort01,itab-land1.

ENDLOOP.

HIDE: itab-kunnr.

at LINE-SELECTION.

CASE sy-lsind.

WHEN '1'.

SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE itab1 WHERE kunnr = itab-kunnr.

LOOP AT itab1.

WRITE: / itab1-vbeln,itab1-erdat.

ENDLOOP.

HIDE: itab1-vbeln.

WHEN '2'.

SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE itab2 WHERE vbeln = itab1-vbeln.

LOOP AT itab2.

WRITE: / itab2-vbeln,itab2-posnr.

ENDLOOP.

WHEN OTHERS.

ENDCASE.

regards,

dhaya.

if its useful,

plz reward points.