05-11-2007 10:17 AM
Hi,
I had created two screens in module pool, second screen has table control
in that i want to two tables data print.By using of join statement i had written the select statement but the data was not printed.
plz tell me how to print two tables data in the table.
send me code.
reguards
raji
05-11-2007 10:25 AM
Hi,
To create a table contrl you have to get the fields from a dicttionary table or say table of your own. What I would say is create a view for the two tables you want to join and base your table control on that view and use.
Then you get the data from the view using the SELECT statement and in the PBO's LOOP ENDLOOP over the table contol push the data onto the table control.
Best Regards,
Sesh
05-11-2007 10:35 AM
Hi,
iam aslo followed the same process but data was not selected in debugging data selected but in screen data was selected.
plz send me code .
05-11-2007 11:06 AM
hi,
after designing the screen.
use this code.
flow logic:
process before output.
loop at itab with control tc.
module status_0100.
endloop.
process after input.
module user_command_0100.
loop at itab.
endloop.
&----
*& Report ZSRTABLECONTROL1 *
*& *
&----
*& *
*& *
&----
report zsrtablecontrol1 .
tables : ekko,ekpo,lfa1.
data : ok_code type sy-ucomm.
data : begin of itab occurs 0,
ebeln like ekko-ebeln,
aedat like ekko-aedat,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
netwr like ekpo-netwr,
end of itab.
controls : tc type tableview using screen '100'.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module user_command_0100 input.
case ok_code.
when 'DISP'.
refresh itab.
select ekko~ebeln
ekko~aedat
ekpo~ebelp
ekpo~matnr
ekpo~netwr
into corresponding fields of itab
from ekko inner join ekpo
on ekkoebeln = ekpoebeln where lifnr = lfa1-lifnr.
append itab.
endselect.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module status_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
move-corresponding itab to ekko.
move-corresponding itab to ekpo.
tc-lines = sy-dbcnt.
endmodule. " STATUS_0100 OUTPUT
05-11-2007 11:07 AM
Hi
check with this select query for joins... hope it helps
Fetch order master data , PM order selection data from AUFK
and VIAUFKS tables
SELECT d1aufnr d1auart d1~ktext
d1erdat d2iwerk d2~swerk
d2tplnr d2addat d2~gewrk
INTO TABLE pa_gt_aufk
FROM aufk AS d1
INNER JOIN viaufks AS d2 ON d1aufnr = d2aufnr
WHERE d1~aufnr IN s_aufk
AND d1~auart IN s_auart
making aliases of the two tables and using them in the way as shown....
regards
Dinesh