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

query

Former Member
0 Likes
581

Hi experts

I am using the following query, its working ,but in debug mode it goes to dump(in smartforms).

Can anyone tell me how to change this query.

select SHKZG

ZUONR

from bseg

into (w_shkzg , w_zuonr)

where belnr = w_belnr and

SHKZG = 'S'.

endselect.

if sy-subrc = 0.

v_zuonr = w_zuonr.

endif.

Thanks in advance.

Regards

Rajaram

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
566

Hi,


select SHKZG
ZUONR
from bseg
into (w_shkzg , w_zuonr)
where belnr = w_belnr and
SHKZG = 'S'.
endselect.
if sy-subrc = 0.  "<< You need to break-point here only and not inside the select endselect statement

v_zuonr = w_zuonr.
endif.

Whenever you are placing a debugger in the select statement you are inturrupting the normal proceeding of a predefined statement.

Generally others are re-written in ABAP but database extractions are used as it from SQL counterparts.

Therefore, system is not able to handle external breakpoint process.

aRs

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
567

Hi,


select SHKZG
ZUONR
from bseg
into (w_shkzg , w_zuonr)
where belnr = w_belnr and
SHKZG = 'S'.
endselect.
if sy-subrc = 0.  "<< You need to break-point here only and not inside the select endselect statement

v_zuonr = w_zuonr.
endif.

Whenever you are placing a debugger in the select statement you are inturrupting the normal proceeding of a predefined statement.

Generally others are re-written in ABAP but database extractions are used as it from SQL counterparts.

Therefore, system is not able to handle external breakpoint process.

aRs

Read only

Former Member
0 Likes
566

well since you dont do anything within your Select - Endselect loop, the question opens up why you dont use an array fetch instead or a select single.

Read only

Former Member
0 Likes
566

Hi ,

their is no problem in ur query . Their could be some pblm in your smartform .

Can u attach the meesage displayed in short dump . With short dump you can identify the problem area .

Regards

Read only

varma_narayana
Active Contributor
0 Likes
566

Hi Rajaram.

It is better if u declare internal table to fetch the data using array fetch.

Check the code below.

data : begin of itab occurs 100,

SHKZG TYPE BSEG-SHKZG,

ZUONR TYPE BSEG-ZUONR,

end of itab.

select SHKZG

ZUONR

from bseg

into TABLE ITAB

where belnr = w_belnr and

SHKZG = 'S'.

if sy-subrc = 0.

**Here you have to use READ TABLE or LOOP .. Endloop on the ITAB

endif.

Note: Whenever you try to Debug SELECT .. ENDSELECT statement in debugging it will give short dump since it will close the Connection to DB.

<b>Reward if Helpful</b>