Skip to Content
Technical Articles
Author's profile photo Alex Muthu Nadar

Excel Mass Upload in Background Job Using SHMA – Part 3: Demo Foreground/Background upload

Overview

So far we have created Custom Shared Memory Area & its Class, ALV report for Mass upload in Background/Foreground. In this Blog post we will cover the Part 3 section of Excel Mass Upload in Background Job Using SHMA – Part 1: Create a Custom Shared Memory Area.

Section 3

we will be using Excel Templates from the following Path: Excel Templates for both Foreground and background run.

Foreground Run

Download the file ‘Ymass_upload 1’  from above Path and keep it ready.

Execute the program YMASS_UPLOAD which was created in the previous blog post. You will get following screen.

Selection%20Screen

Selection Screen

Using the F4 help select the downloaded excel file ‘Ymass_upload 1’ and click on Execute Button.

You will get an ALV Output which will display the Records details.

ALV%20Output%20Foreground%20Run

ALV Output Foreground Run

Table%20Updated

Table Updated

Background Run

Download the file ‘Ymass_upload 2’  from above Path and keep it ready.

Execute the program YMASS_UPLOAD with checkbox Execute in Background Ticked and upload the downloaded file ‘Ymass_upload 2’ using F4 help.

Execute%20Program%20in%20Background%20Mode

Execute Program in Background Mode

a message would be displayed as shown below.

Job%20Triggered

Job Triggered

Go to SM37 and check of the Job under your User ID. There would be a job which might be Completed / Still in Progress.

Background%20Job%20Executed

Background Job Executed

Clicking the Spool you can check the ALV output for each record.

Checking Table from T-Code SE16N shows the number of entries in table.

Table%20Entries

Table Entries

we can further check the Excel Data in SHMM T-Code against the Shared Memory we have created.

SHMM

SHMM

After clicking on the Area YCL_MASS_UPLOAD_SHMA_AREA we will get following screen.

SHMA%20Area%20Instances

SHMA Area Instances

Now double click on the Instance as $DEFAULT_INSTANCE$ you will get the following screen.

SHMA%20Memory%20Analysis

SHMA Memory Analysis

No select the ID and click on display icon you will be able to check the contents stored in the Shared Memory in new window.

SHMA%20Contents

SHMA Contents

Conclusion

We can use SHMA as an alternative option to Application Server(AL11) to Mass Upload Excel File data in Background Mode as well as in Foreground mode. we can also check the data inside the SHMA and cross validate if any issue arises.

We have taken an example of Uploading Data in a Custom Table. This can be expanded to Custom Mass Upload program for Master data using BAPI’s/FM in SAP with custom validation.

References:

 

Hope you guys liked this blog post series.

Feel free to comment, like and share.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Matthew Billingham
      Matthew Billingham

      As I recall, shared memory is shared within the application server, but not across the application server that make up the instance. If your  instance comprises two or more application servers, then this could be a problem for you.

      You see, you're logged into one specific application server (A, say). When you launch the background job, there's no guarantee that it will be running in the same application server, it could be running in appserver B. You've only written your data to A. The shared memory of B won't have the data.

      For this reason, if I had to deal with your project (which doesn't allow writing files to the appserver), I'd persist the data in a database table. When the background job runs, the last thing it will do is delete the data that's been persisted.

       

      Author's profile photo Alex Muthu Nadar
      Alex Muthu Nadar
      Blog Post Author

      The background job will be scheduled in the same application server in which program is executed. which is covered in the previous section