cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with RSCRMBW_REPORT:Could not find query definition

Former Member
0 Kudos
251

Hi All

I am trying to use the following program to down load bex query into a table. It gives error when the function module is called first time with 'OPEN' mode.

Error description:  Could not find query definition error in

 

REPORT ZBW_RUN_QUERY.

 

 

 

DATA: ERROR(50) TYPE C.

DATA: G_T_RETURN LIKE BAPIRET2 OCCURS 0.

DATA: L_PROC LIKE RSCRMMON-PROCESSED.

DATA: GV_BATCHID LIKE RSCRMMON-BATCHID,

GV_JOBNAME LIKE TBTCO-JOBNAME,

GV_ACTSTATUS LIKE TBTCJOB-STATUS,

GV_JOBCOUNT LIKE TBTCO-JOBCOUNT,

GV_DBSTATUS LIKE TBTCJOB-STATUS,

L_STATUS TYPE RSCRMBSTAT,

L_WAIT TYPE I.

DATA: L_T_CRMVAR LIKE RSCRMVARP OCCURS 0,

L_S_CRMVAR TYPE RSCRMVARP.

DATA: L_INPUT(30) TYPE C.

DATA: I_AXIS1 TYPE STANDARD TABLE OF RSCRMAXIS,

I_CELL1 TYPE STANDARD TABLE OF RSCRMCELL,

I_AXIS TYPE STANDARD TABLE OF RSCRMAXIS,

I_CELL TYPE STANDARD TABLE OF RSCRMCELL.

 

PARAMETER: P_REPUID TYPE RSCRMREPUID DEFAULT 'TEST/TEST1'

OBLIGATORY.

PARAMETER: P_EXTRNM TYPE TABNAME OBLIGATORY.

PARAMETER: P_OVERWR LIKE RSCRMCONTXT-ACTIVE DEFAULT 'X'.

 

START-OF-SELECTION.

 

 

 

*Open Query

 

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

I_MODE = 'OPEN'

I_REPORTUID = P_REPUID

I_REPNAME = ''

I_PACKSIZE = 10000

TABLES

E_T_RETURN = G_T_RETURN.

IF G_T_RETURN IS NOT INITIAL.

READ TABLE G_T_RETURN TRANSPORTING NO FIELDS

WITH KEY TYPE = 'E'.

IF SY-SUBRC = 0.

CONCATENATE 'Errors occurred when opening query' ERROR INTO ERROR.

MESSAGE ERROR TYPE 'E'.

EXIT.

ENDIF.

ENDIF.

 

*Execute the report

 

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

I_MODE = 'START'

I_REPORTUID = P_REPUID

I_EXECMODE = 'TABLE'

I_EXTRACT = P_EXTRNM

I_CLEAREXTRACT = P_OVERWR

IMPORTING

E_BATCHID = GV_BATCHID

E_JOBNAME = GV_JOBNAME

E_JOBCOUNT = GV_JOBCOUNT

TABLES

E_T_AXIS = I_AXIS1

E_T_CELL = I_CELL1

E_T_RETURN = G_T_RETURN.

IF G_T_RETURN IS NOT INITIAL.

READ TABLE G_T_RETURN

TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.

IF SY-SUBRC = 0.

CONCATENATE 'Errors occurred when executing query' ERROR INTO ERROR.

MESSAGE ERROR TYPE 'E'. EXIT.

ENDIF.

ENDIF.

IF SY-SUBRC = 0.

WHILE ( L_STATUS NE 'SUCC' ).

CALL FUNCTION 'RSCRMBW_BATCH_STATUS_CHECK'

EXPORTING

I_BATCHID = GV_BATCHID

IMPORTING

E_STATUS = L_STATUS

EXCEPTIONS

NO_JOB_DATA = 1

INHERITED_ERROR = 2

OTHERS = 3.

IF L_STATUS = 'RUNN' OR

L_STATUS = ' ' OR

L_STATUS = 'SCHE'.

WAIT UP TO 30 SECONDS.

ENDIF.

ENDWHILE.

IF L_STATUS = 'SUCC'.

IF SY-SUBRC = 0.

WRITE 'Query finished'.

ELSE.

CLEAR ERROR.

CONCATENATE 'Job ' GV_BATCHID ' failed.' INTO ERROR.

MESSAGE ERROR TYPE 'E'.

ENDIF.

ENDIF.

ENDIF.

 

*Close report

 

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

I_MODE = 'CLOSE'

I_REPORTUID = P_REPUID.

IF G_T_RETURN IS NOT INITIAL.

READ TABLE G_T_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.

IF SY-SUBRC = 0.

CONCATENATE 'Errors occurred when closing query' ERROR INTO ERROR.

MESSAGE ERROR TYPE 'E'.

EXIT.

ENDIF.

ENDIF.

Please advise how to reolve this error. I have tried with many report names. Issue remain same.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi.

Did you try to debug the code ?

Which error messages do you get ?

Regards.

former_member182470
Active Contributor
0 Kudos

Hi,

Try with RSCRM_BAPI t-code to extract a Query result to a table.

Regards,

Suman

sapna_jgurudutt
Active Contributor
0 Kudos

Hi,

Can you please refer the following note and check whether it helps you:

1562400 - RSCRM:Processing of queries with namespaces

Thanks & Regards,

Sapna