‎2007 Mar 30 12:48 AM
Hi there,
On a standard SAP screen when I fill some fields and press enter for validation, it is giving error list on top to show that one of the field is required to be filled. I wrote a screen module to fill in the default value for those fields in the PBO of the screen.
But even though the screen is showing those default value for the field. It is not validating (i.e. the <b>description is not shown for those field values</b>) hence the error is still shown. In this case if I change one of the value manually and press enter on the field, the description is shown and the error disappears.
So can you kindly guide me that how can the default value be properly validated so the error does not appear. Thanks.
Regards,
Faiq
‎2007 Mar 30 2:36 AM
Hi,
May be check PAI of the screen, where the field is validating, if it validating " on request" ie
FIELD <f> MODULE <mod> ON REQUEST.
then
In general, the ON REQUEST condition is triggered through any form of "manual input". As well as user input.
aRs
‎2007 Mar 30 2:21 AM
Hi,
Provide some more detail so we can understand you issue.
- What is the standard SAP screen
- What are the fields are you talking about
- How did you wrote the screen module to fill the default value ( is it a screen exit )
- What error message are you getting.
Regards,
RS
‎2007 Mar 30 2:30 AM
Hi Faiq,
As soon as you fill in the default values in the PBO screen ,make sure enter button is triggered or may be try filling the default description in the PBO screen only.
The problem is enter button is not triggered so the error throws.
Regards
Naresh
‎2007 Mar 30 2:36 AM
Hi,
May be check PAI of the screen, where the field is validating, if it validating " on request" ie
FIELD <f> MODULE <mod> ON REQUEST.
then
In general, the ON REQUEST condition is triggered through any form of "manual input". As well as user input.
aRs
‎2007 Mar 30 5:18 AM
Hi guys,
Thanks for your reply. I did try different approaches mentioned including the function module 'SAPGUI_SET_FUNCTIONCODE'. with okcode /00 for 'Enter'. But still it does not validate and the error still appears.
The error is happening in CRM screen.
I am using the program 'SAPLCRM_ORGMAN_UI' with screen '1001'. The screen fields is CRMT_1001_ORGMAN_UI-DIS_CHANNEL. I modified the screen in PBO and PAI to include the default value but still it displays those value but does not validate them (as descrition not displayed) hence the error is still displayed on top of screen as the field is required to be entered.
I also put the default values in PAI for the field in its CHAIN. But still they are not accepted.
Please advise. Any suggestion will be really appreciated. Thanks.
Regards,
Faiq
‎2007 Mar 30 6:58 AM
Hi guys,
I think that for the values to be validated I need to update the value in the screen buffer also in addition to updating the screen fields. Any ideas how that can be done. Thanks for your assistance.
Regards,
Faiq
‎2007 Mar 30 7:10 AM
use this fm and try he follwing piece of code to kno how to buffer 'DYNP_VALUES_READ'
substitute for dynname = sy-cprog in ur code
-
tables tcurt.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
P_LTEXT LIKE TCURT-LTEXT, "Long Text
P_KTEXT LIKE TCURT-KTEXT. "Short Text
*----
*--- Example of updating value of another field on the screen -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
CLEAR: DYFIELDS[], DYFIELDS.
*--- select currency
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
SELECT_VALUE = P_WAERS.
*--- get long text for the selected currency
SELECT SINGLE LTEXT FROM TCURT
INTO DYFIELDS-FIELDVALUE
WHERE SPRAS = SY-LANGU
AND WAERS = P_WAERS.
IF SY-SUBRC <> 0.
CLEAR DYFIELDS-FIELDVALUE.
ENDIF.
*--- update another field
DYFIELDS-FIELDNAME = 'P_LTEXT'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
tables
dynpfields = DYFIELDS .
*----
**--- Example of reading value of another field
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
*--- read another field
CLEAR: DYFIELDS[], DYFIELDS.
DYFIELDS-FIELDNAME = 'P_WAERS'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
*--- get short text and update current field
SELECT SINGLE KTEXT FROM TCURT
INTO P_KTEXT
WHERE SPRAS EQ SY-LANGU
AND WAERS EQ DYFIELDS-FIELDVALUE.
regards
navjot
reward accordingly