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

error in calling a selection-screen...

aris_hidalgo
Contributor
0 Likes
978

Hello experts,

Please look at my code below:

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.

SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.
PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:'.
SELECTION-SCREEN END OF LINE.

PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.
SELECTION-SCREEN END OF SCREEN 500.

*************
SELECTION-SCREEN BEGIN OF SCREEN 1500 AS WINDOW.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode.
PARAMETERS: p_dcode LIKE vbak-kunnr,
            p_name1 LIKE kna1-name1.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_list2 RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list2.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_add  RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_edit RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code.
PARAMETERS: p_code LIKE zts0001-cdseq.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF SCREEN 1500.

IF v_compflag EQ space.
  CALL SELECTION-SCREEN 500.
ELSE.
  CALL SELECTION-SCREEN 1500.
ENDIF.

Now, what I want to do is that the program will call a selection-screen based on a given variable(v_compflag). But its generating an error saying that 'error generating the selection-screen'. Why is this so?

Again, thank you guys and take care!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
938

Hi Viray,

it is very simple error. when you have some comment and position stuff

because of that you got error.

i replicated the error.

check the below code. this will give same error.

REPORT  ZTEST_ERRROR                            .

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
PARAMETERS: pr_upld1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
SELECTION-SCREEN END OF LINE.

check the below code. this will give not give ny error.

REPORT  ZTEST_ERRROR_CORRECT                 .

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
PARAMETERS: pr_upld1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 25(10) text-007 FOR FIELD pr_upld.
SELECTION-SCREEN END OF LINE.

Regards

vijay

9 REPLIES 9
Read only

Former Member
0 Likes
938

Hi

It means some parameters or select-optios is overwrited by other screen element.

In the dump the system should show you the name of report to analize the selection-screen: RSDBGENA

Max

Read only

Former Member
0 Likes
938

Hi,

when you use the CALL SELECTION SCREEN statement, you should also specify STARTING AT ...and ENDING AT.

This is because you have defined the selection screen AS WINDOW.

Regards,

Anand Mandalika.

Read only

0 Likes
938

Also, for Selection screen 500, there's a small error in your declaration -

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.

  SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
    SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
  SELECTION-SCREEN END OF LINE.

  SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.
    PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:'.
  SELECTION-SCREEN END OF LINE.

<b>  SELECTION-SCREEN BEGIN OF LINE.</b>
    PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.
    SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.
<b>  SELECTION-SCREEN END OF LINE.</b>

SELECTION-SCREEN END OF SCREEN 500.

If you observe, the last parameters should be between a BEGIN OF LINE....and END OF LINE.

Read only

Former Member
0 Likes
939

Hi Viray,

it is very simple error. when you have some comment and position stuff

because of that you got error.

i replicated the error.

check the below code. this will give same error.

REPORT  ZTEST_ERRROR                            .

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
PARAMETERS: pr_upld1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
SELECTION-SCREEN END OF LINE.

check the below code. this will give not give ny error.

REPORT  ZTEST_ERRROR_CORRECT                 .

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.
PARAMETERS: pr_upld1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 25(10) text-007 FOR FIELD pr_upld.
SELECTION-SCREEN END OF LINE.

Regards

vijay

Read only

0 Likes
938

Hi guys,

Thanks for your very helpful reply. But my boss spoke to me now and he wants it that when a user is a 'BOSS', he should be seeing screen 500. And when he is not, he should be seeing/using screen 1500. Where will I put this condition?

Again, thanks and have a nice day!

Read only

0 Likes
938

Corrected code.

REPORT  ztest_errror                            .
data: v_compflag.


SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_upld RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld
.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.
PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF SCREEN 500.
*************SELECTION-SCREEN BEGIN OF SCREEN 1500 AS WINDOW.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode.
PARAMETERS: p_dcode LIKE vbak-kunnr,
          p_name1 LIKE kna1-name1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_list2 RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_add  RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pr_edit RADIOBUTTON GROUP grp.
SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit.
SELECTION-SCREEN END OF LINE.
*************SELECTION-SCREEN END OF SCREEN 1500.
IF v_compflag EQ space.
  CALL SELECTION-SCREEN 500.
ELSE.
  CALL SELECTION-SCREEN 1500.
ENDIF.

Regards

vijay

Read only

0 Likes
938
if sy-uname eq 'BOSS'.
  call selection-screen 500.
else.
  call selection-screen 1500.
endif.
Read only

0 Likes
938

Hi Viray,

you can do that with the help of sy-uname (system variable) based on that you can call the screens..

if sy-uname eq 'BOSS'.

call selection-screen 500.

else.

call selection-screen 1500.

endif.

Regards

vijay

Read only

Former Member
0 Likes
938

Hi Viray,

The line that is causing the problem is,

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.

See here the problem is,

1) First u defined a text at 03(15) and parameter field on the same line.

2) Then u haven't moved to next line and u r trying to write some comment to the radio button pr_list1 at 2(7) on the same.

That's the problem. See here 2(7) means starts at 2nd position on the same line and it can take 7 chars, that's the meaning.

U can solve this problem by moving to next line like,

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.

PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\'.

SELECTION-SCREEN END OF LINE.

<b>SELECTION-SCREEN BEGIN OF LINE.</b>

PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.

<b>SELECTION-SCREEN END OF LINE.</b>

Or u can adjust the char length and specify correct position to have everything on same line.

Hope u got it.