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

Former Member
0 Likes
1,074

Hello Gurus,

Please execute in your system.

This is the way i hve declared my selection screen.

DATA:

g_matnr TYPE matnr, "Material Number

g_asnum TYPE asmd-asnum, "Service Number

g_konnr TYPE ekpo-konnr, "Storage Location

g_noun TYPE /ds1/noun_key, "Outline Agreement Number

g_matkl TYPE matkl, "Material Group

g_bismt TYPE mara-bismt, "Global Mesc

g_lmesc TYPE /ds1/lmesc, "Local Mesc

g_lmatnr TYPE /ds1/lmatnr, "Legacy Material Number

g_ernam TYPE ernam, "Created By

g_erdat TYPE erdat, "Created On

g_mtart TYPE mtart, "Material Type

g_meins TYPE meins, "Unit Of Measure

g_group TYPE char3, "Screen attribute

g_file TYPE string,

g_path TYPE string,

g_type type string,

g_count type i.

************************************************************************

  • SELECTION SCREEN DECLARATION *

************************************************************************

*Selection-screen block Report Selection

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:

rb_mat RADIOBUTTON GROUP rg1 DEFAULT 'X' USER-COMMAND usr. "Material

SELECTION-SCREEN COMMENT (13) FOR FIELD rb_mat.

PARAMETERS:

rb_serv RADIOBUTTON GROUP rg1 . "Service

SELECTION-SCREEN COMMENT (13) FOR FIELD rb_serv.

SELECTION-SCREEN END OF LINE.

PARAMETERS:

p_spras TYPE spras OBLIGATORY DEFAULT 'EN'. "Language Key

SELECTION-SCREEN END OF BLOCK b1.

*Selection-screen block Main Selection Criteria

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:

rb_scr RADIOBUTTON GROUP rg2 DEFAULT 'X' USER-COMMAND usr."On Screen

SELECTION-SCREEN COMMENT (30) FOR FIELD rb_scr.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS:s_matnr FOR g_matnr MODIF ID bt1, "Material Number

s_asnum FOR g_asnum MODIF ID bt2, "Service Number

s_konnr FOR g_konnr MODIF ID scr, "Outline Agreement Number

s_noun FOR g_noun NO INTERVALS MATCHCODE OBJECT /DS1/MM_NOUN_MOD MODIF ID scr, "Noun Modifier

s_matkl FOR g_matkl MODIF ID scr, "Material Group

s_bismt FOR g_bismt MODIF ID bt1, "Global Mesc

s_lmesc FOR g_lmesc MODIF ID bt1, "Local Mesc

s_lmatnr FOR g_lmatnr MODIF ID bt1. "Legacy Number

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:

rb_file RADIOBUTTON GROUP rg2 . "Input File

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_file.

SELECTION-SCREEN END OF LINE.

PARAMETERS:

p_fpath TYPE rlgrap-filename MODIF ID txt.

SELECTION-SCREEN END OF BLOCK b2.

*Selection-screen block Secondary Seletion Criteria

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECT-OPTIONS:s_ernam FOR g_ernam, "Created By

s_erdat FOR g_erdat, "Created On

s_mtart FOR g_mtart, "Material Type

s_meins FOR g_meins. "Unit Of Measure

PARAMETERS:p_ignore TYPE char1 AS CHECKBOX. "Ignore deleted Items

SELECTION-SCREEN END OF BLOCK b3.

*Selection-screen block Report Format Required

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_full RADIOBUTTON GROUP rg3 DEFAULT 'X'. "Full Buying Description

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_full.

PARAMETERS:p_gmesc TYPE char1 AS CHECKBOX MODIF ID chk."Global Mesc Number

SELECTION-SCREEN COMMENT (25) FOR FIELD p_gmesc.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_short RADIOBUTTON GROUP rg3. "Short Description

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_short.

PARAMETERS:p_lmesc TYPE char1 AS CHECKBOX MODIF ID chk.

SELECTION-SCREEN COMMENT (25) FOR FIELD p_lmesc. "Local Mesc Number

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN POSITION 29 .

PARAMETERS:p_lmatnr TYPE char1 AS CHECKBOX MODIF ID chk."Legacy Number

SELECTION-SCREEN COMMENT (25) FOR FIELD p_lmatnr.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b4.

*Selection-screen block Sorting Criteria

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_num RADIOBUTTON GROUP rg4. "GSAP Number

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_num.

PARAMETERS:rb_legac RADIOBUTTON GROUP rg4 MODIF ID rbg. "Legacy Number

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_legac.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_bismt RADIOBUTTON GROUP rg4 MODIF ID rbg. "Global Mesc Number

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_bismt.

PARAMETERS:rb_infil RADIOBUTTON GROUP rg4 MODIF ID xyz.

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_infil. "Input File

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_lmesc RADIOBUTTON GROUP rg4 MODIF ID rbg. "Local Mesc Number

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_lmesc.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b5.

