passing data between cross session applications by EXPORT/IMPORT TO/FROM SHARED BUFFER

Passing ABAP internal memory data to lets say an internal table defined by DATA statement is used very often in ABAP programming. There are different techniques which differs according to architecture of your ABAP program, data size that you want to pass, visibility of your variables(same session or new session) etc.
For instance when you call an ABAP program with SUBMIT statement you can pass your values by selection-screen parameters or select-options. But as you know selection-screen parameters have size limitations, which prevent us from passing more than 10.000 records.
Recently i was caught up to that limitation and searched a workaround. It leaded me to use EXPORT/IMPORT TO/FROM SHARED BUFFER command. This command helps SAP cross memory to be used by ABAP program and provides different session data to be transferred. On the other hand, there was a trick point for my case, I was starting many background job with SUBMIT statement, therefore i needed to find a way to distinguish each EXPORT/IMPORT parameters for each background job. I have used system date, system time and a literal which makes EXPORT/IMPORT parameter unique in overall system. Below you can see code snippets belong to calling/called programs.

 

Calling ABAP program

Called ABAP program

 

You may also like

  • read SM37 logs of background jobs (0)
    Recently i had a requirement to trigger a background job from my custom program. Background job had a standard SAP report as step and report was processing a business logic. After this […]
  • submit background job with date selection (0)
    As mentioned in earlier submit report versions post you can make use of SUBMIT statement from your ABAP program in order to schedule any other ABAP program in background. However recently […]
  • SUBMIT command versions (0)
    In ABAP , if you want to directly execute a report from another program ,you can use . Using submit you can also create dynamic background jobs, call a report with its selection screen […]