‎2005 Sep 12 12:09 PM
Hi,
i need to transport data (Set/Get or other technique) from method 1 to method 2.
abap 1 call method1 of badi 1
abap 1 calls function module 1 IN UPDATE TASK
function module 1 calls function module 2 with destination 'NONE'.
function module 2 calls method 2 of badi 2
I've tried the Set/get parameter technique, but it didn't work.
Are there other possibilities ?
regards,
Hans
hans.senden@philips.com
‎2005 Sep 12 1:34 PM
Hi ,
So you have given 4 scenarios in your first mail.
Please try this
In Method 1
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
WA_INDX TYPE INDX.
Before export, fill the data fields
before CLUSTR.
WA_INDX-AEDAT = SY-DATUM.
WA_INDX-USERA = SY-UNAME.
Export der Daten.
EXPORT IT FROM IT
TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
In Method 2
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
WA_INDX TYPE INDX.
IMPORT IT TO IT
FROM SHARED BUFFER INDX(ST) ID INDXKEY TO WA_INDX.
Hope thsi works .
Cheers.
‎2005 Sep 12 12:19 PM
Hi
You can use ABAP memory with EXPORT / IMPORT parameters .
Cheers.
‎2005 Sep 12 12:21 PM
Try EXPORT TO MEMORY.
For example
EXPORT <var> TO MEMORY ID 'TEST'.
IMPORT <var> FROM MEMORY ID 'TEST'.
‎2005 Sep 12 12:36 PM
I've tried the EXPORT to memory id solution, but the compiler gives an error in the badi-method :
EXPORT var_1 ... var_n TO MEMORY ... is not supported in the OO context.
Hans
‎2005 Sep 12 12:38 PM
Hi
You will have to define the from parameter also like -
EXPORT W_SEND_MEM FROM W_SEND_MEM TO MEMORY ID 'Z129'.
Cheers
‎2005 Sep 12 12:47 PM
I've changed it to this syntax. The compiler says everything is all right. But no data is transferred from method 1 to method 2.
‎2005 Sep 12 1:03 PM
Hi ,
To add to Sanjay,
when you are importing it should have the same parameter name, otherwise it will not copy the value.
For example if you are exporting like this:
EXPORT W_SEND_MEM FROM W_SEND_MEM TO MEMORY ID 'Z129'
the corresponding import statement should be
IMPORT W_SEND_MEM FROM MEMORY ID 'Z129'
W_SEND_MEM in export and import statements should match.
Regards,
Surendra
‎2005 Sep 12 1:05 PM
> Hi ,
> To add to Sanjay,
> when you are importing it should have the same
> parameter name, otherwise it will not copy the
> value.
>
> Regards,
> Surendra
it is !
‎2005 Sep 12 12:54 PM
‎2005 Sep 12 12:59 PM
Code method 1 :
data: lx_convert type xfeld.
* depending on some conditions the variable lx_convert
* will be set to 'X' or ' '
lx_convert = 'X'.
EXPORT lx_convert from lx_convert to memory id 'ZZHSTEST_CONVERT'.Code method 2 :
DATA: lx_convert TYPE xfeld.
IMPORT lx_convert to lx_convert FROM MEMORY ID 'ZZHSTEST_CONVERT'.
* to show the resulting value of lx_convert
* i will use a call of function TH_POPUP with the value
* as text
‎2005 Sep 12 1:00 PM
Hi
My question was how you are calling method 2 from methiod 1
Cheers.
‎2005 Sep 12 1:01 PM
> Hi
>
> My question was how you are calling method 2 from
> methiod 1
>
> Cheers.
see my initial post
‎2005 Sep 12 1:34 PM
Hi ,
So you have given 4 scenarios in your first mail.
Please try this
In Method 1
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
WA_INDX TYPE INDX.
Before export, fill the data fields
before CLUSTR.
WA_INDX-AEDAT = SY-DATUM.
WA_INDX-USERA = SY-UNAME.
Export der Daten.
EXPORT IT FROM IT
TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
In Method 2
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
WA_INDX TYPE INDX.
IMPORT IT TO IT
FROM SHARED BUFFER INDX(ST) ID INDXKEY TO WA_INDX.
Hope thsi works .
Cheers.
‎2005 Sep 12 2:06 PM
Sanjay,
the values are transported now. It seems to work all right. It's the end of the day for me now, but i'm going to test it tomorrow morning.
Thanx,
Hans
‎2005 Sep 13 7:05 AM