‎2012 Mar 07 10:05 PM
Hi Experts,
I developed a report to display material change history based on change date range. Report is taking much time (around 15-20 mins) as I'm hitting CDPOS and CDHDR tables. User wants to execute the report in foreground because he/she can give selection criteria that is required everytime.
So, my requirment is now to create another program with same selection screen elements which will execute the original program in background. In the new program, we will be just capturing the selection elements and will pass them to original program to run in background and display a message to user without wait for the background job to complete. Original program should send an email to an fixed email id with the report output as attachment (for example excel file).
Please suggest.
Thanks in Advance,
Siva Sankar
‎2012 Mar 07 10:15 PM
Hi Siva,
You can try calling standard FMs CHANGEDOCUMENT_READ_HEADERS and CHANGEDOCUMENT_READ_POSITIONS to get the history for material change instead of hitting tables CDHDR and CDPOS.
- Saba
‎2012 Mar 07 10:15 PM
Hi Siva,
You can try calling standard FMs CHANGEDOCUMENT_READ_HEADERS and CHANGEDOCUMENT_READ_POSITIONS to get the history for material change instead of hitting tables CDHDR and CDPOS.
- Saba
‎2012 Mar 08 3:45 AM
Hi Saba,
User will be executing the report based on material group and plant, which will lead to huge number of materials to hit CDHDR and CDPOS. Can we use those func modules for such a big number?
Thanks for your quick response.
Siva Sankar
‎2012 Mar 08 3:15 AM
Hi ,
Could you please check if we can implement blockwise reading of data from change tables using function modules , it will make the program more faster .
Regards,
Ratheesh BS
‎2012 Mar 08 3:50 AM
Hi Ratheesh,
I'm already using parallel processing to hit CDHDR and CDPOS tables. But report is taking lot of time because of huge number of materials.
Regards,
Siva Sankar
‎2012 Mar 08 4:05 AM
Hi Siva,
Please see the link
http://help.sap.com/saphelp_nw04/helpdata/EN/2a/fa01dd493111d182b70000e829fbfe/content.htm
When using function modules , I dont think you can directly get data based on material and plant . these function modules usualy works with object class and creation date .
Once you retrieve the data using the function modules you have to filter out the unncecessary data based on your selection screen conditions .
Regards,
Ratheesh BS
Edited by: Ratheesh Bhaskarapillai Suseeladev on Mar 8, 2012 5:19 AM
‎2012 Mar 08 5:27 AM
Hi Ratheesh,
I tried CHANGEDOCUMENT_* func modules. But execution time is almost same as hitting the tables in parallel processing. I feel executing the report in background (as mentioned in my original message above) is better option. Please suggest.
Thanks,
Siva Sankar
‎2012 Mar 08 5:46 AM
Hi Siva,
In that case go ahead with your plan , but still user wont get the immedaite results . Mean time we will check if any other options are available .
Regards,
Ratheesh BS
‎2012 Mar 08 6:04 AM
Hi Siva,
You can use the FM : OPEN_JOB and get the job number from this FM and use the submit statement with JOB number and pass the selection screen parameter values. Use the FM: CLOSE_JOB with start immediatly. So your orginal program will run in background.
You can handle the logic to sent a mail to user in the orginal program, like check the program is running in background mode sy-batch = 'X' then send the output to users.
Regards
Rajesh V