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

dump when using IN in select statement

Former Member
0 Likes
1,546

Hi All


SELECT rsnum matnr werks bdter bdmng  INTO  TABLE gt_bdmng

     FROM resb FOR ALL ENTRIES IN gt_matnr

      WHERE matnr = gt_matnr-matnr AND bdart IN (c_bdart_sb ,c_bdart_ar)

                                   AND werks = p_werks AND XLOEK = '' AND KZEAR = ''.

c_bdart_sb = 'SB'

c_bdart_ar = 'AR' 

sb and ar are declared as constants.

dump description

I am getting this dump in production,Program worked fine in development and quality.

Thanks

Vamsi

1 ACCEPTED SOLUTION
Read only

former_member188724
Contributor
0 Likes
1,454

Hi,

Please move bdart i.e., sb & ar into ranges table(t_bdart) and use

SELECT rsnum matnr werks bdter bdmng  INTO  TABLE gt_bdmng

     FROM resb FOR ALL ENTRIES IN gt_matnr

      WHERE matnr = gt_matnr-matnr AND bdart IN t_bdart

                                   AND werks = p_werks AND XLOEK = '' AND KZEAR = ''.

Hope it helps.

Regards,

K.S

7 REPLIES 7
Read only

fredericbasilius
Participant
0 Likes
1,454

Hi Mohan,

Can you please share the declaration provided for the constants c_bdart_sb ,c_bdart_ar.

Regards,

FB

Read only

0 Likes
1,454

Hi Fredric

CONSTANTS : c_bdart_sb(2) TYPE c VALUE 'SB',

                          c_bdart_ar(2) TYPE c VALUE 'AR',

thanks

Vamsi

Read only

Former Member
0 Likes
1,454

Hi,

Please try below:

   SELECT rsnum matnr werks bdter bdmng  INTO  TABLE gt_bdmng
     FROM resb FOR ALL ENTRIES IN gt_matnr
      WHERE matnr = gt_matnr-matnr AND ( bdart = c_bdart_sb or bdart = c_bdart_ar )
                                   AND werks = p_werks AND XLOEK = '' AND KZEAR = ''.

Hope it helps.

Regards,

VS

Read only

former_member188724
Contributor
0 Likes
1,455

Hi,

Please move bdart i.e., sb & ar into ranges table(t_bdart) and use

SELECT rsnum matnr werks bdter bdmng  INTO  TABLE gt_bdmng

     FROM resb FOR ALL ENTRIES IN gt_matnr

      WHERE matnr = gt_matnr-matnr AND bdart IN t_bdart

                                   AND werks = p_werks AND XLOEK = '' AND KZEAR = ''.

Hope it helps.

Regards,

K.S

Read only

Former Member
0 Likes
1,454

Hi,

I think the problem seems to be bdart IN (c_bdart_sb ,c_bdart_ar).


Can u check replacing it with bdart IN ('SB','AR')

A Rahim.

Read only

Former Member
0 Likes
1,454

Hi All

changed

   gr_bdart-sign    = c_i .

   gr_bdart-option  = c_eq.

   gr_bdart-low     = c_bdart_sb.

   Append gr_bdart.

   gr_bdart-low     = c_bdart_ar.

   Append gr_bdart.

   CLEAR gr_bdart.

   SELECT rsnum matnr werks bdter bdmng  INTO  TABLE gt_bdmng

     FROM resb FOR ALL ENTRIES IN gt_matnr

      WHERE matnr = gt_matnr-matnr AND bdart IN gr_bdart

                                   AND werks = p_werks AND xloek = '' and kzear = ''.



I need reason why it went dump with earlier query

Read only

0 Likes
1,454

col [NOT] IN (dobj1, dobj2 ... ) ...


in supports only values not variables

like IN ('C','F','Y')

as per documentation

ABAP Keyword Documentation