*Selection-screen block Layout

SELECTION-SCREEN BEGIN OF BLOCK b6 WITH FRAME TITLE text-006.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_ban RADIOBUTTON GROUP rg5 DEFAULT 'X'. "With Banner

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_ban.

PARAMETERS:rb_noban RADIOBUTTON GROUP rg5. "Without Banner

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_noban.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b6.

*Selection-screen block Output

SELECTION-SCREEN BEGIN OF BLOCK b7 WITH FRAME TITLE text-007.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_onscr RADIOBUTTON GROUP rg6 DEFAULT 'X' USER-COMMAND usr1. "Onscreen

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_onscr.

PARAMETERS:rb_doc RADIOBUTTON GROUP rg6. "Save as .doc

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_doc.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_txt RADIOBUTTON GROUP rg6. "Save as .txt

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_txt.

PARAMETERS:rb_rtf RADIOBUTTON GROUP rg6. "Save as .rtf

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_rtf.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:rb_xls RADIOBUTTON GROUP rg6. "Save as .xls

SELECTION-SCREEN COMMENT (25) FOR FIELD rb_xls.

SELECTION-SCREEN END OF LINE.

PARAMETERS:

p_dnload TYPE rlgrap-filename MODIF ID dnl, "Download path

p_count type i no-display.

SELECTION-SCREEN END OF BLOCK b7.

AT SELECTION-SCREEN OUTPUT.

  • If Material Radiobutton is selected

IF rb_mat = 'X'.

  • Select-options related to Service disappears

LOOP AT SCREEN.

IF screen-group1 = 'BT2'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

  • If Service Radiobutton is selected

ELSEIF rb_serv = 'X'.

  • Select-options related to Material disappears

LOOP AT SCREEN.

IF screen-group1 = 'BT1'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'CHK'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'RBG'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

  • If radiobutton selection criteria on screen is selectd

IF rb_scr = 'X'.

  • Radiobutton Input File in block b5 disappears

LOOP AT SCREEN.

IF screen-group1 = 'XYZ'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'TXT'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

  • If radiobutton Extract from input file is selectd

ELSEIF rb_file = 'X'.

  • Radiobutton Input File in block b5 is displayed

LOOP AT SCREEN.

IF screen-group1 = 'XYZ'.

screen-input = 1.

ENDIF.

IF screen-group1 = 'TXT'.

screen-input = 1.

ENDIF.

IF screen-group1 = 'BT1'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'BT2'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'SCR'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

  • Radiobutton Onscreen is selected.

IF rb_onscr = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'DNL'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 = 'DNL'.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

  • Raise an error message if nothing is selected in MAin selection criteria

*AT SELECTION-SCREEN ON BLOCK b2.

  • IF rb_mat = 'X'.

  • IF ( s_matnr IS INITIAL ) AND

  • ( s_konnr IS INITIAL ) AND

  • ( s_noun IS INITIAL ) AND

  • ( s_matkl IS INITIAL ) AND

  • ( s_bismt IS INITIAL ) AND

  • ( s_lmesc IS INITIAL ) AND

  • ( s_lmatnr IS INITIAL ) .

  • MESSAGE e022 WITH 'No selections, please consider report run-time'.

  • ENDIF.

  • ELSEIF rb_serv = 'X'.

  • IF ( s_asnum IS INITIAL ) AND

  • ( s_konnr IS INITIAL ) AND

  • ( s_noun IS INITIAL ) AND

  • ( s_matkl IS INITIAL ) .

*

*

  • MESSAGE e022 WITH 'No selections, please consider report run-time'.

  • ENDIF.

  • ENDIF.

My requirement is

1)In first block if service radiobutton is selected then

corresponding fields shud be ready for input and vice versa.

2)After selecting radiobutton if nothing is entered in second block raise an error message saying 'enter atleast one select option'.

3)once if the 2 above are working i shud enter the values for the select options and if i press F8 then only the program shud run.

I have tried with the commented code.but not working.

Full points will be given if anyone solves my problem..

Thanks in advance.....

11 REPLIES 11
Read only

Former Member
0 Likes
1,006

Anyone reply,...Please.....

Read only

0 Likes
1,006

Hi,

Just check this loop.

LOOP AT SCREEN.

IF screen-group1 = 'BT2'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP

1.write the endif after modify screen and check other things.

Regards,

Shiva Kumar

Read only

Former Member
0 Likes
1,006

hi madan,

May be u can check Radiobutton not in the ON BLOCK event but in the ON RADIOBUTTON GROUP Event. That will help you to Arrange your code more sytamatically.

Hope this will help.

Reward if useful.

Sumit Agarwal

Read only

Former Member
0 Likes
1,006

Hi Madan Mohan,

you try this ,

AT SELECTION-SCREEN.

IF rb_mat = 'X'.

  • Here check the fields initial or not if the field is initial then

give an Error message

if <parameter_1> is initial or <parameter_2> is initial or

