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

My select statement does not get any records...

aris_hidalgo
Contributor
0 Likes
1,329

Hello experts,

I am confused as to why my select statement does not get any records. I checked the table and it

does have records.Anyway, below is my select statement:

REPORT zfr_aging_of_deposits

NO STANDARD PAGE HEADING

LINE-SIZE 0

LINE-COUNT 0

MESSAGE-ID zz.

----


  • Data dictionary tables *

----


TABLES: bsis,

bkpf.

TYPE-POOLS: slis.

----


  • Structures *

----


TYPES: BEGIN OF t_bsis,

bukrs LIKE bsis-bukrs,

hkont LIKE bsis-hkont,

zuonr LIKE bsis-zuonr,

belnr LIKE bsis-belnr,

gjahr LIKE bsis-gjahr,

budat LIKE bsis-budat,

shkzg LIKE bsis-shkzg,

dmbtr LIKE bsis-dmbtr,

sgtxt LIKE bsis-sgtxt,

END OF t_bsis.

----


  • Internal tables *

----


DATA: it_bsis TYPE STANDARD TABLE OF t_bsis.

*field-symbols

FIELD-SYMBOLS: <fs_bsis> LIKE LINE OF it_bsis.

----


  • Selection screen *

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_bukrs LIKE t001-bukrs.

SELECT-OPTIONS: s_budat FOR bkpf-budat.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN ON p_bukrs.

IF p_bukrs <> 'GLOB' and

p_bukrs <> 'INOV' and

p_bukrs <> 'GXCH'.

MESSAGE e008 WITH 'Invalid Company Code!'.

ENDIF.

----


  • Start of selection *

----


START-OF-SELECTION.

PERFORM get_data.

----


  • FORM get_data *

----


  • ........ *

----


FORM get_data.

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis

INTO TABLE it_bsis

WHERE bukrs = p_bukrs

  • AND budat < s_budat

AND xragl = ''

AND xstov = ''

AND hkont = '190100'.

check not it_bsis[] is initial.

ENDFORM.

What I want to do is select records from BSIS where bukrs is equal to the parameter p_bukrs

and budat is less than the select-option s_budat and xragl is initial, xstov is initial

and hkont is equal to 190100. I checked BSIS and put in the conditions it does contain records.

Help would be greatly appreciated.Thanks guys!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,262

Hi,

Do the following thinks




Data : lv_xragl type xragl,
       lv_xstov type xstov,
       lv_honkt type HKONT.


lv_honkt = '190100'.

conversion_exit_alpha_input
  importing
     input = lv_honkt
  exporting
     ouput = lv_honkt.

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis
INTO TABLE it_bsis
WHERE bukrs = p_bukrs
* AND budat < s_budat
AND xragl = lv_xragl
AND xstov = lv_xstov
AND hkont = lv_honkt.

Hello experts,

I am confused as to why my select statement does not get any records. I checked the table and it

does have records.Anyway, below is my select statement:

REPORT zfr_aging_of_deposits

NO STANDARD PAGE HEADING

LINE-SIZE 0

LINE-COUNT 0

MESSAGE-ID zz.

----


  • Data dictionary tables *

----


TABLES: bsis,

bkpf.

TYPE-POOLS: slis.

----


  • Structures *

----


TYPES: BEGIN OF t_bsis,

bukrs LIKE bsis-bukrs,

hkont LIKE bsis-hkont,

zuonr LIKE bsis-zuonr,

belnr LIKE bsis-belnr,

gjahr LIKE bsis-gjahr,

budat LIKE bsis-budat,

shkzg LIKE bsis-shkzg,

dmbtr LIKE bsis-dmbtr,

sgtxt LIKE bsis-sgtxt,

END OF t_bsis.

----


  • Internal tables *

----


DATA: it_bsis TYPE STANDARD TABLE OF t_bsis.

*field-symbols

FIELD-SYMBOLS: <fs_bsis> LIKE LINE OF it_bsis.

----


  • Selection screen *

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_bukrs LIKE t001-bukrs.

SELECT-OPTIONS: s_budat FOR bkpf-budat.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN ON p_bukrs.

IF p_bukrs <> 'GLOB' and

p_bukrs <> 'INOV' and

p_bukrs <> 'GXCH'.

MESSAGE e008 WITH 'Invalid Company Code!'.

ENDIF.

----


  • Start of selection *

----


START-OF-SELECTION.

PERFORM get_data.

----


  • FORM get_data *

----


  • ........ *

----


FORM get_data.

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis

INTO TABLE it_bsis

WHERE bukrs = p_bukrs

  • AND budat < s_budat

AND xragl = ''

AND xstov = ''

AND hkont = '190100'.

check not it_bsis[] is initial.

ENDFORM.

What I want to do is select records from BSIS where bukrs is equal to the parameter p_bukrs

and budat is less than the select-option s_budat and xragl is initial, xstov is initial

and hkont is equal to 190100. I checked BSIS and put in the conditions it does contain records.

Help would be greatly appreciated.Thanks guys!

9 REPLIES 9
Read only

Former Member
0 Likes
1,262

Hello,

Use conversion exit: CONVERSION_EXIT_ALPHA_INPUT before you pass the HKONT. The Acct number has to be padded with leading zeros.

Regards, Murugesh AS

Read only

0 Likes
1,262

Hi,

Could you please provide me with a sample code. Thanks a lot!

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

Hi,

check this piece of code..

data: p(5) value '10'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = p

IMPORTING

OUTPUT = p.

Output: p = 00010.

This way we can do..

Cheers,

SImha.

Read only

