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

Replacing obsolete IMPORT statement

Former Member
0 Likes
1,499

Hi,

The below works in a test program but when used in a user-exit i get the message'

import is not support in oo context. Use import .....

Does anybody know what the new syntax needs to be?

TYPES:

       BEGIN OF t_text,

       line(72),

       END OF t_text.

     DATA:

     ptext TYPE STANDARD TABLE OF t_text INITIAL SIZE 10,

     gw_text TYPE t_text,

     gw_key TYPE pskey.

     MOVE-CORRESPONDING innnn TO gw_key.

     IMPORT ptext FROM DATABASE pcl1(tx) ID gw_key.

     LOOP AT ptext INTO gw_text.

       WRITE / gw_text-line .

     ENDLOOP.

1 ACCEPTED SOLUTION
Read only

former_member201275
Active Contributor
0 Likes
1,204

Here:

   TYPES: BEGIN OF t_text,
       line(72),
       END OF t_text.

DATA:
ptext TYPE STANDARD TABLE OF t_text INITIAL SIZE 10,
gw_text TYPE t_text,
gw_key TYPE pskey.

DATA: gpcl TYPE pcl1.

  IMPORT t_text = ptext FROM DATABASE pcl1(tx) TO gpcl ID gw_key.

  LOOP AT ptext INTO gw_text.
    WRITE / gw_text-line .
  ENDLOOP.

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
1,204

I prefer declaring a global class, and a table as a static public property in the class.

If you use that Global static component and populate some value to it, through out the execution the value will be there. So you can ignore the export memory id statement. and use a static component.

Read only

former_member201275
Active Contributor
0 Likes
1,205

Here:

   TYPES: BEGIN OF t_text,
       line(72),
       END OF t_text.

DATA:
ptext TYPE STANDARD TABLE OF t_text INITIAL SIZE 10,
gw_text TYPE t_text,
gw_key TYPE pskey.

DATA: gpcl TYPE pcl1.

  IMPORT t_text = ptext FROM DATABASE pcl1(tx) TO gpcl ID gw_key.

  LOOP AT ptext INTO gw_text.
    WRITE / gw_text-line .
  ENDLOOP.

Read only

0 Likes
1,204

Thanks Glen, thats what I needed. Unfortunately it's coming back empty though

Read only

0 Likes
1,204

Have you got the correct corresponding EXPORT statement? for eg:    EXPORT t_text = ptext TO DATABASE pcl1(tx) FROM gpcl ID gw_key.

Read only

former_member404244
Active Contributor
0 Likes
1,204

Hello,

Declare a global vairbale / workarea in the zztop include and you can use this variable across the function group.

Regards,

Nagaraj