Skip to Content
0
Former Member
Nov 25, 2011 at 08:20 AM

capture SAP Ad-Hoc query output in report

76 Views

Hi All,

I have to run an Ad-hoc query from report (se38 program) and after execution of that Ad-hoc query I have to capture the output of that query and use in Report.

I am trying the follwing approach but getting Run time error (internal Error)

SUBMIT XXXXX EXPORTING LIST TO MEMORY

Data:

v_spool like pri_params-plist,

v_text like pri_params-prtxt,

v_print_parms type PRI_PARAMS,

V_valid TYPE c LENGTH 1,

v_spool = sy-uzeit.

v_text = sy-uname.

call function 'GET_PRINT_PARAMETERS'

exporting

destination = 'locl'

list_name = v_spool

list_text = v_text

user = sy-uname

importing

out_parameters = v_print_parms

valid = v_valid

exceptions

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

others = 4.

IF V_valid = 'X' AND sy-subrc = 0.

SUBMIT SAP_QUERY_AD_HOC

TO SAP-SPOOL

SPOOL PARAMETERS v_print_parms

  • ARCHIVE PARAMETERS archi_parameters

WITHOUT SPOOL DYNPRO

WITH p_wsid = 'X'

WITH p_bgname = 'ZHR_OM_PA'

WITH p_sgname = 'ZHR_PA_PERSONNELADMIN'

WITH p_quname = 'Z_HRDATA' AND RETURN.

ENDIF.

Thanks in Advance