0 Likes
1,262
REPORT zfr_aging_of_deposits
NO STANDARD PAGE HEADING
LINE-SIZE 0
LINE-COUNT 0
MESSAGE-ID zz.


*---------------------------------------------*
* Data dictionary tables *
*---------------------------------------------*
TABLES: bsis,
bkpf.


TYPE-POOLS: slis.

*---------------------------------------------*
* Structures *
*---------------------------------------------*
TYPES: BEGIN OF t_bsis,
bukrs LIKE bsis-bukrs,
hkont LIKE bsis-hkont,
zuonr LIKE bsis-zuonr,
belnr LIKE bsis-belnr,
gjahr LIKE bsis-gjahr,
budat LIKE bsis-budat,
shkzg LIKE bsis-shkzg,
dmbtr LIKE bsis-dmbtr,
sgtxt LIKE bsis-sgtxt,
END OF t_bsis.

*---------------------------------------------*
* Internal tables *
*---------------------------------------------*
DATA: it_bsis TYPE STANDARD TABLE OF t_bsis.

*field-symbols
FIELD-SYMBOLS: <fs_bsis> LIKE LINE OF it_bsis.


*---------------------------------------------*
* Selection screen *
*---------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE t001-bukrs.
SELECT-OPTIONS: s_budat FOR bkpf-budat.
SELECTION-SCREEN END OF BLOCK b1.


AT SELECTION-SCREEN ON p_bukrs.
IF p_bukrs <> 'GLOB' and
p_bukrs <> 'INOV' and
p_bukrs <> 'GXCH'.
MESSAGE e008 WITH 'Invalid Company Code!'.
ENDIF.
*---------------------------------------------*
* Start of selection *
*---------------------------------------------*
START-OF-SELECTION.
PERFORM get_data.


*---------------------------------------------------------------------*
* FORM get_data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM get_data.
SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis
INTO TABLE it_bsis
WHERE bukrs = p_bukrs
* AND budat < s_budat
AND xragl = ''
AND xstov = ''
AND hkont = <b>'0000190100'</b>.

check not it_bsis[] is initial.
ENDFORM.

Regards

vijay

Read only

0 Likes
1,262
FORM get_data.
*-
data: L_hkont like bsis-hkont.
L_hkont = '190100'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = L_hkont
 IMPORTING
   OUTPUT        = L_hkont
          .
*-
SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis
INTO TABLE it_bsis
WHERE bukrs = p_bukrs
* AND budat < s_budat
AND xragl = ''
AND xstov = ''
AND hkont = L_HKONT.

Message was edited by: Murugesh Arcot

Read only

0 Likes
1,262

Hi,

Change the code like this:

p_hkont like bsid-hkont.

p_hkont = '190100'

pass p_hkont to select statement.

Laxman

Read only

0 Likes
1,262
REPORT zfr_aging_of_deposits
NO STANDARD PAGE HEADING
LINE-SIZE 0
LINE-COUNT 0
MESSAGE-ID zz.


*---------------------------------------------*
* Data dictionary tables *
*---------------------------------------------*
TABLES: bsis,
bkpf.


TYPE-POOLS: slis.

*---------------------------------------------*
* Structures *
*---------------------------------------------*
TYPES: BEGIN OF t_bsis,
bukrs LIKE bsis-bukrs,
hkont LIKE bsis-hkont,
zuonr LIKE bsis-zuonr,
belnr LIKE bsis-belnr,
gjahr LIKE bsis-gjahr,
budat LIKE bsis-budat,
shkzg LIKE bsis-shkzg,
dmbtr LIKE bsis-dmbtr,
sgtxt LIKE bsis-sgtxt,
END OF t_bsis.

*---------------------------------------------*
* Internal tables *
*---------------------------------------------*
DATA: it_bsis TYPE STANDARD TABLE OF t_bsis.

*field-symbols
FIELD-SYMBOLS: <fs_bsis> LIKE LINE OF it_bsis.


*---------------------------------------------*
* Selection screen *
*---------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE t001-bukrs.
SELECT-OPTIONS: s_budat FOR bkpf-budat.
SELECTION-SCREEN END OF BLOCK b1.


AT SELECTION-SCREEN ON p_bukrs.
IF p_bukrs <> 'GLOB' and
p_bukrs <> 'INOV' and
p_bukrs <> 'GXCH'.
MESSAGE e008 WITH 'Invalid Company Code!'.
ENDIF.
*---------------------------------------------*
* Start of selection *
*---------------------------------------------*
START-OF-SELECTION.
PERFORM get_data.


*---------------------------------------------------------------------*
* FORM get_data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM get_data.
<b>data: p_hkont(10).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = '190100'
 IMPORTING
   OUTPUT        = p_hkont
          .</b>

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis
INTO TABLE it_bsis
WHERE bukrs = p_bukrs
* AND budat < s_budat
AND xragl = ''
AND xstov = ''
AND hkont = <b>p_hkont</b>.

check not it_bsis[] is initial.
ENDFORM.
Read only

Former Member
0 Likes
1,263

Hi,

Do the following thinks




Data : lv_xragl type xragl,
       lv_xstov type xstov,
       lv_honkt type HKONT.


lv_honkt = '190100'.

conversion_exit_alpha_input
  importing
     input = lv_honkt
  exporting
     ouput = lv_honkt.

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis
INTO TABLE it_bsis
WHERE bukrs = p_bukrs
* AND budat < s_budat
AND xragl = lv_xragl
AND xstov = lv_xstov
AND hkont = lv_honkt.

Read only

Former Member
0 Likes
1,262

Hi Viray,

Use FM CONVERSION_EXIT_ALPHA_INPUT before you pass HKONT value.

Thanks & Regards,

YJR.