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

Selection-screen in subroutine

Former Member
0 Likes
1,180

Hi,

I would like to know if I can create my selection-screen using a subroutine.

Here is my selection-screen.


SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-aaa, POSITION 50.
PARAMETERS : p_aaa  TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-bbb, POSITION 50.
PARAMETERS : p_bbb  TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-ccc, POSITION 50.
PARAMETERS : p_ccc  TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.

I tried this but it doesn't work.


PERFORM test : USING text-aaa p_aaa,
                          USING text-bbb p_bbb,
                          USING text-ccc p_ccc.

FORM test USING text parameter.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text, POSITION 50.
PARAMETERS : parameter  TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.
ENDFORM.

Error message : SELECTION-SCREEN statement is not allowed in FORM

Has anyone got an idea ?

Regards

1 ACCEPTED SOLUTION
Read only

Kanagaraja_L
Active Contributor
0 Likes
746

You can't declare Selection-SCREEN in a Form.

So Declare all your selection-sCreen in a Include Program and use that Include in your Main Program.

Kanagaraja L

3 REPLIES 3
Read only

Kanagaraja_L
Active Contributor
0 Likes
747

You can't declare Selection-SCREEN in a Form.

So Declare all your selection-sCreen in a Include Program and use that Include in your Main Program.

Kanagaraja L

Read only

Former Member
0 Likes
746

First, you can not use selection-screen in FORM and PERFORM somewhere.

Second, you can use subscreen or include it is up to your screen design.

reward points if it helps.

michael

Read only

0 Likes
746

Thanks for your reply. I hoped there was another way because I have 14 times the same block in my selection-screen.

Rgds,