cancel
Showing results for 
Search instead for 
Did you mean: 

Selection-Screen

Former Member
0 Kudos

Hi all,

Advanced thanks to your reply

In my selection-screen 2 block

selection-screen: begin of block sel with frame title text-sel.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

selection-screen: end of block sel.

selection-screen: begin of block sel1 with frame title text-sec.

PARAMETERS : P_ATNAM LIKE CABN-ATNAM.

PARAMETERS : P_ATWRT LIKE AUSP-ATWRT.

PARAMETERS : P_ATINNR LIKE CABNT-ATINN DEFAULT 'XX_REGION'.

PARAMETERS : P_ATINNL LIKE CABNT-ATINN DEFAULT 'XX_LANG'.

selection-screen: end of block sel1.

my requirement is

execute my report i want see 1 block, the user enter value in this block then display 2 block ,

plz guide me, how to code for it

i look forward to your reply

Thanks

SEK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi raja

Use

at selection-screen on Block blockname

also u need to use check buttons

see this code

PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: p4(10) TYPE c MODIF ID bl2,

p5(10) TYPE c MODIF ID bl2,

p6(10) TYPE c MODIF ID bl2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF show_all <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

VijayasekarK
Active Participant
0 Kudos

Hi ,

As said by vijayasarathy using "AT SELECTION-SCREEN OUTPUT" event is the best and only way to handle your requirement.

Regards,

Vijay

Former Member
0 Kudos

Hi,

Thank u very much for your reply

initially i want display

selection-screen: begin of block sel with frame title text-sel.

PARAMETERS : P_MATNR LIKE MARA-MATNR MODIF ID BL1.

selection-screen: end of block sel.

user enter values in this P_MATNR then press enter

then disply

selection-screen: begin of block sel1 with frame title text-sec.

PARAMETERS : P_ATNAM LIKE CABN-ATNAM MODIF ID BL2 .

PARAMETERS : P_ATWRT LIKE AUSP-ATWRT MODIF ID BL2.

PARAMETERS : P_ATINNR LIKE CABNT-ATINN DEFAULT 'XX_REGION' MODIF ID BL2.

PARAMETERS : P_ATINNL LIKE CABNT-ATINN DEFAULT 'XX_LANG' MODIF ID BL2.

selection-screen: end of block sel1.

i don't want put any check box in this selection screen

plz guide me, how to code for it or send sample code

i look forward to your reply

Thanks

SEK

Former Member
0 Kudos

Hi again,

1. just copy paste this code

(Same parmeters/block as yours)

It works fantastic.

2.

REPORT abc.

*----


SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-sel.

PARAMETERS : p_matnr LIKE mara-matnr MODIF ID bl1.

SELECTION-SCREEN: END OF BLOCK sel.

SELECTION-SCREEN: BEGIN OF BLOCK sel1 WITH FRAME TITLE text-sec.

PARAMETERS : p_atnam LIKE cabn-atnam MODIF ID bl2 .

PARAMETERS : p_atwrt LIKE ausp-atwrt MODIF ID bl2.

PARAMETERS : p_atinnr LIKE cabnt-atinn DEFAULT 'XX_REGION' MODIF ID bl2.

PARAMETERS : p_atinnl LIKE cabnt-atinn DEFAULT 'XX_LANG' MODIF ID bl2.

SELECTION-SCREEN: end of block sel1.

data : entry type i.

DATA : inv TYPE i.

*----


AT SELECTION-SCREEN OUTPUT.

*------ check entry

IF p_matnr IS INITIAL.

entry = 1.

inv = 0.

ELSE.

entry = 0.

inv = 1.

ENDIF.

*----


show / hide

LOOP AT SCREEN.

WRITE : screen-name , screen-group1.

IF screen-group1 = 'BL2'.

screen-invisible = entry.

screen-input = inv.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.

Former Member
0 Kudos

just paste amits code , it working fine

Answers (6)

Answers (6)

