I have constructed a generic function module and also an extract structure in order to build a generic extractor. The abap code fills the E_T_DATA with all the data of the SELECT statement, and a RAISE NO_MORE_DATA instruction was included on the end of the code. I tested my extractor using RSA3 and it returns 0 records. I debugged the code and E_T_DATA is receiving the data (it's filled ok) but data is lost after entering to the RAISE NO_MORE_DATA.
What i am trying to say is that my code is filling E_T_DATA , if i cut the RAISE NO_MORE_DATA then the RSA3 is returning the data, but it never ends because it need the RAISE NO_MORE_DATA in order to stop.
But when i put the RAISE NO_MORE_DATA , the E_T_DATA is cleared and the RSA3 returns 0 records.
Please help me...
Carlos España
CEMPRO.
Hi,
Try this,
e_t_data[] = t_fras[].
if i_initflag is initial.
raise no_more_data.
endif.
But, Basically the no_more_data exception is raised only when there is no data for the selection.This will be the first checkup once you start fetching the cursor. As per your logic e_d_data will be updated only if there is no data which is when i_initflag is initial.Because somewhere else in the top of the code you will be setting i_initflag = some value.
let me know if you have any problem.
Thank you
Arun
THIS IS MY CODE, PLEASE NOTE THAT I AM USING ALL THE RELEVANT INSTRUCTIONS IN ORDER TO BUILD A GENERIC EXTRACTOR.
FUNCTION ZTPM001.
*"----
""Interfase local
*" IMPORTING
*" VALUE(I_REQUNR) TYPE RSAAPI_IF-REQUNR
*" VALUE(I_DSOURCE) TYPE ROOSOURCE-OLTPSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE RSAAPI_IF-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE RSAAPI_IF-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE ARCHREAD OPTIONAL
*" TABLES
*" T_FRAS STRUCTURE ZTPM_FACTURAS OPTIONAL
*" T_RES_FRAS STRUCTURE ZTPM_RESUMEN_FACTURAS OPTIONAL
*" T_CONDICIONES STRUCTURE ZTPM_CONDICIONES OPTIONAL
*" E_T_DATA STRUCTURE ZTPM_FACTURAS OPTIONAL
*" I_T_SELECT STRUCTURE RSSELECT OPTIONAL
*" I_T_FIELDS STRUCTURE RSFIELDSEL OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*"----
perform load_my_data.
if i_initflag is initial.
e_t_data[] = t_fras[].
raise no_more_data.
endif.
ENDFUNCTION.
Add a comment