‎2007 Dec 07 5:21 AM
hi experts,
my requirement is to include select-options in module pool programming. So far i have called a subscreen from a zreport to my dynpro screen.
but how can i fetch the value from that select-options.By what reference,I mean by what name i can refer to select-options.
ztest.
report ztest.
tables: t001.
selection-screen begin of screen 100 as subscreen.
select-options: s_bukrs for t001-bukrs.
selection-screen: end of screen 100.
Module pool
process before output.
MODULE STATUS_0001.
call subscreen sub including 'ZTEST' '100'.
process after input.
MODULE USER_COMMAND_0001.
call subscreen sub.
in debugger s_bukrs in unknown. So by what name i should refer to that select-options values??
Thanks
Gaurav
‎2007 Dec 07 8:13 AM
‎2007 Dec 07 7:56 AM
If the module pool is a different program than "ZTEST", have you tried defining:
ranges:
s_bukrs for t001-bukrs.in the TOP include of the module pool. I've not tried this myself, but it would seem to be the logical place to do so.
Jonathan
‎2007 Dec 07 8:13 AM
‎2007 Dec 07 11:02 AM
hi,
u need to declare variable with same name than it will work...
‎2007 Dec 07 11:32 AM
hi dhwani,
Even same name does not work.I have already tried the same.
PLease help!!
thanks,
Gaurav
‎2007 Dec 07 11:39 AM
hi,
ok let me understand ur need...
u r creating one zreport , in that u call screen for inputting data.
Now u want to use that entered data in ur Zreport for further data fetching...
Is that so?
‎2007 Dec 07 11:43 AM
‎2007 Dec 07 12:08 PM
hi,
i need to include select-options in module pool programming. As we all know that select-options design is not available in screen painter.So i have created a zreport in which i have coded select-options :
report ztest.
tables: t001.
selection-screen begin of screen 100 as subscreen.
select-options: s_bukrs for t001-bukrs.
selection-screen: end of screen 100.
Now in my module pool program, I'm calling this subscreen and I'm getting the desired design as well.But the problem is from where i can fetch the entered data from select-options. I mean s_bukrs in debug mode is having no data. Where is the data which i'm inputting.
process before output.
MODULE STATUS_0001.
call subscreen sub including 'ZTEST' '100'.
process after input.
MODULE USER_COMMAND_0001.
call subscreen sub.
module in1.
now i think it should be clear
Thanks
Gaurav
‎2007 Dec 07 12:18 PM
ok,
and u displaying data in table control using this selection criteria?
Reply quickly
Message was edited by:
Dhwani shah
‎2007 Dec 07 12:21 PM
hi dhwani,
i just want to use that select-options data in my program's select queries.How can i access that values??
Thanks
Gaurav
‎2007 Dec 07 12:32 PM
hi,
cant u do like this?
TABLES: mara.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr,
END OF itab1.
SELECT-OPTIONS : s_matnr FOR mara-matnr.
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB1' ITSELF
CONTROLS: tab1 TYPE TABLEVIEW USING SCREEN 1001.
START-OF-SELECTION.
CALL SCREEN 1001.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE tab1_change_tc_attr OUTPUT.
DESCRIBE TABLE itab1 LINES tab1-lines.
ENDMODULE. "TAB1_CHANGE_TC_ATTR OUTPUT
&----
*& Module get_data OUTPUT
&----
text
----
MODULE get_data OUTPUT.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE itab1 WHERE matnr IN s_matnr.
ENDMODULE. " get_data OUTPUT
&----
*& Module STATUS_1001 OUTPUT
&----
text
----
MODULE status_1001 OUTPUT.
SET PF-STATUS 'ZTEST'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1001 OUTPUT
&----
*& Module USER_COMMAND_1001 INPUT
&----
text
----
MODULE user_command_1001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'UP' OR 'CANC'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
here i have table control on my screen and rather calling selection screen as sub screen i am calling screen for output from z report it self.....
‎2007 Dec 07 12:36 PM
hi dhwani,
your prg is executable type not module pool. I need to do this in <b>module pool.</b>In simple report,Its working fine.
Thanks,
Gaurav
‎2007 Dec 07 12:59 PM
‎2007 Dec 10 5:35 AM
Because the subscreen is in an external program, you'll have to pass the data back from your report program to your main module pool program... so I suggest in your report you have something like:
tables:
t001.
selection-screen begin of screen 0999 as subscreen.
select-options:
s_bukrs for t001-bukrs.
selection-screen end of screen 0999.
at selection-screen.
if sy-dynnr = '0999'. "your subscreen
export gr_bukrs = s_bukrs to memory id 'Z:S_BUKRS'.
endif.and then in your module pool, define:
ranges:
gr_bukrs for t001-bukrs. "g = global, r = rangewithin your "top" include and then grab the value from the report subscreen back in the PAI logic via:
import gr_bukrs[] from memory id 'Z:S_BUKRS'.That should do the trick... you can then use gr_bukrs for your selections / logic.
Jonathan
‎2007 Dec 10 8:41 AM
hi jonathan,
Thanks alot.You are Great.My problem is solved.Thanks again....
max points have been awarded.
Gaurav