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: 

reg selection screen

Former Member
0 Kudos
290

Hi guys..,

i have 2 radio buttons on selection screen.

1) sales order details,

2) purchase order details.

if we select radio button purchase order only fields of relevent selection criteria for purchase should populate in selection screen.(eg: ekko-vgbel)..,

my main problem is i can use..SCREEN-invisible based on group's...

but my fields are mandatory .., even when they are in invisible..., its populating message fields are mandatory(on sales side which are invisable at that point of time)..., how can i solve this problem...,

guys here is the code i am using...,

this is syntatically correct so please copy into your system and check..,when i change radio buttons it causes problem

REPORT Z_TEST_1 NO STANDARD PAGE HEADING

LINE-SIZE 254

LINE-COUNT 0

MESSAGE-ID ZZ.

*Variable *Declartion **

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

DATA : V_CREDAT TYPE EDIDC-CREDAT,

V_MESTYP TYPE EDMSG-MSGTYP,

V_EKORG TYPE T024E-EKORG, "MOD-002+++

V_BUKRS TYPE T001-BUKRS, "MOD-002+++

V_IDOC_STS TYPE /FACTGLB/GTO_IDOC_STATUS,

V_TTYP TYPE CHAR2, "TRIGER TYPE MOD-002+++

  • Screen fields.

V_DATE_LOW TYPE SYDATUM,

V_DATE_HIGH TYPE SY-DATUM,

V_MSO_TOT TYPE INT4,

V_MSO_COMP TYPE INT4,

V_MSO_INCOMP TYPE INT4,

V_DSO_TOT TYPE INT4,

V_DSO_COMP TYPE INT4,

V_DSO_INCOMP TYPE INT4,

V_INV_TOT TYPE INT4,

V_ACC_DOC TYPE INT4,

V_NO_ACC_DOC TYPE INT4.

SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE TEXT-028.

PARAMETERS: RB_SAL RADIOBUTTON GROUP RADI DEFAULT 'X' USER-COMMAND UC,

RB_PUR RADIOBUTTON GROUP RADI .

SELECTION-SCREEN END OF BLOCK ONE.

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

SELECT-OPTIONS : S_CREDAT FOR V_CREDAT OBLIGATORY DEFAULT

SY-DATUM TO SY-DATUM ,

S_MESTYP FOR V_MESTYP , "mod-001

S_STATUS FOR V_IDOC_STS NO INTERVALS .

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE TEXT-027.

SELECT-OPTIONS : S_EKORG FOR V_EKORG OBLIGATORY MODIF ID ABC,

"Purchasing Org

S_BUKRS FOR V_BUKRS MODIF ID ABC.

"Company Code

SELECTION-SCREEN END OF BLOCK TWO.

  • Begin of mod-002+++.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.

SELECT-OPTIONS: S_TYP1 FOR V_TTYP NO INTERVALS MODIF ID ABC.

SELECTION-SCREEN END OF BLOCK B3.

  • End of mod-002+++.

SELECTION-SCREEN BEGIN OF BLOCK THREE WITH FRAME TITLE TEXT-026.

PARAMETERS : P_VKORG TYPE TVKO-VKORG OBLIGATORY

VALUE CHECK

MODIF ID XYZ ,

P_SPART TYPE TSPA-SPART VALUE CHECK MODIF ID XYZ ,

P_KUNNR TYPE KNA1-KUNNR VALUE CHECK MODIF ID XYZ .

SELECTION-SCREEN END OF BLOCK THREE.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002. "Selection

"criteria

PARAMETERS : CB_INCOM TYPE CHAR1 AS CHECKBOX MODIF ID XYZ,

CB_BILL TYPE CHAR1 AS CHECKBOX MODIF ID XYZ.

SELECTION-SCREEN END OF BLOCK B2.

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

      • SELECTION SCREEN VALIDATIONS ***

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

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN .

IF RB_SAL = 'X'.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INPUT = '0'.

screen-active = '0' .

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ELSEIF SCREEN-GROUP1 = 'XYZ'. "MOD-002+++

SCREEN-INPUT = '0'.

