Function module in background work process
Hi All,
i'm using trfc for processing FM only in background work process
CALL FUNCTION 'FUNCTION_MODULE' IN BACKGROUND TASK
but when i execute FM it's occupying two work process one is dialog (running current FM )and another one is background( running SAPLERFC) .
so pls suugest me how to avaiod FM to occupy dialog workprocess.
Regards,
Anuj jain
Hi Anuj,
It unfortunately means:
start FM in a particular time in Dialog work process
The BACKGROUND word in abap syntax is misleading.
For true background processing, i.e. background WORK PROCESS (of type BGD in SM50)
ONLY ABAP PROGRAMS or Commands or External Programs
can be run under background work process. (as per SM36)
Here we are trying a function module, which is not supported. This is as per my understanding.
regards,
amit m.
Edited by: Amit Mittal on Aug 17, 2010 2:03 PM
Edited by: Amit Mittal on Aug 17, 2010 2:05 PM
Similar Messages
-
Function Module (ENQUEUE_ES_PROG) not working in Background
I scheduled a job which runs every 15 mins in the the background to fetch data from an external system,depending on the data volume ,the program can sometimes run for over 15 minutes.To avoid data conflict I used a function module ENQUEUE_ES_PROG on the program to first check if the job started is still running before another job gets kicked.The problem I have is the fact that this function module does not seem to work in the background but in the looks perfect in foreground. Does anyone have a clue on how to use this FM for background job?
Hello Mochabo,
Consider the following scenario:
Your job is running for more than 15 minutes. Since it is running in the background, it will be executed by a work-process of type BACKGROUND. If there's only one BACKGROUND work process configured for your application server, then the second job will have to be waiting till the first one finishes and releases the background work process.
But when you are executing this in the foreground, the DIALOG work-process does the processing. So you are not finding any problem.
So, to my knowledge, there will be a problem when there's only one BACKGROUND work process. Please go to transaction SM50 and see how many of them are configured for the current application server.
Also, in case there's only one BACKGROUND work-process, you will not have toworry that the second job will start before the first has finished. It simply can't. It has got to wait.
Hope this explanation helps.
Regards,
Anand Mandalika. -
Function module is not working properly in background
Hi all,
i have used one Function module 'PRICING' in user exit SAPMV45A to calculate pricing for sales order.
i am using BAPI_SALESORDER_CHANGE to change the sales order pricing.
when i run the program in foreground, all condition records for pricing is updated correctly. but it is not updating
correctly when i run the program in background.
Please tell me wheather 'PRICING' or 'BAPI_SALESORDER_CHANGE' function module is not working properly in background ?
or any other reason?
Thanks
babuHi Pabitra,
Can you provide some more information as to the type of error you are getting? Or can you check the log entries and give some more information so that it would be possible to provide a solution.
And, try to put questions in proper Forum for quick and prompt reply.
Hope this helps.
Thanks,
Samantak. -
What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?
Hi experts,
I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
Finally, thanks for reading and help.HI,
When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. 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. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days -
Jco Call a Function Module in BackGround
Hello All.
Some one can send me a simple exemplo how to call a ABAP Function Module in BackGround.
Can i set this in Java side?
..or only set the BackGround Work Process in SAP side?
In my java application call the Abap Function Module like this:
client.execute(function);
How to set parameters to execute the function in BackGround.
My rpoblem is when the return the data to java side ...occurs the error TIME_OUT in Dialog WorkProcess.
I need to call in background to better performance and to prevent the TIME_OUT.
Best regards.
Taylor.Hi.
I dont know how to do, but, you can do a previous RFC, this new RFC execute the original function in background mode. I did something like that:
- JAVA: client.execute("RFC_FUNCTION", input, output);
- SAP: RFC_FUNCTION:
CALL FUNCTION func IN BACKGROUND TASK
[DESTINATION dest]
parameter_list
[AS SEPARATE UNIT].
or
CALL FUNCTION update_function IN UPDATE TASK
[EXPORTING p1 = a1 p2 = a2 ...]
[TABLES t1 = itab1 t2 = itab2 ...].
I hope that help you -
Error in debugging tRFC Function module (in background task) in SM58
Hi,
I am trying to debug this statement:
CALL FUNCTION 'CRM_UPLOAD_TRIGGER'
IN BACKGROUND TASK
DESTINATION gv_smof_erpsh-rfcdest AS SEPARATE UNIT
I have followed these steps:
When you debug a program that calls function modules using the IN BACKGROUND TASK addition, they are processed in a background work process (additional internal session). If you set the In background task: Do not process option, the system collects the function calls, but does not start the background work process. The Debugger assigns a transaction ID, which identifies the background work process uniquely. You can now start the Debugger for the background work process using transaction SM58. You can select the function module concerned here, and then execute it via the Edit menu.
but still i cant find any entry in SM58.
Can anybody help me out in this?
Thanks a lot.
Best Regards,
ShwetaHI,
When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. 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. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days -
Function module for background jobs email
hi abaper's
i hace to create a function module for background jobs this function module have to send an email automatically when a background job is assigned or processed in background.
thnks n regards
pardeep kumarhi dear
open this site
https://weblogs.sdn.sap.com/pub/wlg/781. [original link is broken] [original link is broken] [original link is broken]
<removed by moderator>
Edited by: Mike Pokraka on Aug 8, 2008 12:48 PM -
How to find out number of background work processe available in the system?
Hi All,
I have a FM that triggers a background job using JOB_OPEN, ABAP_SUBMIT and JOB_CLOSE. But the problem is if there are no background work processes available at that moment, it does not return error. Not sure whether the job is even scheduled!
Is there a way to find out if there are any background work processes available in the system? I know a FM SPBT_INITIALIZE which gives info about dialog work processes. Is there any other FM similar to this which gives info about background wp??
Regards,
Shaileshyour Job will remain in a queue by message handler. once workprocess is free, your job gets scheduled
by the way, you can use the functionality used in FM TH_DISPLAY_WORKPROCESS_LIST to read the workprocesses
the command which gets you the workprocess is:
CALL 'ThWpInfo' ID 'OPCODE' FIELD OPCODE_WP_LIST
ID 'TAB' FIELD LIST_STATE_WPLST-TABL
ID 'CPU' FIELD LIST_STATE_WPLST-CPU.
check how its written in include LSDEBF01, form SET_LIST_WPLST
Edited by: Soumyaprakash Mishra on Dec 12, 2011 12:17 PM -
Debugging the Functional Module in Background.
I am calling a Custom Functional module in Background mode using the syntax CALL FUNCTION ZFM in background task.
Can anyone tell how to debug the code using this..
Thanks ,
YatishHello Yatish
You could try to use the following trick:
(1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
DATA:
lx_exit_loop(1) TYPE c.
lx_exit_loop = ' '.
DO.
IF ( lx_exit_loop = 'X' ).
EXIT.
ENDIF.
ENDDO.
(2) Call your function module in background task
(3) Call transaction <b>SM50</b> and search for the background process.
(3) Choose from menu <i>Program/Mode -> Program -> Debugging</i>
Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
Regards
Uwe -
Error occurs in background work process.
Respected Guru's,
error occurs in two background work process, i have displayed the trace files of both the bgd work process.
How to rectify this error ?
Further, can you please help me in identifying the problem, please suggest me good material which gives steps for troubleshooting such error in the developer's and system trace.
Thank you.
Dayanandan.a
Developer trace file for BGD WP 1
trc file: "dev_w12", trc level: 1, release: "620"
ACTIVE TRACE LEVEL 1
ACTIVE TRACE COMPONENTS all, M
M systemid 560 (PC with Windows NT)
M relno 6200
M patchlevel 0
M patchno 251
M intno 20020600
M pid 2864
M
M ***LOG Q0Q=> tskh_init, WPStart (Workproc12 2864) [dpxxdisp.c 1016]
M <EsNT> Memory Reset enabled as NT default
M calling db_connect ...
M db_connect o.k.
M rdisp/reinitialize_code_page -> 0
M
M Tue Jul 30 10:22:53 2002
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020730.AUD
M
M Tue Jul 30 10:22:55 2002
M *** ERROR => SlicLockSema: sema locked [slicshm.c 89]
M *** ERROR => SlicShmInit: SlicLockSema failed [slicshm.c 231]
M *** ERROR => SlicValBufInit: cannot initialize SHM [slicshm.c 299]
M *** ERROR => SlicValBufRead: license buffer not initialized [slicshm.c 329]
M *** ERROR => SlicCheckBuf: some error reading license buffer contents [slicshm.c 419]
M
M Wed Jul 31 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020730.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020731.AUD
M Thu Aug 01 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020731.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020801.AUD
M
M Fri Aug 02 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020801.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020802.AUD
M
M Fri Aug 02 00:14:09 2002
M *** ERROR => ThCallHooks: event handler rsts_before_commit for event BEFORE_COMMIT failed [thxxtool3.c 235]
M ***LOG R38=> ThICommit3, db_commit98 ( 001024) [thxxhead.c 10641]
M ***LOG R18=> ThPrivCommit, ThICommit () [thxxhead.c 11307]
M in_ThErrHandle: 1
M *** ERROR => ThPrivCommit: ThICommit (step 4, th_errno 9, action 2, level 1) [thxxhead.c 8277]
M
M Info for wp 12
M
M stat = 4
M reqtype = 4
M act_reqtype = 4
M tid = 12
M mode = 0
M len = 24
M rq_id = 6638
M rq_source = 1
M last_tid = 12
M last_mode = 0
M rfc_req = 0
M report = > <
M action = 16
M tab_name = > <
M
M
M Modeinfo for User T12/M0
M
M tm state = 2
M uid = 13
M term type = 0x0
M display = 0x0
M cpic_no = 0
M cpic_idx = -1
M usr = >SAPUSER <
M terminal = > <
M client = >800<
M conversation_ID = > <
M appc_tm_conv_idx = -1
M imode = 3
M mode state = 0x42
M th_errno = 9
M async_receives = 0
M cpic_receive = 0
M em handle = 2
M roll state = 4
M abap state = 4
M em state = 3
M eg state = 1
M lock = 0
Developer's trace file for BGD WP 2
trc file: "dev_w13", trc level: 1, release: "620"
ACTIVE TRACE LEVEL 1
ACTIVE TRACE COMPONENTS all, M
M systemid 560 (PC with Windows NT)
M relno 6200
M patchlevel 0
M patchno 251
M intno 20020600
M pid 2872
M
M ***LOG Q0Q=> tskh_init, WPStart (Workproc13 2872) [dpxxdisp.c 1016]
M <EsNT> Memory Reset enabled as NT default
M
M Tue Jul 30 10:21:44 2002
M calling db_connect ...
M db_connect o.k.
M
M Tue Jul 30 10:22:25 2002
M rdisp/reinitialize_code_page -> 0
M
M Tue Jul 30 10:22:53 2002
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020730.AUD
M
M Wed Jul 31 00:00:52 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020730.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020731.AUD
M
M Thu Aug 01 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020731.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020801.AUD
M
M Fri Aug 02 00:00:51 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020801.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020802.AUD
M
M Fri Aug 02 00:14:09 2002
M *** ERROR => ThCallHooks: event handler rsts_before_commit for event BEFORE_COMMIT failed [thxxtool3.c 235]
M ***LOG R38=> ThICommit3, db_commit98 ( 001024) [thxxhead.c 10641]
M ***LOG R18=> ThPrivCommit, ThICommit () [thxxhead.c 11307]
M in_ThErrHandle: 1
M *** ERROR => ThPrivCommit: ThICommit (step 4, th_errno 9, action 2, level 1) [thxxhead.c 8277]
M
M Info for wp 13
M
M stat = 4
M reqtype = 4
M act_reqtype = 4
M tid = 13
M mode = 0
M len = 24
M rq_id = 6643
M rq_source = 1
M last_tid = 13
M last_mode = 0
M rfc_req = 0
M report = > <
M action = 16
M tab_name = > <
M
M Modeinfo for User T13/M0
M
M tm state = 2
M uid = 14
M term type = 0x0
M display = 0x0
M cpic_no = 0
M cpic_idx = -1
M usr = >SAPUSER <
M terminal = > <
M client = >800<
M conversation_ID = > <
M appc_tm_conv_idx = -1
M imode = 3
M mode state = 0x42
M th_errno = 9
M async_receives = 0
M cpic_receive = 0
M em handle = 3
M roll state = 4
M abap state = 4
M em state = 3
M eg state = 1
M spa state = 3
M enq state = 0
M next hook = T-1/U-1/M255
M master hook = T-1/U-1/M255
M slave hook = T-1/U-1/M255
M debug_tid = -1
M mode type = 0x1
M debug = 0
M lock = 0
M
M
M Sat Aug 03 00:00:55 2002
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020803.AUD
M
M Sun Aug 04 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020803.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020804.AUD
M
M Mon Aug 05 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020804.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020805.AUD
M
M Tue Aug 06 00:00:49 2002
M SecAudit(check_daily_file): audit file closed E:\usr\sap\SER\DVEBMGS00\log\20020805.AUD
M SecAudit(check_daily_file): audit file opened E:\usr\sap\SER\DVEBMGS00\log\20020806.AUDThank you, Bhaskar,
I have performed consistency check for temse objects and all the comments are displayed in red color.
Does it mean that objects are inconsistent. But, no comments states that object are inconsistent.
I have attached the comments displayed,
Consistency check of table TST01 / TemSe objects
This comment occurs repeatedly, Unable to access the related file Length = 0
Incorrect number of data lines in TST03
Object with part number 1 missing
Object reset Length = 0
The related file has an incorrect length
Consistency check of table TST03 / TemSe data
No object found in TST01
May i delete all objects, as all the comments are red in color.
Dayanandan.A -
How to run ABAP Function Module in Background Wchich Takes Long Time to Run
How to run ABAP Function Module in Background FOR LONG TIME
I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE
RSDRT_INFOCUBE_DATA_COPY.
I used SE37 and then executed the module, I supplied the parameters on the form which opped-up and then program started running. . Program was however interrupted after 10 minutes by ABAP. How can I run it in background without interruption?
THANKS A LOT.Hi,
You can call this FM in a program and run that program in background.
Regards,
Raju -
Hi All,
When i execute the function module SAPWL_GET_SUMMARY_STATISTIC in CRM ABAP 6.0 passing the values below,
PERIODTYPE
HOSTID
STARTDATE
it's not showing any values in the summary.
it's showing the exporting parameters as,
RFC_ERROR_TYPE L
SUMMARY_AVAILABLE N
HITLISTS_N_PROFILES_AVAILABLE A
if this function module will not work means kindly provide me the solution for calculating
Average Response Time as in tcode st03 - Instance - total - Workload Overview.
Average CPU Time and some more fileds.
Regards,
SureshHi
I used the FM mentioned and found the details as below:
VKORG
TABNAME TVKO
FIELDNAME VKORG
LANGU EN
POSITION 0001
OFFSET 000006
DOMNAME VKORG
ROLLNAME VKORG
CHECKTABLE
VTEXT
TABNAME TVKOT
FIELDNAME VTEXT
LANGU EN
POSITION 0002
OFFSET 000014
DOMNAME TEXT20
ROLLNAME VTXTK
CHECKTABLE
LENG 000020
Shiva -
Check Function Module is not working
Hi All Expert,
I'm new in workflow and develop custom workflow for Transaction FB65 ( Vendor Credit Memo) and using business object FIPP , event CREATED.
Actually requirement is that when user click on park button in FB65 then should be trigger workflow only for particular vendor code .
Now my workflow is working fine for all vendor code.
For particular vendor code, I have created an new entries in SWE2 and assigning a check function module to that
Refer Link : http://www.****************/Tutorials/Workflow/checkfunctionmodule/demo.htm
and also same entries create in SWETYPV But Check Function Module is not working before workflow trigger.
Appreciate your help and support.
Regards
SaurabhHi
: Check FM : ZWF_DR_CR_MEMO
SourceCode :
FUNCTION ZWF_DR_CR_MEMO.
*"*"Local Interface:
*" IMPORTING
*" VALUE(OBJTYPE) LIKE SWETYPECOU-OBJTYPE
*" VALUE(OBJKEY) LIKE SWEINSTCOU-OBJKEY
*" VALUE(EVENT) LIKE SWETYPECOU-EVENT
*" VALUE(RECTYPE) LIKE SWETYPECOU-RECTYPE
*" EXPORTING
*" REFERENCE(RESULT) TYPE C
*" TABLES
*" EVENT_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOT_TRIGGERED
BREAK-POINT.
TABLES : VBSEGK.
DATA : LV_VEND TYPE VBSEG-LIFNR.
CLEAR : LV_VEND.
SELECT SINGLE LIFNR FROM VBSEGK INTO LV_VEND WHERE BELNR EQ OBJKEY.
if sy-subrc eq 0
IF LV_VEND = '0000120510'.
RAISE NOT_TRIGGERED.
ENDIF
endif.
ENDFUNCTION. -
Function module is not working
Hi Experts,
There is one function module "RH_READ_INFTY_1001" is working fine with developement server but not working with Quality server.
In development server the value of sy-subrc is 0. But in quality server it is not working.
Error comes NO MSGTYPE " " FOUND.
Thanks....Hi,
I guess the message type is not getting populated.
Use your own message
Message 'Error' TYPE 'E'. "--> Message type must be in CAPS
Regards -
Creating a function module in background
Hi
Is there any way by which if i want to create any function module in background .
like in any screen i have created a button and on pressing that button a blank fucntion module should be created in the function group that is already created .
waiting for your reply.Hello, Ashish;
When you mention a "Function Module" where are you trying to create it? The report designer? A .NET form?
What version of Crystal Reports are you using?
What version of Visual Studio .NET?
What requirements are you trying to meet?
Elaine
Maybe you are looking for
-
Desktop Software Stopped working all of the sudden..
All of the sudden I got a windows message saying "Blackberry Desktop Software has stopped working" (A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.) I un-installed and
-
All attachments sent from work now only appear as winmail.dat
This didn't happen in the past and now if I send any type of attachment from work (png or zip for instance), the attachment only appears as a winmail.dat file on both my MacBook Pro running 10.7.3 and my iPhone running iOS5.1 The important thing here
-
when i want to sign in apple id in icloud from setting , appear a black page and loading .... help me ...
-
Certain Groups Not Filling in email addresses
Some Address Contact Groups are filling in email address and others are not. I have tried recreating the group but it still will not fill in the email addresses while other Groups do fine. Any ideas?
-
10.5.4 upgrade failure - can't repair permissions: "no valid packages"
I just ran the 10.5.4 combo updater to upgrade from 10.5.3 but now I can't boot into the main boot drive (get the circle with line through it instead of login screen). Fortunately I have Panther on another drive and was able to boot into it via the L