Skip to Content
author's profile photo Former Member
Former Member

FOR ALL ENTRIES IS possible in OPEN CURSOR and FETCH CURSOR?

Hi Experts

below is my code statements is it possible to add FOR ALL ENTRIES statement?if yes plz help me how to add?

OPEN CURSOR WITH HOLD i_cursor_bsik FOR

SELECT mandt bukrs lifnr umsks umskz augdt augbl zuonr gjahr

belnr buzei monat shkzg gsber dmbtr wrbtr sgtxt hkont

vbund kostl xnegp prctr fkber bschl

FROM zbw_bkpf_bsik

CLIENT SPECIFIED

WHERE mandt = sy-mandt

AND lifnr IN r_lifnr

AND blart IN r_blart

AND ( ( zzcpudt = max_cpudt AND

zzcputm > max_cputm ) OR

( zzcpudt > max_cpudt ) ).

OPEN CURSOR WITH HOLD i_cursor_bsak FOR

SELECT mandt bukrs lifnr umsks umskz augdt augbl zuonr gjahr

belnr buzei monat shkzg gsber dmbtr wrbtr sgtxt hkont

vbund kostl xnegp prctr fkber zzcpudt zzcputm bschl

FROM zbw_bkpf_bsak

CLIENT SPECIFIED

WHERE mandt = sy-mandt

AND lifnr IN r_lifnr

AND blart IN r_blart

AND ( ( zzcpudt = max_cpudt AND

zzcputm > max_cputm ) OR

( zzcpudt > max_cpudt ) ) .

2ND STATEMENT(this point iam getting dump at production) but not in development

FETCH NEXT CURSOR i_cursor_bsik

APPENDING CORRESPONDING FIELDS OF TABLE lt_buffer_bsik

PACKAGE SIZE i_max_lines.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 22, 2009 at 08:45 AM

    OPEN CURSOR WITH HOLD i_cursor_bsik FOR

    SELECT mandt bukrs lifnr umsks umskz augdt augbl zuonr gjahr

    belnr buzei monat shkzg gsber dmbtr wrbtr sgtxt hkont

    vbund kostl xnegp prctr fkber bschl

    FROM zbw_bkpf_bsik

    CLIENT SPECIFIED

    WHERE mandt = sy-mandt

    AND lifnr IN r_lifnr

    AND blart IN r_blart

    AND ( ( zzcpudt = max_cpudt AND

    zzcputm > max_cputm ) OR

    ( zzcpudt > max_cpudt ) ).

    do.

    FETCH NEXT CURSOR i_cursor_bsik

    APPENDING CORRESPONDING FIELDS OF TABLE lt_buffer_bsik

    PACKAGE SIZE i_max_lines.

    • do you want these entries for "FOR ALL ENTRIES" in the select for BSAK ??

    if sy-subrc <> 0.

    exit.

    endif.

    OPEN CURSOR WITH HOLD i_cursor_bsak FOR

    SELECT mandt bukrs lifnr umsks umskz augdt augbl zuonr gjahr

    belnr buzei monat shkzg gsber dmbtr wrbtr sgtxt hkont

    vbund kostl xnegp prctr fkber zzcpudt zzcputm bschl

    FROM zbw_bkpf_bsak

    CLIENT SPECIFIED

    for all entries in BSIK ==> see this

    WHERE mandt = sy-mandt

    AND lifnr IN r_lifnr

    AND blart IN r_blart

    AND ( ( zzcpudt = max_cpudt AND

    zzcputm > max_cputm ) OR

    ( zzcpudt > max_cpudt ) ) .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.