screen-active = '0' .

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

swetha

Message was edited by:

Swetha YALA

1 ACCEPTED SOLUTION

harishaginati
Explorer
0 Kudos
262

i guess you can't ful fill you'r criteria..., unless you design you screen using modulepool with diffrent tabs for sales and purchase..,

cheers,

Harish

14 REPLIES 14

Former Member
0 Kudos
262

Hi swetha,

try this:

  • here XXXX contains the names of the purchase order block

If saleorder = 'X'.

loop at screen.

if screen-group1 = 'XXX' or

screen-group1 = 'XXXX'.

screen-active = 0.

modifyscreen.

endif.

endif.

  • here XXXX contains the names of the salesorder block

if purchaseorder = 'X'.

loop at screen.

if screen-group1 = 'XXX' or

screen-group1 = 'XXXX'.

screen-active = 0.

modifyscreen.

endif.

endif.

Hope this helps you. reply for queries. shall post the updates.

Regards,

Ravi

0 Kudos
262

no this z causing same problem...,

its asking to enter mandatory fields(of sales) when i click on purchasing block

swetha

0 Kudos
262

Hello,

In that case then when u select the radiobutton 2 make the values for the radiobutton1 related parameters as 0.

i.e.

make screen-input = 0. for that then it'll not check the mandatory condition as the input is not available.

Regards,

Deepu.K

0 Kudos
262

hi thx for u'r update..,

even if input = 0 it will check for mandatory condition...,

cheers,

swetha

0 Kudos
262

Hello,

I tried this code.It works for me.

U too try it in the same way .


PARAMETERS: p_matnr TYPE matnr.
PARAMETERS: p_string TYPE char10 OBLIGATORY.

DATA: lv_matnr TYPE matnr.

AT SELECTION-SCREEN OUTPUT .

  LOOP AT SCREEN .
    IF screen-name = 'P_STRING'.
      screen-active = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.


START-OF-SELECTION.
  SELECT SINGLE matnr FROM mara INTO lv_matnr WHERE matnr = p_matnr.
  IF sy-subrc = 0.
    WRITE p_matnr.
  ENDIF.

Regards,
Deepu.K

0 Kudos
262

Hello Swetha,

U could set SCREEN-ACTIVE and SCREEN-INPUT to 0.

Kindly reward if it helps.

Regards,

Johnson

Former Member
0 Kudos
262

Hi

Remove the command OBLIGATORY in the selection screen against those fields

and write the code in At seelction screen:

if r_so = 'X'

<validate sales order related fields

and issue a message such that when there is no value entered in mandatory fields gives a error/warning message>.

if s_vbeln[] is initial.

message...

endif.

else.

<validate purchase order related fields

and issue a message such that when there is no value entered in mandatory fields gives a error/warning message>.

endif.

Reward points if useful

Regards

Anji

0 Kudos
262

but how do user know which fields are mandatory...,

Former Member
0 Kudos
262

make them non-mandatory when ever a field is invisible using the same screen table.

It will solve ur problem na.

Former Member
0 Kudos
262

if radiobutton1 = 'X'.

select queries.

elseif radiobutton2 = 'X'.

select Queries.

endif.

Reward with points.

Former Member
0 Kudos
262

> Hi guys..,

> i have 2 radio buttons on selection screen.

> 1) sales order details,

> 2) purchase order details.

>

> if we select radio button purchase order only fields

> of relevent selection criteria for purchase should

> populate in selection screen.(eg: ekko-vgbel)..,

>

> my main problem is i can use..SCREEN-invisible based

> on group's...

> but my fields are mandatory .., even when they are in

> invisible..., its populating message fields are

> mandatory(on sales side which are invisable at that

> point of time)..., how can i solve this problem...,

>

>

> guys here is the code i am using...,

> this is syntatically correct so please copy into your

> system and check..,when i change radio buttons it

> causes problem

>

> REPORT Z_TEST_1 NO STANDARD PAGE HEADING

> LINE-SIZE 254

> LINE-COUNT 0

> MESSAGE-ID ZZ.

> *****************************************************

>

> iable *Declartion **

