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 inside a Dynpro

Former Member
0 Likes
1,875

Hi,

How can a I do to put a field that seems like a select-options, but inside a dynpro.

I have the field: R_RANGE.

In dynpro it should appear

r_range-low [ ] r_range-high [ ]

and also the buttom of multiple value.

Thanks

Regards

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,137

Couple ways to do this.

1) you can build the screen yourself and use a FM to handle the "multiple selections" functionality

or

2) you can embed a selection screen inside of a subscreen.

Here is a sample program.

Regards,

Rich Heilman

report zrich_0006 .

tables: mara.

  • Custom Selection Screen 1010

selection-screen begin of screen 1010 as subscreen.

selection-screen begin of block b1 with frame title text-001.

parameters: p_rad1 radiobutton group grp1 default 'X',

p_rad2 radiobutton group grp1,

p_rad3 radiobutton group grp1.

select-options: s_matnr for mara-matnr,

s_matkl for mara-matkl,

s_mtart for mara-mtart.

selection-screen end of block b1.

selection-screen end of screen 1010.

start-of-selection.

call screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


module status_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

endmodule.

&----


*& Module USER_COMMAND_0100 INPUT

&----


module user_command_0100 input.

endmodule.

  • Screen screen 100 with a subscreen area

  • called "subscreen_1010"

  • Screen Flow Logic follows

process before output.

module status_0100.

call subscreen subscreen_1010

including sy-repid '1010'.

process after input.

call subscreen subscreen_1010 .

module user_command_0100.

Message was edited by: Rich Heilman

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
1,137

I don't think you can do that without some pogramming. You have to create PF-Status just like report selection screen. Then you have to program it for value request.

Read only

Former Member
0 Likes
1,137

Hi Cesar,

I don't think you can do that. When you define your selection screen with select-options, system generates the screen 1000 automatically for and all the buttons, and the range from and to are also automatically defined based on your definition.

If you want to do something like that, you need to look at the screen design of any report that has select-options and see the screen flow logic for the push buttons. I don't think there is any straight forward way to do this. Alternatively you can try defining a selection-screen in your program and calling it from your dynpro in a subscreen. Here is how.

In your main program(say ZTEST), you define a selection screen having the select-options you want as follows.

TABLES: t001.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs.
SELECTION-SCREEN: END OF SCREEN 100.

After that in your dynpro, you need to define a subscreen area(say SUB). In your flow logic, you need to call the subscreen defined above as follows.

PROCESS BEFORE OUTPUT.

  • MODULE STATUS_0200.

CALL SUBSCREEN sub

INCLUDING 'ZTEST' '100'.

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_0200.

CALL SUBSCREEN sub.

After that you are good to go.

If this helps, please reward and close.

Regards,

Srinivas

Read only

Former Member
0 Likes
1,137

Hello Cesar,

I agree completely with Srinivas. The best option is to call a selection-screen as a subscreen.

It takes less time and effort to do that then to program a select-options behaviour in a normal screen.

I do not know your complete requirement, but if you do not have elements like a table-control on this particular screen, you can directly <i>call</i> this selection screen - there's no need to call it as a <i>subscreen</i>.

All the best,

Regards,

Anand Mandalika.