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

select statement

Former Member
0 Likes
953

hi to all

help me inthis issue

SELECT BLDAT DMBTR SGTXT FROM BSIS

INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS

WHERE BUKRS IN G_BUKRS

AND GJAHR IN G_GJAHR

AND BLART IN G_BLART

AND BELNR IN G_BELNR

AND HKONT NE '00000207130'.

i am eliminating gl account 00000207130' from selection but still it is selecting data

and i need to elimate one more account o also can do like this

AND HKONT NE ( '00000207130' or '000000200123').

thanks in advance

kiran kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926
Account maximum length is only 10 but u had given 11 , remove one zero at the beginning


SELECT BLDAT DMBTR SGTXT FROM BSIS
INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS
WHERE BUKRS IN G_BUKRS
AND GJAHR IN G_GJAHR
AND BLART IN G_BLART
AND BELNR IN G_BELNR
AND HKONT NE '0000207130' or 
        HKONT NE '0000200123' .
8 REPLIES 8
Read only

Former Member
0 Likes
926

Hi Kiran,

The length for HKONT in BSIS table is of 10 but you are specifying that with a length of 12.

SELECT BLDAT DMBTR SGTXT FROM BSIS

INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS

WHERE BUKRS IN G_BUKRS

AND GJAHR IN G_GJAHR

AND BLART IN G_BLART

AND BELNR IN G_BELNR

AND HKONT NE <b>'000207130'.</b>

Thanks,

Vinay

Read only

Former Member
0 Likes
927
Account maximum length is only 10 but u had given 11 , remove one zero at the beginning


SELECT BLDAT DMBTR SGTXT FROM BSIS
INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS
WHERE BUKRS IN G_BUKRS
AND GJAHR IN G_GJAHR
AND BLART IN G_BLART
AND BELNR IN G_BELNR
AND HKONT NE '0000207130' or 
        HKONT NE '0000200123' .
Read only

Former Member
0 Likes
926

I think the HKONT is a 10 char field and u are using more that 10 char in ur select statement.

Try this out.

Shejal.

Read only

Former Member
0 Likes
926

Yes you can do that way.

Or alternatively

RANGES : R_HKONT FOR BSIS-HKONT.
R_HKONT-LOW = '00000207130'.
R_HKONT-SIGN = 'I'.
R_HKONT-OPTION = 'EQ'.
APPEND R_HKONT.

R_HKONT-LOW = '00000200123'.
R_HKONT-SIGN = 'I'.
R_HKONT-OPTION = 'EQ'.
APPEND R_HKONT.

SELECT BLDAT DMBTR SGTXT FROM BSIS
INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS
WHERE BUKRS IN G_BUKRS
AND GJAHR IN G_GJAHR
AND BLART IN G_BLART
AND BELNR IN G_BELNR
AND not HKONT IN R_HKONT.

Perfer the second way, if you have more G/L accounts to be added

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
926

This isn't the question you asked, but here's my answer anyway:

If you don't know the GL, but do know the document number, you should go to BKPF and BSEG rather than BSIS. There is no index in BSIS on document number and the index on GL account won't work with NE.

Rob

Read only

Former Member
0 Likes
926

Hi Kiran,

Othewise, user conversion exit before you compare the value in SELECT statement.

<b>CONVERSION_EXIT_ALPHA_INPUT</b>

DATA V_HKONT(10).

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = '207130'

IMPORTING

OUTPUT = V_HKONT.

SELECT BLDAT DMBTR SGTXT FROM BSIS

INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS

WHERE BUKRS IN G_BUKRS

AND GJAHR IN G_GJAHR

AND BLART IN G_BLART

AND BELNR IN G_BELNR

<b>AND HKONT NE V_HKONT.</b>

Thanks,

Vinay

Read only

Former Member
0 Likes
926

Hi Kiran,

Do one thing u can prepare one ranges table with the values what u are trying to eliminate from select statement and use that in where class.

see the below code.....

r_hkont-sign = 'E'.

r_hkont-option = 'EQ'.

r_hkont-low = 'xxxxxxxxxxx'.

append r_hkont.

clear r_hkont-low.

r_hkont-low = 'yyyyyyyyyyy'.

append r_hkont.

<b>where hkont in r_hkont</b>

Regards,

Bujji

Read only

Former Member
0 Likes
926

hi,

SELECT BLDAT DMBTR SGTXT FROM BSIS

INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS

WHERE BUKRS IN G_BUKRS

AND GJAHR IN G_GJAHR

AND BLART IN G_BLART

AND BELNR IN G_BELNR

AND <b>HKONT NOT IN ( '0000207130', '0000200123')</b>.

Regards