> ******************************************************

> ***

>

> DATA : V_CREDAT TYPE EDIDC-CREDAT,

> V_MESTYP TYPE EDMSG-MSGTYP,

> V_EKORG TYPE T024E-EKORG,

> "MOD-002+++

> 001-BUKRS, "MOD-002+++

> V_IDOC_STS TYPE /FACTGLB/GTO_IDOC_STATUS,

> V_TTYP TYPE CHAR2, "TRIGER TYPE MOD-002+++

>

> * Screen fields.

>

> V_DATE_LOW TYPE SYDATUM,

> V_DATE_HIGH TYPE SY-DATUM,

> V_MSO_TOT TYPE INT4,

> V_MSO_COMP TYPE INT4,

> V_MSO_INCOMP TYPE INT4,

> V_DSO_TOT TYPE INT4,

> V_DSO_COMP TYPE INT4,

> V_DSO_INCOMP TYPE INT4,

> V_INV_TOT TYPE INT4,

> V_ACC_DOC TYPE INT4,

> V_NO_ACC_DOC TYPE INT4.

>

> SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE

> TEXT-028.

>

>

> PARAMETERS: RB_SAL RADIOBUTTON GROUP RADI DEFAULT 'X'

> USER-COMMAND UC,

> RB_PUR RADIOBUTTON GROUP RADI .

> N-SCREEN END OF BLOCK ONE.

>

> SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE

> TEXT-001. "Selection "criteria

>

> SELECT-OPTIONS : S_CREDAT FOR V_CREDAT OBLIGATORY

> DEFAULT

> SY-DATUM TO SY-DATUM

> ,

> S_MESTYP FOR V_MESTYP ,

> "mod-001

> STATUS FOR V_IDOC_STS NO INTERVALS .

>

> SELECTION-SCREEN END OF BLOCK B1.

>

>

> SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE

> TEXT-027.

> SELECT-OPTIONS : S_EKORG FOR V_EKORG OBLIGATORY MODIF

> ID ABC,

> "Purchasing Org

> S_BUKRS FOR V_BUKRS MODIF ID ABC.

> SELECTION-SCREEN END OF BLOCK TWO.

>

> * Begin of mod-002+++.

> SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE

> TEXT-030.

> SELECT-OPTIONS: S_TYP1 FOR V_TTYP NO INTERVALS MODIF

> ID ABC.

>

> SELECTION-SCREEN END OF BLOCK B3.

> * End of mod-002+++.

>

> SELECTION-SCREEN BEGIN OF BLOCK THREE WITH FRAME

> TITLE TEXT-026.

>

> PARAMETERS : P_VKORG TYPE TVKO-VKORG

> OBLIGATORY

> VALUE CHECK

> MODIF ID XYZ ,

> P_SPART TYPE TSPA-SPART VALUE

> CHECK MODIF ID XYZ ,

> P_KUNNR TYPE KNA1-KUNNR VALUE

> CHECK MODIF ID XYZ .

>

>

> SELECTION-SCREEN END OF BLOCK THREE.

>

> SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE

> TEXT-002. "Selection

> "criteria

>

> PARAMETERS : CB_INCOM TYPE CHAR1 AS CHECKBOX

> MODIF ID XYZ,

> CB_BILL TYPE CHAR1 AS CHECKBOX

> MODIF ID XYZ.

>

> SELECTION-SCREEN END OF BLOCK B2.

>

> ******************************************************

> ***

> *** SELECTION SCREEN VALIDATIONS

> ***

> **********************************

>

> AT SELECTION-SCREEN OUTPUT.

>

> LOOP AT SCREEN .

> IF RB_SAL = 'X'.

> IF SCREEN-GROUP1 = 'ABC'.

> SCREEN-INPUT = '0'.

> screen-active = '0' .

> SCREEN-INVISIBLE = '1'.

> MODIFY SCREEN.

> ENDIF.

> ELSEIF SCREEN-GROUP1 = 'XYZ'.

> "MOD-002+++

> .

> screen-active = '0' .

> SCREEN-INVISIBLE = '1'.

> MODIFY SCREEN.

