cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive thread

Former Member
0 Kudos

I have two tables 1. vbak which have sales order details and 2. vbap having items detail. know problem is i want to display on intial screen sales order details and while on clicking that i want to display the items details.

i am using hide

code i written is

REPORT YTEST_REP5 no standard page heading.

tables: vbak , vbap.

data: it_vbak type vbak occurs 3 with header line.

data: it_vbap type vbap occurs 3 with header line.

DATA: F TYPE STRING.

data : begin of it_res occurs 3,

vbeln type vbak-vbeln,

kunnr type vbak-kunnr,

posnr type vbap-posnr,

matnr type vbap-matnr,

end of it_res.

data : begin of itab occurs 3,

posnr type vbap-posnr,

matnr type vbap-matnr,

end of itab.

select-options: s_vbeln for vbak-vbeln.

start-of-selection.

select *

from vbak

into table it_vbak

where vbeln in s_vbeln.

select *

from vbap

into table it_vbap

for all entries in it_vbak

where vbeln = it_vbak-vbeln.

loop at it_vbak.

at first.

write: / 'vbeln' , 20 'kunnr'.

uline.

skip.

endat.

write: / it_vbak-vbeln , 20 it_vbak-kunnr.

loop at it_vbap where vbeln = it_vbak-vbeln.

*hide: it_vbap-posnr , it_vbap-matnr.

itab-posnr = it_vbap-posnr.

itab-matnr = it_vbap-matnr.

append itab.

hide itab.

endloop.

endloop.

at line-selection.

loop at itab.

write: / itab-posnr , itab-matnr.

endloop.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

compare ur program with this.

REPORT ZBHREP3 LINE-COUNT 15(1) LINE-SIZE 75.

TABLES: SFLIGHT.

DATA VAR LIKE SFLIGHT-CONNID.

DATA ITAB LIKE SFLIGHT OCCURS 0 WITH HEADER LINE.

SELECT-OPTIONS CARRID1 FOR SFLIGHT-CARRID.

FORMAT HOTSPOT ON.

WRITE:/10 'AIRLINE CODE',25 'CONNECTION ID',40 'FLIGHT DATE'.

SELECT * FROM SFLIGHT WHERE CARRID IN CARRID1.

WRITE:/10 SFLIGHT-CARRID,25 SFLIGHT-CONNID,40 SFLIGHT-FLDATE.

HIDE SFLIGHT-CONNID.

ENDSELECT.

*END-OF-PAGE.

END-OF-PAGE.

WRITE:/64 'P.NO:',SY-PAGNO.

*TOP-OF-PAGE.

TOP-OF-PAGE.

WRITE:/ 'THIS IS MY FIRST REPORTS PROGRAM.'.

*AT LINE-SELECTION.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN '1'.

SELECT * FROM SFLIGHT INTO CORRESPONDING FIELDS OF ITAB WHERE

CONNID = SFLIGHT-CONNID.

WRITE:/ ITAB-CARRID,ITAB-PLANETYPE,ITAB-PAYMENTSUM.

ENDSELECT.

WRITE:/ SFLIGHT-CONNID.

ENDCASE.

please reward helpful answers.

rgds,

bharat.

Message was edited by:

Bharat Kalagara

Former Member
0 Kudos

Thanks Mr. Bharat

My code is working now

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ajay,

You need to change your coding. what ever you are hiding can't be displayed as you are hiding wrong fields. The fields which wre written using WRITE should be hided and used in the AT LINE- SELECTION.

Regards,

Atish