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

exchanging values between programs...

Former Member
0 Likes
755

Hi,

I have a screen where the user selects a value. I want to insert that into a table in a BADI method.

I try to do the following:

EXPORT TTXJ-TXJCD TO MEMORY.

when i check for syntax i get a warning message

"the EXPORT statement without ID specification exists only for the sake of compatibility with R/2. It should not be used because of unforeseeable effect"

In my BADI's POST_DOCUMENT method, I use

DATA TXJ TYPE C.

IMPORT TXJ FROM MEMORY.

When i do syntax check, i get the same message but it is shown as an error now !!

What is wrong ??

My requirement is to exchange the selected value. Is there anyother way it could be done ??

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
719

Hi,

In ABAP objects you have to EXPORT/IMPORT paramenters with reference to a ID.

USe like

EXPORT ZZRESWK FROM ZZRESWK TO MEMORY ID 'ZPDT1'.

IMPORT ZZRESWK TO ZZRESWK FROM MEMORY ID 'ZPDT1'.

Hope this will help.

6 REPLIES 6
Read only

manuel_bassani
Contributor
0 Likes
719

Hi ,

try to use


EXPORT TTXJ-TXJCD TO MEMORY ID 'ZTXJCD'.
IMPORT TTXJ-TXJCD FROM MEMORY ID 'ZTXJCD'.

Here the ID 'ZTXJCD' is arbitrary, but have to be the same in import end export

Regards, Manuel

Read only

0 Likes
719

In ABAP Objects, the syntax is more strict. You need to write it like this.

EXPORT 
    TTXJ-TXJCD = TTXJ-TXJCD
             TO MEMORY ID 'ZTXJCD'.


IMPORT
    TTXJ-TXJCD = TTXJ-TXJCD
             FROM MEMORY ID 'ZTXJCD'.

Regards,

Rich HEilman

Read only

0 Likes
719

Thanks Manuel. The Export statement did work, but import failed !!!

For that I typed

DATA TXJ TYPE C.

IMPORT TTXJ-TXJCD to TXJ FROM MEMORY ID 'ZTXJCD'.

no errors as of now...let me check if this works as desired...

thanks..

Read only

0 Likes
719


DATA TXJ TYPE <b>TTXJ-TXJCD</b>.
IMPORT TTXJ-TXJCD to TXJ FROM MEMORY ID 'ZTXJCD'.


Please make certain that the types or data delaration is the same on both sides, EXPORT side and IMPORT SIDE.

Read only

Former Member
0 Likes
720

Hi,

In ABAP objects you have to EXPORT/IMPORT paramenters with reference to a ID.

USe like

EXPORT ZZRESWK FROM ZZRESWK TO MEMORY ID 'ZPDT1'.

IMPORT ZZRESWK TO ZZRESWK FROM MEMORY ID 'ZPDT1'.

Hope this will help.

Read only

Former Member
0 Likes
719

Hi,

While exporting and importing we need to specify the ID, so that the values will be stored with that ID.

You can do that by

EXPORT TTXJ-TXJCD TO MEMORY ID 'ZTXJCD'.

Then you can import it by

IMPORT TTXJ-TXJCD FROM MEMORY ID 'ZTXJCD'.

While importing or exporting make sure that the particular variable is visible in that routine. Otherwise you can use a different variables to hold these values.

DATA: V_TXJCD LIKE TTXJ-TXJCD.

IMPORT TTXJ-TXJCD TO V_TXJCD FROM MEMORY ID 'ZTXJCD'.

Thanks

Giridhar

Message was edited by: Giridhar Nayudu