11-24-2009 6:50 AM
I want to upload data from a file to 2 different infotypes at the same time. One is a user defined infotype 9010 and the other is a standard infotype 2010. 9010 infotype has the start and end time whereas 2010 doesn't.While uploading I have put validations to check duplicate entries for infotype 9010 based on the start time and endtime. The duplicate entry is rejected in 9010 but the same gets uploaded in 2010. In 2010 I can't put any validations because there is no start time and end time. I want to prevent the upload of the entry in infotype 2010 if it is not uploaded in 9010. Please help.
11-24-2009 7:02 AM
Hi Sharmila,
Just set a flag whenever you append a value to infotype 9010 & while checking for infotype 2010, if the flag is not equal to X, then dont append.
Regards
Abhii
11-24-2009 7:22 AM
BAdI Implementation : ZHIM047_CHECK_9010
Interface : ZHIF001_INT_PBAS0001
Implementing class : ZHIM047_CHECK_9010
METHOD: ZHIF001_INT_PBAS0001~AFTER_INPUT (Validations written here. If I set a flag here its not accessible in the code of Infotype 2010)
BAdI Implementation : ZHIM048_CHECK_2010
Interface: ZHIF001_INT_PBAS0001
Implementing class : ZHIM048_CHECK_2010
METHOD: ZHIF001_INT_PBAS0001~AFTER_INPUT (Flag not accesible here)
How do I set a global variable which can be accessible at both the places?
11-25-2009 4:33 AM
11-25-2009 4:34 AM
11-25-2009 7:47 PM
Doing IMPORT?EXPORT will act like a global variable shared between two separate programs.
Here is an example:
In first part, export the values to a memory variable after your conditions satisfy and you want to set a flag, like this ...
free memory id 'ZFLAG_VAR'. "recomended to clear that variable
" before start, you dont need to declare it
data: l_flag type c.
if my_condition = 'true'.
l_flag = 'X'.
export l_flag to memory id 'ZFLAG_VAR'.
endif.
In second part, you can
import l_flag from memory id 'ZFLAG_VAR'.
if l_flag = 'X'.
write: 'hmmmm ... the flag was marked, so my condition was true in last part'.
endif.
Edited by: Rob Burbank on Nov 25, 2009 3:12 PM
11-26-2009 4:25 AM
I get this error message
Class ZHIM047_CHECK_9010,Method ZHIF001_INT_PBAS0001~AFTER_INPUT
EXPORT var_1 ... var_n TO MEMORY ... is not supported in the OO
context. Use EXPORT name_1 from var_1 ... name_n from var_n TO MEMORY
... instead. .
when I tried the method suggested by you. Please help.
11-26-2009 4:31 AM
First part
Class ZHIM047_CHECK_9010,Method ZHIF001_INT_PBAS0001~AFTER_INPUT
EXPORT var_1 ... var_n TO MEMORY ... is not supported in the OO
context. Use EXPORT name_1 from var_1 ... name_n from var_n TO MEMORY
... instead. .
Second part
Class ZHIM048_CHECK_2010,Method ZHIF001_INT_PBAS0001~AFTER_INPUT
IMPORT var_1 ... var_n FROM MEMORY ... is not supported in the OO
context. Use IMPORT name_1 TO var_1 ... name_n TO var_n FROM MEMORY ...
instead. .
What does name_1 mean in these cases? Is it the value of var_1?
11-26-2009 7:30 AM
Sharmila Jee, please search that error on sdn or google, people will not solve your problem from 0 to 100 if you are not showing your interest.
11-27-2009 7:18 AM
I tried using set parameter/ get parameter but it doesn't retain the value of the variable.
12-02-2009 3:35 AM
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.
I got the solution from an earlier forum and the answer was posted by Sanjay Sinha in the forum
Transporting data from abap to function