Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Errors.

former_member212002
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

9 REPLIES 9

GrahamRobbo
Active Contributor
0 Kudos

Can't see where you have defined P_JDATE1.

0 Kudos

i hav defined p_jdate1 as an parameter.but while pasting in the forum j got deleted from P_jdate1.

former_member190578
Participant
0 Kudos

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

Please check all your '(' and ')'...... there are doesn't fit.... not even.

To much ')' or to less '('... you can choose.

If this is NOT the error, please past and copy the EXACT error message!

0 Kudos

the exact error message is :

Field" ( P_EX1 = 'X' ) AND (( P_JDATE1 = '' ) OR P_JDATE1 IS INITIAL ))" is unknown.

it is nor one of the specified tables or defined by the data statement.

and also a warning tht.

after x there must be equivalent characters (".",etc

0 Kudos

May be I missing something but you have more ) than (.

You have three open brackets and four close brackets.

Also I would drop the '' comparison.

Try something like...


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

Cheers

Graham Robbo

0 Kudos

Field" ( P_EX1 = 'X' ) AND (( P_JDATE1 = '' ) OR P_JDATE1 IS INITIAL ))" is unknown.

There is a lot wrong:

1. your '(' ')' are not even.

2. ( P_JDATE1 = '' ) <<<--- this is wrong! First no other variable,

second: this sign ---> " is wrong.

0 Kudos

now m getting a different kind of error tht

the syntax for method specification is "objref->method" or classref-method"

but here in my code the use of objects is not there.

0 Kudos

Hi Abhinab,

please do not be offended by this advice.

You seem a little out of your depth here. I suggest you do some proper ABAP study. By a book, go on a course, etc. You need to walk before you can run.

I also notice that of 25 questions you have put into SDN you have 18 unresolved. You need to start closing these questions, and refraining from asking simple syntax questions or you will lose credibility with the SDN community and they will stop responding to you.

SDN is a valuable resource, but it relies on the good will of the participants to contribute so it is important you give to the community and not just take.

Cheers

Graham Robbo

uwe_schieferstein
Active Contributor
0 Kudos

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