Application Development 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: 

Selection Screen Depeon Upon Radio Button

former_member303185
Participant
0 Kudos

How to display Selection Screen depend upon the Radiobutton Flag.

SELECTION-SCREEN BEGIN OF BLOCK OPTION WITH FRAME TITLE TEXT-T01.

PARAMETERS: <b>CUSTOMER</b> LIKE KNA1-LOEVM DEFAULT 'X'

RADIOBUTTON GROUP HIT.

PARAMETERS: <b>VENDOR</b> LIKE LFA1-LOEVM RADIOBUTTON GROUP HIT.

SELECTION-SCREEN END OF BLOCK OPTION.

SELECTION-SCREEN SKIP 0.

SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-T02 .

PARAMETERS : P_BUKRS TYPE T001-BUKRS DEFAULT 'EIS' OBLIGATORY.

  • "Company Code

SELECT-OPTIONS:

S_LAND1 FOR T005-LAND1 DEFAULT 'IT' OBLIGATORY,

  • "Country

S_SPMON FOR S031-SPMON, "Period

<b> S_KUNNR FOR KNA1-KUNNR, "Customer

S_LIFNR FOR LFA1-LIFNR, "Vendor</b> S_STCEG FOR KNA1-STCEG, "VAT Registration Number

S_STCD1 FOR KNA1-STCD1, "TAX Code1

S_STCD2 FOR KNA1-STCD2. "TAX Code2

SELECTION-SCREEN END OF BLOCK 1.

I want to diaplay <b>S_KUNNR</b> or <b>S_LIFNR</b> depend upon Radiobutton Flag.

Could any body help me.

Thanx in Advance.<b></b><b></b>

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can try this.



report zrich_0001.

tables: t005, s031, kna1, lfa1.

selection-screen begin of block option with frame title text-t01.
parameters: customer like kna1-loevm default 'X'
                 radiobutton group hit  user-command chk.   "<- ADD THIS
parameters: vendor like lfa1-loevm radiobutton group hit.
selection-screen end of block option.


selection-screen skip 0.
selection-screen begin of block 1 with frame title text-t02 .
parameters : p_bukrs type t001-bukrs default 'EIS' obligatory.
* "Company Code
select-options:
s_land1 for t005-land1 default 'IT' obligatory,
* "Country
s_spmon for s031-spmon,
s_kunnr for kna1-kunnr modif id kun, "<- ADD THIS
s_lifnr for lfa1-lifnr modif id lif, "<- ADD THIS
s_stcd1 for kna1-stcd1,                                     "TAX Code1
s_stcd2 for kna1-stcd2.                                     "TAX Code2
selection-screen end of block 1.


*  ADD ALL THIS

at selection-screen output.

  loop at screen.
    if customer = 'X'
        and screen-group1 = 'LIF'.
      screen-active = '0'.
      modify screen.
    endif.

    if vendor = 'X'
        and screen-group1 = 'KUN'.
      screen-active = '0'.
      modify screen.
    endif.



  endloop.


REgards,

Rich Heilman

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can try this.



report zrich_0001.

tables: t005, s031, kna1, lfa1.

selection-screen begin of block option with frame title text-t01.
parameters: customer like kna1-loevm default 'X'
                 radiobutton group hit  user-command chk.   "<- ADD THIS
parameters: vendor like lfa1-loevm radiobutton group hit.
selection-screen end of block option.


selection-screen skip 0.
selection-screen begin of block 1 with frame title text-t02 .
parameters : p_bukrs type t001-bukrs default 'EIS' obligatory.
* "Company Code
select-options:
s_land1 for t005-land1 default 'IT' obligatory,
* "Country
s_spmon for s031-spmon,
s_kunnr for kna1-kunnr modif id kun, "<- ADD THIS
s_lifnr for lfa1-lifnr modif id lif, "<- ADD THIS
s_stcd1 for kna1-stcd1,                                     "TAX Code1
s_stcd2 for kna1-stcd2.                                     "TAX Code2
selection-screen end of block 1.


*  ADD ALL THIS

at selection-screen output.

  loop at screen.
    if customer = 'X'
        and screen-group1 = 'LIF'.
      screen-active = '0'.
      modify screen.
    endif.

    if vendor = 'X'
        and screen-group1 = 'KUN'.
      screen-active = '0'.
      modify screen.
    endif.



  endloop.


REgards,

Rich Heilman

Former Member
0 Kudos

hI

Try this:

SELECTION-SCREEN BEGIN OF BLOCK OPTION WITH FRAME TITLE TEXT-T01.
PARAMETERS: CUSTOMER RADIOBUTTON GROUP HIT DEFAULT 'X' USER-COMMAND RAD.
PARAMETERS: VENDOR   RADIOBUTTON GROUP HIT.
SELECTION-SCREEN END OF BLOCK OPTION.


SELECTION-SCREEN SKIP 0.
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-T02 .
PARAMETERS : P_BUKRS TYPE T001-BUKRS DEFAULT 'EIS' OBLIGATORY.
* "Company Code
SELECT-OPTIONS:
S_LAND1 FOR T005-LAND1 DEFAULT 'IT' OBLIGATORY,
* "Country
S_SPMON FOR S031-SPMON, "Period
S_KUNNR FOR KNA1-KUNNR MODIF ID KUN, "Customer
S_LIFNR FOR LFA1-LIFNR MODIF ID LIF, "Vendor S_STCEG FOR KNA1-STCEG,
"VAT
S_STCD1 FOR KNA1-STCD1,                                     "TAX Code1
S_STCD2 FOR KNA1-STCD2.                                     "TAX Code2
SELECTION-SCREEN END OF BLOCK 1.

AT SELECTION-SCREEN OUTPUT.

  CASE 'X'.
    WHEN CUSTOMER.
      LOOP AT SCREEN.
        IF SCREEN-GROUP1 = 'LIF'.
          SCREEN-ACTIVE = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    WHEN VENDOR.
      LOOP AT SCREEN.
        IF SCREEN-GROUP1 = 'KUN'.
          SCREEN-ACTIVE = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
  ENDCASE.

Max