Submit...to Spool in background, ALV Grid
Hello,
I am trying to using the SUBMIT to SPOOL statement for SAP std. program RKPEP003.
Now this works well when i execute in the foreground mode but doesnt work in the background mode, it gives an error "Make an Entry in All Required fields"
RKPEP003 output is ALV Grid, so is this the probable reason or something else becoz the code works fine in the foreground mode
Thanks in advance
Minhaj
Hello,
Following is my code:
MOVE:
'CN_PSPNR' TO I_SELTAB_WA_ANLAGE-SELNAME,
'S' TO I_SELTAB_WA_ANLAGE-KIND, " SELECT-OPTION
'I' TO I_SELTAB_WA_ANLAGE-SIGN,
'EQ' TO I_SELTAB_WA_ANLAGE-OPTION,
'W-000001-01-101' TO I_SELTAB_WA_ANLAGE-LOW,
'W-000001-01-101' TO I_SELTAB_WA_ANLAGE-HIGH.
APPEND I_SELTAB_WA_ANLAGE TO I_SELTAB_ANLAGE.
MOVE: 'R_BUDAT' TO I_SELTAB_WA_ANLAGE-SELNAME,
'S' TO I_SELTAB_WA_ANLAGE-KIND, " SELECT-OPTION
'I' TO I_SELTAB_WA_ANLAGE-SIGN,
'BT' TO I_SELTAB_WA_ANLAGE-OPTION,
S_DAT TO I_SELTAB_WA_ANLAGE-LOW,
E_DAT TO I_SELTAB_WA_ANLAGE-HIGH.
APPEND I_SELTAB_WA_ANLAGE TO I_SELTAB_A
SUBMIT RKPEP003
WITH selection-table I_SELTAB_ANLAGE
WITH P_DISVAR = '/5SAP'
TO SAP-SPOOL
SPOOL PARAMETERS PARAMS
ARCHIVE PARAMETERS ARPARAMS
WITHOUT SPOOL DYNPRO AND RETURN.
Now this works well in the foreground mode but other otherwise even with JOBNAME AND NUMBER
Thanks,
Minhaj
Similar Messages
-
Prevent Occurence of list header and page breaks in spool file of ALV Grid
Prevent Occurence of list header and page breaks in spool file of ALV Grid Display.
When we run the ALV in background and create spool request then:
Spool file output is coming like this.
Column1 Column2 Column3 Column4
data data data data
data data data data
data data data data
Column1 Column2 Column3 Column4
data data data data
data data data data
data data data data
But the required is like this
Column1 Column2 Column3 Column4
data data data data
data data data data
data data data data
data data data data
data data data data
data data data data
Please suggest a posible answerHello all,
if you have not yet solved this on your own, here is my solution: use a format type that has 60000 lines per page for your spool output device.
It all depends on the format type that was used for creating the spool output.
By default (in our system), we have 65 lines per page. And after each page the column headings of the ALV will appear.
What i did:
create a new format type via transaction SPAD->full administration->device types->format types (copy an existing one)
change"Number of Rows" to 60000 or something applicable
edit the device type of your output device (e.g. LOCL) to contain the newly created format type (via SPAD; Button "Formats" in device type maintenance).
That's it! Be sure to use this format type for your output device in the "Background Print Parameters" window (-> Button "Properties").
Regards
Daniel Klein
All other parameters you discussed before didn't do it. All ALV-Settings will be overwritten by the output device settings and its print properties. -
How to convert spool no into ALV GRID ?
HI EXPERTS,
I am scheduling SAP REPORTS IN BACKGROUND through F9.
The report output generated in sap spool "sp02" . Then output appears as list but my client wants in ALV grid.
so i go through the following link
http://wiki.sdn.sap.com/wiki/display/Snippets/ConvertSpoolListtoALV+Grid
when i am creating function module of that coding this come out with error
the type "MATCH_RESULT_TAB " is unknown.
i am using 4.7 version of sap.
or
if there is any other alternative solution.
thanks <promise removed by moderator>.
vikas
Edited by: Thomas Zloch on Feb 11, 2011 11:26 AMHi Bikas,
That MATCH_RESULT_TAB means Table with Search Results.I copied the sam progrm it is working.Tryto copy all.
That import Parameters and all. What is your sap version.
Regards,
Madhu. -
ALV Grid not displying properly when spool is generated by print button
Hi All,
When print button is used to genarate spool of the ALV Grid, then in the spool the end of page content is getting over lapped on the main lines. Please let me know how to display end of page content without geting overlapped on the lines.
Below is the code which I have written.
<cut>
Edit: Please see next post.
Thanks in Advance!
Regards,
Preethi G
Edited by: Julius Bussche on Feb 14, 2010 9:15 AMHi All,
Sorry. Please ignore my first post. When print button is used to generate spool then in the spool file the end of page content is getting overlapped on the main lines. Please let me know to solve this.
Thanks in Advance!
Below is the code written
ALV Grid display
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
wa_print_info-no_print_listinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_grid_title = ''
i_callback_pf_status_set = 'FRM_SET_STATUS'
i_callback_user_command = 'FRM_USER_COMMAND'
is_layout = alv_layout
it_events = i_events
it_fieldcat = alv_fieldcat
is_print = wa_print_info
TABLES
t_outtab = it_payroll
EXCEPTIONS
program_error = 1
OTHERS = 2.
End of Page and End of list
IF sy-pagno = 0.
s_pageno = 1.
ELSE.
s_pageno = sy-pagno.
ENDIF.
CLEAR: i_list_comments[].
SKIP.
SKIP.
CONCATENATE 'u85AAu8D44u4E13u5458' '________' 'HRSu7ECFu7406' '________' 'u4EBAu529Bu8D44u6E90u603Bu76D1'
'________' 'u7EE9u6548u8D22u52A1u603Bu76D1' '________' 'u603Bu7ECFu7406' '________'''INTO s_out
SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) s_out CENTERED.
SKIP.
CONCATENATE s_pageno '-' v_pagsum 'u9875' INTO
w_list_comments-info SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) w_list_comments-info CENTERED.
Edited by: Julius Bussche on Feb 14, 2010 9:16 AM
Tried to fix formatting a bit. -
Hi,
I have an alv grid , which gives the output in an aligned format on execution .
If the same program is executed in background and printed on spool , the columns get misaligned . How can i align them with their columne headings ?
ThanksCheck these thread -
ALV Grid At Background
ALV GRID CONTROL + BACKGROUND JOB
Also, check the forum there is a blog also on displaying the ALV Grid in background with lots of good information on it.
Regards,
Amit -
Running report with alv grid in background and exporting to excel
Hi Guys,
I've created a report program that uses the alv grid. When I run the report in foreground, I can easily export it to excel. However, if I run it in background, then display the spooled report and try to export to excel, it does not put it in excel format (seems to go over as one big column rather than individual columns that are defined in the report). Is there a way to run it in background ,export to excel properly and i have to email also in Excel sheet format.?
Thanks,
Gopi.In background u cannot do a download to excel. you can do is create CSV format file
or
write a report for output with tabs then call that report using
submit yXXXX exporting list to memory
and return.
call function 'LIST_FROM_MEMORY'
tables
listobject = report_list
exceptions
not_found = 1
others = 2.
and send the report_list to email users
a® -
Background Execution Problem-Docking Container with 2 ALV Grids in one scre
Hi Friends,
I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER.
The objects are 'g_dock_cont' and 'g_dock_cont1'.
I am getting the foreground output as expected with 2 ALV Grids.
While executing in background (F9), I am getting only output of first ALV grid. Second ALV is not getting displayed in BACKGROUND(F9) mode.
How to solve this.
FORM create_objects.
* Materials with data
IF g_dock_cont IS INITIAL.
IF sy-batch NE 'X'.
*CREATE THE OBJECT FOR DOCKING CONTAINER
CREATE OBJECT g_dock_cont
EXPORTING
side = cl_gui_docking_container=>dock_at_top
extension = 300.
ENDIF.
*CREATE THE OBJECT FOR ALV GRID
CREATE OBJECT g_alvgrid
EXPORTING i_parent = g_dock_cont.
wa_layout-grid_title =
'Materials with Data'.
ENDIF.
IF NOT I_DETAIL[] IS INITIAL.
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
IS_VARIANT = WA_VARIANT_STX
IS_LAYOUT = wa_layout
CHANGING
it_outtab = I_DETAIL
IT_FIELDCATALOG = LIT_FIELDCATALOG[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
ENDIF.
ENDIF.
*MATERIALS WITHOUT DATA
IF g_dock_cont1 IS INITIAL.
IF sy-batch NE 'X'.
*CREATE THE OBJECT FOR DOCKING CONTAINER
CREATE OBJECT g_dock_cont1
EXPORTING
side = cl_gui_docking_container=>dock_at_bottom
extension = 300.
ENDIF.
*CREATE THE OBJECT FOR ALV GRID
CREATE OBJECT g_alvgrid1
EXPORTING i_parent = g_dock_cont1.
wa_layout1-grid_title =
'Materials without Data'.
ENDIF.
IF NOT I_MARA[] IS INITIAL.
CALL METHOD g_alvgrid1->set_table_for_first_display
EXPORTING
IS_LAYOUT = wa_layout1
CHANGING
it_outtab = I_MARA
IT_FIELDCATALOG = i_fieldcat[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDFORM. " create_objects
Regards,
Viji.Hi,
What i was saying is that you need to code again for background mode of execution.
AT END OF SELECTION.
IF SY-BATCH EQ 'X'.
PERFORM DISPLAY1.
PERFORM DISPLAY2.
In DISPLAY1 use REUSE_ALV_LIST_DISPLAY to display data from outtab1.
In DISPLAY2 use REUSE_ALV_LIST_DISPLAY to display data from outtab2.
For example : execute this report in background mode.this will not execute in online mode.
After execution you will get two spools one for KNA1 and one for LFA1 data. Spool can be controlled via IS_PRINT structure.
report zrbackground.
data gt_lfa1 type standard table of lfa1.
data gt_kna1 type standard table of kna1.
start-of-selection.
select * from lfa1 into table gt_lfa1 up to 10 rows.
select * from kna1 into table gt_kna1 up to 20 rows.
end-of-selection.
if sy-batch eq 'X'.
perform display_lfa1.
perform display_kna1.
endif.
*& Form DISPLAY_LFA1
text
--> p1 text
<-- p2 text
form display_lfa1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'LFA1'
tables
t_outtab = gt_lfa1
exceptions
program_error = 1
others = 2.
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_LFA1
*& Form DISPLAY_KNA1
text
--> p1 text
<-- p2 text
form display_kna1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'KNA1'
tables
t_outtab = gt_kna1
exceptions
program_error = 1
others = 2.
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_KNA1
Please let me know if its not clear or you need more info.
Thanks,
Abhishek
Edited by: abhishek sinha on May 8, 2009 7:42 PM
Edited by: abhishek sinha on May 8, 2009 8:45 PM -
Dear All,
There is t code called MB51 which the user use, we recommend them to execute that report in the background using this method -- t code-- execute in background--- enter the printer name and generate the temporary spool to veiw the report, however when we veiw that report using spo2, the <b>tool bar</b> (that comes when we execute in the foreround) is missing, which is used to veiw it in the ALV grid format, actually the user easily select the feilds in that format and download them to excel sheets, in the background that <b>" Details"</b> <b>option</b> is not there, is there any work around for this.
Thanks,..
Ravi.Hi Clemens,
Thanks for that valuable suggestion, atleast I got a direction to think about, so from here on its gotta be xml...
But, since I have no idea about xml coding, also I went through those 2 links you had sent, but I'm still unable to understand the following points:
1.How do I generate the xml code, relevant to formatting that I did in ALV Grid using the FM "REUSE_ALV_GRID_DISPLAY"?
2. How do I go about saving the xml file onto the Application server?
3. Can you please provide any sample ALV report code, where such XML formatting has been used?
Thanks in advance.
Regards,
Azeem Ahmed Matte -
ALV Grid output in background Job
Hello everyone,
Can someonen plz tell me if I execute my report (with Grid ALV Display) in background (sy-batch not initial ) , will the ALV Grid be displayed ?
If no, then in order to show success do I have to 'WRITE' the success message ?
ThanksHello,
The grid will be generated as a list & spool will be generated. REUSEALVGRID* FM handles this explicitly no need to code for it.
You do not need to use WRITE for this
Also FYI for OO ALV you have to code for the batch handling: [CNTL_ERROR while running a report in background mode|CNTL_ERROR while running a report in background mode]
BR,
SUhas
Edited by: Suhas Saha on Jan 18, 2010 4:52 PM -
How to display more than 255 chars in background job with ALV Grid ????
Hi All,
I am using ALV grid with OO.
I have used call screen for ALV grid display. I have to display more than 255 characters in width. While running it, I can see the list perfectly.
But in background mode, the list is truncated after 255 chars.
Can anybody help how to send complete list(width more than 255 chars) to spool.
Thanks and Regards,
NehaHi SAP fan,
<b>YES you can run the ALV report in background mode.
To run the report in background do F9 instead of F8, then give immediate and save.
Now goto Sm35 goto job overview and view the job listed
Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.
To see this the job should be in the finished status.
How to define Periodic Jobs
1.Execute transaction SM36
2.Define Job name, Job class, Target server
3.Click on 'START CONDITION' button
4.Click on 'Date/Time' button
5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
8.Click on 'Job overview' button or execute SM37 transaction.
9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
10.You will now see all your scheduled JOBS.
<b>Case: 2</b>
You can Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
if sy-batch = ' '.
call 'REUSE_ALV_GRID_DISPLAY'.
else.
call 'REUSE_ALV_LIST_DISPLAY'.
endif.
if you are using OO alv then write this code..
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = off.
IF off IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
ENDIF.
<b>Case: 3</b>
if you are using OO ALV.
Just before creating the custom container check for the following condition.
Batch or Web Reporting
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT o_custcontainer
EXPORTING
container_name = lc_custcontrol
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
ENDIF.
You can see the output in Spool in transaction SP01.</b>
Good Luck and thanks
AK -
ALV grid in Spool screen limit
Hi,
I am displaying a report for bulk of order.
So we will schedule it in background .
Through the program, i am creating the output as file in appln server also i m dispklaying the report in ALV grid.
now the report is working fine and its creating a file in appln server.
Now my problem is if I see the spool in SM37,its showing the ALV grid. but some columns are missing in the right side.
I hope this is because of the screen limitation.How should I solve this.
I have to allow the user to see all the columns.Hi
I too have the same issue....Where u able to find the solution...
I have checked through this Thread, when I create a new Format 65_1000, I still get some pages missing
Re: Spool ALV LIST
Your responses will be helpful.
Thanks,
Chaithanya k -
2 ALV grids display in background
Hello,
I am using 2 ALV grids in my report output. But while running this is background it shows only one in the spool.
Can somebody please suggest the possible solutions ?
Following is the code I am using:-
Create grid to display deleted entries
CREATE OBJECT go_alv_grid
EXPORTING
i_parent = go_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
Create grid to display completed entries
CREATE OBJECT go_alv_grid2
EXPORTING
i_parent = go_container2
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
Prepare fieldcatalog
PERFORM perpare_fieldcat.
Set layout
lv_layout-cwidth_opt = 'X'.
Call display for deleted entries
CALL METHOD go_alv_grid->set_table_for_first_display
EXPORTING
is_layout = lv_layout
CHANGING
it_outtab = gt_wflog
it_fieldcatalog = gt_fldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Call display for completed entries
CALL METHOD go_alv_grid2->set_table_for_first_display
EXPORTING
is_layout = lv_layout
CHANGING
it_outtab = gt_wflog_rec
it_fieldcatalog = gt_fldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Please suggest.yes it displays only one grid in the spool. the other will miss. For background run you have to proceed differently in this case.
-
Way to get alv grid varients info during background execution
I have used the function module 'REUSE_ALV_GRID_LAYOUT_INFO_GET' to get info alv grid varients i.e already created layout info. Is there any other way of getting this info as this is not giving the exact layout during background execution.
Hi Vijaya,
It should work. I am giving you a sample code. Try this and let me know.
REPORT TEST.
data gt_lfa1 type standard table of lfa1.
data gt_kna1 type standard table of kna1.
start-of-selection.
select * from lfa1 into table gt_lfa1 up to 10 rows.
select * from kna1 into table gt_kna1 up to 20 rows.
end-of-selection.
if sy-batch eq 'X'.
perform display_lfa1.
perform display_kna1.
endif.
form display_lfa1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'LFA1'
tables
t_outtab = gt_lfa1
exceptions
program_error = 1
others = 2.
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_LFA1
form display_kna1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'KNA1'
tables
t_outtab = gt_kna1
exceptions
program_error = 1
others = 2.
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_KNA1
copy and paste the code and create a program. Activate it and come back to SE38 screen.
Now, in program name give the name of the report created and then
select PROGRAM->EXECUTE->BACKGROUND from the MENU bar.
This will generate two separate spools . One for KNA1 data & one for LFA1 data.
Let me know how it goes.
Thanks,
Abhishek -
Hi
I have a alv grid display. when i run the report in background, i am able to see that a spool number is generated but i dont know how to check whether what is inside the spool is same as in ALV.here is FM i used
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = report_id
i_callback_top_of_page = 'LIST_HEADING'
is_layout = i_layout
it_fieldcat = i_fieldcat
TABLES
t_outtab = ALV_OUT[]
EXCEPTIONS
program_error = 1
OTHERS = 2 -
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.
Maybe you are looking for
-
Getting Error while trying to dynamically extending the VO through Control
Hi, PoRequSuppliersVO is the vo to which i am trying to add a dynamic and clause. I tried to as much info as possible. Please help me understand , why am i not able to add the add condition . In the below, i have jsut hardcoded the value to 100 to se
-
My gmail crashes when I add attachment same with facebook, what can I do to fix this?
my gmail crashes when I add attachment same with facebook, what can I do to fix this?
-
Migrating to PSE10 & moving default storage locations
Greetings all, I have purchased the upgrade from PSE9 to PSE10 and am planning to migrate the default location of my images and catalog from a local drive on my Windows 7 PC to a NAS device. I am wanting to move the default location to a NAS so that
-
Hi This is Mohammed vaseem khan, recently i am selected for on one implementation project on IS OIL and GAS,can any body tell me from where,i get soem knowledge in IS OIL&GAS, if any body having this so kindly send me links,from where i can downlode
-
Hi guru's I declared my own screen insted of selection screen i entered values in it and i want values entered in the screen back to my program . say i have screen which accepts two numbers and i want to write sum of those numbers in a list please he