Parallel processing: Help!
Hi Experts!
I need to use parallel processing for BAPI_INQUIRY_CREATEFROMDATA2 since this process huge data.
How could I actually start a parallel processing using this BAPI ?
Thanks!
Hi,
Check this example..This code is there in the abap help..
Press F1 on the CALL FUNCTION key word..
Then choose the link..
"CALL FUNCTION func STARTING NEW TASK taskname. "
There you will find the code that I mentioned here...
DATA: MSG_TEXT(80) TYPE C. "Message text
Asynchronous call to Transaction SM59 -->
Create a new session
CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'
DESTINATION 'NONE'
EXPORTING
TCODE = 'SM59'
EXCEPTIONS
COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
SYSTEM_FAILURE = 2 MESSAGE MSG_TEXT.
IF SY-SUBRC NE 0.
WRITE: MSG_TEXT.
ELSE.
WRITE: 'O.K.'.
ENDIF.
Using RFC groups to parallelize function module calls (RFC parallel processing)
TYPES: BEGIN OF TASKLIST_TYPE,
TASKNAME(4) TYPE C, "Task administration
RFCDEST LIKE RFCSI-RFCDEST
END OF TASKLIST_TYPE.
DATA: INFO LIKE RFCSI, C, "Message text
JOBS TYPE I VALUE 10, "Number of parallel jobs
SND_JOBS TYPE I VALUE 1, "Sent jobs
RCV_JOBS TYPE I VALUE 1, "Received replies
EXCP_FLAG(1) TYPE C, "Number of RESOURCE_FAILUREs
TASKNAME(4) TYPE N VALUE '0001', "Task name administration
TASKLIST TYPE TABLE OF TASKLIST_TYPE,
WA_TASKLIST TYPE TASKLIST_TYPE.
DO.
CALL FUNCTION 'RFC_SYSTEM_INFO'
STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT
PERFORMING RETURN_INFO ON END OF TASK
EXCEPTIONS
COMMUNICATION_FAILURE = 1
SYSTEM_FAILURE = 2
RESOURCE_FAILURE = 3.
CASE SY-SUBRC.
WHEN 0.
Administration of asynchronous tasks
WA_TASKLIST-TASKNAME = TASKNAME.
CLEAR WA_TASKLIST-RFCDEST.
APPEND WA_TASKLIST TO TASKLIST.
WRITE: / 'Started task: ', WA_TASKLIST-TASKNAME COLOR 2.
TASKNAME = TASKNAME + 1.
SND_JOBS = SND_JOBS + 1.
JOBS = JOBS - 1. "Number of existing jobs
IF JOBS = 0.
EXIT. "Job processing finished
ENDIF.
WHEN 1 OR 2.
Handling of communication and system failure
WHEN 3. "No resources available at present
Receive reply to asynchronous RFC calls
IF EXCP_FLAG = SPACE.
EXCP_FLAG = 'X'.
First attempt for RESOURCE_FAILURE handling
WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.01' SECONDS.
ELSE.
Second attempt for RESOURCE_FAILURE handling
WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.1' SECONDS.
ENDIF.
IF SY-SUBRC = 0.
CLEAR EXCP_FLAG. "Reset flag
ELSE. "No replies
"Endless loop handling
ENDIF.
ENDCASE.
ENDDO.
Receive remaining asynchronous replies
WAIT UNTIL RCV_JOBS >= SND_JOBS.
LOOP AT TASKLIST INTO WA_TASKLIST.
WRITE:/ 'Received task:', WA_TASKLIST-TASKNAME COLOR 1,
30 'Destination: ', WA_TASKLIST-RFCDEST COLOR 1.
ENDLOOP
FORM RETURN_INFO USING TASKNAME.
RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
IMPORTING RFCSI_EXPORT = INFO
EXCEPTIONS
COMMUNICATION_FAILURE = 1
SYSTEM_FAILURE = 2.
RCV_JOBS = RCV_JOBS + 1. "Receiving data
IF SY-SUBRC NE 0.
Handling of communication and system failure
ELSE.
READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME
INTO WA_TASKLIST
IF SY-SUBRC = 0. "Register data
WA_TASKLIST-RFCDEST = INFO_RFCDEST.
MODIFY TASKLIST INDEX SY-TABIX FROM WA_TASKLIST.
ENDIF.
ENDIF.
ENDFORM
Thanks,
Naren
Similar Messages
-
Need help with parallel process in background; not able to call FM in bgnd
Hello,
I am trying since 2 days to solve the issue of parallel process in background without using FPP.
For which I want to call function module of class method in new task but to be processed by background process and not dialog.
I searched so many websites but everyone has suggesteed to 'call function in background task' . But the fact is the processing of function happens by dailog process even in this case.
I want to loop at table and call FM or class method inside each loop.
Kindly suggest me how can I call function or class method in new task in everycall and prcoess it in background.
thanksBalaji,
Is the name of the button between single or double quotes?
Regards,
Dan
Blog: http://DanielMcGhan.us/
Work: http://SkillBuilders.com/ -
Parallel processing in a state machine, help a semi-newbie out...
To simplify my problem:
1. I have two buttons and a string indicator on my front panel.
2. My code contains a state machine.
3. In state X, I need to update the string indicator with a new string once every second UNTIL one of the buttons is pressed.
4. When one of the buttons is pressed, I need to switch to a different state, depending on which button was pressed.
I'm having trouble coding the parallel processing part of this. I have the code to update the string indicator once every second and I have the code to switch to a different state depending on which button was pressed. But I can't get them to work together so the updating of the string indicator immediately stops and moves to the next state when either button is pressed.
Any thoughts?This might be slightly closer to what you might be expecting.
Regards,
Chetan K
Application Engineer
National Instruments
Message Edited by CKap on 07-10-2006 03:21 PM
Attachments:
State Machine Demo.vi 32 KB -
Parallel Processing : Unable to capture return results using RECIEVE
Hi,
I am using parallel processing in one of my program and it is working fine but I am not able to collect return results using RECIEVE statement.
I am using
CALL FUNCTION <FUNCTION MODULE NAME>
STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT_GROUP
PERFORMING RETURN_INFO ON END OF TASK
and then in subroutine RETURN_INFO I am using RECEIVE statement.
My RFC is calling another BAPI and doing explicit commit as well.
Any pointer will be of great help.
Regards,
Deepak Bhalla
Message was edited by: Deepak Bhalla
I used the wait command after rfc call and it worked additionally I have used Message switch in Receive statement because RECIEVE statement was returing sy-subrc 2.Not sure what's going on here. Possibly a corrupt drive? Or the target drive is full?
Try running the imagex command manually from a F8 cmd window (in WinPE)
"\\OCS-MDT\CCBShare$\Tools\X64\imagex.exe" /capture /compress maximum C: "\\OCS-MDT\CCBShare$\Captures\CCB01-8_15_14.wim" "CCB01CDrive" /flags ENTERPRISE
Keith Garner - Principal Consultant [owner] -
http://DeploymentLive.com -
Parallel processing of mass data : sy-subrc value is not changed
Hi,
I have used the Parallel processing of mass data using the "Start New Task" . In my function module I am handling the exceptions and finally raise the application specific old exception to be handled in my main report program. Somehow the sy-subrc is not getting changed and always returns 0 even if the expection is raised.
Can anyone help me about the same.
Thanks & Regards,
NitinHi Silky,
I've build a block of code to explain this.
DATA: ls_edgar TYPE zedgar,
l_task(40).
DELETE FROM zedgar.
COMMIT WORK.
l_task = 'task1'.
ls_edgar-matnr = '123'.
ls_edgar-text = 'qwe'.
CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
EXPORTING
line = ls_edgar.
l_task = 'task2'.
ls_edgar-matnr = 'abc'.
ls_edgar-text = 'def'.
CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
EXPORTING
line = ls_edgar.
l_task = 'task3'.
ls_edgar-matnr = '456'.
ls_edgar-text = 'xyz'.
CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
EXPORTING
line = ls_edgar.
*& Form f_go
FORM f_go USING p_c TYPE ctype.
RECEIVE RESULTS FROM FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' EXCEPTIONS err = 2.
IF sy-subrc = 2.
*this won't affect the LUW of the received function
ROLLBACK WORK.
ELSE.
*this won't affect the LUW of the received function
COMMIT WORK.
ENDIF.
ENDFORM. "f_go
and the function is:
FUNCTION z_edgar_commit_rollback.
*"*"Interface local:
*" IMPORTING
*" VALUE(LINE) TYPE ZEDGAR
*" EXCEPTIONS
*" ERR
MODIFY zedgar FROM line.
IF line-matnr CP 'a*'.
*comment raise or rollback/commit to test
* RAISE err.
ROLLBACK WORK.
ELSE.
COMMIT WORK.
ENDIF.
ENDFUNCTION.
ok.
In your main program you have a Logical Unit of Work (LUW), witch consists of an application transaction and is associated with a database transaction. Once you start a new task, your creating an independent LUW, with it's own database transaction.
So if you do a commit or rollback in your function the effect is only on the records your processing in the function.
There is a way to capture the event when this LUW concludes in the main LUW. That is the PERFORMING whatever ON END OF TASK. In there you can get the result of the function but you cannot commit or rollback the LUW from the function since it already have implicitly happened at the conclusion of the funtion. You can test it by correctly comment the code I've supplied.
So, if you want to rollback the LUW of the function you better do it inside it.
I don't think it matches exactly your question, maybe it lead you on the right track. Give me more details if it doesn't.
Hope it helps,
Edgar -
Parallel processing open items (FPO4P)
Hello,
I have a question about transaction FPO4p (parallel processing of open items).
When saving the parameters the following message always appears : "Report cannot be evaluated in parallel". The information details tells that when you use a specific parallel processing object, you also need to use that field to sort on.
I my case I use the object GPART for parallel processing (see tab technical settings). In the tab output control I selected a line layout which is sorted by business partner (GPART). Furthermore no selection options are used.
Does anyone know why the transaction cannot save the parameters and shows the error message specified above. I really don't know what goes wrong.
Thank you in advance.
Regards, Ramon.Ramon
Apply note 1115456.
Maybe that note can help you
Regards
Arcturus -
How to do parallel processing with dynamic internal table
Hi All,
I need to implement parallel processing that involves dynamically created internal tables. I tried doing so using RFC function modules (using starting new task and other such methods) but didn't get success this requires RFC enabled function modules and at the same time RFC enabled function modules do not allow generic data type (STANDARD TABLE) which is needed for passing dynamic internal tables. My exact requirement is as follows:
1. I've large chunk of data in two internal tables, one of them is formed dynamically and hence it's structure is not known at the time of coding.
2. This data has to be processed together to generate another internal table, whose structure is pre-defined. But this data processing is taking very long time as the number of records are close to a million.
3. I need to divide the dynamic internal table into (say) 1000 records each and pass to a function module and submit it to run in another task. Many such tasks will be executed in parallel.
4. The function module running in parallel can insert the processed data into a database table and the main program can access it from there.
Unfortunately, due to the limitation of not allowing generic data types in RFC, I'm unable to do this. Does anyone has any idea how to implement parallel processing using dynamic internal tables in these type of conditions.
Any help will be highly appreciated.
Thanks and regards,
Ashintry the below code...
DATA: w_subrc TYPE sy-subrc.
DATA: w_infty(5) TYPE c.
data: w_string type string.
FIELD-SYMBOLS: <f1> TYPE table.
FIELD-SYMBOLS: <f1_wa> TYPE ANY.
DATA: ref_tab TYPE REF TO data.
CONCATENATE 'P' infty INTO w_infty.
CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
ASSIGN ref_tab->* TO <f1>.
* Create dynamic work area
CREATE DATA ref_tab TYPE (w_infty).
ASSIGN ref_tab->* TO <f1_wa>.
IF begda IS INITIAL.
begda = '18000101'.
ENDIF.
IF endda IS INITIAL.
endda = '99991231'.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr
infty = infty
begda = '18000101'
endda = '99991231'
IMPORTING
subrc = w_subrc
TABLES
infty_tab = <f1>
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
subrc = w_subrc.
ELSE.
ENDIF. -
How to achieve parallel processing in a single request?
Hi all,
I have a method in a Session EJB that will perform some business logic before it returns an answer to the client. The logic it will perform is to collect data from the applications database and two external systems, before sending all data to a third external system to get a response and send it back to the client. Each external system is quite slow so I would like to do all the collecting of data concurrent, parallel processing. How should I handle this? I'm not allowed to create my own threads in EJB's. Can I use MDB in some way? To the calling client this should be a synchronous call...
Greatfull for any suggestions
Cheers
Anders =)Usually, the request is received by a component located in the web container, such as by an HTTP request (including Web Services). This component is able to start threads to allow parallel processing. Now, if for some reason the request arrives directly at EJB level and that you cannot move its receiver to web component, I think JMS is not a viable solution because you will switch to asynchronous processing and you have no way to make your EJB wait for the responses while preserving the client request (waiting implies programmatic life cycle management, which is forbidden in EJB container). Maybe a resource adapter (JCA) can bring a solution. A resource adapter acts as a datasource (a datasource is a specialization of a resource adapter) and thus it is a logical way to implement an adapter to an external, eventually non-J2EE, resource, as the name implies :) But I don't have enough knowledge in JCA to be sure of this.
Hope it helps.
Bruno Collet
http://www.practicalsoftwarearchitect.com -
FORK is Not happening Parallel processing- It's working sequential
Hi,
we are into PI 7.O and SP 13.
I am trying to test Parallel processing using Fork step. (With Two branches)
My problem is sxm_moni both branches are not executed simultenously and it's executing one after the other.
Did any body done in XI parallel processing using BPM...both calls has to finish at the same time. I mean first call 10 min and second call aslo has to finish first 10 min ..not other 10 min.
I heard this problem from XI 3.0 and PI 7.O. But PI 7.1 did any body test the Parallel processing using Fork step.
Pls help me is this issue will resolve if I go to PI 7.1.
Regards,
Venu.Hi Henrique,
they would not necessarily start at the same time but shouldnt also be queued - Customer expecting the response within a 17 sec or 20 Sec but coming response 34 sec will not ok for the customer..tomorrow need add some more target again 17 sec will take...How PI can handle the Multi threading they are checking...I am not sure this problem fixed in PI 7.1 or not.
there're # of connection restrictions in your system? Check that - Where can I check connections restrictions...If you know pls through some light on this.
Also, how's your BPM transactional behavior (did you flag the create new transaction steps)?
- I did not checked the flag for create new transaction step..once my server is up I can check the flag and I can test.
Regards,
Venu. -
Parallel Processing in CRM 5.0 for Customer download
Hi
I was referring to OSS note 350176 for implementing parallel processing. I wanted to achieve parallel processing for request loads for Customer download.
Is it possible to achieve it by setting the parameter CRM_MAX_QUEUE_NUMBER_INITIAL in CRMPAROLTP or it can be achieved only through implementing exits?
Thanks for your help in anticipation.
Regards
KarthikHI
Karthik in Parralllel processing first you need to set up diffent filters for diffrent types of data basic or business data, customizing and condition data R3 AC1, R3 AC4, R3 Ac5 separately then start down loading the objects to CRM , remaning objects left over can be bypassed , then set the Satus of down loading Yellow red and Blue depends up on percentage of down load y for more than 100% R for more than 75%, B for less than 50%
Reward if helpful
Venkat -
Parallel Processing in CRM 5.0
Hi
I was referring to OSS note 350176 for implementing parallel processing. I wanted to achieve parallel processing for request loads for Customer download.
Is it possible to achieve it by setting the parameter CRM_MAX_QUEUE_NUMBER_INITIAL in CRMPAROLTP or it can be achieved only through implementing exits?
Thanks for your help in anticipation.
Regards
KarthikHI
Karthik in Parralllel processing first you need to set up diffent filters for diffrent types of data basic or business data, customizing and condition data R3 AC1, R3 AC4, R3 Ac5 separately then start down loading the objects to CRM , remaning objects left over can be bypassed , then set the Satus of down loading Yellow red and Blue depends up on percentage of down load y for more than 100% R for more than 75%, B for less than 50%
Reward if helpful
Venkat -
ABAP OO and parallel processing
Hello ABAP community,
I am trying to implement a ABAP OO scenario where i have to take into account parallel processing and processing logic in the sense of update function modules (TYPE V1).
The szenario is definied as follows:
Frame class X creates a instance of class Y and a instance of class Z.
Classes Y and Z sould be processed in parallel, so class X calls classes Y and Z.
Classes Y and Z call BAPIS and do different database changes.
If classes Y or Z have finished, the status of processing is written into a status table by caller class X.
The processing logic within class Y and class Z should be a SAP LUW in the sense of a update function module (TYP V1).
Can i use events?
(How) Should i use "call function in upgrade task"?
(How) Should i use "call function starting new task"?
What is the best method to realise that behaviour?
Many thanks for your suggestions.Hallo Christian,
I will describe you in detail, whow I have solved this
problem. May be there is a newer way ... but it works.
STEPS:
I asume you have splitt your data in packages.
1.) create a RFC-FM: Z_WAIT
It return OK or NOT OK.
This FM: does following:
DO.
call function TH_WPINFO -> until the WPINFO has more
than a certain number of lines. (==> free tasks)
ENDDO.
If it is OK ==> free tasks are available
call your FM (RFC!) like this:
CALL FUNCTION <FM>
STARTING NEW TASK ls_tasknam " Unique identifier!
DESTINATION IN GROUP p_group
PERFORMING return_info ON END OF TASK
EXPORTING
TABLES
IMPORTING
EXCEPTIONS
*:--- Take care of the order of the exceptions!
COMMUNICATION FAILURE = 3
SYSTEM_FAILURE = 2
UNFORCED_ERROR = 4
RESOURCE_FAILURE = 5
OTHERS = 1.
*:--- Then you must check the difference between
*:--- the started Calls and the received calls.
*:--- If the number increases a certain value limit_tasks.
wait until CALLED_TASK < LIMIT_TASKS up to '600' seconds.
The value should be not greater then 20!
DATA-Description:
parameters: p_group like bdfields-rfcgr default 'Server_alle'. " For example. Use the F4 help
if you have defined the report-parameter as above.
ls_tasknam ==> Just the increasing number of RFC-Calls
as Character.
RETURN_INFO is a form routine in which You can check the results. Within this Form you must call:
RECEIVE RESULTS FROM FUNCTION <FM>
TABLES: ... " The tables of your <FM> exactly the same order!
EXCEPTIONS
COMMUNICATION FAILURE = 3
SYSTEM_FAILURE = 2
UNFORCED_ERROR = 4
NO_ACTIVATE_INFOSTRUCTURE = 1.
Her eyou must count the received Calls!
And you can save them into a internal table for checking!
I hope I could help you a little bit
God luck
Michael -
Java Proxy Generation not working - Support for Parallel Processing
Hi Everyone,
As per SAP Note 1230721 - Java Proxy Generation - Support for Parallel Processing, when we generate a java proxy from an interface we are supposed to get 2 archives (one for serial processing and another suffixed with "PARALLEL" for parallel processing of jaav proxies in JPR).
https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1230721
We are on the correct patch level as per the Note, however when we generate java proxy from the IR for an outbound interface, it genrates only 1 zip archive (whose name we ourselves provide in the craete new archive section). This does not enable the parallel processsing of the messages in JPR.
Could you please help me in this issue, and guide as to how archives can be generated for parallel processing.
Thanks & Regards,
Rosie Sasidharan.Hi,
Thanks a lot for your reply, Prateek.
I have already checked SAP Note 1142580 - "Java Proxy is not processing messages in parallel" where they ask to modify the ejb-jar.xml. However, on performing the change in ejb-jar.xml and while building the EAR, I get the following error:
Error! The state of the source cache is INCONSISTENT for at least one of the request DCs. The build might produce incorrect results.
Then, on going through the SAP Note 1142580 again, I realised that the SAP Note 1230721 also should be looked onto which will be needed for generating the Java proxy from Message Interfaces in IR for parallel processing.
Kindly help me if any of you have worked on such a scenario.
Thanks in advance,
Regards,
Rosie Sasidharan. -
Parallel Process Option for Optimization in Background.
Hi,
I am testing the SNP Optimizer with various settings this week on demo version from SAP for a client. I am looking for information that anyone might have on the SNP Parallel Processing Option in the execution of the Optimizer in the background. The information that I could find is very thin. I would be interested in any documentation or experience that you have.
Sincerely,
Michael M. Stahl
[email protected]Hello,
While running the transaction /SAPAPO/SNPOP - Supply Network Optimization in the background, In the variant of it you can enter Parallel Processing profile in the field Paral. Proc. Profile.
This profile you will require to define in the Customization(SPRO) before use it in the variant.
Path to maintain it is as below Use transaction SPRO
Advanced Planning and Optimization --> Supply Chain Planning -->Supply Network Planning (SNP) --> Profiles --> Define Parallel Processing Profile
Here you will require to define your profile... e.g. as below
Paral. Proc. Profile SNP_OPT
Description SNP OPTIMIZER PP PROFILE
Appl. (Parallel Pr.) : Optimization
Parallel Processes 2
Logical system :
Server Group :
Block Size:
You will require to take Basis team's help to enter value for Server Group and Block size.
I hope, above information is helpful for you.
Regards,
Anjali -
Parallel process define for batch job
Hi,
I would like to run a batch job with a few processes run parallel together. May I know where can i define it ? T-code ?
Regards
LauranHi Lauren,
First of all there is no transaction code as such.
First of all the report that needs to be run in background should enable you to do parrallel processing. For that code has to be written accordingly.
Check this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm
It gives details of function modules needed for this purpose.
After this you need to create a variant for the report and schedule it to run in background using either SE38 (dirrectly) or by creating a job explicitily- SM36.
A standard report that has parallel processing feature available is RBDAPP01.
Also check transactions like BD18. They also make use of parallel processing.
Regards.
Ruchit.
Maybe you are looking for
-
Pages 5.5: complete garbage, alas
Pages 5.5: a year after the Big Update. What's missing: - facing pages (Yes, facing pages) - non-contiguous selection of text - hyperlinks - bookmarks - mail merege (really, its gone, despite what they say about applescript). - all manner of typograp
-
Adobe Reader won't work on My mac
Hi, I've installed Adobe Reader but when I try to open a file online, it sends me straight back to the downloader page. I tried to re-install it but it tells me it's already installed and it is. I've tried to work with the plug-in's and selected "alw
-
ATT can't tether/hotspot and do voice at same time?
While using the new hotspot feature in IOS6 on a 4S, I can't tether/hotspot and do a voice call at the same time. It appears to pause the clients on the hotspot, although data directly from applications on the phone seem to work. I understand Verizon
-
Javascript Flyout Menu Misbehaving in IE
Hi all. The site I am working on is http://www.43rdstnorfolk.com/ I'm pretty good with the html, but a new to javascript. Can anyone offer recommendations as to why my flyout menu is inactive in older versions of IE? Also, in newer versions, I think
-
Route Determination in Inbound
Dear All, How to configure the system to automatically determine the Route incase of Inbound Delivery Process? I know that the Route is getting detemined through the transportation zones & also the transportation group of the material. I have given t