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

Dynamically calling selection screens with obligatory

Former Member
0 Likes
1,120

TABLES :

******selection-screen: begin of block bal with frame title txt3.

******parameters: RB1 radiobutton group rd1 user-command abc default 'X'.

******parameters: RB2 radiobutton group rd1.

******selection-screen: end of block bal.

******

******selection-screen: begin of block B1 with frame title txt1.

******SELECT-OPTIONS : s_cust FOR KNA1-kunnr OBLIGATORY MODIF ID r1.

******SELECT-OPTIONS : s_plant FOR plko-werks OBLIGATORY MODIF ID r1 .

******selection-screen: end of block val.

******

******selection-screen: begin of block upd with frame title txt2.

******SELECT-OPTIONS: s_vend FOR lfa1-lifnr OBLIGATORY modif id r2.

******SELECT-OPTIONS: s_plan FOR plko-werks OBLIGATORY modif id r2.

******selection-screen: end of block upd.

Here i need to call these two selection screens dynamically depends on radio buttion selection.

But

Problem is a arising when when both are obligatory in selection screen ( with out obligatory , it is working fine)

I need to call screens dynamically, ecen though we have obligatory

Let me know procedure , the possibility of same funcationality in tabstips & selection screen.

Madhu

TABLES :

******selection-screen: begin of block bal with frame title txt3.

******parameters: RB1 radiobutton group rd1 user-command abc default 'X'.

******parameters: RB2 radiobutton group rd1.

******selection-screen: end of block bal.

******

******selection-screen: begin of block B1 with frame title txt1.

******SELECT-OPTIONS : s_cust FOR KNA1-kunnr OBLIGATORY MODIF ID r1.

******SELECT-OPTIONS : s_plant FOR plko-werks OBLIGATORY MODIF ID r1 .

******selection-screen: end of block val.

******

******selection-screen: begin of block upd with frame title txt2.

******SELECT-OPTIONS: s_vend FOR lfa1-lifnr OBLIGATORY modif id r2.

******SELECT-OPTIONS: s_plan FOR plko-werks OBLIGATORY modif id r2.

******selection-screen: end of block upd.

Here i need to call these two selection screens dynamically depends on radio buttion selection.

But

Problem is a arising when when both are obligatory in selection screen ( with out obligatory , it is working fine)

I need to call screens dynamically, ecen though we have obligatory

Let me know procedure , the possibility of same funcationality in tabstips & selection screen.

Madhu

8 REPLIES 8
Read only

Former Member
0 Likes
1,074

for calling selection screen dynamically use this

PARAMETERS: p_myparm TYPE c LENGTH 15,
                         rb_rbn1  TYPE flag RADIOBUTTON GROUP g1 DEFAULT 'X' MODIF ID id1 ,
                          rb_rbn2  TYPE flag RADIOBUTTON GROUP g1 MODIF ID id2 ,
                          rb_rbn3  TYPE flag RADIOBUTTON GROUP g1 MODIF ID id3.
AT SELECTION-SCREEN OUTPUT.
  PERFORM sub_output.
FORM sub_output.
  IF p_myparm = ''.
    LOOP AT SCREEN.
      IF screen-group1 = 'ID1' OR screen-group1 = 'ID2' OR screen-group1 = 'ID3'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDFORM.

for adding tabstrip at selection screen

TABLES: mara, lfa1, ekpo.
* Define screen 101 as subscreen
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t00.
SELECT-OPTIONS matnr FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 101.
* Define screen 102 as subscreen
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
SELECT-OPTIONS: kunnr FOR lfa1-kunnr.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 102.
* Define screen 103 as subscreen
SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
PARAMETERS werks LIKE ekpo-werks.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN END OF SCREEN 103.
* Define tab screen
SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.
SELECTION-SCREEN TAB (10) name1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.
SELECTION-SCREEN TAB (20) name2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.
SELECTION-SCREEN TAB (30) name3 USER-COMMAND ucomm3 DEFAULT SCREEN 103.
SELECTION-SCREEN END OF BLOCK t1.
INITIALIZATION.
name1 = text-n01. "Material
name2 = text-n02. "Vendor
name3 = text-n03. "Plant

