Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Getting Errors.

Hi Experts, I am getting some error in the following code,can u suggest me a way to overcome tht error.

&----


*& Report ZSELSCREEN *

*& *

&----


*& *

*& *

&----


REPORT ZSELSCREEN MESSAGE-ID Y6.

TABLES MARA.

SELECTION-SCREEN SKIP 1.

selection-screen BEGIN OF BLOCK BLOCK0 WITH FRAME TITLE TEXT-000.

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF LINE.

selection-screen PUSHBUTTON 10(20) TEXT-003 USER-COMMAND ENGL.

selection-screen PUSHBUTTON 50(20) TEXT-004 USER-COMMAND GERM.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK BLOCK0.

selection-screen SKIP 2.

SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001 NO

INTERVALS.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : P_EX1 RADIOBUTTON GROUP RAD1.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX1.

SELECTION-SCREEN END OF LINE.

PARAMETERS : P_DATE1 TYPE D DEFAULT 'SY-DATUM'.

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : P_EX2 RADIOBUTTON group RAD1.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX2.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS S_JDATE2 FOR MARA-LAEDA.

SELECTION-SCREEN skip.

SELECTION-SCREEN BEGIN OF line.

parameters: P_EX3 RADIOBUTTON GROUP RAD1.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX3.

SELECTION-SCREEN END OF LINE.

PARAMETERS : p_JDATE3 LIKE MARA-LAEDA.

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : P_EX4 RADIOBUTTON GROUP RAD1.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX4.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS S_JDATE4 FOR MARA-LAEDA NO-EXTENSION no intervals.

SELECTION-SCREEN END OF BLOCK BLOCK1.

SELECTION-SCREEN BEGIN OF BLOCK BLOCK02 WITH frame TITLE TEXT-002 NO

INTERVALS.

SELECTION-SCREEN BEGIN OF LINE.

parameter: P_EX5 AS CHECKBOX.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX5.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : P_EX7 AS CHECKBOX.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX7.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : P_EX6 AS checkbox.

SELECTION-SCREEN COMMENT 5(30) TEXT-EX6.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK BLOCK02.

AT SELECTION-SCREEN.

IF ( P_EX1 = 'X' ) AND (( P_JDATE1 = '' ) OR P_JDATE1 IS INITIAL )).

MESSAGE E017 WITH 'SELECTION OPTION WIHT DEFAULT FIELD HAS NO VALUE'.

ELSEIF ( P_EX1 = 'X')AND NOT (( P_JDATE1 = 'IEQ? ') OR ( P_JDATE1 IS

INITIAL)).

MESSAGE I017 WITH 'WE ARE NOW USING EXAMPLE 01'.

ENDIF.

IF ( P_EX2 = 'X') AND (( P_JDATE2 = 'IEQ?') OR P_JDATE2 IS INITIAL )).

MESSAGE E017 WITH 'SELECTION OPTION USING FOR FIELD HAS NO VALUE'.

ELSEIF ( P_EX2 = 'X')AND NOT ((P_JDATE2 = 'IEQ?') (OR P_JDATE2 IS

INITIAL)).

MESSAGE I017 WITH 'WE ARE NOW USING EXAMPLE 02'.

ENDIF.

IF ( P_EX3 = 'X') AND (( P_JDATE3 = 'IEQ?') OR P_JDATE3 IS INITIAL )).

MESSAGE E017 WITH 'PARAMETER WITH LIKE STATEMENT HAS NO FIELD VALUE'.

ELSEIF ( P_EX3 = 'X')AND NOT ((P_JDATE3 = 'IEQ?') (OR P_JDATE3 IS

INITIAL)).

MESSAGE I017 WITH 'WE ARE NOW USING EXAMPLE 03'.

ENDIF.

IF ( P_EX4 = 'X') AND (( P_JDATE4 = 'IEQ?') OR P_JDATE4 IS INITIAL )).

MESSAGE E017 WITH 'SELECTION OPTION WIHT NO INTERNAL VALUE OR HAS NO

VALUE'.

ELSEIF ( P_EX4 = 'X')AND NOT ((P_JDATE4 = 'IEQ?') (OR P_JDATE4 IS

INITIAL)).

MESSAGE I017 WITH 'WE ARE NOW USING EXAMPLE 04'.

ENDIF.

IF P_EX5.

PERFORM GET_PRICE_DATA.

ELSEIF P_EX6.

PERFORM GET_COST_DATA.

ELSEIF P_EX7.

PERFORM GET_REVENUE_DATA.

ENDIF.

now when i m executing the above code i m getting an error tht

IF ( P_EX1 = 'X' ) AND (( P_JDATE1 = '' ) OR P_JDATE1 IS INITIAL )) is unknown, it is neither in one of the defined tables or defined by the data statement .

can u help me to solve this problem.

Regards,

Abhinab

Tags:
Former Member replied

Hello Abhinab

Aside from Graham's suggestion another major reason for poor programming is due to poor organization of the coding.

I assume that for each radiobutton you wanted to check if either the date parameter or the date select-option is filled.

AT SELECTION-SCREEN.
  " Assumption: p_jdate1 should be s_jdate1

  IF ( p_ex1 = 'X' ) AND ( ( p_jdate1 = '' ) OR ( p_jdate1 IS INITIAL ) ).
    MESSAGE e017 WITH 'SELECTION OPTION WIHT DEFAULT FIELD HAS NO VALUE'.
  ELSEIF ( p_ex1 = 'X') AND NOT ( ( s_jdate1 = 'IEQ? ') OR ( s_jdate1 IS
  INITIAL ) ).
    MESSAGE i017 WITH 'WE ARE NOW USING EXAMPLE 01'.
  ENDIF.

Since p_jdate1 must be filled you could just use the OBLIGATORY option of the PARAMETER statement.

S_JDATE1 is an itab with header line. Thus, you need to check its body whether it is filled or not:

PARAMETERS : p_jdate1 TYPE d DEFAULT 'SY-DATUM' OBLIGATORY.
...
AT SELECTION-SCREEN.
  IF ( p_ex1 = 'X' ).
    IF ( s_jdate1[] IS INITIAL ).
    ELSE.
      MESSAGE i017 WITH 'WE ARE NOW USING EXAMPLE 01'.
    ENDIF.

  ENDIF.

Regards

Uwe

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question