Application Development 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: 

Module pool programming

Former Member
0 Kudos

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

4 REPLIES 4

0 Kudos

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

Former Member
0 Kudos

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 .

Former Member
0 Kudos

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

Former Member
0 Kudos

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