-
Notifications
You must be signed in to change notification settings - Fork 0
/
abapcall_function_background_task.html
212 lines (210 loc) · 12.8 KB
/
abapcall_function_background_task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="EN">
<!-- ABAPCALL_FUNCTION_BACKGROUND_TASK -->
<!-- Mirrored from help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapcall_function_background_task.htm by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 20 Jan 2022 18:03:52 GMT -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="SAP">
<meta name="description" content="CALL FUNCTION - IN BACKGROUND TASK">
<title>
CALL FUNCTION - IN BACKGROUND TASK - ABAP Keyword Documentation
</title>
<link rel="icon" href="ABAPIcon.ico" type="image/ico">
<link rel="shortcut icon" href="ABAPIcon.ico">
<LINK rel="stylesheet" href="abap_docu.css" type="text/css">
<script type="text/JavaScript">
function call_link(linked_file)
{
if(parent.frames.length>0){
parent.window.frames["basefrm"].window.location = linked_file;
parent.window.frames["treeframe"].window.location = "abap_docu_tree92bd.html?file=" + linked_file;}
else {
window.location = linked_file;}
}
function urlToClipboard(id){
try{ var loc = top.location.href;}
catch(e){ alert( "URL cannnot be determined" ); return; }
var field = document.getElementById(id);
field.focus();
if ( loc.search( ".htm" ) == -1 && loc.search( ".HTM" ) == -1 ){ loc = loc + "index.htm"; }
if ( loc.search( "index.html" ) != -1
|| loc.search( "INDEX-2.html" ) != -1 ){
var off = loc.search( "file=" );
if ( off == -1 ){
field.value = loc + "?file=abapcall_function_background_task.htm"; }
else {
field.value = loc.substring( 0, off ) + "file=abapcall_function_background_task.htm";
}
}
else {
field.value = loc; }
field.setSelectionRange(0, field.value.length);
var r = confirm( "Copy URL to clipboard?\n\n" + field.value + "\n\nCopy to clipboard does not work in all browsers." );
if (r == true) {
try{
document.execCommand("copy");
}
catch(e){ alert( "URL could not be copied to clipboard" ); }
}
window.scrollTo(0,0);
}
</script>
</head>
<body>
<div class="all">
<p class="copyright">SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG. All rights reserved.
<input type="button" value="URL" style="font-size:8px; width:26px; height:16px; padding:0"
onclick="urlToClipboard('url')" title="Copy URL to Clipboard" >
</p>
<span class="path">
<a href="javascript:call_link('abenabap.html')" class="blue">ABAP - Keyword Documentation</a> →
<a href="javascript:call_link('abenabap_reference.html')" class="blue">ABAP - Reference</a> →
<a href="javascript:call_link('abenabap_obsolete.html')" class="blue">Obsolete Language Elements</a> →
<a href="javascript:call_link('abenextern_obsolete.html')" class="blue">Obsolete Data and Communication Interfaces</a> →
<a href="javascript:call_link('abenrfc_obsolete.html')" class="blue">Obsolete Transactional RFC</a> →
</span>
<A NAME="@@IN BACKGROUND TASK@@CALL FUNCTION (obsolete)@@"></A>
<A NAME="@@DESTINATION@@CALL FUNCTION IN BACKGROUND TASK (obsolete)@@"></A>
<p><span class="h1">
CALL FUNCTION - IN BACKGROUND TASK <br><br>
</span></p>
<P>
<a href="javascript:call_link('abapcall_function_shortref.html')" class="blue">Quick Reference</a> <br><br>
</P>
<p><span class="h2">
<span class="bold">Obsolete Syntax</span>
</span></p>
<P>
<span class="qtext">CALL FUNCTION func IN BACKGROUND TASK</span> <br><span class="qtext">
<i class=bn>[</i>AS SEPARATE UNIT<i class=bn>]</i></span> <br>
<span class="qtext"> <i class=bn>[</i>DESTINATION dest<i class=bn>]</i></span> <br>
<span class="qtext">
<a href="javascript:call_link('abapcall_function_background_para.html')" class="blue">parameter_list</a></span>. <br><br>
</P>
<p><span class="h3">
Addition:
</span></p>
<P>
<A HREF="#!ABAP_ONE_ADD@1@" class="blue"> <span class="qtext">... AS SEPARATE UNIT</span> </A> <br><br>
</P>
<p><span class="h4">
Effect
</span></p>
<P>
Transactional call (tRFC) of a <a href="javascript:call_link('abenremote_enabled_fm_glosry.html')" class="grey" title="Glossary Entry">remote-enabled function module</a> specified in <span class="qtext">func</span> using the
<a href="javascript:call_link('abenrfc_interface_glosry.html')" class="grey" title="Glossary Entry">RFC interface</a>. Using the addition <span class="qtext">DESTINATION</span>, a unique
<a href="javascript:call_link('abenrfc_destination.html')" class="blue">destination</a> can be specified in <span class="qtext">dest</span>.
If the destination is not specified, the destination <span class="qtext400">"NONE"</span> is used implicitly. <span class="qtext">func</span> and <span class="qtext">dest</span> expect character-like data objects.
</P>
<P>
The transactional call registers the name of the called function, together with the destination and
the actual parameters passed in <a href="javascript:call_link('abapcall_function_background_para.html')" class="blue"><span class="qtext">parameter_list</span></a> for the current
<a href="javascript:call_link('abensap_luw_glosry.html')" class="grey" title="Glossary Entry">SAP LUW</a> in the database tables <span class="lnkgrey">ARFCSSTATE</span> and <span class="lnkgrey">ARFCSDATA</span> of the current
<a href="javascript:call_link('abensap_nw_abap_glosry.html')" class="grey" title="Glossary Entry">AS ABAP</a> under a unique
transaction ID (abbreviated as TID, stored in a structure of type ARFCTID from ABAP Dictionary, viewed
using transaction <span class="lnkgrey">SM58</span>). After registration, the calling program is continued after the statement <span class="qtext">CALL FUNCTION</span>.
</P>
<P>
When the <a href="javascript:call_link('abapcommit.html')" class="blue"><span class="qtext">COMMIT WORK</span></a> statement
is executed, the function modules registered for the current SAP LUW are started in the order in which
they were registered. The statement <a href="javascript:call_link('abaprollback.html')" class="blue"><span class="qtext">ROLLBACK WORK</span></a> deletes all previous registrations for the current SAP LUW.
</P>
<P>
If the specified destination is not available when <span class="qtext">COMMIT WORK</span> is executed, an
<a href="javascript:call_link('abenexecutable_program_glosry.html')" class="grey" title="Glossary Entry">executable program</a> called RSARFCSE is started in
<a href="javascript:call_link('abenbackround_processing_glosry.html')" class="grey" title="Glossary Entry">background processing</a>.
By default, this tries to start the function modules registered for a SAP LUW in their destination every
15 minutes and up to 30 times. Changes can be made to these parameters using transaction <span class="lnkgrey">SM59</span>.
If the destination does not become available within the defined time, it is recorded in the database
table <span class="lnkgrey">ARFCSDATA</span> as the entry <span class="qtext400">"CPICERR"</span>. By default, this entry in database table <span class="lnkgrey">ARFCSSTATE</span> is deleted after eight days.
</P>
<p><span class="h4">
Note
</span></p>
<P>
<a href="javascript:call_link('abenbg_remote_function_glosry.html')" class="grey" title="Glossary Entry">background RFC (bgRFC)</a>
executed with the statement <a href="javascript:call_link('abapcall_function_background_unit.html')" class="blue"><span class="qtext">CALL
FUNCTION IN BACKGROUND UNIT</span></a> is the enhanced successor technology of transactional RFC (tRFC) and makes this technology obsolete. It is strongly recommended that bgRFC is used instead of tRFC.
</P>
<P>
<span class="bold">More Information</span>
</P>
<P>
More information about tRFC is available in the
</P>
<p>
<span class="lnkgrey">RFC</span> documentation on <a href="http://help.sap.com/" target="blank" class="blue">SAP Help Portal</a>. <br><br>
</p>
<A NAME="@@AS SEPARATE UNIT@@CALL FUNCTION IN BACKGROUND TASK (obsolete)@@"></A>
<p><span class="h3">
<A NAME="!ABAP_ONE_ADD@1@"></A> <span class="bold">Addition</span>
</span></p>
<P>
<span class="qtext">... AS SEPARATE UNIT</span> <!-- /A --> <br>
</P>
<p><span class="h4">
Effect
</span></p>
<P>
When using the addition <span class="qtext">AS SEPARATE UNIT</span>, the relevant function module is executed in a separate
<a href="javascript:call_link('abenrfc_session_glosry.html')" class="grey" title="Glossary Entry">RFC session</a>, in which the
global data of the function group is not influenced by previous calls. Each function module that is
registered with the addition <span class="qtext">AS SEPARATE UNIT</span> is given a separate transaction ID. Without the addition <span class="qtext">AS SEPARATE UNIT</span>, the usual
<a href="javascript:call_link('abenrfc_context.html')" class="blue">description</a> applies to the
<a href="javascript:call_link('abenrfc_session_glosry.html')" class="grey" title="Glossary Entry">RFC session</a> of the called function modules. This means that, when using the same
<a href="javascript:call_link('abendestination_glosry.html')" class="grey" title="Glossary Entry">destination</a> for multiple
calls of function modules belonging to the same function group, the global data of this function group is accessed collectively. <br><br>
</P>
<p><span class="h4">
Notes
</span></p>
<ul class="disc">
<li>
The function module <span class="lnkgrey">ID_OF_BACKGROUNDTASK</span> can be used after a transactional RFC to determine the transactional ID (TID) of the current
<a href="javascript:call_link('abensap_luw_glosry.html')" class="grey" title="Glossary Entry">SAP LUW</a>. <br>
<br></li>
<li>
Transactional RFC (tRFC) is suitable for realizing LUWs in distributed environments (a typical application is ALE). Note that, although the execution of the function modules within a transaction ID is specified, the order of the
<a href="javascript:call_link('abenluw_glosry.html')" class="grey" title="Glossary Entry">LUWs</a> on the RFC servers is not
necessarily the same as the order of the SAP LUWs on the RFC client. To ensure the same serialization is also used on RFC servers, the tRFC can be enhanced as
<a href="javascript:call_link('abenqrfc_glosry.html')" class="grey" title="Glossary Entry">queued RFC (qRFC)</a>. For this, the
function module <span class="lnkgrey">TRFC_SET_QUEUE_NAME</span> can be called before a transactional RFC. More information about qRFC is available in the
<br></li>
</ul>
<p>
SAP NetWeaver documentation in <a href="http://help.sap.com/" target="blank" class="blue">SAP Help Portal</a>.
</p>
<ul class="disc">
<li>
If <a href="javascript:call_link('abentrfc_2_glosry.html')" class="grey" title="Glossary Entry">tRFC</a> or
<a href="javascript:call_link('abenqrfc_glosry.html')" class="grey" title="Glossary Entry">qRFC</a> are registered in a
<a href="javascript:call_link('abendialog_module_object_glosry.html')" class="grey" title="Glossary Entry">dialog module</a>
and are not started with <span class="qtext">COMMIT WORK</span>, they are not executed by the <span class="qtext">COMMIT WORK</span> of the caller. <br>
<br></li>
<li>
The new variant <a href="javascript:call_link('abapcall_function_background_unit.html')" class="blue"><span class="qtext">CALL FUNCTION IN BACKGROUND UNIT</span></a>
(<a href="javascript:call_link('abenbgrfc_glosry.html')" class="grey" title="Glossary Entry">bgRFC</a>) includes and enhances
the existing tRFC and qRFC variants. For this reason, it is strongly recommended that bgRFC is used instead of tRFC. <br>
<br></li>
<li>
The statements <a href="javascript:call_link('abapcommit.html')" class="blue"><span class="qtext">COMMIT WORK</span></a> and
<a href="javascript:call_link('abaprollback.html')" class="blue"><span class="qtext">ROLLBACK WORK</span></a> must not be executed within a LUW. In addition, no implicit
<a href="javascript:call_link('abendatabase_commit_glosry.html')" class="grey" title="Glossary Entry">database commit</a> can be triggered there. <br>
<br></li>
<li>
When handling the registration entries in the database tables ARFCSSTATE and ARFCSDATA, note that they are subject to the regular administration rules for a
<a href="javascript:call_link('abendatabase_luw_glosry.html')" class="grey" title="Glossary Entry">database LUW</a>. For example, the database LUW is ended by a
<a href="javascript:call_link('abendatabase_rollback_glosry.html')" class="grey" title="Glossary Entry">database rollback</a>, all registration entries of the current database LUW are deleted.
<br></li>
</ul>
<br>
<br>
<br>
<br>
</DIV>
<fieldset style="opacity:0">
<input id="url" type="text" />
</fieldset>
</BODY>
<!-- Mirrored from help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapcall_function_background_task.htm by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 20 Jan 2022 18:03:52 GMT -->
</html>