2008 Mar 25 6:59 PM
Hello Gurus,
Can we use a FM inside do loop after FETCH NEXT CURSOR statement?....is it gives any short dumps?
i have code like this:
OPEN CURSOR WITH HOLD db_cursor FOR
SELECT * FROM -
DO.
FETCH NEXT CURSOR db_cursor
INTO CORRESPONDING FIELDS OF TABLE ABC
PACKAGE SIZE package_size.
IF sy-subrc NE 0.
CLOSE CURSOR db_cursor.
EXIT.
ENDIF.
LOOP AT ABC INTO XYZ.
MOVE-CORRESPONDING XYZ TO SRT.
IF 123 = 234.
-
ELSE.
CALL FUNCTION 'G_PERIOD_GET'
EXPORTING
company = company_code
date = date
variant = fiscal_variant
IMPORTING
period = period
year = year.
ENDIF.
is anything wrong in this code plz suggest...
from the above code iam getting an runtime error : The current ABAP program "SAP-----" had to be terminated because it has
come across a statement that unfortunately cannot be executed. Unable to perform database selection fully.
Appriciate for useful answers...
Thanks,
Sree.
Hello Gurus,
Can we use a FM inside do loop after FETCH NEXT CURSOR statement?....is it gives any short dumps?
i have code like this:
OPEN CURSOR WITH HOLD db_cursor FOR
SELECT * FROM -
DO.
FETCH NEXT CURSOR db_cursor
INTO CORRESPONDING FIELDS OF TABLE ABC
PACKAGE SIZE package_size.
IF sy-subrc NE 0.
CLOSE CURSOR db_cursor.
EXIT.
ENDIF.
LOOP AT ABC INTO XYZ.
MOVE-CORRESPONDING XYZ TO SRT.
IF 123 = 234.
-
ELSE.
CALL FUNCTION 'G_PERIOD_GET'
EXPORTING
company = company_code
date = date
variant = fiscal_variant
IMPORTING
period = period
year = year.
ENDIF.
is anything wrong in this code plz suggest...
from the above code iam getting an runtime error : The current ABAP program "SAP-----" had to be terminated because it has
come across a statement that unfortunately cannot be executed. Unable to perform database selection fully.
Appriciate for useful answers...
Thanks,
Sree.
2008 Mar 25 7:36 PM
hi check this example....to under stand....
DATA: BEGIN OF count_line,
carrid TYPE spfli-carrid,
count TYPE i,
END OF count_line,
spfli_tab TYPE TABLE OF spfli.
DATA: dbcur1 TYPE cursor,
dbcur2 TYPE cursor.
OPEN CURSOR dbcur1 FOR
SELECT carrid count(*) AS count
FROM spfli
GROUP BY carrid
ORDER BY carrid.
OPEN CURSOR dbcur2 FOR
SELECT *
FROM spfli
ORDER BY carrid.
DO.
FETCH NEXT CURSOR dbcur1 INTO count_line.
IF sy-subrc <> 0.
EXIT.
ENDIF.
FETCH NEXT CURSOR dbcur2
INTO TABLE spfli_tab PACKAGE SIZE count_line-count.
ENDDO.
CLOSE CURSOR: dbcur1,
dbcur2.
regards,
venkat.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |