‎2006 Nov 08 2:42 PM
Its a simple question but dont know how to solve it . I will get a pop up window for customer number 'seledir' and 'empldir'.if i simply press enter on the pop up it displays an error saying 'enter the postal code' but if i simply press enter again it displays the error saying 'field pstlz in table kna1 cannot be specified twice' which is not understandable to the user how do i make it to display the same error 'enter the postal code ' again.
AT SELECTION-SCREEN.
IF P_KUNNR = 'SELEDIR' OR P_KUNNR = 'EMPLDIR'.
IVALS-TABNAME = 'KNA1'.
IVALS-FIELDNAME = 'PSTLZ'.
APPEND IVALS.
IVALS-TABNAME = 'KNA1'.
IVALS-FIELDNAME = 'REGIO'.
APPEND IVALS.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
NO_VALUE_CHECK = ' '
POPUP_TITLE = 'Enter Sold-to party''s Postal code and Region'
START_COLUMN = '25'
START_ROW = '10'
IMPORTING
RETURNCODE =
TABLES
FIELDS = ivals
EXCEPTIONS
ERROR_IN_FIELDS = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IVALS WITH KEY FIELDNAME = 'PSTLZ'.
IF NOT IVALS-VALUE IS INITIAL.
PSTLZ = IVALS-VALUE.
ELSE.
MESSAGE E017 with 'Enter the postal code'.
ENDIF.
READ TABLE IVALS WITH KEY FIELDNAME = 'REGIO'.
IF NOT IVALS-VALUE IS INITIAL.
REGIO = IVALS-VALUE.
ELSE.
MESSAGE E018 WITH 'Enter the Region'.
ENDIF.
ENDIF.
‎2006 Nov 08 2:57 PM
‎2006 Nov 08 2:57 PM
‎2006 Nov 08 2:58 PM
Or fill IVALS in the INITIALIZATION event.
<b>INITIALIZATION.
IVALS-TABNAME = 'KNA1'.
IVALS-FIELDNAME = 'PSTLZ'.
APPEND IVALS.
IVALS-TABNAME = 'KNA1'.
IVALS-FIELDNAME = 'REGIO'.
APPEND IVALS.</b>
AT SELECTION-SCREEN.
IF P_KUNNR = 'SELEDIR' OR P_KUNNR = 'EMPLDIR'.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
* NO_VALUE_CHECK = ' '
POPUP_TITLE = 'Enter Sold-to party''s Postal code and Region'
START_COLUMN = '25'
START_ROW = '10'
* IMPORTING
* RETURNCODE =
TABLES
FIELDS = ivals
* EXCEPTIONS
* ERROR_IN_FIELDS = 1
* OTHERS = 2
Regards,
Rich Heilman
‎2006 Nov 08 2:58 PM
Why dont you set the field Field_OBL in your table IVALS for both post code and regio...in that case you would not need to give error message.