11-05-2007 12:20 PM
Hi All,
I am trying to execute AT SELECTION-SCREEN and AT SELECTION-SCREEN output. Both the para's working fine seperately. But when I execute them together AT SELECTION-SCREEN output is not working. Please let me know how to solve this problem. Please see below for the code.
PARAMETERS: p_werks LIKE marc-werks OBLIGATORY MEMORY ID WRK,
p_lgort LIKE mard-lgort OBLIGATORY,
p_rlgort LIKE mard-lgort OBLIGATORY.
PARAMETERS: p_boml TYPE c RADIOBUTTON GROUP mode user-command flag.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_aufnr LIKE aufk-aufnr MODIF ID cp2.
SELECTION-SCREEN: END OF BLOCK b1.
*SELECTION-SCREEN COMMENT 1(44) text-004 FOR FIELD p_cmpl.
PARAMETERS: p_cmpl TYPE c RADIOBUTTON GROUP mode.
*-----
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_matnr type marc-matnr MODIF ID cp1,
p_verid type afpo-verid MODIF ID cp1,
p_labst type mard-labst MODIF ID cp1.
SELECTION-SCREEN: END OF BLOCK b2.
*------
PARAMETERS: p_mstr TYPE c RADIOBUTTON GROUP mode.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF p_boml <> 'X' AND
screen-group1 = 'CP1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
IF p_cmpl <> 'X' AND
screen-group1 = 'CP2'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
IF p_boml EQ 'X'.
IF p_AUFNR EQ space.
MESSAGE e000(z1) WITH 'Please fill Production Order.'.
ENDIF.
endif.
IF p_cmpl EQ 'X'.
IF p_MATNR EQ space OR p_verid EQ space OR p_labst EQ space.
MESSAGE e000(z1) WITH text-003 'Production Version & Quantity. '.
ENDIF.
endif.
Thanks,
Senthil
11-06-2007 10:15 AM
hi,
your logic is wrong as per my knowledge p_boml, p_cmpl are two different parameters, in the scenario where two radio buttons are active, at selection screen work fine and At selection screen output won't .
This is upto my understanding. i answered correct me if i am worng.
<b> kindly observe bold lines</b>
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
<b>IF p_boml <> 'X'</b> AND
screen-group1 = 'CP1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
<b>IF p_cmpl <> 'X'</b> AND
screen-group1 = 'CP2'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
<b>IF p_boml EQ 'X'.</b>
IF p_AUFNR EQ space.
MESSAGE e000(z1) WITH 'Please fill Production Order.'.
ENDIF.
endif.
<b>
IF p_cmpl EQ 'X'.</b>
IF p_MATNR EQ space OR p_verid EQ space OR p_labst EQ space.
MESSAGE e000(z1) WITH text-003 'Production Version & Quantity. '.
ENDIF.
endif.
Reward points if useful
regards,
Pavan
11-06-2007 11:54 AM
Hi Senthil,
As far as my knowledge is concerned AT Selection-Screen output and AT Selection-Screen wont work together.In this code you are trying to do the validation in AT Selection-Screen. Instead of that try doin your validations in Start-of-selection Event.
i,e., modify your code as follows:
PARAMETERS: p_werks LIKE marc-werks OBLIGATORY MEMORY ID WRK,
p_lgort LIKE mard-lgort OBLIGATORY,
p_rlgort LIKE mard-lgort OBLIGATORY.
PARAMETERS: p_boml TYPE c RADIOBUTTON GROUP mode user-command flag.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_aufnr LIKE aufk-aufnr MODIF ID cp2.
SELECTION-SCREEN: END OF BLOCK b1.
*SELECTION-SCREEN COMMENT 1(44) text-004 FOR FIELD p_cmpl.
PARAMETERS: p_cmpl TYPE c RADIOBUTTON GROUP mode.
*-----
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_matnr type marc-matnr MODIF ID cp1,
p_verid type afpo-verid MODIF ID cp1,
p_labst type mard-labst MODIF ID cp1.
SELECTION-SCREEN: END OF BLOCK b2.
*------
PARAMETERS: p_mstr TYPE c RADIOBUTTON GROUP mode.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF p_boml <> 'X' AND
screen-group1 = 'CP1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
IF p_cmpl <> 'X' AND
screen-group1 = 'CP2'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
START-OF-Selection.
Perform validation.
form validation.
IF p_boml EQ 'X'.
IF p_AUFNR EQ space.
MESSAGE e000(z1) WITH 'Please fill Production Order.'.
ENDIF.
endif.
IF p_cmpl EQ 'X'.
IF p_MATNR EQ space OR p_verid EQ space OR p_labst EQ space.
MESSAGE e000(z1) WITH text-003 'Production Version & Quantity. '.
ENDIF.
endif.
endform.
Kindly reward if useful.
Thanks,
pavithra
11-09-2007 11:43 AM
Thanks for response.
Sorry for the late reply. Below code is working for me. But it takes a while for the Text box to come up.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF p_boml <> 'X' AND
screen-group1 = 'CP2'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF p_cmpl <> 'X' AND
screen-group1 = 'CP1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN on radiobutton group mode. " Start-of-selection FOR p_cmpl.
LOOP AT SCREEN.
IF p_boml = 'X' AND
screen-group1 = 'CP2'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
IF p_cmpl = 'X' AND
screen-group1 = 'CP1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
CLEAR : g_posnr,
g_update_complete.
IF p_cmpl EQ 'X'.
IF p_MATNR EQ space OR p_labst EQ space.
MESSAGE i000(z1) WITH text-003 'Material & Quantity. '.
ENDIF.
ENDIF.
IF p_boml EQ 'X'.
IF p_AUFNR EQ space.
MESSAGE i000(z1) WITH 'Please fill Production Order.'.
ENDIF.
ENDIF.