with cheers

s.janagar

Read only

Former Member
0 Likes
1,074

May be you can give a try to Loop at Screen..Endloop. Do F1 on keyword "Screen", you will get more information on that.

Hope this helps.

Thanks,

Harkamal

Read only

venkat_o
Active Contributor
0 Likes
1,074

Hi Madhu,

Even if you use Tabstrips with mandatory fields also, error comes as it comes in Selection-screen. Instead of making fields mandatory at declaration. You need to write like below, it gives error, when you run program.

"AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
"You need to write like this
  IF s_cust[] IS INITIAL.
    MESSAGE e001(z7) WITH 'Customer field is initial. Plz enter customer'.
  ENDIF.

Thanks

Venkat.O

Read only

Former Member
0 Likes
1,074

Hi

Its working for one radio buttion and one selection screen, (the error mesg)

if i click 2 nd radiio button , i am unable to get any message and also i am unabe to enter selection screen only,

still it is showing first selection screen

Read only

venkat_o
Active Contributor
0 Likes
1,074

mention name for whom you are responding. So that he can work on and get it solved for you. You just take every ones input but do not mention whether the given reply is suitable for u or not.

Thanks

venkat.O

Read only

Former Member
0 Likes
1,074

Hi Madhu,

You have to write code in AT SELECTION-SCREEN OUTPUT event.

First of all remove obligatory from select-options declaration. Do it dynamically in AT SELECTION-SCREEN OUTPUT event.

You enable or disable the block depending upon the rediobutton selected. Then in the venet AT SELECTION-SCREEN ON field, you can check whethere user has entered data into that field or not depending upon the radiobutton selected.

TABLES : kna1,

plko,

lfa1.

SELECTION-SCREEN: BEGIN OF BLOCK bal WITH FRAME TITLE txt3.

PARAMETERS: rb1 RADIOBUTTON GROUP rd1 USER-COMMAND abc DEFAULT 'X'.

PARAMETERS: rb2 RADIOBUTTON GROUP rd1.

SELECTION-SCREEN: END OF BLOCK bal.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE txt1.

SELECT-OPTIONS : s_cust FOR kna1-kunnr MODIF ID r1.

SELECT-OPTIONS : s_plant FOR plko-werks MODIF ID r1 .

SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.

SELECT-OPTIONS: s_vend FOR lfa1-lifnr MODIF ID r2.

SELECT-OPTIONS: s_plan FOR plko-werks MODIF ID r2.

SELECTION-SCREEN: END OF BLOCK upd.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb1 EQ 'X'.

IF ( screen-name EQ 'S_CUST-LOW'

OR screen-name EQ 'S_CUST-HIGH'

OR screen-name EQ 'S_PLANT-LOW'

OR screen-name EQ 'S_PLANT-HIGH') .

screen-active = '1' .

ENDIF.

IF ( screen-name EQ 'S_VEND-LOW'

OR screen-name EQ 'S_VEND-HIGH'

OR screen-name EQ 'S_PLAN-LOW'

OR screen-name EQ 'S_PLAN-HIGH') .

screen-active = '0' .

ENDIF.

ELSEIF rb2 EQ 'X'.

IF ( screen-name EQ 'S_VEND-LOW'

OR screen-name EQ 'S_VEND-HIGH'

OR screen-name EQ 'S_PLAN-LOW'

OR screen-name EQ 'S_PLAN-HIGH') .

screen-active = '1' .

ENDIF.

IF ( screen-name EQ 'S_CUST-LOW'

OR screen-name EQ 'S_CUST-HIGH'

OR screen-name EQ 'S_PLANT-LOW'

OR screen-name EQ 'S_PLANT-HIGH') .

screen-active = '0' .

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regards,

Anil Salekar

Read only

Former Member
0 Likes
1,074

Hi,

You cannot use loop at screen, when you declare the parameters as obligatory. Instead you can check for inital and then proceed.

Regards,

Dhasarathy.

Read only

Former Member
0 Likes
1,074

Thanks