on 11-16-2004 6:38 PM
Hello All,
Is there any way to choose selection parameters dynamically (not a whole structure as with FM FREE_SELECTIONS_DIALOG), I'd want to represent the input parameters of a Function Module without either to know the FM at design time nor regenerate the selection program each time I run it.
Thanks
Martin
Martin,
what's your intention ?
-> look F1 : SELECT-OPTIONS sel FOR (f).
coud be helpful
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
to my knowledge there is no direct dynamic way to create parameters on selection-screens. You must either generate a transient subroutine pool with <b>GENERATE SUBROUTINE POOL</b> and call the generated selection screens with <b>CALL SELECTION-SCREEN</b> from a generated subroutine or you dynamically create a persistent program that you store in the repository with <b>INSERT REPORT</b> and call it with <b>SUBMIT</b>.
A workaround could be, that you create a set of selection screens as subscreens with <b>SELECTION-SCREEN BEGIN OF SCREEN dynnr AS SUBSCREEN</b> and include them on your selection screen with
<b>SELECTION-SCREEN BEGIN OF TABBED BLOCK tblock FOR n LINES.
SELECTION-SCREEN END OF BLOCK tblock.</b>
This is the special case of a Tabstrip without tabtitle.
Example how to include subscreens dynamically from transaction ABAPDOCU (example library):
<b>REPORT demo_sel_screen_with_subscreen.
TABLES sscrfields.
SUBSCREEN 1
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS: p1(10) TYPE c,
p2(10) TYPE c,
p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 100.
SUBSCREEN 2
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.
PARAMETERS: q1(10) TYPE c,
q2(10) TYPE c,
q3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 200.
SUBSCREEN 3
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-030.
PARAMETERS: r1(10) TYPE c,
r2(10) TYPE c,
r3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN END OF SCREEN 300.
STANDARD SELECTION SCREEN
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 10 LINES,
END OF BLOCK sub.
INITIALIZATION.
sscrfields-functxt_01 = '@0D@'.
sscrfields-functxt_02 = '@0E@'.
sub-prog = sy-repid.
sub-dynnr = 100.
AT SELECTION-SCREEN.
CASE sy-dynnr.
WHEN 100.
IF sscrfields-ucomm = 'FC01'.
sub-dynnr = 300.
ELSEIF sscrfields-ucomm = 'FC02'.
sub-dynnr = 200.
ENDIF.
WHEN 200.
IF sscrfields-ucomm = 'FC01'.
sub-dynnr = 100.
ELSEIF sscrfields-ucomm = 'FC02'.
sub-dynnr = 300.
ENDIF.
WHEN 300.
IF sscrfields-ucomm = 'FC01'.
sub-dynnr = 200.
ELSEIF sscrfields-ucomm = 'FC02'.
sub-dynnr = 100.
ENDIF.
ENDCASE.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
You might want to dynamically generate a program and then submit that program. Do help on GENERATE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.