<parameter_3> is initial.

message 'Enter all required fields' type 'E'.

endif.

ENDIF.

Like this you check for all the radio buttons.

Regards ,

Rajitha.

Read only

Former Member
0 Likes
1,006

Hi see this report and write the logic for ur report

TABLES EKKO.

********END OF DATA DECLARATIONS*********

********SELECTION SCREEN DESIGN ***********

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.

SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R2 RADIOBUTTON GROUP G1.

SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

******END OF SELECTION SCREEN DESIGN****************

***********SCREEN MODIFICATIONS*******************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

********END OF SCREEN MODIFICATIONS*****************

Read only

Former Member
0 Likes
1,006

Hi see this report and write the logic for ur report

TABLES EKKO.

********END OF DATA DECLARATIONS*********

********SELECTION SCREEN DESIGN ***********

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.

SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND UC!.

SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R2 RADIOBUTTON GROUP G1.

SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

******END OF SELECTION SCREEN DESIGN****************

***********SCREEN MODIFICATIONS*******************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

********END OF SCREEN MODIFICATIONS*****************

execute this small program and you can find that diff and how to write the code for selection screen

Read only

Former Member
0 Likes
1,006

Hi madhan mohan,

Select-options related to Service disappears

LOOP AT SCREEN.

IF rb_mat = 'X'.

IF screen-group1 = 'BT2'.

screen-input = 0.

else.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

endif.

ENDLOOP.

you tried to all radio buttons like above

it will helpful you

Thanks &regards

Bhupal.

Read only

Former Member
0 Likes
1,006

Hi Guys,

First of all thanks for your reply.But none of them solved my problem.Please execute the piece of code in ur sys and u will come to know abt my problem....

Thanks

Read only

Subhankar
Active Contributor
0 Likes
1,006

Hi,

Please try it like this way. I think it will be working fine. Please let us know your feedback.

AT SELECTION-SCREEN OUTPUT.

  • If Material Radiobutton is selected

LOOP AT SCREEN.

  • Select-options related to Service disappears

IF rb_mat = 'X'.

IF screen-group1 = 'BT2'.

screen-input = 0.

ENDIF.

  • If Service Radiobutton is selected

ELSEIF rb_serv = 'X'.

  • Select-options related to Material disappears

IF screen-group1 = 'BT1'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'CHK'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'RBG'.

screen-input = 0.

ENDIF.

ENDIF.

  • If radiobutton selection criteria on screen is selectd

IF rb_scr = 'X'.

  • Radiobutton Input File in block b5 disappears

IF screen-group1 = 'XYZ'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'TXT'.

screen-input = 0.

ENDIF.

  • If radiobutton Extract from input file is selectd

ELSEIF rb_file = 'X'.

  • Radiobutton Input File in block b5 is displayed

IF screen-group1 = 'XYZ'.

screen-input = 1.

ENDIF.

IF screen-group1 = 'TXT'.

screen-input = 1.

ENDIF.

IF screen-group1 = 'BT1'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'BT2'.

screen-input = 0.

ENDIF.

IF screen-group1 = 'SCR'.

screen-input = 0.

ENDIF.

ENDIF.

  • Radiobutton Onscreen is selected.

IF rb_onscr = 'X'.

IF screen-group1 = 'DNL'.

screen-input = 0.

ENDIF.

ELSE.

IF screen-group1 = 'DNL'.

screen-input = 1.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

AT SELECTION-SCREEN ON BLOCK b2.

IF sy-ucomm = 'ONLI' OR sy-ucomm = ''.

IF rb_mat = 'X'.

IF ( s_matnr IS INITIAL ) AND

( s_konnr IS INITIAL ) AND

( s_noun IS INITIAL ) AND

( s_matkl IS INITIAL ) AND

( s_bismt IS INITIAL ) and

( s_lmesc IS INITIAL ) AND

( s_lmatnr IS INITIAL ) .

MESSAGE e000 WITH 'No selections, please consider report run-time'.

ENDIF.

ELSEIF rb_serv = 'X'.

IF ( s_asnum IS INITIAL ) AND

( s_konnr IS INITIAL ) AND

( s_noun IS INITIAL ) AND

( s_matkl IS INITIAL ) .

MESSAGE e000 WITH 'No selections, please consider report run-time'.

ENDIF.

ENDIF.

ENDIF.

Thank & Regard

Subhankar

Read only

Former Member
0 Likes
1,006

Hi,

Its working.But it solved 50 % of my problem.Now,if i run the report without any inputs it is giving an error message and block b2 is ready for input.Upto here it is fine.

Now if i enter a valid material number and press enter it is executing the report.But actually it shud open the rest of inputs.

This occurs if your pgm have any start-of-selection event..

Instead of that it is directly going to Star-of -selection event.

Can u solve this one also..?

Thanks a lot atleast u have solved one of my issue.

Read only

Former Member
0 Likes
1,006

Reply please................