02-17-2005 1:50 PM
Hi,
I had mentioned this problem in a thread. But, then I thought that creating new thread is more logical.
Now, I am calling FUNCTION 'RS_DD_COPY_OBJ' as:
CALL FUNCTION 'RS_DD_COPY_OBJ'
EXPORTING
SOURCE_NAME = SRC_TABL
TARGET_NAME = TGT_TABL
OBJTYPE = OBJECT_TYPE
EXCEPTIONS
NOT_EXECUTED = 1
PERMISSION_FAILURE = 2
OTHERS = 3.
As you see above there are two parameters that this function gets: SRC_TABL and TGT_TABL. These are table names. Before this function gets these parameters I am getting these table names from user. Although I send these parameters, FUNCTION 'RS_DD_COPY_OBJ' get table names itself from user. So, there may be difference between start of the program that I wanted and while Function wanted.
In this position, I need the table names that function gets.
How can I solve this problem?
02-17-2005 2:04 PM
Hi Huseyin
It seems the only way is to copy the function to your namespace (i.e. ZRS_DD_COPY_OBJ) and make it not popping the screen for new names by deleting relevant code part. In fact there are more technical FMs to copy wrt. object types if you inspect the code. But they do not handle CTS (Change and Transport System) and locking. So, they are not feasible.
Kind Regards
*--Serdar
ssimsekler@yahoo.com
02-17-2005 2:04 PM
Hi Huseyin
It seems the only way is to copy the function to your namespace (i.e. ZRS_DD_COPY_OBJ) and make it not popping the screen for new names by deleting relevant code part. In fact there are more technical FMs to copy wrt. object types if you inspect the code. But they do not handle CTS (Change and Transport System) and locking. So, they are not feasible.
Kind Regards
*--Serdar
ssimsekler@yahoo.com
02-18-2005 8:48 AM
Hi,
To copy 'RS_DD_COPY_OBJ' is too difficult. I could not managed .
But there is one thing about ABAP logical error that I think. As I above mentioned, If function changes the SOURCE and TARGET, why these parameters defined as CHANGING?
02-18-2005 8:55 AM
Hi Huseyin
"RS_DD_COPY_OBJ" is an advanced FM which is not for general use. So, it is the developers decision how to handle it. It should be easier to copy and modify it. Anyways, a second alternative: <i>You can write a batch input program for the transaction SE11</i>. For more information on batch-input programming you can refer to standard SAP course BC420.
Kind Regards
*--Serdar
ssimsekler@yahoo.com
02-18-2005 9:32 AM
Hello Huseyin,
The solution to your problem is quite simple. You don't need a BDC. And you don't have to bother with copying the FM either.
You only need the name of the <i>target table,</i> so that you can use that for calling the FM RS_DD_ACTIVATE. Is that correct?
Here's the answer:
When the table gets copied, the system sets the parameter-ID for the table with the new table's name. So after calling the FM RS_DD_COPY_OBJ, just use this statement:
GET PARAMETER ID 'DTB' field TGT_TABL.
Then use this TGT_TABL in your next FM call , i.e, for the FM RS_DD_ACTIVATE.
Regards,
Anand Mandalika.
02-18-2005 9:48 AM
Hi Anand
The problem is that, it is required that what the name is passed to the FM for the target object, it must not be changed. The mentioned FM pop-ups a new screen which accepts user input. That is; what you pass to the function module serves just as default value for that pop-up. Besides, I agree with you about activation process.
By the way, I feel your breath at my neck. Whooouww...! I will not deliver the flag till my last blood drops ;). Just kidding, you really deserve the first place...:) Who shares more, gets the flag.
Kind Regards...
*--Serdar
ssimsekler@yahoo.com
02-18-2005 10:01 AM
Hi Anand,
Thanks, your idea is again useful I only wrote:
GET PARAMETER ID 'DTB' field TGT_TABL.
I did not wrote :
GET PARAMETER ID 'DTB' field SRC_TABL.
But, altough source adress is changed I can see the last value of source. Why this is so?
02-18-2005 10:13 AM
Hello Huseyin,
When the user changes both the source table and the target table names in the POP-UP, the system tries to check whether the new source table is existing in the database.
If it is existing , then the system will copy it to the
new target table.
Otherwise,
The system throws an error saying that the source table does not exist.
In any case, the system just needs to create the new table based on the source table. So, the actual operation is happenning only on the new table, so the system sets the parameter-ID to the new table. The source table has just been used as a template and there's no parameter-id associated with it. so you are not able to get the changed value of the source table.
Regards,
Anand Mandalika.
P.S. Please don't forget the points..:-)
02-18-2005 9:01 AM
Hi Huseyin,
Instead of FM RS_DD_COPY_OBJ try using RS_DD_COPY FM.
Thanks
Lakshman
02-18-2005 10:20 AM
Hi Anand,
I apolagize my previous message. Ignore that. If source table changes system don't care it. system cares only the first value of source table. But if target is changed system cares the last value of target.
Is there any way that system cares the last value of source adress?
Thanks.
02-18-2005 10:34 AM
Hello Huseyin,
I don't think you have observed it carefully. The system does take into consideration only those values of the source table which are last specified on the pop-up.
I have just checked this out. So please re-verify it once again.
Regards,
Anand Mandalika.
Hint: As a sample, give different source tables in both the screen and the pop-up.
02-18-2005 8:26 PM