sreemsft
Contributor
0 Kudos

Hi Raja Sekhar,

Check this code on selection screen.


report  zsree_selection                         .

tables: vbak.

data: v_spart type vbak-spart,  " Division
      v_vbeln type vbak-vbeln,  " Sales document
      v_bstkd type vbkd-bstkd,  " Customer purchase order number
      v_kunnr type vbak-kunnr,  " Customer number 1
      v_werks type vbap-werks,  " Plant (own or external)
      v_lifsk type vbak-lifsk,  " Delivery block
      v_lfgsk type vbuk-lfgsk,  " Delivery block (Document Header)
      v_lfgsa type vbup-lfgsa,  " Overall delivery status of the item
      v_spart1 type vbap-spart, " Division
      v_prctr type vbap-prctr.  " Profit Center

*--- SELECTION OPTIONS ---------------------------------------

selection-screen begin of block b1 with frame title text-001.
select-options: s_vbeln for vbak-vbeln modif id xyz."Sales order number
selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-002.
parameters: p_radio1 radiobutton group g1 default 'X' modif id xyz
                                          user-command kant,
            p_radio2 radiobutton group g1 modif id xyz.
selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-003.
parameters: p_check1 as checkbox modif id abc user-command sree,
            p_check2 as checkbox modif id abc user-command babu.
selection-screen end of block b3.

selection-screen begin of block b4 with frame title text-004.
selection-screen begin of line.
selection-screen comment 1(15) text-001 for field p_sree.
parameters: p_sree type c.
selection-screen comment 30(15) text-001 for field p_kant.
parameters: p_kant type c.
selection-screen end of line.
selection-screen end of block b4.

*--------------------------------------------
*  Tabbed Screen
*--------------------------------------------

*---Subscreen 1
selection-screen begin of screen 310 as subscreen.
selection-screen begin of block b5 with frame.
select-options:  s_vbeln1 for v_vbeln,  " Sales document
                 s_bstkd for v_bstkd,  " Customer purchase
                 s_kunnr for v_kunnr,  " Customer number
                 s_werks for v_werks,  " Plant (Own or External)
                 s_lifsk for v_lifsk.  " Delivery block
" (document header)
selection-screen end of block b5.
selection-screen end of screen 310.

*---Subscreen 2
selection-screen begin of screen 320 as subscreen.
selection-screen begin of block b6 with frame.
select-options:  s_lfgsk for v_lfgsk,  " Delivery block
                 s_lfgsa for v_lfgsa,  " Overall delivery
                 s_spart1 for v_spart1, " Division
                 s_prctr for v_prctr.  " Profit center
selection-screen end of block b6.
selection-screen end of screen 320.

*---Tab 3 for Selection screen
selection-screen: begin of tabbed block mytab for 7 lines,
                  tab (20) button1 user-command push1,
                  tab (20) button2 user-command push2,
                  end of block mytab.

*-------------------------------------
* Initialization
*-------------------------------------

initialization.
perform initialization.

*-------------------------------------
* At Selection Screen
*-------------------------------------

at selection-screen.
perform at_selection_screen.

*-------------------------------------
* At Selection Screen Output
*-------------------------------------

at selection-screen output.
  if p_radio1 = 'X'.
    loop at screen.
      check screen-group1 = 'ABC'.
      screen-active = 0.
      p_check1 = ' '.
      p_check2 = ' '.
      modify screen.
    endloop.
  endif.
  if p_radio2 = 'X'.
    loop at screen.
      check screen-group1 = 'ABC'.
      screen-active = '1'.
      modify screen.
    endloop.
  endif.

  if p_check1 = 'X'.
    loop at screen.
      if screen-name = 'S_VBELN-LOW'.
        screen-active = '0'.
        modify screen.
      endif.
    endloop.
  endif.
  if p_check2 = 'X'.
    loop at screen.
      if screen-name = 'S_VBELN-HIGH'.
        screen-active = '0'.
        modify screen.
      endif.
    endloop.
  endif.

