ALV in background
I am running a ALV report in background and in the spool noticed that one of my column is truncated. When i changed to the Column heading to more characters ....i notice that the output is fine....( field catalog was built by using the FM)
I am not able to understand what could cause problem.....
can anyone explain what could be the issue.....
Whether it is background or foreground if any of the field value is more than what it is defined it will be truncated.So always declare with maximum characters, so that it will not be a problem.
Actually ALV will take the header as count while printing in spool.
Reward points if helpful.
RamaKrishna C
Similar Messages
-
If i run oops alv in background, its going dump
If I run oops alv in background its going dump?
can any one suggest me to do this or to overcome
thanks and regards
settyALV's can be run in background if you use a docking container instead of a custom container.
Please search the forum for "ALV in background". You will find tons of threads with solutions.
Re: How to run ALV reports in batch
Sample code to have ALV Grid in Background -
Run ALV in Background JOB (DUMP)
HI Experts,
Before post i have already look at this forum and tried many solutions , im on SAPGUI 7.20 and already creatde a doc container... so nothing has work yet...
Im trying to run a alv report in a scheduled JOB...!!
Below the Dump Description and My source code...!
Many Thanks for any help..!!!!
DUMP.
Short text
Exception condition "CNTL_ERROR" raised.
What happened?
The current ABAP/4 program encountered an unexpected
situation.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
A RAISE statement in the program "CL_GUI_CONTROL================CP" raised the
exception
condition "CNTL_ERROR".
Since the exception was not intercepted by a superior
program, processing was terminated.
Short description of exception condition:
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
SOURCE CODE:
DATA: gro_doc_container TYPE REF TO cl_gui_docking_container,
w_off TYPE INT4.
IF w_1c_container IS INITIAL.
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = w_off.
IF NOT w_off is initial.
CREATE OBJECT w_1obj_alv
EXPORTING i_parent = gro_doc_container .
else.
CREATE OBJECT w_1c_container
EXPORTING
container_name = c_1alv.
CREATE OBJECT w_1obj_alv
EXPORTING
i_parent = w_1c_container.
ENDIF.
CREATE OBJECT w_event_receiver.
SET HANDLER: w_event_receiver->handle_data_changed FOR w_1obj_alv,
w_event_receiver->handle_toolbar FOR w_1obj_alv,
w_event_receiver->handle_user_command FOR w_1obj_alv.
CALL METHOD w_1obj_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
CALL METHOD w_1obj_alv->set_table_for_first_display
EXPORTING
i_save = c_a
is_layout = e_1layout
is_variant = e_1variant
it_toolbar_excluding = is_1func
i_structure_name = c_1strucs1
CHANGING
it_outtab = is_1pant
it_fieldcatalog = is_1fcat[].HI ,
The ALV grid will not work in background. You need to check sy-batch (for background processing ) and write a seperate code .
The better way of doing is to use SALV factory methods - It works both in background and foreground modes.
Remember It will work on ECC and it doesnot support editable ALV directly.
For Demo program SALV_DEMO* and F4
Hope this brings clarity and neccassary help to you. -
Alv grid background column headings
HI EVERYONE,
I was able to execute the ALV grid report in background .But columns heading is reeating for
each page.
Can't we just just have the Column Headings once for all pages.?For the IS_LAYOUT parameter it is possible to set NO_COLHEAD = 'X'. Then the header is gone. Then you have to create first line in table with texts. But then all fields must be character fields.
Regards
Roy -
Reg:ALV list Background Problem
Dear All,
I created a ALV LIST report. While i am running in that program in foreground i am getting timeout error. While running in background i am getting the output in improper way. While i am seeing that report in spool request and pressing the spool output display in maximum width i am getting the output list fields in improper position. What should i have to do for this issue?
Thanks,
Sankar MWhen you execute the report in background, u require to provide the width of the output it will be some thing like X_65_255.Try increasing the width.
One more alternative is go to SPAD -> In settings Menu option -> Select Spool System -> go to others tab -> select the check box number of columns for list display format.
Hope this inputs will help you.
Regards,
Shafivullah Mohammad -
ALV Grid Background Coulmn headings issue
Hi Guys,
I was able to execute the ALV grid report in background .When i am looking into the Spool o/p columns heading is reeating for each page.
Can't we just just have the Column Headings once for all pages.?
The problem with this is when i downloaded it into Excel from Spool column headingare displayed multiple times.
Thanks,
Chand.Hi,
While executing in background, it will ask for the print parameters, somewhere you will be giving the spool length and width (by default it is 65 * 80 i guess). Hence it is truncating the characters which are exceeding this limit.
Hence try changing this one to the maximum available one. It will work.
If you need a bigger one which is not available in the options available, then your BASIS people have to create the new one. -
Hi Experts,
I know this topic is discussed several times but I still have a confusion.
I have created one ALV report using custom container like the usual way. As per my understanding this report shouldn't execute in background
but when I execute the report in background in development system, it's not throwing any error and I am able to get the spool.
Why is this happening? Is there a possibility that if I transport the object to other system I may get error?
Please share your thoughts.
Thanks,
TikiThis is my "common code" i use to manage CL_GUI_GRID in background without touching the output screen to define a container
CLASS lcl_event_handler DEFINITION DEFERRED.
DATA: gr_event_handler TYPE REF TO lcl_event_handler.
*---- ALV Grid instance reference
DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid.
*---- Custom container instance reference
DATA: gr_splitter_container TYPE REF TO cl_gui_splitter_container,
gr_container TYPE REF TO cl_gui_container.
*---- Header container
DATA: gr_docking_container TYPE REF TO cl_gui_docking_container,
gr_document TYPE REF TO cl_dd_document.
IN PBO
IF sy-batch = 'X'.
*---- Creating ALV grid within a docking container
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_docking_container.
ELSE.
*---- Creating Splitted Containers
CREATE OBJECT gr_splitter_container
EXPORTING
parent = cl_gui_container=>screen0
rows = 1
columns = 1.
CALL METHOD gr_splitter_container->set_border
EXPORTING
border = cl_gui_cfw=>false.
CALL METHOD gr_splitter_container->set_row_mode
EXPORTING
mode = gr_splitter_container->mode_relative.
gr_container =
gr_splitter_container->get_container( row = 1 column = 1 ).
*---- Creating ALV Grid instance
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_container.
*---- Preparing document header
PERFORM prepare_header.
ENDIF.
*-- Creating an instance for the event handler
CREATE OBJECT gr_event_handler.
*-- Registering handler methods to handle ALV Grid events
* NOTA: Qua vanno registrati eventuali metodi aggiunti per gestire
* altri eventi della classe CL_GUI_ALV_GRID.
SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_data_changed FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_data_changed_finished
FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid.
SET HANDLER gr_event_handler->handle_user_command FOR gr_alvgrid.
*-- Preparing layout structure
PERFORM prepare_layout.
*-- Preparing print structure
PERFORM prepare_print.
*-- Preparing field catalog
PERFORM prepare_field_catalog.
*-- Preparing sort criteria table
PERFORM prepare_sort_criteria.
*-- Prepating filter criteria table
PERFORM prepare_filter_criteria.
*-- Preparing function codes to exclude from the toolbar
PERFORM prepare_toolbar_exclude.
*-- Preparing the output for the ALV grid list
*-- NOTE: set I_BUFFER_ACTIVE = 'X' to speed to the list display
*-- if the ALV grid uses statically always the same field catalog
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
* i_buffer_active = 'X'
* i_structure_name = 'GS_OUTTAB'
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
is_layout = gs_layout
is_print = gs_print
* IT_SPECIAL_GROUPS =
it_toolbar_excluding = gt_exclude[]
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
CHANGING
it_outtab = gt_outtab[]
it_fieldcatalog = gt_fieldcat[]
it_sort = gt_sort[]
it_filter = gt_filter[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
*-- Allows to edit the toolbar
CALL METHOD gr_alvgrid->set_toolbar_interactive. -
Multiple Alv in background mode
Hi all,
I am executing a program with two ALV's using a splitter container in background mode..It generates a spool with the data of only one alv..It never reflects both the alv's together..
Please provide with a solution..
Points will be rewarded...
Thanks in advance..
ArunUnfortunately, ALV functionality is lost when the program is executed in the background. You'll have to modify the program to use plain WRITE, for example, or run it in the foreground.
-
Hi I run a alv report in background.
I see it in a report format, i want to see it in a alv format.
Kindly helpHi SK ,
If use Grid in BG u will get o/p In ALV List Itself, second thing is u will get Croped o/p bcos of Print Format 65255 , in this case u have to create/change a new Print Format only for BG jobs like 651000.
for more info ask ur basis person to create a new print formats in such cases.
Regards
Prabhu -
In OOPS ALV docking container gives error while execute in Background.
When i try to use Docking container to execute OOPS ALV in background the jobs still fails with Switch framework error.
Kindly let me know your inputs to resolve the same.
Thank you !!Hello Nalini,
Yes, it is possible to schedule background.
data: or_doc type ref to cl_gui_docking_container .
if cl_gui_alv_grid=>offline( ) is initial.
create object or_custom_container
exporting container_name = cust_container.
create object or_grid
exporting i_parent = or_custom_container.
else .
create object or_grid
exporting i_parent = or_doc .
endif .
Regards,
Vadamalai A.
Message was edited by: Matthew Billingham -
Can we schedule oo alv tree in background?
hi all
can we schedule oo alv tree in background?
Thanks
venkatHi,
We can schedule OO ALV in background.
follow this link ALV Tree in Background
Regards,
Pravin -
Cant send an e-mail in ALV report for background executaion
Hello friends,
I am displaying ALV report using container.
Now when i run this report in background, an e-mail should be go with an EXCEL attachment of report.
I am able to send e-mail and attachment in foreground .
I am also able to run alv report in background.
now, only problem is that i am am not able to send e-mail in background.
any sujjetions ?
Points will rewarded if little bit useful.
Regards,
nimesh
if cl_gui_alv_grid=>offline( ) is initial.
Create custom container
CREATE OBJECT g_r_cust_container
EXPORTING
container_name = gv_ctrl_custom.
Create TOP-Document
CREATE OBJECT g_r_dd_document
EXPORTING
style = 'ALV_GRID'.
Create Splitter for custom_container
CREATE OBJECT g_r_splitter
EXPORTING
parent = g_r_cust_container
rows = 2
columns = 1.
Split the grid in two parts- top and grid
CALL METHOD g_r_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = g_r_parent_top.
CALL METHOD g_r_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = g_r_parent_grid.
Set height for g_parent_html
CALL METHOD g_r_splitter->set_row_height
EXPORTING
id = 1
height = 1.
Create grid object
CREATE OBJECT g_r_alvgrid
EXPORTING
i_parent = g_r_parent_grid. "g_r_cust_container.
else .
Create grid object
CREATE OBJECT g_r_alvgrid
EXPORTING
i_parent = or_doc. "g_r_cust_container.
endif .
Create object handler object (of type local class)
CREATE OBJECT g_r_handler.
SET HANDLER g_r_handler->top_of_page FOR g_r_alvgrid.
SET HANDLER g_r_handler->print_top_of_page FOR g_r_alvgrid.
w_disvariant-report = sy-repid.
w_disvariant-variant = p_vari.
CALL METHOD g_r_alvgrid->set_table_for_first_display
EXPORTING
i_structure_name = 'ysds_sox_price_change'
is_layout = w_layout
is_variant = w_disvariant
i_save = yc_chara
CHANGING
it_outtab = t_st_result
it_fieldcatalog = t_fieldcat[]
it_sort = t_sortinfo[].
CALL METHOD g_r_dd_document->initialize_document
EXPORTING
background_color = cl_dd_area=>col_textarea.no i am using container for ALV.
In above code i have mantioned If.......ELSE.....Condition.
which give me allow to run ALV in background mode but my problem is that i am not able to send e-mail with attachment in background mode.
DATA : or_doc type ref to cl_gui_docking_container .
My report is working fine in foreground but not able to send email in background.
so anybody can solve it? -
ALV print in background : print dialog pops up
Hi,
I want to print a ALV grid to Spool in background......................I am using FM ' REUSE_ALV_GRID_DISPLAY'
But when I execvute the program in foreground or background the print selection dialog comes up....................How to avoid this........................Any ideas or experience
*-- CODE--
**- Get printer parameters
DATA : l_params.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = SPACE
LAYOUT = 'X_58_170"'
LINE_COUNT = '58'
LINE_SIZE = '1024'
NO_DIALOG = 'X'
DESTINATION = 'LOCL'
IMPORTING
OUT_PARAMETERS = l_params
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
*- Prepare ALV print str.
l_print-print = abap_true .
l_print-print_ctrl = lfd_params.
l_print-NO_CHANGE_PRINT_PARAMS = abap_true.
l_print-no_print_listinfos = 'N'.
*-Call ALV in background
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
* i_callback_pf_status_set = L_pf_stat
* i_callback_user_command = l_user_cmd
i_callback_top_of_page = l_top_page
is_layout = l_layout
it_fieldcat = lt_ALV_fcat
IS_PRINT = l_print
i_save = 'A'
TABLES
t_outtab = lt_objects
EXCEPTIONS
program_error = 1.
<Added code tags>
Edited by: Suhas Saha on Nov 21, 2011 2:54 PMHi,
try K_KKB_LIST_DISPLAY fm. The below code can gives you an idea.
DATA: SELF LIKE SY-REPID.
DATA: END_OF_LIST_ROUTINE type KKBLO_FORMNAME.
GS_LAYOUT-NO_PRINT_LISTINFOS = 'X'. "No selinfolist when printing
GS_LAYOUT-NO_PRINT_SELINFOS = 'X'.
END_OF_LIST_ROUTINE = 'ERROR_LIST'.
IF SY-BATCH = TRUE. "this part you need
GS_LAYOUT-PRINT = 'X'. "Get Print_Parameters
GS_LAYOUT-MIN_LINESIZE = 132.
GS_LAYOUT-SUPPRESS_DYNPRO = ' '. "no call screens
ENDIF. "this part you need
SELF = SY-REPID.
CALL FUNCTION 'K_KKB_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SELF
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_SEG_REV'
I_CALLBACK_PF_STATUS_SET = 'SET_STATUS_SEG_REV'
I_CALLBACK_END_OF_LIST = END_OF_LIST_ROUTINE
IS_LAYOUT = GS_LAYOUT
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE_SEG_REV'
I_TABNAME = 'GT_SEG_REVREB'
IT_FIELDCAT = XFIELD
* it_special_groups = gt_groups
* importing
* e_exit_caused_by_caller = exit_caused_by_caller
TABLES
T_OUTTAB = GT_SEG_REVREB
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 1.
MESSAGE E161.
* Fehler bei Aufruf Listtool
ENDIF.
Çağatay -
Display title in spool generated in background processing of report
Hi All,
I am working on a report which uses splitter container to display report details as title in one part of the container and ALV report (using OOPS ALV) in the other part when executed in foreground.
I have referred the following links and added code accordingly to execute the report in background.
OOps ALV in background
CNTL_ERROR while running a report in background mode
But in the spool that is generated, I am able to see only the ALV output in the form of classical report without the report details as title. To add the tilte I have tried using "top_of_page" event, but it is not working. Please let me know how this can be achieved.
Thanks & Regards,
AnkitHi 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 -
Hi ,
I need to know which all fields are hidden in the ALV in background (as the user will enter the layout) ...i have used REUSE_ALV_LIST_LAYOUT_INFO_SET but this doesn't work in the background..
Regards
Gunjanhi
good
i dont think there is any such function module to solve your problem..
thanks
mrutyun^
Maybe you are looking for
-
Problem in getting current row with JTree
Following is the code. It doesn't show the currently selected row, it shows the previously selected row: treeEqType.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node =
-
Hi All,, I am generating one file on unix server using Open dataset statement. I want to move that file from UNIX server to some other server (windows server). How i can proceed? Is it possible to generate the file directly on the
-
hi, i have a CountryTable class which i want to implement as a hash table: import java.util.*; class CountryTable { static int count = 0; private HashMap table = new HashMap(); public void addEntry(Colour key, Country country) {
-
Invalid sim after updated to 5.1.1
I have updated iphone from ios 4.3 to 5.0.1. After updating ios, the phone doesn't recognize sim and keep saying sim invalid. However there is no problem with sim and phone never been hacked (jailbroken).
-
I am trying to use firefox as the web lauch for citrix ica client but when I go to login into remote site - I get the message waiting to find website but it nver finds the website. Has anyone else had this problem? When I installed firefox, it asked