‎2007 Jun 19 6:51 AM
Hi,
I have created a selection screen .The screen fields of my screen refer the screen fields of a sap standard selection screen saprck23.In the standard selection screen there is a validation added for a screen field called Period which accepts value from 1 to 14.since i m also making use of the same screen field how can i use the validation which is existing in sap standard screen to my own selection screen
can anyone help me ....points will be rewarded...
‎2007 Jun 19 6:55 AM
Hi,
hi I have faced similar problem because when u make a field obligatory and if we again use at-selection screen event the error message can not be avoided
Define a form statement which checks whether the field is initial..
try this code, based on the radio button clicked the block appears & disappears, hope this helps
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
************************************************************************
At Selection-Screen Output *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
<b>Rewardpoints</b>
Regards
‎2007 Jun 19 6:54 AM
Hi,
Use the event at selection screen on field .
At selection screen on field p_period.
if p_perid < 1 or p_perid >14.
error message.
endif.
Regards,
‎2007 Jun 19 6:55 AM
Hi Hemavathi,
Just copy paste the same code of validation into your program.
Reward points if useful.
Regards,
Atish
‎2007 Jun 19 6:55 AM
Hi,
hi I have faced similar problem because when u make a field obligatory and if we again use at-selection screen event the error message can not be avoided
Define a form statement which checks whether the field is initial..
try this code, based on the radio button clicked the block appears & disappears, hope this helps
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
************************************************************************
At Selection-Screen Output *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
<b>Rewardpoints</b>
Regards
‎2007 Jun 19 6:55 AM
hi
i think u can write the same validation code in ur program under
at selection-screen output on field
event
‎2007 Jun 19 6:57 AM
Hi,
FInd the parameter/Select-options used in the standard program.
Then in main program,check for that.You can find the validation related to that.
Other way is,simply put /h after you entered values.Then check in program, where the cursor is going.From there in program,copy the coding.
‎2007 Jun 19 6:58 AM
declare the same naming conversion of the standard and include this <b> saprck23</b>
program, so that you don't want write the validation logic ... it will take care of it ...
becuase saprck23 has the AT SELECTION-SCREEN ON VALUE-REQUEST ...
Girish
‎2007 Jun 19 7:29 AM
hi girish,
as per ur suggestion, actually what i shud declare??
im not able to get wat u said....
can u explain it in detailed manner pls??
‎2007 Jun 19 7:41 AM
Hi,
The validation for POSTING PERIOD is done by AT SLECTION_SCREEN in the prog SAPRCK23.
If u wantto use teh same logic, then search for" AT selection-screen " in the program and just copy-pase the logic, taking care of all naming conventions of variables followed by standartd sap program.
Revert back if any issues,
Reward with points if helpful ,
Regards,
Naveen