To Execute a Fm in Background
Hi all,
I had created a RFC (function Module) ,
I called this FM in a program With "BACKGROUND TASK"
CALL FUNCTION "ZBAPI_ROUND" BACKGROUND TASK DESTINATION 'NONE' AS SEPARATE UNIT.
But I couldn't get the data from the FM , But when I'm running in foreground I retrieving the Data.
Can Anyone Help me with Example Please as early as possible.
Regards
S.Janani.
Hi Janani,
The info in this link might help you out..
http://help.sap.com/saphelp_nw04/helpdata/en/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm
Reward points if helpful..
Regards,
Goutham.
Similar Messages
-
Require Job name in SM37 while executing call transaction in background
Hi all,
I am executing a report program, which contains Call transaction.
I have recorded properly. The recording contains background job screen also ( means a separate popup came and i gave the job name and i gave immediately )
When i execute in this program in foreground its creating job,its showing the job in sm37.
But when i execute this program in background, it does not showing the job name in sm37.
Anyone kindly help this out?
AnandhabHi,
The job will be created by the step level user.
Try searching again with jobname and * for username.
Regards,
Jovito -
BDC is not working in when executing the program in background
Hi gurus,
I have a problem that in BDC is not working when i'm executing the upload program in background thru scheduling(SM36) , while it works fine when i execute directly with NO screen display modeMany transactions behave differently when executed in foreground and background. The fields on the screen may be different.
In transaction SHBD when starting a recording there is a checkbox where you can select 'Simulate Background Mode'. If you do your recording using this option you will get the code suitable for background mode. If you do not select this option you will get a code for foreground mode.
By compairing the two codes you will know the changes required for background mode.
Hope this helps you -
Executing the program in Background
Hi experts i'm trying to Execute the Program in background.
Given the Input and output file locations and Press F9 for process the program in background from SE38. cause i want to run my program as a batch(Background)
but its not accepting. can you please help me how to resolve this issue.
i'm providing the code can you please verify that.
Many Thanks
SELECTION-SCREEN *
selection-screen begin of block b1 with frame title text-001.
*.. Filename
PARAMETERS: f_name TYPE char100, "Upload filename
d_name TYPE char100. " Download filename
selection-screen end of block b1 .
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_serv radiobutton group RAD1,
p_frnt radiobutton group RAD1 default 'X'.
SELECTION-SCREEN: END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_name.
*.. Data Declaration
DATA: lt_file TYPE filetable,
lv_file TYPE LINE OF filetable,
rc_i TYPE i,
cl_gui TYPE REF TO cl_gui_frontend_services,
w_path LIKE dxfields-longpath.
*.. Check if from server or frontend
IF p_frnt = 'X'.
*.. Create objects for method
CREATE OBJECT cl_gui.
*.. Clear the filename
CLEAR f_name.
*.. Call method to search for file
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Choose Input File'
CHANGING
file_table = lt_file
rc = rc_i
EXCEPTIONS
OTHERS = 4.
*.. Check if file found
IF sy-subrc EQ 0.
*.. Check that file path not empty
CHECK NOT lt_file[] IS INITIAL.
LOOP AT lt_file INTO lv_file.
*.. Set parameter to filename
f_name = lv_file-filename.
ENDLOOP.
ENDIF.
*.. Free object
FREE cl_gui.
*.. Upload from Server
ELSE.
Retrieve filename
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = '/sap_ftp/'
filemask = '**'
fileoperation = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
o_path = w_path
ABEND_FLAG =
EXCEPTIONS
rfc_error = 1
error_with_gui = 2
OTHERS = 3.
Set file path
f_name = w_path.
ENDIF.
*.. File selection for output file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR d_name.
*.. Only allow search for front-end
IF p_frnt = 'X'.
*.. Data Declaration
DATA: lt_file TYPE filetable,
lv_file TYPE LINE OF filetable,
rc_i TYPE i,
cl_gui TYPE REF TO cl_gui_frontend_services.
*.. Create objects for method
CREATE OBJECT cl_gui.
*.. Clear the filename
CLEAR d_name.
*.. Call method to search for file
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Choose Input File'
CHANGING
file_table = lt_file
rc = rc_i
EXCEPTIONS
OTHERS = 4.
*.. Check if file found
IF sy-subrc EQ 0.
*.. Check that file path not empty
CHECK NOT lt_file[] IS INITIAL.
LOOP AT lt_file INTO lv_file.
*.. Set parameter to filename
d_name = lv_file-filename.
ENDLOOP.
ENDIF.
*.. Free object
FREE cl_gui.
ENDIF.
*.. General Checks for Selection screen
AT SELECTION-SCREEN.
*.. Check if program run in batch mode and ping directory
IF sy-batch = 'X'.
*.. Move filename to file_name
file_name = d_name.
*.. Check if path can be reached
OPEN DATASET file_name FOR INPUT IN TEXT MODE.
IF sy-subrc NE 0.
MESSAGE e082(zsomerfield).
ENDIF.
ENDIF.
NITIALIZATION.
*.. ALV Variables
variant_save = 'A'.
w_repid = sy-repid.
w_variant_handle = c_handl.
START-OF-SELECTION *
START-OF-SELECTION.
*.. Check if batch program running in batch mode or not
IF sy-batch = 'X'.
*.. Open file on application server for reading
OPEN DATASET file_name FOR INPUT IN TEXT MODE.
DO.
*.. Upload entries
READ DATASET file_name INTO zpernr.
*.. IF end of file reached then exit DO statement
IF sy-subrc = '4'.
EXIT.
ELSE.
*.. IF entry found then add to employee table
in_file-empnum = zpernr.
*.. Add entries to table
APPEND: in_file.
*.. Clear header lines
CLEAR: in_file, zpernr.
ENDIF.
ENDDO.
*.. Close dataset
CLOSE DATASET file_name.
*.. Get file from frontend and run in foreground
ELSE.
*.. Upload from local machine.
DATA: file_name TYPE string. "LIKE rlgrap-filename,
*.. Set filename to filename from screen
file_name = f_name.
*.. Upload the information from the file into the table in_file
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
TABLES
data_tab = in_file
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
*.. Make sure file uploaded correctly
IF sy-subrc <> 0.
MESSAGE E018(ZHR_MESSAGES).
ELSE.
MESSAGE i017(ZHR_MESSAGES).
ENDIF.
ENDIF.Hi Vamsi,
<b>First Check in the Foreground your program is working for the application server file or not</b>
When you will Execute your program in Background internal table "ZPERNR" will be populated from the file that is there on the application server.
After that what you want to do with the internal table.I think you have not sent the whole code.
In background FM GUI_UPLOAD willl not work.
If you want to debug your code put wait for 100 seconds at the place where you want to dubug your code.Go to transaction code SM50 your job will be running there.
Select Your job
Go to Menu Bar Program/Mode - > program - > Debugging.
In this way you can debug your code.
First Check in the Foreground your program is working for the application server file or not -
How to execute ME22N transaction in background.
Hi experts,
How to execute ME22N and ME23N in background, when execute the transaction in background, , it should generate a spool, with out any printpreview. How can we do this....?
thanksHi,
Write a BDC program for updation of tables for u r user-exit.
After that Schedule u r program in back gound job scheduling.
Using SM36 - Define Background job.
Give the job name and Press job wizard button.
It's asking about job name and job class -prioritty.
press continue and give program name .
Select radiobutton based on u r requirement.
Then specify periodic job or only in holidays.
Then u select hours and all.
In SM37 give u r job name and and press execute.
Reward if useful.
Regards,
Narasimha -
Database Alert Macros issue while executing the macros in Background
Hi All,
I am facing some problems while executing the Database alert macros in Background/Process Chain.
There are two macros for which the problem exists.
1.Excess Projected Inventory above Max
The logic here is, the alert should work for Only Fixed Lot size Procedure.
If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
XX is the Percent above Max.
Note: SOQ => fixed lot size.
2.Excess Actual Days of Supply
The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size".
Actual Days Supply >=180 days. (current -> future buckets)
- For every receipt cell check the Actual Days Supply - if >= 180 days.
The macros are working perfectly as expected.Hi Abhi,
Hope you are doing good.
Yes exactly, the macros are working in foreground/Interactively but not in the Background via Process chain. Let me send the details again.
Issue :
I am facing some problems while executing the Database alert macros in Background/Process Chain.
There are two macros for which the problem exists.
1.Excess Projected Inventory above Max
The logic here is, the alert should work for Only Fixed Lot size Procedure. But in Background the alerts are getting created for Lot for Lot and other Planning procedures..
If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
XX is the Percent above Max.
Note: SOQ => fixed lot size.
2.Excess Actual Days of Supply
The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size". But in Background the alerts are getting created for the Fixed Lot size procedures too..
Actual Days Supply >=180 days. (current -> future buckets)
- For every receipt cell check the Actual Days Supply - if >= 180 days.
The macros are working perfectly as expected in Foreground/Interactively but the samething is not happening while executing the macro in Background/Process Chain.
I have tried running these macros in different sequences(Default/Start/Macro) but couldn't able to resolve the issue.
Thanks in Advance,
Jay. -
How to execute an RFC in background
Hello People!
Is there a way of execute an RFC in background without broken the execution after connection timeout? I have a RFC calling another RFC in background mode but the process stops after connection timeout. As far as I know, the sap user connection is done like DIALOG and, after timeout, all processes started are finished.
I thought to use JCO directly but i'm looking for a better solution.
Thanks to all.
Best regards,
MarceloProcess p = Runtime.getRuntime().exec("yourCommand.exe");
-
Problem when I execute program SCM in background
Hi experts,
I am with problem when I execute a program (SCM) in background. I inserted a new field (estoque_seg(10)) and the process stopped at execute in background.When I call transaction and press F8, works but for this, I need jump the consistence IF sy-batch IS INITIAL....Dont has any bath imput, only functions. Any idea?
Follow below the code:
Estrutura para tabela ENTRADA
DATA: BEGIN OF st_entrada,
matnr(40) TYPE c,
werks(20) TYPE c,
ponto_abas(10) TYPE c,
estoque_max(10) TYPE c,
cobertura(10) TYPE c,
estoque_seg(10) TYPE c, " Erlon Lourenço 20/01/2011
END OF st_entrada.
Estrutura para tabela de LOG
*TYPES: BEGIN OF st_saida,
pernr(8) TYPE c ,
date(10) TYPE c,
er_contribuition(15) TYPE c,
tax(15) TYPE c,
msg_erro(80) TYPE c,
END OF st_saida.
Tabela para obter descricao da mensagem
*DATA: ti_saida TYPE STANDARD TABLE OF st_saida WITH HEADER LINE
INITIAL SIZE 0.
Tabela que recebera o arquivo texto
DATA: BEGIN OF ti_entrada OCCURS 0.
INCLUDE STRUCTURE st_entrada.
DATA: END OF ti_entrada.
DATA: BEGIN OF it_matid OCCURS 0,
matnr TYPE /sapapo/matkey-matnr,
matid TYPE /sapapo/matkey-matid,
END OF it_matid.
DATA: BEGIN OF it_locid OCCURS 0,
locno TYPE /sapapo/loc-locno,
locid TYPE /sapapo/loc-locid,
END OF it_locid.
DATA: BEGIN OF it_matlotsz OCCURS 0,
target_dur TYPE /sapapo/matlotsz-target_dur,
END OF it_matlotsz.
DATA: wa_matloc LIKE /sapapo/matloc OCCURS 0 WITH HEADER LINE,
wa_matlsim LIKE /sapapo/matlsim OCCURS 0 WITH HEADER LINE,
wa_matlotsz LIKE /sapapo/matlotsz OCCURS 0 WITH HEADER LINE.
Variáveis Globais
DATA: v_tabix TYPE sy-tabix,
v_vrsioid TYPE /sapapo/apo01-vrsioid,
v_tam TYPE i.
Select-Options & Parameters
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_versao TYPE /sapapo/apo01-vrsioex OBLIGATORY DEFAULT '000',
p_abas AS CHECKBOX ,
p_est AS CHECKBOX ,
p_cober AS CHECKBOX ,
p_estsg AS CHECKBOX. " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
SELECTION-SCREEN END OF BLOCK b1.
Start-of-Selection
START-OF-SELECTION.
PERFORM consiste.
PERFORM f_upload.
PERFORM f_processa_batch.
PERFORM f_saida_dados.
MESSAGE i000 WITH 'Processo encerrado com Sucesso'.
END-OF-SELECTION.
*& Form F_UPLOAD
text
--> p1 text
<-- p2 text
FORM f_upload .
DATA: lc_file TYPE string.
TYPES: BEGIN OF st_ent,
cam(80),
END OF st_ent.
DATA: ti_ent TYPE STANDARD TABLE OF st_ent WITH HEADER LINE
INITIAL SIZE 0.
RANGES: r_file FOR zget0001-field_content.
r_file[] = zbs_constantes=>obter( i_bukrs = space i_field = 'FILE' i_process = 'PONTO-REAB' ).
READ TABLE r_file INDEX 1.
lc_file = r_file-low.
CLEAR: ti_entrada,
ti_entrada[],
ti_ent,
ti_ent[].
abrir arquivo para leitura
OPEN DATASET lc_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-e01.
STOP.
ENDIF.
Leitura de arquivos
DO.
READ DATASET lc_file INTO ti_ent.
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND ti_ent.
ENDDO.
Fechamento do arquivo
CLOSE DATASET lc_file.
LOOP AT ti_ent.
SPLIT ti_ent AT ';' INTO ti_entrada-matnr ti_entrada-werks ti_entrada-ponto_abas ti_entrada-estoque_max ti_entrada-cobertura ti_entrada-estoque_seg.
APPEND ti_entrada.
ENDLOOP.
ENDFORM. " F_UPLOAD
*& Form F_PROCESSA_BATCH
text
--> p1 text
<-- p2 text
FORM f_processa_batch .
LOOP AT ti_entrada.
v_tabix = sy-tabix.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ti_entrada-matnr
IMPORTING
output = ti_entrada-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ti_entrada-ponto_abas
IMPORTING
output = ti_entrada-ponto_abas.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ti_entrada-estoque_max
IMPORTING
output = ti_entrada-estoque_max.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ti_entrada-cobertura
IMPORTING
output = ti_entrada-cobertura.
IA - ERLON LOURENCO - 20/01/2012
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ti_entrada-estoque_seg
IMPORTING
output = ti_entrada-estoque_seg.
FA - ERLON LOURENCO - 20/01/2012
MODIFY ti_entrada INDEX v_tabix.
ENDLOOP.
CLEAR: it_matid,
it_matid[],
it_locid,
it_locid[],
wa_matlsim,
wa_matlsim[],
wa_matloc,
wa_matloc[].
SELECT matnr matid INTO TABLE it_matid FROM /sapapo/matkey
FOR ALL ENTRIES IN ti_entrada WHERE matnr = ti_entrada-matnr.
SELECT locno locid INTO TABLE it_locid FROM /sapapo/loc
FOR ALL ENTRIES IN ti_entrada WHERE locno = ti_entrada-werks.
IF p_versao = '000'.
LOOP AT ti_entrada.
READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
IF sy-subrc = 0 .
READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
IF sy-subrc = 0.
SELECT SINGLE * INTO wa_matloc FROM /sapapo/matloc WHERE matid = it_matid-matid AND
locid = it_locid-locid.
IF sy-subrc = 0.
IF p_abas = 'X'.
wa_matloc-reord = ti_entrada-ponto_abas.
ENDIF.
IF p_est = 'X'.
wa_matloc-maxstock = ti_entrada-estoque_max.
ENDIF.
" IA - Erlon Lourenço - 23/01/2012
if p_estsg = 'X'.
wa_matloc-safty = ti_entrada-estoque_seg. " Erlon Lourenço - 23/01/2012
endif.
"FA - Erlon Lourenço - 23/01/2012
IF p_abas = 'X' OR
p_est = 'X' OR
p_estsg = 'X'. " Erlon Lourenço - 23/01/2012
APPEND wa_matloc TO wa_matloc.
ENDIF.
SELECT SINGLE * INTO wa_matlotsz FROM /sapapo/matlotsz WHERE lszid = wa_matloc-lszid.
IF sy-subrc = 0.
IF p_cober = 'X'.
wa_matlotsz-target_dur = ti_entrada-cobertura.
APPEND wa_matlotsz TO wa_matlotsz.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP. " LOOP AT ti_entrada.
ELSE.
Verifica versáo para saber se preenche a tabela wa_matlsim
SELECT SINGLE vrsioid INTO v_vrsioid FROM /sapapo/apo01 WHERE vrsioex = p_versao.
IF sy-subrc = 0.
SELECT * INTO TABLE wa_matlsim FROM /sapapo/matlsim WHERE simid = v_vrsioid.
IF wa_matlsim[] IS NOT INITIAL.
LOOP AT ti_entrada.
READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
IF sy-subrc = 0 .
READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
IF sy-subrc = 0.
READ TABLE wa_matlsim WITH KEY matid = wa_matloc-matid
locid = wa_matloc-locid.
IF sy-subrc = 0.
wa_matlsim-reord = ti_entrada-ponto_abas.
wa_matlsim-maxstock = ti_entrada-estoque_max.
wa_matlsim-safty = ti_entrada-estoque_seg. " Erlon Lourenço - 23/01/2012
MODIFY wa_matlsim INDEX v_tabix.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP. " LOOP AT ti_entrada.
ENDIF. " IF wa_matlsim[] IS NOT INITIAL.
ENDIF. " IF sy-subrc = 0. 1º
ENDIF. "IF p_versao = '000'
Funcáo que atualiza campos nas bases de dados.
CALL FUNCTION '/SAPAPO/DM_PRODUCTS_POST'
EXPORTING
iv_vb = 'U'
TABLES
it_matloc = wa_matloc
it_matlsim = wa_matlsim
it_matlotsz = wa_matlotsz
EXCEPTIONS
not_qualified = 1
insert_failed = 2
update_failed = 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. " F_PROCESSA_BATCH
FORM BDC_DYNPRO
*& Form F_SAIDA_DADOS
text
--> p1 text
<-- p2 text
FORM f_saida_dados .
IF ti_saida[] IS NOT INITIAL.
DATA: lc_file TYPE string.
lc_file = p_erros.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = lc_file
FILETYPE = 'ASC'
TABLES
data_tab = ti_saida
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 i005 WITH 'Error to unload file !'.
STOP.
ENDIF.
ENDIF.
ENDFORM. " F_SAIDA_DADOS
*& Form CONSISTE
text
--> p1 text
<-- p2 text
FORM consiste .
IF p_abas IS INITIAL AND
p_est IS INITIAL AND
p_cober IS INITIAL AND
p_estsg IS INITIAL. " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
MESSAGE i000 WITH text-e03.
STOP.
ENDIF.
IF sy-batch IS INITIAL.
MESSAGE i000 WITH text-e02.
STOP.
ENDIF.
Best regards,
Erlon Lourenço
Edited by: Erlon Louren on Jan 27, 2012 11:09 AMHi Raja,
Check weather there are any enhancements to the datasource.If yes once check the code in CMOD.Seems there is some discrepency in that.
Regards
Karthik -
How to Execute RMDATIND inside another Background Job using a variant?
Hi,
It is only possible to start RMDATIND (direct input) in background from transaction BMV0 u2013 it is impossible just to place the program in another job in SM37 or SM36.
In a related thead I saw : u201DSolved my self by using BI_START_JOB. If I use this function module along with RS_CREATE_VARIANT and RS_VARIANT_DELETE. u201C
Following is the link to that thread
Re: Problem in using JOB_OPEN, JOB_SUBMIT & JOB_CLOSE
RS_CREATE_VARIANT (Creating a variant (not using a selection screen))
RS_VARIANT_DELETE(Variant to be deleted)
BI_START_JOB
Can some one provide me with all the parameters required to execute the above Function Modules?Hi,
Refer below thread:
Process Control in Confirmation Parameters
All the relevant details are explained in detail..
Best Regards,
Siva -
Error in executing a program in background?
Hi all,
I have one report , which is alv grid display using Oops.
it is going to be executed in online but when we are try to execute this in background through path
Program->Execute in background.
the job is going to be canceled with error "Control Framework: Fatal error - GUI cannot be reached" and also i am getting one popup message like " format set to x_65_132"
how can we rectify this error , what we have to code in program to overcome this problem.....
thanks in advanceHi,
1)Goto SM36,
2)Enter all the options
3)Click step,
4)If the job is being scheduled to run an ABAP program, follow the directions mentioned below. Else, jump to Step 5.
Fill the User field . This is very important, Put the program name in the NAME field,Put the variant name in the VARIANT field and save.
5)If the job executes an external command, then follow the steps below:Click on External Command and fill the fields and click save.
Reward if useful -
Error while executing pgm RMMR1MRS in background
Hi Experts,
when executing pgm RMMR1MRS ( T-code MRRL) in background , when i check job log am getting errors and warnings , but when executed manually it is working fine ,
can you guide me what might be the problem.
Thank's in advance,
Aby.closed
-
Execute one thread in background mode.
hello ,
I have an application where the user can shows dialogs to displays, adds, modify and delete rows of one tale inside some JTextFields.
I have a problem to use this application, when one same dialog is showed more then one time....
Exactly: not problems come the first time the dialog is showed, but the second time, the time to wait because the performance is executed is very long..., and further, ....when the dialog at last was is shoved, no data of the table are in the JTextFields.
I get errors too when at last the dialog was shoved, and the errors not aways said the same reason..., but all the errors are referred to the impossibility (in the performances that followed the first) to have a suitable resultset containing the data.
Some error are "null pointer exception" to read the resultSet, other error is "Impossibils get a block in the required time" ...
I read documentation and I understand that the fault, probably, could came from the Event Dispach Thread that had the task to manage the creation of the ResultSet.
Now I am trying to solve (at this moment without success) the problem in this direction, ...as well I have not experience about to manage the use of SwingWorker class.
I should like hear what it is wrong in that I am doing...
Initially my code was this
* Create a resultSet, for the current table
private void createResultSet() {
statement = dbconn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
currentResultSet = statement.executeQuery("Select * from " + tableName);
boolean validateState = currentResultSet.last();
regsNmbrOnTheTable = currentResultSet.getRow();
System.out.println("Numero attuale di records = " + regsNmbrOnTheTable);
// here come the exception:
// Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
} catch (SQLException ex) {
reportErrors.checkingSyntaxInInputTags("metodo createResultSet(): Errore nel creare il resultSet");
// Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} // createResultSetrecently I modified it in order to put the creation of the ResultSet in background....
* Create a resultSet, for the current table
private void createResultSet() {
(acquiresResultSetInBackground = new AcquiresResultSetInBackground()).execute();
currentResultSet = acquiresResultSetInBackground.doInBackground();
} // createResultSet
// inner class to manage the performance in background mode.
class AcquiresResultSetInBackground extends SwingWorker <ResultSet, Void> {
ResultSet resultSet;
@Override
protected ResultSet doInBackground() {
try {
statement = dbconn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
resultSet = statement.executeQuery("Select * from " + tableName);
} catch (SQLException ex) {
reportErrors.checkingSyntaxInInputTags("metodo createResultSet(): Errore nel creare il resultSet");
return resultSet;
}How I said I get again the same behavior that was before......
thank you
Regards
tonyMrsangeloFor custom transactions you shouldn't have a problem - unless you're trying to do something that needs dialog with the presentation server.
Set an infinite loop in the custom transaction, launch your program in backround, then from Sm50, go to debug and find out what's going on.
DATA: debug.
WHILE debug IS INITIAL. " Debug from SM50 will get you here, change field DEBUG in the
ENDWHILE. " debugger to contain 'X', and the loop will end.
Also, if your custom tx calls any standard SAP programs/FM, there is a chance that those programs work differently in background than foreground. -
Hello experts,
please have a look at the part of the code in report below
CALL FUNCTION 'ME_PRICING_ALL'
IN BACKGROUND TASK.
IMPORT EKOMV TO lt_KOMV FROM MEMORY ID 'RM06K010'.
loop at lt_komv.
write: / lt_komv-KWERT.
endloop.
in FM ('ME_PRICING_ALL') is syntax "EXPORT EKOMV TO MEMORY ID 'RM06K010'" and syntax with command WRITE .... ("report on the screen")
i don't want to "see" output(report) from FM ME_PRICING_ALL on the screen, so i called FM with "IN BACKGROUND TASK.", but I couldn't get the data from the FM.
When I'm running FM in foreground (without IN BACKGROUND TASK) I'm retrieving the data, but i don't want to see report in FM.
Thanks for help
MartinHi,
Check the following
Syntax
CALL FUNCTION func IN BACKGROUND TASK
DESTINATION dest
parameter list
AS SEPARATE UNIT.
Addition:
... AS SEPARATE UNIT
Effect
Transactional call of a remote-capable function module specified in func using the RFC interface. You can use the addition DESTINATION to specify an individual destination in dest. If the destination has not been specified, the destination NONE is used implicitly. Character-type data objects are expected for func and dest.
When the transactional call is made, the name of the called function, together with the destination and the actual parameters given in parameter list, are registered for the current SAP LUW in the database tables ARFCSSTATE and ARFCSDATA of the current SAP system under a unique transaction ID (abbreviated as TID, stored in a structure of type ARFCTID from the ABAP Dictionary, view using transaction SM58). Following this registration, the program making the call is continued by way of the statement CALL FUNCTION.
When executing the COMMIT WORK statement, the function modules registered for the current SAP LUW are started in the sequence in which they were registered. The statement ROLLBACK WORKdeletes all previous registrations of the current SAP LUW.
If the specified destination is not available for COMMIT WORK, an executable called RSARFCSE is started in the background. This attempts to start the functional modules registered for an SAP LUW in their destination, every 15 minutes up to a total of 30 times. You can make changes to these parameters using transaction SM59. If the destination does not become available within the given time, this is noted in the database table ARFCSDATA as a CPICERR entry. By default, this entry in database table ARFCSSTATE is deleted after 8 days.
Addition
... AS SEPARATE UNIT
Effect
When using the addition AS SEPARATE UNIT, the relevant function module is executed in a separate context, a context in which the global data of the function group is not influenced by previous calls. Each function module that is registered with the addition AS SEPARATE UNIT is given a separate transaction ID. Without the addition AS SEPARATE UNIT, the usual description is applicable for the context of the called function modules. What this means is that, when using the same destination for multiple calls of function modules belonging to the same function group, the global data of this function group is accessed collectively.
You can use the function module ID_OF_BACKGROUNDTASK to define the transaction ID (TID) of the current SAP LUW, according to a transactional RFC.
The transactional RFC (tRFC) is suitable for realizing LUWs in distributed environments (a typical application is ALE). Here it must be noted that although executing the function modules within a transaction ID is predefined, the sequence of the LUWs on the RFC servers does not necessarily correspond to the sequence of SAP LUWs in the RFC client. To achieve a serialization on the RFC servers as well, the tRFC can be enhanced to queued RFC (qRFC). For this, you can call function module TRFC_SET_QUEUE_NAME before a transactional RFC.
CALL FUNCTION - IN BACKGROUND TASK parameter_list
Syntax
... http://EXPORTING p1 = a1 p2 = a2...
http://TABLES t1 = itab1 t2 = itab2 ... ... .
Effect
These additions are used to assign actual parameters to the formal parameters of the function module. The significance of the additions is the same as for synchronous RFC with the exception that no values can be copied with IMPORTING and CHANGING, and no return values can be allocated to exceptions that are not class-based.
Regards,
Raj. -
Problem in executing the SO_NEW_DOCUMENT_SEND_API1 in background task
Hi All,
I have specific requirement in which I need to put the workflow into an error whenever posting of the journal document fails (which is a background task in my workflow) and before that I should send the notification to the initiator's lotus notes ID a mail with error description. So that user can repost the document after removing the error in standard SAP. For that I am using function module SO_NEW_DOCUMENT_SEND_API1. But when I execute the workflow then it is not sending any notification to the e-mail ID. But when I debug in foreground then it is sending an e-mail notification to initiator's e-mail address.
I think this FM will not execute in background, if any one is having idea how to make this run then please let me know.
If any one knows any alternate solution that will also help me to meet my requirement.
Please let me know if anything else requires.
Thanks in advance.
Prashant P. Raichurkarhello,
If you use this FM in a background task then the user is different. probably this is user wf-batch.
Can you verify if the user has a correct email address assigned in his user master data?
What you also can try is to logon with user WF-BATCH (change type of user for that) and run the FM.
/Peter -
Executing a report in background,without selection scr with a variant
Dear All,
Please let me know whether I can execute a report which doesn't has a selection-screen, in background, <b>using a variant</b> ?
Alok.Hi,
In order to restrict the user to run it only in background , you can as well check for SY-BATCH condition.
The other way is try to remove "execute in foreground" option from the menu and this can be done with the function module .
Do reward points if useful and close the thread if the doubt is cleared
data: begin of int_exc occurs 0,
code like sy-ucomm,
end of int_exc.
data wf_repid .
initialization.
clear int_exc.
int_exc-code = 'ONLI'.
append int_exc.
int_exc-code = 'PRIN'.
append int_exc.
move: sy-repid to wf_repid .
call function 'RS_SET_SELSCREEN_STATUS'
exporting
p_status = '%_00'
p_program = 'wf_repid'
tables
p_exclude = int_exc
Regards,
Ram
Pls reward points if helpful.... -
Execute a report in background
Hi All,
I have to create a batch job which will run a report. For that batch job i have to show only few Columns in report. This report also used to run for others batch jobs.
Now i want to know how can i modified my report to know which batch job is executing my report while processing in background.
i.e i can modify the report output based on the folloing condition.
If SY-BATCH is initial and BATCHJOBNAME = 'Test'.
desired output.
else.
endif.Hi piyush,
1. The answer to your question is :
the FM
GET_JOB_RUNTIME_INFO
2. Use this FM inside the code
of your report.
3. It will give you various details like.
EVENTID
EVENTPARM
EXTERNAL_PROGRAM_ACTIVE
JOBCOUNT
JOBNAME
STEPCOUNT
regards,
amit m.
Maybe you are looking for
-
SQL loader : how to populate a calculated feild of a table?
Hi All, I have a table which has total 92 columns, among them 6 feilds are calculated using few other fields of the same table. i have a csv file , which has only 86 feilds . during upload data using sql loader, is it possible to calculate other 6 fe
-
Will I pay with credit card or with the iTunes gift card? Can I choose?
-
Acrobat X announced, coming soon
Now that "Acrobat X and its associated products are scheduled to ship within 30 days," is it possible to find out whether the custom panel I made with XMP File Info SDK for CS4 will work with it,or will I need to convert it to the CS5 SDK? I assume
-
Change Report Title for an RDL
I have deployed an SSRS report to Sharepoint 2013 that has a name I do not want to display to the users. I tried entering the desired name of the report in the Title field of the properties page for the RDL but it did not make any change to what the
-
Taking a long time to log in or wake up from sleep.
Over the past couple weeks, I've noticed that it takes a long time for me to log in to my own password-protected laptop and waking it up from sleep. I type my password and sometimes have to wait for at least a minute before the Finder appears. Today,