‎2007 Feb 02 1:17 PM
Hi,
<b>My selection screen is as follows:</b>
SELECTION-SCREEN BEGIN OF BLOCK global WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
PARAMETERS : p_rd1 RADIOBUTTON GROUP r1 DEFAULT 'X' USER-COMMAND cmd1,
p_rd2 RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
PARAMETERS : p_rd3 RADIOBUTTON GROUP r2 DEFAULT 'X' USER-COMMAND r MODIF ID sc3.
*SELECTION-SCREEN SKIP.
SELECT-OPTIONS: s_prod FOR /sapapo/rrpio-matnr MODIF ID sc1,
s_plan FOR /sapapo/planner-planner MODIF ID sc1.
p_loc FOR /sapapo/rrpio-locno MODIF ID sc1 .
PARAMETERS : p_loc TYPE /sapapo/rrpio-locno MODIF ID sc1.
*SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN ULINE.
*SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-004.
PARAMETERS : p_rd4 RADIOBUTTON GROUP r2 MODIF ID sc4.
*SELECTION-SCREEN SKIP.
SELECT-OPTIONS: s_ordnum FOR /sapapo/rrpio-delnr MODIF ID sc2 .
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK global.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS :
p_plnver TYPE /sapapo/rrpio-simid,
p_start TYPE /sapapo/cdps_rept_evdate_start ,
p_end TYPE /sapapo/cdps_rept_evdate_end ,
p_ver TYPE /sapapo/version ,
p_ver type BAPI10504STOCKLIST2-version,
p_bcstat TYPE bapi10504stocklist2-atpcat,
p_timepf TYPE /sapapo/timeprf-timepro_id.
p_stktyp TYPE bapi10504stocklist2-stock_type.
SELECT-OPTIONS: s_reqdat FOR /sapapo/rrpio-rqdat.
SELECTION-SCREEN END OF BLOCK b4.
AT SELECTION-SCREEN.
*PERFORM f_VALIDATE_MANDATORY_FIELDS.
LOOP AT SCREEN.
IF screen-group1 = 'SC1'.
IF screen-input = 1.
IF p_rd1 = 'X' AND p_rd3 = 'X'.
Location validation at selection screen
IF p_loc IS INITIAL.
MESSAGE e217(/sapapo/rrp).
ENDIF.
ELSE.
CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'
EXPORTING
iv_locno = p_loc
IMPORTING
ev_locid = lv_locid
EXCEPTIONS
location_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
CALL FUNCTION '/SAPAPO/OM_MESSAGES_SY_STORE'.
CALL FUNCTION '/SAPAPO/OM_MESSAGES_SHOW'.
ENDIF.
ENDIF.
ELSEIF p_rd2 = 'X' AND p_rd3 = 'X'.
*Product validation at selection screen
IF s_prod IS INITIAL.
MESSAGE e216(/sapapo/rrp).
ENDIF.
Location validation at selection screen
IF p_loc IS INITIAL.
MESSAGE e217(/sapapo/rrp).
ENDIF.
ELSE.
CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'
EXPORTING
iv_locno = p_loc
IMPORTING
ev_locid = lv_locid
EXCEPTIONS
location_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
CALL FUNCTION '/SAPAPO/OM_MESSAGES_SY_STORE'.
CALL FUNCTION '/SAPAPO/OM_MESSAGES_SHOW'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
IF sy-ucomm = 'R'.
IF p_rd3 = 'X'.
flag = '1'.
flag1 = '0'.
ELSEIF p_rd4 = 'X'.
flag = '0'.
flag1 = '1'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
*AT SELECTION-SCREEN ON RADIOBUTTON GROUP R1.
LOOP AT SCREEN.
IF screen-group1 = 'SC1'.
screen-input = flag.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'SC2'.
screen-input = flag1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
<b>The problem:</b>
There are 4 radio buttons in total. The requirement is, when I select the radio button p_rd1 it should validate only the s_prod field mentioned under the radio button p_rd3. When I select the radio button p_rd2 it should validate both the fields s_prod and p_loc mentioned under the radio button p_rd4. The validation is happening correctly but when I am switching over from one radio button to another, there is a message to "Enter Product" / Enter location. This is because I have validated for the logic where the field s_prod and p_loc are blank. Also when I click the "Multiple selection button" on the selection field s_prod, it shows a message " Enter Product" as I have not entered any data there.
Thus, I would like to know how to supress this error message if that field remains blank using the same logic.
Hope to hear from you soon.
Regards,
Debaprasad.
‎2007 Feb 02 1:56 PM
first of all i would suggest u to handle the code with a click of a radio button .
This minimises the confusion .
like
If r1 = 'X'.
endif.
If r2 = 'X'.
endif.
If r3 = 'X'.
endif.
If r4 = 'X'.
endif.
2.
If r1 = 'X'.
endif.Product validation at selection screen
<b>IF s_prod IS INITIAL.</b> "prone to bypass
MESSAGE e216(/sapapo/rrp).
ENDIF.
Location validation at selection screen
IF p_loc IS INITIAL.
MESSAGE e217(/sapapo/rrp).
ENDIF.
ELSE.
instead of this
<b>IF s_prod IS INITIAL</b>.
modify this as
IF <b>s_prod[]</b> IS INITIAL. cause select options is a internal table by itself and
make use of
multi selections like
3.
IF s_prod[] IS INITIAL or s_prod[] eq ' '
if p_loc is initial or p_loc eq ' '
message .
end if .
endif.4.
deal the s_prod[] as
s_prod-low "lower value
s-prod-high. " higher value
regards,
vijay
‎2007 Feb 02 1:50 PM
Hi,
<b>selection-screen begin of block RAD with frame.</b>
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .
PARAMETERS : R3 RADIOBUTTON GROUP RG .
<b>selection-screen end of block RAD with frame.</b>
*----
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id abc.
selection-screen end of block b1.
selection-screen begin of block b2 with frame.
parameters : c(40) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.
selection-screen begin of block b3 with frame.
parameters : e(40) type c modif id ghi.
parameters : f(20) type c modif id ghi.
selection-screen end of block b3.
*----
AT Selection screen on radio button Group RG.
IF R1 = 'X'.
if Field is initial.
message 'Please enter the field'
endif.
Endif.
Write the above logic for all the fields
Regards
Sudheer
‎2007 Feb 02 1:56 PM
first of all i would suggest u to handle the code with a click of a radio button .
This minimises the confusion .
like
If r1 = 'X'.
endif.
If r2 = 'X'.
endif.
If r3 = 'X'.
endif.
If r4 = 'X'.
endif.
2.
If r1 = 'X'.
endif.Product validation at selection screen
<b>IF s_prod IS INITIAL.</b> "prone to bypass
MESSAGE e216(/sapapo/rrp).
ENDIF.
Location validation at selection screen
IF p_loc IS INITIAL.
MESSAGE e217(/sapapo/rrp).
ENDIF.
ELSE.
instead of this
<b>IF s_prod IS INITIAL</b>.
modify this as
IF <b>s_prod[]</b> IS INITIAL. cause select options is a internal table by itself and
make use of
multi selections like
3.
IF s_prod[] IS INITIAL or s_prod[] eq ' '
if p_loc is initial or p_loc eq ' '
message .
end if .
endif.4.
deal the s_prod[] as
s_prod-low "lower value
s-prod-high. " higher value
regards,
vijay