> DIF.

> ENDLOOP.

>

> swetha

>

> Message was edited by:

> Swetha YALA

hi swetha,

you can't disable the manditory fields while using selection-screen OUTPUT.

madhukar.

harishaginati
Explorer
0 Kudos
262

use this now.,

REPORT Z_TEST_1 NO STANDARD PAGE HEADING

LINE-SIZE 254

LINE-COUNT 0

MESSAGE-ID ZZ.

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

*Variable *Declartion **

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

DATA : V_CREDAT TYPE EDIDC-CREDAT,

V_MESTYP TYPE EDMSG-MSGTYP,

V_EKORG TYPE T024E-EKORG, "MOD-002+++

V_BUKRS TYPE T001-BUKRS, "MOD-002+++

V_IDOC_STS TYPE /FACTGLB/GTO_IDOC_STATUS,

V_TTYP TYPE CHAR2, "TRIGER TYPE MOD-002+++

  • Screen fields.

V_DATE_LOW TYPE SYDATUM,

V_DATE_HIGH TYPE SY-DATUM,

V_MSO_TOT TYPE INT4,

V_MSO_COMP TYPE INT4,

V_MSO_INCOMP TYPE INT4,

V_DSO_TOT TYPE INT4,

V_DSO_COMP TYPE INT4,

V_DSO_INCOMP TYPE INT4,

V_INV_TOT TYPE INT4,

V_ACC_DOC TYPE INT4,

V_NO_ACC_DOC TYPE INT4.

SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE TEXT-028.

PARAMETERS: RB_SAL RADIOBUTTON GROUP RADI DEFAULT 'X' USER-COMMAND UC,

RB_PUR RADIOBUTTON GROUP RADI .

SELECTION-SCREEN END OF BLOCK ONE.

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

SELECT-OPTIONS : S_CREDAT FOR V_CREDAT OBLIGATORY DEFAULT

SY-DATUM TO SY-DATUM ,

S_MESTYP FOR V_MESTYP , "mod-001

S_STATUS FOR V_IDOC_STS NO INTERVALS .

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE TEXT-027.

SELECT-OPTIONS : S_EKORG FOR V_EKORG OBLIGATORY MODIF ID ABC,

"Purchasing Org

S_BUKRS FOR V_BUKRS MODIF ID ABC.

"Company Code

SELECTION-SCREEN END OF BLOCK TWO.

  • Begin of mod-002+++.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.

SELECT-OPTIONS: S_TYP1 FOR V_TTYP NO INTERVALS MODIF ID ABC.

SELECTION-SCREEN END OF BLOCK B3.

  • End of mod-002+++.

SELECTION-SCREEN BEGIN OF BLOCK THREE WITH FRAME TITLE TEXT-026.

PARAMETERS : P_VKORG TYPE TVKO-VKORG OBLIGATORY

VALUE CHECK

MODIF ID XYZ ,

P_SPART TYPE TSPA-SPART VALUE CHECK MODIF ID XYZ ,

P_KUNNR TYPE KNA1-KUNNR VALUE CHECK MODIF ID XYZ .

SELECTION-SCREEN END OF BLOCK THREE.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002. "Selection

"criteria

PARAMETERS : CB_INCOM TYPE CHAR1 AS CHECKBOX MODIF ID XYZ,

CB_BILL TYPE CHAR1 AS CHECKBOX MODIF ID XYZ.

SELECTION-SCREEN END OF BLOCK B2.

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

      • SELECTION SCREEN VALIDATIONS ***

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

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN .

IF RB_SAL = 'X'.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INPUT = '0'.

screen-active = '0' .

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ELSEIF SCREEN-GROUP1 = 'XYZ'. "MOD-002+++

SCREEN-INPUT = '0'.

screen-active = '0' .

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP

harishaginati
Explorer
0 Kudos
262

dont make fields mandatory at selection screen level.., validate them after start-of-selection.

harishaginati
Explorer
0 Kudos
263

i guess you can't ful fill you'r criteria..., unless you design you screen using modulepool with diffrent tabs for sales and purchase..,

cheers,

Harish