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

select-options problem in dynpro

Former Member
0 Likes
1,444

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,410

hi jonathan,

it didn't work..

Thanks

Gaurav

14 REPLIES 14
Read only

Former Member
0 Likes
1,410

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

Read only

Former Member
0 Likes
1,411

hi jonathan,

it didn't work..

Thanks

Gaurav

Read only

0 Likes
1,410

hi,

u need to declare variable with same name than it will work...

Read only

0 Likes
1,410

hi dhwani,

Even same name does not work.I have already tried the same.

PLease help!!

thanks,

Gaurav

Read only

0 Likes
1,410

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?

Read only

0 Likes
1,410

tell ur requirement clearly so i can help u

Read only

0 Likes
1,410

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

Read only

0 Likes
1,410

ok,

and u displaying data in table control using this selection criteria?

Reply quickly

Message was edited by:

Dhwani shah

Read only

0 Likes
1,410

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

Read only

0 Likes
1,410

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.....

Read only

0 Likes
1,410

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

Read only

0 Likes
1,410

ok

let me check that

Read only

0 Likes
1,410

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 = range

within 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

Read only

0 Likes
1,410

hi jonathan,

Thanks alot.You are Great.My problem is solved.Thanks again....

max points have been awarded.

Gaurav