Default Layout for a report running in background
Dear Friends,
I have created a layout for report ME2L and set as default layout (for every user)....
Foreground execution picked the DEFAULT layout but when am trying to execute the same report in background, default layout is not picked but the STANDARD layout is shown in the spool
Could you please suggest me how can i use same report layout for foreground as well as background
Thanks in Advance
Ana
Atanu dey,
If you wnat to download excel in back ground
You have to download in application server only.
EX:
DATA : v_filepath(80) VALUE '/data/sapdata/inc/error_log/pme_br/',
c_coma VALUE ',' .
OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE.
IF sy-subrc EQ 0.
LOOP AT i_errors_bat.
CONCATENATE i_errors_bat-plant c_coma
i_errors_bat-zzvendor c_coma
INTO v_string.
TRANSFER v_string TO v_filepath.
ENDLOOP.
CLOSE DATASET v_filepath.
Note : you can download in presentation server also.
but it requires lot of authorizations and have to use
FTP commands.
Reason is Apllication server in back ground has to
recognize the from which system request came.
Better go for OPEN DATA sets.
Don't forget to reward if useful.....
Similar Messages
-
Default Layout for Z.transaction codes
hi,
we copied the FAGLL03 progamre and we made ZFAGLL03 becz there is a some reqirement from client.
we want set the defalut layout for this T.Code ZFAGLL03,
For this we save the layout and assign in FB00, then also when we excute the programe , it is not comeing the defalut layout .
what is process to set the defalut layout for Z T.Codes.
Regards,
Balu.KHi,
The default layout for the report cannot be done through FB00. You need to take help of an abaper. Similar to FAGLL03, you should have an icon to change and save layout for the report. If the icon is not present, an ABAPer can include it. Once the icon is available, you can change the layout and set it as default or user specific.
Hope this helps.
Thanksa and Regards,
Anit -
How to set default layout for ALV grid ?
Dear all,
When execute ALV reports, the user customize the layout for their own purpose. But each time they run that report, they must choose again their layout. Is there any way to set the layout as default ?
Thank you very much,
Sylvecat.Hi,'
After you have created a layout just follow the steps listed below for making it as default layout:
1. Click (Save Layout).
2. Enter a name in the Save Layout field. The name must begin with a letter.
3. Type in a description for the layout in the Name field.
4. Select the Default Setting check box if you want this layout to be the default layout every time you run
the report.
5. Click (Continue).
Note: A warning message will appear if you are trying to save over an existing layout. Close the box by
selecting the X in the upper right hand corner or choose Yes to overwrite the layout.
Reward Points if found helpfull..
Cheers,
Chandra Sekhar. -
Creation of Spool for a Report Output in background.
Hi Gurus,
I am working on a Report and my requirement is that a Spool should be Generated for the Report Output in background. Instead of generating the spool manually, I need it to be generated in background.
Please let me know ASAP.
Regards,
Amit.Get print parameters using 'GET_PRINT_PARAMETERS'.
DATA : rep LIKE pri_params-plist,
w_title TYPE tsp01-rqtitle,
mstr_print_parms LIKE pri_params.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING destination = 'LP01'
copies = 1
list_name = rep
list_text = w_title
immediately = 'X'
release = 'X'
new_list_id = 'X'
expiration = 1
line_size = 132
line_count = 65
layout = 'X_65_132'
sap_cover_page = 'X'
cover_page = ' '
receiver = sy-uname
department = 'System'
no_dialog = 'X'
IMPORTING out_parameters = mstr_print_parms
valid = mc_valid.
and then use submit statement-
SUBMIT
zp1012_ar_rep_vendstat
TO SAP-SPOOL
WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS mstr_print_parms
WITH s_lifnr IN s_lifnr
WITH p_bukrs eq p_bukrs
WITH s_gjahr eq p_gjahr SIGN 'I'
WITH s_monat BETWEEN p_per-low AND p_per-high SIGN 'I'
AND RETURN.
COMMIT WORK.
Regards,
Aparna Gaikwad -
Default Layout for Multiple ALV displays
Hello All,
I have a requirement where I am displaying multiple ALV grid displays on different tabs of a screen.
Now I have to set a default layout for each of the grids separately as they have different fields.
Please let me know how to do it, I am using OO ALV display.
Thanks a lot
RuchiHi,
According to your grid called pass the variant name
gs_variant-report = sy-repid.
gs_variant-username = sy-uname.
gs_variant-variant = v_vari. " Your variant Name
call method grid1->set_table_for_first_display
exporting
is_layout = gs_layout
is_variant = gs_variant "<<<<<<<<<
i_save = 'A'
it_toolbar_excluding = i_exclude[]
changing
it_outtab = i_output[]
it_fieldcatalog = i_fieldcat[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
a® -
GRC Default Layout for Controllers
Hi Gurus,
We have a requirement to set the default layout for the Firefighter Controllers. Currently the log report doesn't show some fields like Old Value and New value and change type.
How can we set this as global and default for all users ?
Regards,
Salmanthank you Alessandro and Katrice. I found that package but not sure what should I mention in the path to open the approver screen as it says page cannot be displayed. I tried to use object id as GRAC_UI_SPM_AUDIT_WF but doesn't open
http://------------------/sap/bc/webdynpro/sap/grac_ui_spm_audit_wf?sap-language=EN&sap-config-mode=X
We need to go to path Web dynpro Applications and test the object -
Defining default value for financial reports display in the workspace (9.3)
Hi
I need to change the default value for financial reports workspace preview mode, for every workspace user. It is actually set on html, and I would like to have pdf instead.
This option can be changed when logged on the workspace, in file->preferences->financial reporting->default preview mode. However I want every user to start with the right settings, so they dont have to change anything manually.
I have tried to do it with Shared Services : under projects, BI+, assign preferences. From there I can change the default folder and the start page (the general preferences), however I cannot find the options for financial reporting.
Is there a way to change these values with hyperion tools ?
If not, is it possible to change it directly in the repository DB ?Thanks and best regardsWe looked at this about 2 years ago - from memory, you can only set preferences when the users are first setup in Shared Services, under the manage preferences section of the wizard.
I can't remember if there is a settings file you can edit for the default users - i think there is, but again this must be set before users are set up.
We looked at changing users preferences, but gave up on the idea as all users had been provisioned already :-(
Cheers, Iain -
How generate a crystal reports layout for Batch Report
Dear Experts,
I want to create a crystal reports layout for Batch Report that appears when printing Delivery Note.
I've tried using DocKey@ token but it only works in the delivery note layout itself. The following code at the select expert for this crystal layout doesn't work:
{ODLN.DocEntry} = {?DocKey@}
Kindly guide me in the above issue. Thanks.I am using version 8.8 SP.00 PL.10
It is very strange that I cannot get the layout connected to the database as I have followed the same steps for all layouts. It all works fine until I get to the invoice stage and then I cannot make the connection.
(I dont need to worry about the sales invoice as this was provided at installation point by our vendor) -
Layout to a Report run in the background
For a standard SAP Report which is run in background everyday with a variant . How can I attach a layout ( i created for sort column )to the report ? I want the output of the report to be as per the Layout ...How can i assign the layout to the report ?
Hi,
By attaching a layout, if you mean that you want the output spool to be changed as per the new layout, then i dont think that it is possible directly.
You have to copy the standard program and do the changes. Later on schedule this program in background with the variant.
Best regards,
Prashant
PS : How have u created a layout with sort column. Have you copied the standard program ? -
Spool to PDF Conversion in ECC6 from Report running in Background
Hi Friends,
Iam working in ECC6, I have created one Classical report with line size of 295 which is running in Background and spool is generating.
But my requirement is I have to send this spool to email through PDF Attachment.
Here i have to convert Spool of line size 295 to PDF format. and then using FM give mail to respective email ids.
Here is the code i have written for your refference:
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
endif.
1. FORM GET_JOB_DETAILS .
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM. " G
2. FORM OBTAIN_SPOOL_ID .
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
MESSAGE s004(zdd) WITH gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM. " OBTAIN_SPO
3. CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
dst_device = 'ZLOCL'
PDF_DESTINATION = 'X'
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
*Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " CONVERT_SPOOL_TO_PDF
4. FORM PROCESS_EMAIL .
DESCRIBE TABLE it_mess_att LINES gd_recsize.
*DESCRIBE TABLE it_pdf_output LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
ENDFORM. " P
5. FORM SEND_EMAIL USING P_EMAIL.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachnament'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as PDF format
PERFORM send_file_as_email_attachment
TABLES it_mess_bod
it_mess_att
it_pdf_output
USING p_email1
'PDF Document Attached'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
CHANGING gd_error
gd_reciever.
ENDFORM. " SEND_EMAIL
6. FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES it_message
it_attach
USING p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
CHANGING p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
send_mail LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
LOOP AT p_email1.
t_receivers-receiver = p_email1-low.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
ENDLOOP.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENT
But when iam executing the report in Background mail is coming to respective email ids but when i opened that attachment which is in PDF is not opening, giving error as below:
"Could not parsed Attachment.PDF!"
and file size is less oringinallly file size should be 125 KB buit in mail it is coming only 3 KB.
When i executed FM CONVERT_ABAPSPOOLJOB_2_PDF in foreground, its working fine for that Spool id.
Any suggestions from u friends.
regards,
Sekhar.Hi when ur running tha application in background pass the below parameters .
DATA:
w_form_name TYPE tdsfname VALUE 'Zpramu_TEST',
w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
W_bin_filesize TYPE i, " Binary File Size
w_FILE_NAME type string,
w_File_path type string,
w_FULL_PATH type string.
Internal tables declaration
Internal table to hold the OTF data
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
Internal table to hold the data from the FM CONVERT_OTF
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
This function module call is used to retrieve the name of the Function
module generated when the SMARTFORM is activated
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_form_name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = w_fmodule
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Calling the SMARTFORM using the function module retrieved above
GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
format of the output
w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box
" for print preview
w_cparam-getotf = 'X'.
Printer name to be used is provided in the export parameter
OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'.
CALL FUNCTION w_fmodule
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = w_cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = w_outoptions
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
t_otf[] = t_otf_from_fm-otfdata[].
Function Module CONVERT_OTF is used to convert the OTF format to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
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 File SAVE dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = w_FILE_NAME
path = w_FILE_PATH
fullpath = w_FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 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.
Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_bin_filesize
filename = w_FULL_PATH
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = T_pdf_tab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Error when OO ALV report run in background
Hello all,
We recently applied stack 12 for a 7.0 system. My custom ALV report using CL_GUI_CUSTOM_CONTAINER coding now returns an error when run in Background. It works fine in dialog.
The error occurred in program CL_GUI_CUSTOM_CONTAINER=======CP. The log message was "Control Framework: Fatal error - GUI cannot be reached".
Is there a solution for OO ALV reports run in the background? I would not like to re-write my ALV reports using the function call. Any advice is appreciated. Thanks!!Yes, you need to code it a little differently, but you can still use CL_GUI_ALV_GRID. Here is an example.
REPORT ZRICH_0006 .
DATA: ITAB TYPE TABLE OF MARA.
DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
DATA: OKCODE type sy-ucomm.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE ITAB up to 100 rows.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
IF R_CONTROL 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 R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
ELSE.
* Run in background
CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
ENDIF.
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
IT_OUTTAB = ITAB.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE OKCODE.
WHEN 'BACK'.
leave program.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards,
Rich Heilman -
ALV report run In background gives 2 spool numbers
Hi ,
The ALV report which I am running in Background gives me 2 spool numbers after the Job is created in sm37.
I am just executing my ALV report by running it in backgroung procressing, but I get 2 spool one has all the correct data of the ALV and 1 blank spool is created.
I have Passed the followin parameter to my ALV FM.
lwa_print-no_change_print_params = 'X'.
lwa_print-no_print_listinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_default = space
is_layout = t_layout
is_print = lwa_print
it_fieldcat = t_fieldcat
TABLES
t_outtab = t_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Unable to find the reason why I get 2 spool created for it?
Thanks
RiteshHi venkatesh,
Thanks for the reply.
I tried that also but issue was due to a SKIP statement called in the program and due to which a new spool which was blank was called.
The issue is resolved.
Thanks
Solanki Ritesh -
How can I set default copies for specific report?
I'm trying to set a default of one copy on a specific concurrent request. In this particular case, the NACHA request that produces the NACHA magnetic file. I have a dummy custom printer driver, style, etc. setup and attached to the NACHA concurrent program so that when it executes (as long as the user remembers to put 1 in the Copies field on the concurrent request screen) it will execute the Unix shell script (it grabs the file and FTP's it somewhere).
The problem is, if the user forgets to put 1 in Copies, the Unix shell script won't execute. I'd like to make it so this one request comes up with a default of 1 in Copies. The only way I know of to set copies is in the site profile, application profile (like HR, AP, etc.) or user profile. I really don't want any of these because then the default will be set for all reports within those respective profiles. I was hoping there was a way to set the number of copies in the printer control file, but thus far I can't find any current documentation that shows the syntax of the available commands for the printer control file. Found something on the Internet, but it looked like it was for Oracle 7, perhaps. We're on 11i. On that page, I saw nothing about setting copies, so I don't know if it was just missed, isn't possible or is possible in the new version.Looks like I may have found my answer.
Create a report set
Add the concurrent program to the report set
set copies in the options zone of the report set to 1
Run the report set instead of the concurrent program itself and the copies will always be defaulted to 1. -
Printout of report running in background.
Hi
i have a report which i am running in background , If i want to take printout of the output
list generated, which FM am i suppose to use ?
thanks in advance.Sample code would be
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
copies = 1
department = c_dept
destination = c_dest
expiration = 2
layout = c_layout
line_count = 65
line_size = 255
list_name = text-031
list_text = text-032
mode = ' '
new_list_id = 'X'
no_dialog = 'X'
receiver = c_rec
release = 'X'
sap_cover_page = 'X'
user = sy-uname
IMPORTING
out_parameters = l_params
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc = 0 AND NOT l_params IS INITIAL.
NEW-PAGE PRINT ON PARAMETERS l_params NO DIALOG NEW-SECTION.
g_spool = 'X'.
ENDIF. -
Error while report running in background
Hello to all,
I am running a report in backgroud using SM37.This report already programmed to call a report in background.It takes stocks for given period,I am taking the values using "import memory-id" statement.It gives an error log in SM37 as:
Choose at least one scope of list
Message no. M7829
Can we call a submit stmt in a report that is to run in background?? or pls provide any alternative for this problem??
Thnax & Regards
Vipin B.Hi,
If you faced problem in submit statement,then try replacing the same by running the bdc for the particular program that you are using in submit statement.
Make sure that you had given values for all the mandatory parameters and select option in the selection screen of the report program that you are submitting using submit statement.
Kindly reward points by clicking the star on the left of reply,if it helps.
Maybe you are looking for
-
I keep getting an error message when trying to purchase more gold coins?
I keep getting an error message when trying to purchase more gold coins. Same unexpected error occurs with all of my slot machines??
-
How to Get Channel Name in Adapter Engine Alerts
Hi All, I am using 'Alrtcatdef' and 'Rules' in RWB to generate Adapater Engine Alerts. I am aware of the standard containers that are available to compose Alert Email content. Is there a way I can read the Channel Name(and NOT Adapter type i.e Idoc,
-
AS3 - dynamic class names with *new* operator
I'm using AcrtionScript 3 and Adobe Flash 9 Public Alpha. I have 50 movie clips in the Library that use Linkage to set the Class name to: Img1, Img2, Img3, ..., Img50. I have a parent class named RandImg. I want the constructor for RandImg to randoml
-
DOS Command Window flashes.
I have multiple VI's that are built into exe's. They communicate with shared variables. I launch one exe manually, and it uses the System Exec VI to launch the other two. The main vi (exe) runs each time it is requested and quits (as it was dsigned t
-
How to get more colors in forms6.0 as background . There are a few colors provided but if we want to use the other colors ... How can we do that? regards satish