Background run of a report
Hi all,
I want my report to run in background becoz it is taking more time in front time....when i have given some selection screen variants and click on F9...it is not going directly to background run...but instead it is executing in the front end and displaying the o/p and then when i click on back(F3) it is showing to enter background run parameters and then execute in background....but i want background to be done..before the frontend...when ever i click F9 it should display the background parameter to enter and execute in background...pls help
AT SELECTION-SCREEN.
PERFORM build_table_for_report.
IF NOT ( gt_reptab1 IS INITIAL ).
CALL SCREEN '0900'.
ENDIF.
This i have wrote in my report...when i comment the AT SELECTION-SCREEN. it is showing my background run first correctly...but if i comment it will it have any side-effects???
Similar Messages
-
CNTL_ERROR while running a custom report program in background mode
Hi,
I am running a report in background on daily basis. I am using cl_gui_custom_container class here and calling the constructor of this class. I am getting a CNTL_ERROR exception at this point. But if i run the same report directly, it is not throwing any exception. The problem is if i schedule it to background. I am not able to sort it out.
I've written the following code below:
I did apply the logic that you'd mentioned.
I've implemented the code as below.
IF gr_container IS INITIAL.
*** Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
* Run in foreground
CREATE OBJECT gr_container
EXPORTING
container_name = 'WORK_AREA_CONTAINER'.
CREATE OBJECT lv_grid
EXPORTING I_PARENT = gr_container.
ELSE.
* Run in background
CREATE OBJECT lv_grid
EXPORTING
I_PARENT = gr_dockcontainer.
ENDIF.
ENDIF.
i_parent_control = gr_dockcontainer.
CREATE OBJECT m_base_splitter
EXPORTING
parent = i_parent_control
ROWS = 1
columns = 2
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CALL METHOD m_base_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = m_splitter_right_part
EXCEPTIONS
OTHERS = 1.
After I've implemented the above code I'm getting the following error in the batch job:
Category ABAP Programming Error
Runtime Errors OBJECTS_OBJREF_NOT_ASSIGNED
Except. CX_SY_REF_IS_INITIAL
You attempted to use a 'NULL' object reference (points to 'nothing')
access a component (variable: "M_BASE_SPLITTER").
An object reference must point to an object (an instance of a class)
before it can be used to access components.
Either the reference was never set or it was set to 'NULL' using the
CLEAR statement.
Would you be able to help me in the above issue?
Regards,
MandeepHi Alexander,
Yes I'd declared gr_dockcontainer as type ref to CL_GUI_DOCKING_CONTAINER. And I've now replaced the previous code and wwrote the below code :
gr_container IS INITIAL.
***Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
***Run in foreground
CREATE OBJECT gr_container
EXPORTING
container_name = 'WORK_AREA_CONTAINER'.
CREATE OBJECT lv_grid
EXPORTING
I_PARENT = gr_container.
ELSE.
***Run in background
CREATE OBJECT gr_dockcontainer
EXPORTING
NAME = 'WORK_AREA_CONTAINER'.
ENDIF.
ENDIF.
= gr_dockcontainer.
CREATE OBJECT m_base_splitter
EXPORTING
parent = i_parent_control
ROWS = 1
columns = 2
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CALL METHOD m_base_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = m_splitter_right_part
EXCEPTIONS
OTHERS = 1.
But after implementing the above code I'm facing the same issue of CTRL ERROR- " GUI cannot be reached".
Please guide me through this.
Regards,
Mandeep -
Running the alv report in background and sending it thro email
hi,
i have to run the alv report in background and send the output through emailHi
Many a times there is a requirement to display ALV Grid (not ALV List) in the background Job. I have checked the SDN Forum for the same and it has been mentioned that ALV Grid cannot be displayed in Background, but the list output of ALV is possible. So user wont have the actual Grid interface but the List interface.
There is a workaround to display ALV Grid in Background Job. The only restriction is you cant schedule the job through SM36. You need to execute the transaction of the report program, fill in the selection screen data and hit Execute.
The job would be executed in background. User will be able to see the Job Log and Job Status after executing the program. User doesnt have to go to SM37 to view the job status/log. Once the Job Status is changed to COMPLETED, user can click on DISPLAY SPOOL to view the ALV Grid.
Limitations:
Cant schedulea background job
The session should be active until the background job is completed. If the session is closed, then user wont be able to check the output in ALV Grid. User would be able to check the output through spool or SM37
Advantages:
If the spool width is greater than 255 characters, then the entire width could be seen in the output because the output is directed to an ALV Grid and not to spool
Interface of ALV Grid is available instead of ALV List even though its a background job.
Program wont give the TIME OUT error
Steps Required:
1. Once you execute the program, the following screen would be displayed
2. Click Display Job Status to check the Status of the Background Job
3. Click on Display the Job Log to check the Log
4. Click on Display Job Status to check the Job Status
5. Click on DISPLAY SPOOL to check the spool content once the Job Status is changed to COMPLETED. Output is displayed in ALV Grid
Programs:
1. Two different programs needs to be created
ZPROGRAM_ONE: This is the 1st program, where the selection screen and all the data validations would be done. Error handling for invalid data should be done in this program.
Once the data validation is done, this program would call the 2nd program ZPROGEAM_TWO. Build the logic to display ALV Grid in this program. The logic will only display ALV in foreground and it wont be reflected in the spool.
ZPROGRAM_TWO: This program would fetch all the data and do all the processing. If you want the spool output along with ALV Grid output, then build the logic in this program to display ALV Grid.
*& Report ZPROGRAM_ONE *
REPORT zprogram_one .
PRASHANT PATIL
TABLES : mara,
tsp01.
type-pools:slis.
TYPES : BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
END OF t_mara.
DATA : i_mara TYPE STANDARD TABLE OF t_mara,
wa_mara TYPE t_mara,
wa_index TYPE indx, " For Index details
wa_index_key TYPE indx-srtfd VALUE 'PRG_ONE',
i_jobsteplist TYPE STANDARD TABLE OF tbtcstep, " For spool number
wa_params TYPE pri_params, " To Get Print Parameters
wa_jobhead TYPE tbtcjob, " To know the status of job
wa_jobsteplist TYPE tbtcstep, " To know the spool
w_jobname TYPE tbtco-jobname, " Job name for bckgrnd job
w_jobcount TYPE tbtco-jobcount, " Unique id for bckgrd job
w_path TYPE string, " Upload path
w_lsind TYPE sy-lsind, " Index
wa_seltab TYPE rsparams,
i_seltab TYPE STANDARD TABLE OF rsparams,
wa_index1 TYPE indx, " For Index details
wa_index_key1 TYPE indx-srtfd VALUE 'PRG_TWO',
i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF i_fieldcat.
CONSTANTS DECLARATION *
CONSTANTS :
c_a(1) TYPE c VALUE 'A',
c_m(1) TYPE c VALUE 'M',
c_l(1) TYPE c VALUE 'L',
c_c(1) TYPE c VALUE 'C',
c_zfdr(4) TYPE c VALUE 'ZFDR',
c_x(1) TYPE c VALUE 'X',
c_locl(4) TYPE c VALUE 'LOCL', " Destination is LOCAL
c_f(1) TYPE c VALUE 'F', " Job Status - Failed
c_s(1) TYPE c VALUE 'S',
c_p(1) TYPE c VALUE 'P'.
SELECTION SCREEN PARAMETERS
SELECT-OPTIONS : s_matnr FOR mara-matnr.
START-OF-SELECTION.
Before the export, fill the data fields before CLUSTR
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
EXPORT s_matnr
TO DATABASE indx(st) FROM wa_index ID wa_index_key.
To Open the Job for background processing
PERFORM open_job.
To get the print parameters
PERFORM get_print_parameters.
Submit the job in background
PERFORM job_submit.
Close the background job
PERFORM job_close.
This is the output screen with the buttons ********
Create 3 buttons DISPLAY SPOOL, STATUS, JOBLOG
SET PF-STATUS 'ZS001'.
WRITE: / 'The program is submitted in Background'.
WRITE: / 'Press DISPLAY SPOOL to see the spool'.
WRITE: / 'Press STATUS to see the status of the background'.
AT USER-COMMAND.
If user presses the 'BACK' button
IF sy-ucomm = 'BAK'.
IF wa_jobhead-status = c_f OR
wa_jobhead-status = c_a.
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
If the user presses the 'DISPLAY SPOOL' Button
IF sy-ucomm = 'DISPLAY'.
PERFORM display_spool.
ENDIF.
If the user presses the 'JOB STATUS' Button
IF sy-ucomm = 'STATUS'.
PERFORM display_status.
ENDIF.
If the user presses the 'JOB LOG' Button
IF sy-ucomm = 'JOBLOG'.
PERFORM display_job_log.
ENDIF.
*& Form open_job
text
--> p1 text
<-- p2 text
FORM open_job .
This is to Create a new job which is to be submitted in background to
process sales order/delivery/invoice
Here we would get a unique id ( Jobcount ) which identifies our job
along with the job name which we have assigned to our job
CONCATENATE sy-uname
sy-datum
sy-uzeit
INTO w_jobname . " Assign unique jobname
CALL FUNCTION 'JOB_OPEN'
EXPORTING
DELANFREP = ' '
JOBGROUP = ' '
jobname = w_jobname
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
JOBCLASS =
IMPORTING
jobcount = w_jobcount
CHANGING
RET =
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " open_job
*& Form get_print_parameters
text
--> p1 text
<-- p2 text
FORM get_print_parameters .
DATA : l_valid TYPE c.
This is to get the Print Parameters for the job which is to be
submitted in background to process sales order/delivery/invoice
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_ID = C_CHAR_UNKNOWN
ARCHIVE_INFO = C_CHAR_UNKNOWN
ARCHIVE_MODE = C_CHAR_UNKNOWN
ARCHIVE_TEXT = C_CHAR_UNKNOWN
AR_OBJECT = C_CHAR_UNKNOWN
ARCHIVE_REPORT = C_CHAR_UNKNOWN
AUTHORITY = C_CHAR_UNKNOWN
COPIES = C_NUM3_UNKNOWN
COVER_PAGE = C_CHAR_UNKNOWN
DATA_SET = C_CHAR_UNKNOWN
DEPARTMENT = C_CHAR_UNKNOWN
destination = c_locl " LOCL
EXPIRATION = C_NUM1_UNKNOWN
immediately = space
IN_ARCHIVE_PARAMETERS = ' '
IN_PARAMETERS = ' '
LAYOUT = C_CHAR_UNKNOWN
LINE_COUNT = C_INT_UNKNOWN
LINE_SIZE = C_INT_UNKNOWN
LIST_NAME = C_CHAR_UNKNOWN
LIST_TEXT = C_CHAR_UNKNOWN
MODE = ' '
new_list_id = c_x
PROTECT_LIST = C_CHAR_UNKNOWN
no_dialog = c_x
RECEIVER = C_CHAR_UNKNOWN
RELEASE = C_CHAR_UNKNOWN
REPORT = C_CHAR_UNKNOWN
SAP_COVER_PAGE = C_CHAR_UNKNOWN
HOST_COVER_PAGE = C_CHAR_UNKNOWN
PRIORITY = C_NUM1_UNKNOWN
SAP_OBJECT = C_CHAR_UNKNOWN
TYPE = C_CHAR_UNKNOWN
user = sy-uname
USE_OLD_LAYOUT = ' '
UC_DISPLAY_MODE = C_CHAR_UNKNOWN
DRAFT = C_CHAR_UNKNOWN
ABAP_LIST = ' '
USE_ARCHIVENAME_DEF = ' '
DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN
PO_FAX_STORE = ' '
NO_FRAMES = C_CHAR_UNKNOWN
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = wa_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " get_print_parameters
*& Form job_submit
text
--> p1 text
<-- p2 text
FORM job_submit .
The job which we have created & the unique id ( jobcount ) which we
have got identifies our job. Hence those parameters are passed along
with the name of the background program "ZPROGRAM_TWO"
The job is submitted in background.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
ARCPARAMS =
authcknam = sy-uname
COMMANDNAME = ' '
OPERATINGSYSTEM = ' '
EXTPGM_NAME = ' '
EXTPGM_PARAM = ' '
EXTPGM_SET_TRACE_ON = ' '
EXTPGM_STDERR_IN_JOBLOG = 'X'
EXTPGM_STDOUT_IN_JOBLOG = 'X'
EXTPGM_SYSTEM = ' '
EXTPGM_RFCDEST = ' '
EXTPGM_WAIT_FOR_TERMINATION = 'X'
jobcount = w_jobcount
jobname = w_jobname
LANGUAGE = SY-LANGU
priparams = wa_params
report = 'ZPROGRAM_TWO'
VARIANT = ' '
IMPORTING
STEP_NUMBER =
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " job_submit
*& Form job_close
text
--> p1 text
<-- p2 text
FORM job_close .
Once the job is submitted in background then the job is closed
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
AT_OPMODE = ' '
AT_OPMODE_PERIODIC = ' '
CALENDAR_ID = ' '
EVENT_ID = ' '
EVENT_PARAM = ' '
EVENT_PERIODIC = ' '
jobcount = w_jobcount
jobname = w_jobname
LASTSTRTDT = NO_DATE
LASTSTRTTM = NO_TIME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
PRDMONTHS = 0
PRDWEEKS = 0
PREDJOB_CHECKSTAT = ' '
PRED_JOBCOUNT = ' '
PRED_JOBNAME = ' '
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
strtimmed = c_x
TARGETSYSTEM = ' '
START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
START_ON_WORKDAY_NR = 0
WORKDAY_COUNT_DIRECTION = 0
RECIPIENT_OBJ =
TARGETSERVER = ' '
DONT_RELEASE = ' '
TARGETGROUP = ' '
DIRECT_START =
IMPORTING
JOB_WAS_RELEASED =
CHANGING
RET =
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " job_close
*& Form display_spool
text
--> p1 text
<-- p2 text
FORM display_spool .
To Read the Job to get the spool details
DATA : l_rqident TYPE tsp01-rqident, " Spool Number
l_spoolno TYPE tsp01_sp0r-rqid_char.
CLEAR : l_rqident,
w_lsind,
wa_jobsteplist.
REFRESH : i_jobsteplist.
SET PF-STATUS 'ZAR02'.
Get the Spool Number
CALL FUNCTION 'BP_JOB_READ'
EXPORTING
job_read_jobcount = w_jobcount
job_read_jobname = w_jobname
job_read_opcode = '20'
JOB_STEP_NUMBER =
IMPORTING
job_read_jobhead = wa_jobhead
TABLES
job_read_steplist = i_jobsteplist
CHANGING
RET =
EXCEPTIONS
invalid_opcode = 1
job_doesnt_exist = 2
job_doesnt_have_steps = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Read the Job Step list to get the spool number
READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.
CHECK wa_jobsteplist-listident <> space.
Spool Number
l_rqident = wa_jobsteplist-listident.
MOVE l_rqident TO l_spoolno.
Check the spool in TSP01
SELECT SINGLE * FROM tsp01 WHERE rqident = l_rqident.
IF sy-subrc = 0.
LEAVE TO LIST-PROCESSING.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = l_spoolno
IMPORTING
RC =
STATUS =
PERFORM show_alv.
ENDIF.
w_lsind = sy-lsind.
IF sy-lsind GE 19.
sy-lsind = 1.
ENDIF.
ENDFORM. " display_spool
*& Form show_alv
text
--> p1 text
<-- p2 text
FORM show_alv .
Before the import, fill the data fields before CLUSTR.
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
To Import the selection screen data from Calling Program
IMPORT i_mara
FROM DATABASE indx(st) ID wa_index_key1 TO wa_index1.
FREE MEMORY ID wa_index_key1.
This prepares the field-catalog for ALV.
PERFORM prepare_fieldcatalog.
This displays the output in ALV format .
PERFORM display_alv.
ENDFORM. " show_alv
*& Form display_status
text
--> p1 text
<-- p2 text
FORM display_status .
To Display the STATUS of the JOB which is exectued in background
CLEAR : wa_jobsteplist.
REFRESH : i_jobsteplist.
WRITE:/ 'DISPLAYING JOB STATUS'.
CALL FUNCTION 'BP_JOB_READ'
EXPORTING
job_read_jobcount = w_jobcount
job_read_jobname = w_jobname
job_read_opcode = '20'
JOB_STEP_NUMBER =
IMPORTING
job_read_jobhead = wa_jobhead
TABLES
job_read_steplist = i_jobsteplist
CHANGING
RET =
EXCEPTIONS
invalid_opcode = 1
job_doesnt_exist = 2
job_doesnt_have_steps = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
To Display the status text as per the status type
CASE wa_jobhead-status.
WHEN 'S'. WRITE: / 'Scheduled'.
WHEN 'R'. WRITE: / 'Released'.
WHEN 'F'. WRITE: / 'Completed'.
WHEN 'A'. WRITE: / 'Cancelled'.
WHEN OTHERS.
ENDCASE.
IF sy-lsind GE 19.
sy-lsind = 1.
ENDIF.
ENDFORM. " display_status
*& Form display_job_log
text
--> p1 text
<-- p2 text
FORM display_job_log .
To display the log of the background program
LEAVE TO LIST-PROCESSING.
CALL FUNCTION 'BP_JOBLOG_SHOW_SM37B'
EXPORTING
client = sy-mandt
jobcount = w_jobcount
joblogid = ' '
jobname = w_jobname
EXCEPTIONS
error_reading_jobdata = 1
error_reading_joblog_data = 2
jobcount_missing = 3
joblog_does_not_exist = 4
joblog_is_empty = 5
joblog_show_canceled = 6
jobname_missing = 7
job_does_not_exist = 8
no_joblog_there_yet = 9
no_show_privilege_given = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " display_job_log
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
FORM prepare_fieldcatalog .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Material no.'.
wa_fieldcat-outputlen = '18'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERSDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Creation date'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Name of Person'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'LAEDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = ' Last Change'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " prepare_fieldcatalog
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat
tables
t_outtab = i_mara.
ENDFORM. " display_alv
ZPROGRAM_TWO: This is the 2nd program which would be called from program ZPROGRAM_ONE.
*& Report ZPROGRAM_TWO *
REPORT zprogram_two .
PRASHANT PATIL
TABLES : mara.
TYPE-POOLS:slis.
TYPES : BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
END OF t_mara.
DATA : i_mara TYPE STANDARD TABLE OF t_mara,
wa_mara TYPE t_mara,
wa_index TYPE indx, " For Index details
wa_index_key TYPE indx-srtfd VALUE 'PRG_ONE',
wa_index1 TYPE indx, " For Index details
wa_index_key1 TYPE indx-srtfd VALUE 'PRG_TWO',
i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF i_fieldcat.
SELECT-OPTIONS : s_matnr FOR mara-matnr.
Before the import, fill the data fields before CLUSTR.
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
To Import the selection screen data from Calling Program
IMPORT s_matnr
FROM DATABASE indx(st) ID wa_index_key TO wa_index.
FREE MEMORY ID wa_index_key.
SELECT matnr
ersda
ernam
laeda
FROM mara
INTO TABLE i_mara
WHERE matnr IN s_matnr.
PERFORM prepare_fieldcatalog.
PERFORM display_alv.
Before the export, fill the data fields before CLUSTR
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
EXPORT i_mara
TO DATABASE indx(st) FROM wa_index1 ID wa_index_key1.
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
FORM prepare_fieldcatalog .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '18'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERSDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'LAEDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " prepare_fieldcatalog
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = i_fieldcat
TABLES
t_outtab = i_mara.
ENDFORM. " display_alv
its possible to display ALV Grid using OO ALV. Following code can be used instead of FM.
In the PBO, add following code
SET PF-STATUS 'ZSTAT'.
If program is executed in background
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
IF off IS INITIAL.
IF container1 IS INITIAL.
CREATE OBJECT container1
EXPORTING
container_name = 'CC_ALV1' .
ENDIF.
ENDIF.
CREATE OBJECT g_grid1
EXPORTING
i_parent = container1.
CALL METHOD g_grid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
i_save = 'A'
i_default = ' '
is_layout =
is_print =
IT_SPECIAL_GROUPS =
it_toolbar_excluding =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = i_output
it_fieldcatalog = i_fieldcatalog
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Reward points if useful
Regards
Anji -
Background processing of S_ALR_87013558 report with output in txt file
Dear Friend's,
Here I have a requirement of, to execute standard report S_ALR_87013558 (Budget/Actual/Commitment/Rem Plan/Assigned) in background processing mode. Here we have to run this report in background on daily basis at a particular given time.
Once this report gets executed in background, output of this report should get converted automatically into txt file and this converted txt file must be downloaded in a respective folder automatically by giving desired path.
After completion of this process, downloaded txt file they have to use for internal MIS reporting purpose.
Is this possible via standard PS or else I have to go for the development.Please suggest, what should be the approach?
Regards,
SandeepHi Sandeep,
Check if you can create batch job to run for S_ALR_87013558 using SM36
The Program name is GP8YTY7TBR1TYRPCIPKAC6X9GZG
Please check with ABAP.
Regards,
Nitin -
Background processing for ABAP report with selection screen
Hi ABAP Gurus,
I m facing a strange problem in scheduling a background job for my report with a selection screen. I have a variant for the report.
I scheduled a job, but it seems to be not doing anything though all the system resources are available. The job overview shows "Acive" for the job. The job is neither stopping anything, it is just sitting there In SM50, the status shows "On Hold".
Any ideas/comments on the problem and how this can be overcome?
Qucik replies and solutions will be highly appreciated as this is a crucial part for a go-live project.
Thanks in advance.
Shivani.Yes. My report has a selection-screen which requires user input. But I have created a variant for the report and trying to run it in background using this variant. But facing this problem.
Strange thing is, instead of the usual SM36/SM37 option where we schedule and monitor background jobs, this option does not work for my report.
But I tried through SE38, and from my selection screen I selected "Schedule background job" and "run immediately" option, and this works. Though I still use SM37 to monitor this background job.
I have never faced such a situation before.
Any hints/tips why this happens and how this can be overcome in the future?
Thanks in advance.
Shivani. -
Background Image on a Report Region
Greetings,
Is it possible to put a background image on a report region? Using the code shown below I can get an image on most other region types, but the code simply doesn't work on a report region.
Thanks in advance for your help, Tony
REGION HEADER
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left"
background = "#WORKSPACE_IMAGES#image.jpg">
<tr height="500px" align="left" valign="top">
<td>
REGION FOOTER
</td>
</tr>
</table>cloaked wrote:
Greetings fac586,
Been reading up on CSS's. I guess the main aspect is to determine the CSS component that deals with the Tabular Form in the Template I am using and modify it. I would need to modify the background attribute of the Tabular Fom, right?
Gotta crawl before I walk, so I am also assuming that I would modify the CSS initially with a hard-coded background image. Then, if I get that to work I would make the image dynamic based on the criteria in a database. Am I on the right track?
Is there a common attribute/component in the Apex Template CSS's for Tabular Forms? I've tried to find it, but am not sure what I'm looking for.Tabular forms can be created using any report template—built-in or custom—so the CSS will differ by theme and template.
Yes, you can define background images for report templates, but It's not appropriate to do what you're trying to do at the report template level. Templates are static and defined at design-time. Challenging Apex Page - Grid with 100+ items - Suggestions Needed. This needs to be dynamic and determined at run-time. -
How to run a bex report in backround
All,
Could anybody tell me how to schedule a bacround job to run a bex report. It would be great if i could email the results also,
I appreciate any help with points,
Regards,
MikeA reporting agent (RSREP TC) is replaced by broadcaster in 7.0, but what both do is execute the query in background and put it in cache and you try to access the cache when you execute the web template which is techinically a query.
thanks.
Wond -
SSRS - A Subreport background image is overridden by background image of parent report
Hello. I have a background image on my parent report and a different background image for my sub reports. The background image of my sub reports are instead inheriting the background image of the parent report. I've researched and found nobody talking about
this. All my images are embedded.
Is there away around this?
Thanks,
James
JamesFor both the parent report and the sub report, I right clicked the Images folder in the Report Data section and embedded the images in the rdl. The parent report has an embedded image called watermark. The child report has an embedded image called subreportwatermark.
In the parent report, I added the following to the report properties:
In the child report, I added the following to the body properties:
Yes, I use an expression to determine whether to use the watermark or nothing based on a field of a dataset as you see above in both Value properties of both the report properties of the parent report and the body properties of the child sub report.
If I run the sub report only in the BIDS solution for a child row that has Y for watermark value, the sub report's subreportwatermark does show.
If I run the sub report only in the BIDS solution for a child row that has N for watermark value, the watermark does not show.
So far so good.
If I run the parent report in the BIDS solution for a parent row that has Y for watermark value, I don't get what I
expect. Here is the scenario. Five pages are produced. One for the parent, and one each for the sub report.
Parent Row - Watermark Y
Child Row 1 - Watermark Y
Child Row 1 - Watermark N
Child Row 1 - Watermark N
Child Row 1 - Watermark Y
What I expect to see.
Page 1 - Parent Report's watermark should display.
Page 2 - Child Sub Report's subreportwatermark should display.
Page 3 - Child Sub Report's - No watermark at all.
Page 4 - Child Sub Report's subreportwatermark should display.
Page 5 - Child Sub Report's - No watermark at all.
To be clear. I should NEVER expect to see the parent report's watermark on pages 2 - 5.
What was the actual result? This is what I see in BIDS when I click the preview tab in
Print Layout.
Page 1 - Parent Report's watermark displayed.
Page 2 - Child Sub Report - Parent Report's watermark displayed.
Page 3 - Child Sub Report - Parent Report's watermark displayed.
Page 4 - Child Sub Report - Parent Report's watermark displayed.
Page 5 - Child Sub Report - Parent Report's watermark displayed.
This is what I see in BIDS when I click the preview tab in View
Layout.
Page 1 - Parent Report. No watermark displays.
Page 2 - Child Sub Report - Child Report's subreportwatermark displayed.
Page 3 - Child Sub Report - No watermark.
Page 4 - Child Sub Report - Child Report's subreportwatermark displayed.
Page 5 - Child Sub Report - No watermark.
Both the print layout and view layout is wrong. What matters is what prints or is saved to a pdf. What prints and gets saved to a PDF is the Print Layout view.
If you want, we can swap rdls. Can you send me your rdls?
You can find my rdls at:
https://onedrive.live.com/redir?resid=4292E6DE18E2BB8F!3676&authkey=!AKJwIRWxPmOPitw&ithint=folder%2crdl
Thanks,
James -
Run Character mode reports in Menu/forms.
Hi,
we are using ora-dev-suite 10g and trying to Run Character mode reports in Menu/forms and output ascii text or pdf files generated and saved in local/client PC's.
report when run through report builder, it is ok.
But we are not able to run these reports through menus/forms. can we run these reports using background report engine on a click of button.
pl.guide us.
thanks.Hello,
You can put a variable in your default.env file like SERVER_URL http://<yourserver>:<yourport> and then retrieve it in forms with the tool_env.getvar package
declare v_server_url varchar2(100);
begin
tool_env.getvar(SERVER_URL,v_server_url);
/* then launch your report */
web.show_document(v_server_url||'/reports/rwservlet?yourparameters.....');
end;So if you deploy your form in server 1 or 2 you only have to change the value in the default.env file according to the server you use.
Hope this helps.
Regards
Jean-Yves -
Run a BW Report(Query) from R/3
Hi All,
Is there really a way to run a BW Report report from R/3? I have come across a lot of articles explaining ways to convert an R/3 report to BW and so on. But have never heard about doing it vice-versa.
My scenario, to be exact, is to run a BW report from R/3 as a scheduled background job.
Please share what you all know.
Thanks,
Mahesh M.S.Thank you very much for your valuable help, i checked your suggestion and looks great. But i need to pass 3 parameters from an ABAP to the wad query report.
How can i pass the parameters to the web template???
another issue: My WAS (Web Application Server 6.20) is not public, is currently working for a local area network.
The access to this report is from outside of the office, so we need to access this through the PORTAL. -
Error while running a customize report in oracle ebs
Hi ..
can anybody suggest how to solve the follwing error while running a customize report in oracle ebs?
XXIFMS: Version : UNKNOWN
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
Current system time is 03-JUN-2011 11:09:24
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
Arguments
P_DATE_FROM='2010/04/01 00:00:00'
P_DATE_TO='2011/06/03 00:00:00'
Forcing NLS_NUMERIC_CHARACTERS to: '.,' for XDO processing
APPLLCSP Environment Variable set to :
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
American_America.AL32UTF8
stat_low = 9
stat_high = 0
emsg:was terminated by signal 9
ld.so.1: rwrun: fatal: librw.so: open failed: No such file or directory
Start of log messages from FND_FILE
End of log messages from FND_FILE
Program was terminated by signal 9
Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 1068011.
Review your concurrent request log and/or report output file for more detailed information.
Executing request completion options...
------------- 1) PUBLISH -------------
Beginning post-processing of request 1068011 on node D0005 at 03-JUN-2011 11:09:24.
Post-processing of request 1068011 failed at 03-JUN-2011 11:09:24 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
Finished executing request completion options.
Concurrent request completed
Current system time is 03-JUN-2011 11:09:24Please post the details of the application release, database version and OS.
Is the issue with this specific concurrent program?
Can you find any errors in the CM/OPP log files?
Please see if these docs help.
On R12.1.1/Solaris Platform While Generating Oracle Reports Files Failed With Error " ld.so.1: rwconverter: fatal: librw.so: open failed: No such file or directory [ID 1067786.1]
Apps UPG Fail With Error Ld.So.1: Rwserver: Fatal: Librw.So [ID 961222.1]
Thanks,
Hussein -
Urgent.....Error while running a jsp report from Jdeveloper
Hi,
I am getting following error while running a jsp report from Jdeveloper. I am using version 10.1.2.1.0. The same report is working fine when I am running it from report builder. ( Both these tools were installed using Oracle Developer Suite 10g version 10.1.2). I did search in oracle discussion forums and google, but I could not arrive at a resolution of error. Any help in resolving this issue would be grateful.
Error details:
Page url : http://<hostipaddress>:8988/Reports-reportproject-context-root/MyReport.jsp
Reports Error Page
Wed Oct 17 20:03:22 IST 2007
javax.servlet.jsp.JspException: REP-51002: Bind to Reports Server myreportserver failed
javax.servlet.jsp.JspException: REP-51002: Bind to Reports Server myreportserver failed
at oracle.reports.jsp.ReportTag.doStartTag(ReportTag.java:464)
at MyReport.jspService(MyReport.jsp:4)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Could anyone help me out in resolving this issue.
Thanks
Siva...Hi,
I posted this message in jdeveloper forum yesterday, but there was no response. So I thought of posting it in this forum to check my luck.
Thanks
Siva... -
Error while running custom BI report in R12.1.1
Hi All,
We are encountering below error while running custom BI report in R12.1.1...
Forcing NLS_NUMERIC_CHARACTERS to: '.,' for XDO processing
APPLLCSP Environment Variable set to :
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
American_America.UTF8
Enter Password:
MSG-00001: started report
REP-1401: '': Fatal PL/SQL error occurred.
REP-0069: Internal error
REP-57054: In-process job terminated:Terminated with error:
REP-1401: '': Fatal PL/SQL error occurred.
Report Builder: Release 10.1.2.3.0 - Production on Fri Jun 24 16:47:30 2011
Please let us know how to fix this error.
Thanks
PraveenHi Praveen,
Seems the issue is with the rdf. Check whether all the parameters are passed correctly.
REP-1401: '': Fatal PL/SQL error occurred. -
Error while running the financial report in the workspace.
Hi,
Im getting the below error while running the financial report in the workspace in HTML mode.
*"Required application module reporting.HRRunDlg is not configured. Please contact your administrator".*
And im not able to login to the Hyperion Financial Reporting as well.. i get the below error
*"You are not authorized to use this functionality. Contact your administrator"*
Can someone let me know how to resolve this error.You don't mention the version, what app server or web server you are using, etc.. That information might be helpful, but in general, you can try the following:
1. Make sure you have gone through the FR Web App deployment steps and verify the settings entered in the Config Tool.
2. For version 11.1.1.x and 9.3.1.x, try opening the report in FR Studio and running it via the FR Studio Print Preview (*bold*not*bold* Web Preview.) If the report runs/processes, then the back-end FR Services are functioning and the issue is confined to the web interface. Verify the FR Web App is up and listening on the designated port (8200, by default), check the FR Web App logs and the App Server (WebLogic, WebSphere, Tomcat, OAS) logs for errors/issues.
If the report fails to process in FR Studio Print Preview, then there is a problem with the FR Reporting Server Service. Check to make sure the service is up/functioning and check the FR Report Server logs for errors.
3. Test access to other FR functionality in workspace (ex: Files->Preferences->Financial Reporting or Explore->Tools->Database Connection Manager?) If these don't work, then try to connect to the following URLs:
http://workspaceServer:19000/hr/status.jsp
http://frWebAppServer:8200/hr/status.jsp
Note: The URLs above assume standard/default ports. You may need to adjust them for your environment.
If the first URL fails, but the second URL works, there is a problem with the HTTP redirect settings on the Web Server (Apache, IIS, etc.) Run through the Workspace deployment and make sure the Web Server Config settings point to the right ports/servers. -
Urgent...Error while running a jsp report in Jdeveloper
Hi,
I am getting following error while running a jsp report from Jdeveloper. I am using version 10.1.2.1.0. The same report is working fine when I am running it from report builder. ( Both these tools were installed using Oracle Developer Suite 10g version 10.1.2). I did search in oracle discussion forums and google, but I could not arrive at a resolution of error. Any help in resolving this issue would be grateful.
Error details:
Page url : http://<hostipaddress>:8988/Reports-reportproject-context-root/MyReport.jsp
Reports Error Page
Wed Oct 17 20:03:22 IST 2007
javax.servlet.jsp.JspException: REP-51002: Bind to Reports Server myreportserver failed
javax.servlet.jsp.JspException: REP-51002: Bind to Reports Server myreportserver failed
at oracle.reports.jsp.ReportTag.doStartTag(ReportTag.java:464)
at MyReport.jspService(MyReport.jsp:4)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Could anyone help me out in resolving this issue.
Thanks
Siva...Hi,
I posted this message in jdeveloper forum yesterday, but there was no response. So I thought of posting it in this forum to check my luck.
Thanks
Siva...
Maybe you are looking for
-
Multiple Stock transfer report
1. I want a report which captures the issue of a material from a plant/storage loc, its transit and delivery at a plant/storage loc. Then again it is stock transfered to another plant/storage loc. Means I want to capture the entire folw of stock tr
-
Move tool misbehaving in photoshop CC 2014
hello re; Move tool misbehaving in Photoshop. Move tool selected. When I right click to select an individual item it initially does select it, but when I go to drag the item it picks up all the items in the layer folder. I must have changed a setting
-
Abap Proxy Convert UTF-8 to ISO-8859-1
Dear, I have the following scenario: Abap Proxy-> PI -> WebService. I need to change the encondig UTF-8 to ISO-8859-1 when the SAP ECC sends data to the PI. How do I do this? I have a XSLT program that performs the this conversion, UTF-8 to ISO-8859-
-
I have downloaded Oracle8i Release3(8.1.7)for Sun SPARC Solaris and the file 817solaris_cpio.gz is in its own directory. The instructions indicate to extract the files execute the command-- $gunzip 817solaris.cpio.gz; cat 817.cpio | cpio -icd After e
-
Error about the dll crdb_dao.dll - In Event Viewer - Application log
We have classic ASP application and we are using Crystal XI for reports viewing and printing. We are keep getting the following error logged in the event view application log. Faulting application dllhost.exe, version 5.2.3790.3959, faulting module c