Application Development and Automation 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: 
Read only

sql problem

Former Member
0 Likes
1,848

dear all,below is my code

IF CHKPD = 'X'.

SELECT AMATNR AMTART ASPART APRDHA AMEINS BEKGRP B~DISPO

INTO CORRESPONDING FIELDS OF TABLE ISLOC

FROM MARA AS A INNER JOIN MARC AS B ON AMATNR = BMATNR

INNER JOIN MARD AS D ON DMATNR = AMATNR

INNER JOIN MKOL AS E ON EMATNR = AMATNR

WHERE AMATNR IN S_MATNR AND AMTART IN S_MTART AND

ASPART IN S_SPART AND APRDHA IN S_PRDHA AND

B~EKGRP IN S_EKGRP AND

( DLGORT IN S_LMAIN OR ELGORT IN S_LMAIN ).

ENDIF.

i dun see any error in the coding,but when i execute,i get the following errors.

Error analysis

The current ABAP/4 program attempted to execute an ABAP/4 Open SQL

statement in which the WHERE condition contains an IN itab operator.

The IN itab operator is used with internal tables which

have the following structure:

SIGN(1) OPTION(2) LOW LIKE db_field HIGH LIKE db_field

In the SIGN column, use only one of the values "I" or "E".

The value " " is not allowed here.

How to correct the error

In the SIGN column, use only one of the values "I" or "E".

You may able to find an interim solution to the problem in the

SAP note system.

Can anyone pls tell me wat's the error about? thanks

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
1,446

The piece of code pasted looks oK.. the error could be from the sel scr.. verify if u used any variants.. also, are you filling any of these sel options in the INITIALIZATION event? The error indicates that for one of the sel options the SIGN operator is left blank..

~Suresh

11 REPLIES 11
Read only

former_member186741
Active Contributor
0 Likes
1,446

are all the fields using 'IN' declared as select-options?

if so, have you populated some values yourself? maybe you haven't added entries correctly.

eg,

*default condition keys...

REFRESH s_kschl.

s_kschl-option = 'EQ'.

s_kschl-sign = 'I'.

s_kschl-low = 'ZXYZ'.

APPEND s_kschl.

Read only

suresh_datti
Active Contributor
0 Likes
1,447

The piece of code pasted looks oK.. the error could be from the sel scr.. verify if u used any variants.. also, are you filling any of these sel options in the INITIALIZATION event? The error indicates that for one of the sel options the SIGN operator is left blank..

~Suresh

Read only

0 Likes
1,446

yea,at initialization ,i hardcoded these

MOVE 'I' TO S_TEM-SIGN.

MOVE 'EQ' TO S_TEM-OPTION.

MOVE 'P190' TO S_TEM-LOW. APPEND S_TEM. CLEAR S_TEM-LOW.

MOVE 'P110' TO S_TEM-LOW. APPEND S_TEM. CLEAR S_TEM-LOW.

MOVE 'C250' TO S_TEM-LOW. APPEND S_TEM. CLEAR S_TEM-LOW.

MOVE 'I' TO S_LMAIN-SIGN.

MOVE 'EQ' TO S_LMAIN-OPTION.

MOVE 'L001' TO S_LMAIN-LOW. APPEND S_LMAIN. CLEAR S_LMAIN.

MOVE 'L002' TO S_LMAIN-LOW. APPEND S_LMAIN. CLEAR S_LMAIN.

MOVE 'I' TO S_VMAIN-SIGN.

MOVE 'EQ' TO S_VMAIN-OPTION.

MOVE 'V001' TO S_VMAIN-LOW. APPEND S_VMAIN. CLEAR S_VMAIN.

MOVE 'V002' TO S_VMAIN-LOW. APPEND S_VMAIN. CLEAR S_VMAIN.

MOVE 'I' TO S_LVPROD-SIGN.

MOVE 'EQ' TO S_LVPROD-OPTION.

MOVE 'L003' TO S_LVPROD-LOW. APPEND S_LVPROD. CLEAR S_LVPROD.

MOVE 'V003' TO S_LVPROD-LOW. APPEND S_LVPROD. CLEAR S_LVPROD.

Read only

0 Likes
1,446

Change

CLEAR S_LMAIN to CLEAR S_LMAIN-LOW.

CLEAR S_VMAIN to CLEAR S_VMAIN-LOW.

CLEAR S_LVPROD to CLEAR S_LVPROD-LOW.

~Suresh

Read only

0 Likes
1,446

error..the clear after the append clears the whole structure and so the option and sign fields now have invalid values.

Hi Joan.....Suresh did just beat me and it looks like you've accidentally given me the points!

Read only

0 Likes
1,446

thanks suresh ^^ problem solved

Read only

0 Likes
1,446

thx for d infor Neil ^^

Read only

0 Likes
1,446

Neil,

Actually both of us had the same timestamp.. so it is Joan's discretion and you are the chosen one.. good for you..

~Suresh

Read only

0 Likes
1,446

thanks for being so gracious about it Suresh but Joan's answers indicated that she'd given us both points but in fact she's given me 16 and you none! I think she just clicked on the wrong one and didn't check.

Read only

0 Likes
1,446

huh? did i assigned wrong marks to both of u? i actually wana assigned 10marks for suresh and 6 marks for Neil. if can give both 10marks. in my display here, my 10 marks goes to suresh n 6marks goes to neil..how come suresh aint getting anymarks? hmm..sorry..i din know such problem wl occur

Read only

0 Likes
1,446

yea..i manage to change the points d...sorry guys..

n sorry neil,if i can assign 10marks for more than one person,surely i wl give u tat 😛 anyway,thanks alot for the solutions again ^^ cheers

Joan