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

Access global Internal Table in Update Task

Former Member
0 Likes
2,735

Hi,

We have an internal table itab defined globally transaction LT06.

This table gets filled by some exit , exit1 (by online processing in transaction).

Now we have a user exit , exit2 which gets called in update task , where we need the data from this internal table.

How to achieve this ?

The table is available in the exit2 called in update task , but it does not contain any data.

We tried exporting itab in exit1 to memory id and importing in exit2. Still no luck.

Kindly provide some inputs.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,401

Also you can try the Shared memory Also

Before going to the Update Task Exit export it to memory

data: werks type werks_d.

DATA: wa TYPE indx.

werks = '1000'.

EXPORT werks FROM werks

TO SHARED MEMORY indx(xy)

FROM wa

CLIENT sy-mandt

ID 'MID'.

inside the Update task function

import that ... shared memory will work for you.

Normal export and Import fails but shared memory will work.

data: werks type werks_d.

DATA: wa TYPE indx.

IMPORT werks TO werks

FROM SHARED MEMORY indx(xy)

TO wa

CLIENT sy-mandt

ID 'MID'.

"check write werks.

Hi,

We have an internal table itab defined globally transaction LT06.

This table gets filled by some exit , exit1 (by online processing in transaction).

Now we have a user exit , exit2 which gets called in update task , where we need the data from this internal table.

How to achieve this ?

The table is available in the exit2 called in update task , but it does not contain any data.

We tried exporting itab in exit1 to memory id and importing in exit2. Still no luck.

Kindly provide some inputs.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
1,401

But before calling the Exit data is data there in internal table . if so you can try this...

Try with the Dynamic Fieldsymbols.

data: v_field(20) type c value '(MAINPROG)ITAB[]'.

field-symbols: <fs> type standard table .

assign (v_field) to <fs>.

check <fs> for internal table data,.

Read only

Former Member
1,401

try this

in place SAPFP50M --exit1 program name

STEXT -- Internal table

FIELD-SYMBOLS : <fs> TYPE ANY TABLE.


*           Getting the text from the buffer
            ASSIGN ('(SAPFP50M)STEXT[]') TO <fs>[].

*           Refresh the work area
            REFRESH : t_textlines.
            CLEAR   : t_textlines.

*           Getting the text into the internal table
            LOOP AT <fs>[] INTO t_textlines.

              APPEND t_textlines.
              CLEAR t_textlines.

            ENDLOOP.  " <fs>[]

Read only

Former Member
0 Likes
1,401

Hi,

You should be able to export the internal table to an indx-type database table. See the online help for the EXPORT statement addition "DATABASE dbtab(ar) [FROM wa] [CLIENT cl] ID id." Once you export the internal table to dbtab(ar) in exit1, you can then IMPORT the internal table (again using the DATABASE addition of the keyword IMPORT) within exit2.

Regards,

Jamie

Read only

Former Member
0 Likes
1,402

Also you can try the Shared memory Also

Before going to the Update Task Exit export it to memory

data: werks type werks_d.

DATA: wa TYPE indx.

werks = '1000'.

EXPORT werks FROM werks

TO SHARED MEMORY indx(xy)

FROM wa

CLIENT sy-mandt

ID 'MID'.

inside the Update task function

import that ... shared memory will work for you.

Normal export and Import fails but shared memory will work.

data: werks type werks_d.

DATA: wa TYPE indx.

IMPORT werks TO werks

FROM SHARED MEMORY indx(xy)

TO wa

CLIENT sy-mandt

ID 'MID'.

"check write werks.