*PARAMETERS CONNID LIKE SBOOK-CONNID VALUE CHECK.  " This will Check the
*value from Database

*PARAMETERS p TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 20.  " this
*will declare as list box.

*SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
*

*&---------------------------------------------------------------------*
*&      Form  INITIALIZATION
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form initialization .
  button1 = text-003.            " Button1 Text
  button2 = text-002.            " Button2 Text
  mytab-prog = sy-repid.         " Program Name
  mytab-dynnr = 310.             " Default Screen
  mytab-activetab = 'BUTTON1'.   " Default Tab
endform.                    " INITIALIZATION

*&---------------------------------------------------------------------*
*&      Form  AT_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form at_selection_screen .

*---Choosing A Particular Screen When Clicking On A Particular Button
  case sy-ucomm.
    when 'PUSH1'.
      mytab-dynnr = 310.
      mytab-activetab = 'BUTTON1'.
    when 'PUSH2'.
      mytab-dynnr = 320.
      mytab-activetab = 'BUTTON2'.
  endcase.

endform.                    " AT_SELECTION_SCREEN

Thanks,

Sreekanth

Former Member
0 Kudos

hi

AT SELECTION-SCREEN OUTPUT

is the best option

regs

Arun

Former Member
0 Kudos

Use following logic

at selection-screen output.

LOOP AT SCREEN.

if screen-name = 'p_matnr'.

if p_atnam eq space.

screen-invisible = 1.

else.

screen-invisible = 0.

endif.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

The parameter in the second box will be hidden till you populate parameter in the first block.

Former Member
0 Kudos

Hi raja,

1. to get the taste how to do it,

try this simple code (just copy paste)

the imoprtant things in this code are:

  • modif id

  • screen table

  • invisible and input fields of screen table

  • validation if user has entered something in block 1

2.

REPORT abc.

*----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS : a TYPE c MODIF ID m1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS : b TYPE c MODIF ID m2.

SELECTION-SCREEN END OF BLOCK b2.

DATA : entry TYPE i.

DATA : inv TYPE i.

*----


AT SELECTION-SCREEN OUTPUT.

*------ check entry

IF a IS INITIAL.

entry = 1.

inv = 0.

ELSE.

entry = 0.

inv = 1.

ENDIF.

*----


show / hide

LOOP AT SCREEN.

WRITE : screen-name , screen-group1.

IF screen-group1 = 'M2'.

screen-invisible = entry.

screen-input = inv.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.

Message was edited by: Amit Mittal

Former Member
0 Kudos

Dear Raja,

Write the code in event AT-SELECTION SCREEN OUTPUT. Its PBO for selection-screen and you can handle LOOP AT SCREEN to acheive what you want.

Regards,

Deva.

Former Member
0 Kudos

Hi,

Put the code for the second block in the AT selection-screen event.

Hope it helps..

Lokesh

Pls. reward appropriate points

Former Member
0 Kudos

Hi Lokesh,

Thank u very much for your reply

plz send the code sample for this

i look forward to your reply

reword points

Thanks

SEK

Former Member
0 Kudos

Hi,

selection-screen: begin of block sel with frame title text-sel.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

selection-screen: end of block sel.

AT Selection-screen on BLOCK se1.

selection-screen: begin of block sel1 with frame title text-sec.

PARAMETERS : P_ATNAM LIKE CABN-ATNAM.

PARAMETERS : P_ATWRT LIKE AUSP-ATWRT.

PARAMETERS : P_ATINNR LIKE CABNT-ATINN DEFAULT 'XX_REGION'.

PARAMETERS : P_ATINNL LIKE CABNT-ATINN DEFAULT 'XX_LANG'.

selection-screen: end of block sel1.

AT selection-screen on block se11.

Start of selection

program logic

.....

end of selection

Hope it helps...

Lokesh

Pls. reward appropriate points