Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

clarification with indx table while import/export using shared momory

Former Member
0 Kudos
4,644

Hi All,

I need to call a report in another report in background mode using job_open and job_close.

Code:

EXPORT LT_INPUT FROM input TO SHARED BUFFERindx(XY) id 'INPUT'.

* Get Print Parameters

  CALL FUNCTION 'GET_PRINT_PARAMETERS'

    EXPORTING

      no_dialog      = 'X'

    IMPORTING

    valid         = lv_valid

      out_parameters = ls_params.

** JOB_OPEN

  CALL FUNCTION 'JOB_OPEN'

    EXPORTING

      JOBNAME          = LV_JOBNAME

      SDLSTRTDT        = sy-datum

      SDLSTRTTM        = sy-uzeit

    IMPORTING

      JOBCOUNT         = LV_JOBCOUNT.

**Submitreport

  submitZLCL_rep

viaJOBLV_JOBNAME

  NUMBER LV_JOBCOUNT

  TO SAP-SPOOL WITHOUT SPOOL DYNPRO

  SPOOL PARAMETERS

  LS_PARAMS AND RETURN.

** Close JOB

  CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

      JOBCOUNT             = LV_JOBCOUNT

      JOBNAME              = LV_JOBNAME

      STRTIMMED            = 'X'.

***

Import inside 2nd report:

IMPORT LT_INPUT TO INPUT FROM SHARED BUFFERindx(XY) id 'INPUT'.

deletefrom shared buffer indx(xy) id 'INPUT'.

*******

Here the data are not imported in the second report.

What is the purpose of index table and do I need to create Rlid value inside a table or we can use existing area value.

While executing in backgrond mode no  data in importing in second report.

There are lotof  SDN links how to use shared memory to export and import using shared memory,but I didnt find which indx id.

Please suggest..,

Regads,

Lokes.

1 ACCEPTED SOLUTION
Read only

tolga_polat
Active Participant
0 Kudos
2,301

Hi,

Here is my example about INDX table and Data cluster, you can use this code for your logic too.

Kind Regards

8 REPLIES 8
Read only

suresh_kutam
Participant
0 Kudos
2,301

Hello Lokesh,

Yes You can use INDX table - but please make sure you use right index name and also

delete the key at right place.

Program 1::-

DATA: INDXKEY LIKE INDX-SRTFD VALUE 'ZSURESH',

      WA_INDX TYPE INDX.

EXPORT p_ipay p_bill i_tttab from i_tttab

       TO DATABASE INDX(ZS) FROM WA_INDX ID INDXKEY.

Program 2::-...

DATA: INDXKEY LIKE INDX-SRTFD VALUE 'ZSURESH',

      WA_INDX TYPE INDX.

IMPORT  p_ipay p_bill i_tttab FROM DATABASE INDX(ZS) ID INDXKEY

         TO WA_INDX.

*// if we do not delete them the table will be filled and INDX table is one of the critical table - Hence take a decision to delete the entry after you imported..

DELETE FROM DATABASE INDX(ZS) ID INDXKEY.

Thanks,

Suresh K..

Read only

0 Kudos
2,301

Hi Suresh,

Thanks for your input, but still i'm not able to export data  using database indx.

Please suggest any other options.

Read only

0 Kudos
2,301

Hope you are using same Data types and structure in both the programs and also Check after program1 execution whether u have entry in INDX table or not ?

And also comment Delete statement for a while to make sure the entries are written in that file..

Read only

tolga_polat
Active Participant
0 Kudos
2,302

Hi,

Here is my example about INDX table and Data cluster, you can use this code for your logic too.

Kind Regards

Read only

0 Kudos
2,301

Hi,

Is it not possible with indx table , without creating new custom table ?

Read only

0 Kudos
2,301

As far as I know you need INDX table in database for cluster data.


But I think you have simple table to export and import. You have to use EXPORT/IMPORT MEMORY ID.


EXPORT input = lt_input TO MEMORY ID 'MYINPUT'.

IMPORT input = lt_input FROM MEMORY ID 'MYINPUT'.

Read only

0 Kudos
2,301

Hi Tolga,

Here my requirement is to execute a report in background using JOB_OPEN and JOB_CLOSE and submit a report.

I have tried with Sharememory butno success.

withexport/import memory it wont work in background job.

Read only

0 Kudos
2,301

So I will suggest you more simple way use Functions.


You need one function group and 2 function. and In function group global data declare your table. For example :

ZEXP_IMP_GROUP has two function and one data:

DATA : MY_DATA TYPE TABLE ( your table type ).

FUNCTION ZEXP_IMP_SET_DATA.

* IMPORTING

* IT_DATA TYPE TABLE ( your table type or generic )

MY_DATA = IT_DATA.

ENDFUNCTION.

FUNCTION ZEXP_IMP_GET_DATA.

* EXPORTING

* ET_DATA TYPE TABLE ( your table type or generic )

ET_DATA = MT_DATA.

ENDFUNCTION.