cancel
Showing results for 
Search instead for 
Did you mean: 

Client Rename Using ABAP Program

Former Member
0 Kudos

Hello Friends,

Can we use ABAP Program with UPDATE statement to update the client number instead of using local client copy.

What are drawbacks or consequences of the same.

Thanks and Best Regards,

Aman

Accepted Solutions (0)

Answers (2)

Answers (2)

raymond_giuseppi
Active Contributor
0 Kudos

Open-sql statements wont allow to change a primary key value, so client/mandt field, so answer would be NO, else you should be required to use native sql at your own risks, and you will get some problems with cluster and pool tables.Some data like logical systems are related to client but not in client dependant table, or even not with the mandt they refer to... Try to raise an OSS message after that...

Of course there won't be any longer data in the original client, why don't you want to use client copy ?

Regards,

Raymond

Former Member
0 Kudos

Hello Raymond,

I have written a small piece of code and tested the same and it is working fine.

REPORT  zupdate.

TYPES : BEGIN OF ty_dd02l,

        tabname TYPE tabname,

        END OF ty_dd02l.

DATA   itab_dd02l TYPE STANDARD TABLE OF ty_dd02l.

DATA   wa_dd02l  TYPE  ty_dd02l.

DATA   wa_dd03l TYPE char30.

SELECT tabname FROM dd02l INTO TABLE itab_dd02l WHERE tabclass = 'TRANSP'

                                                AND clidep     = 'X'.

LOOP AT itab_dd02l INTO wa_dd02l.

  SELECT SINGLE fieldname FROM dd03l INTO wa_dd03l WHERE tabname = wa_dd02l-tabname

                                            AND   Position = '0001'.

  IF wa_dd03l = 'CLIENT'.

    UPDATE (wa_dd02l-tabname) CLIENT SPECIFIED SET client = '300'

                                       WHERE client = '100'.

  ELSEif wa_dd03l = 'MANDT'..

    UPDATE (wa_dd02l-tabname) CLIENT SPECIFIED SET mandt = '300'

                                     WHERE mandt = '100'.

   ENDIF.

Do you think it can cause issues. Client copy is taking a very long time in copying the data.That is the reason i do not want to use the same.

Thanks and Best Regards,

Aman

raymond_giuseppi
Active Contributor
0 Kudos

It seems the client specified bypass the update rules when using SET WHERE, But what will you do if a problem arise during an update (e.g. undo/rollback space is full) you will get 2 client unavailable ?

And what with the other table with mandt in, not in the key. And with T000 table ? And not TRANSP tables ? And system parameters/profiles values related to mandt ? And other objects that neither you nor me have knowledge of ?

I never dare to try this, but ask for a new sandbox to test first time. And you should analyze the list of tables as some may get unpredictable result.

I can not advise you to persist in this idea.


Regards,

Raymond

Former Member
0 Kudos

Hello Raymond,

To overcome the update we can commit the changes after every table and then check the log how many tables are completed.

To overcome the T000 table and other table, I have found a FM SCC1_BUILD_SELTAB_EXT_CLIENTCP which returns  a table list which get transferred during the client copy.

So I hope this list should be fine. and we can update the client for these tables.

Please let me know if you think there can be any other issues with this approach.

Regards,

Aman

ThomasZloch
Active Contributor
0 Kudos

There could be many issues not foreseeable by the "average" ABAP developer. I will ask to have this discussion moved to for further insight.

Also please let us know should this really work as desired without wrecking your installation

Thomas

raymond_giuseppi
Active Contributor
0 Kudos

What I called "And other objects that neither you nor me have knowledge of ?"

Regards,

Raymond

ThomasZloch
Active Contributor
0 Kudos

Absolutely. I'm curious what e.g. thinks of this proposal.


Thomas

JPReyes
Active Contributor
0 Kudos

I think this is looking for the cat's 5th leg 

 

Theres plenty of procedures that can be performed using "alternative" ways... does that make them correct?... I don't thinks so.

If we all proceeded our own way SAP couldn't possibly provide support.

My best advice, is to migrate the client using the standard procedure. If for X, Y or Z reason the standard procedure was not an option then explain the scenario and we could suggest alternative solutions.

Thats my 2 cents...

Regards, Juan

Former Member
0 Kudos

Hello Juan,

Only the reason is that standard client copy procedure is taking approx. 8 weeks to finish.

Our scenario is that we have two clients in QAS.We want to copy all data from client 100 to 200 and delete the client 100 once the copy is done.

So what could be best alternative to save time.

Regards,

Aman

JPReyes
Active Contributor
0 Kudos

BTW, This reminded me when use to quote SAP Note 7

Regards, Juan

JPReyes
Active Contributor
0 Kudos

is taking approx. 8 weeks to finish.

Well thats a lot of time, wonder how big is the client and what method are you using?, There is ways to speed up a client copy

Regards, Juan

Former Member
0 Kudos

Hello Juan,

Client is approx. 2 TB size and we are using SCCL tcode to perform the client copy.

Regards,

Aman

JPReyes
Active Contributor
0 Kudos

I believe the process is much quicker if you use client export/import in a client that size, you can take advantage of parallel processing. have you tried this option?

Regards, Juan

Former Member
0 Kudos

Hello Juan,

I will try the same and check the performance. What can be other alternatives to improve the performance.

Thanks and Best Regards,

Aman

Former Member
0 Kudos

hello,

what do you mean by update client number ?

best regards,

swanand

Former Member
0 Kudos

Hello Swanand,

Update client number means take all client dependent table DD02l and then update the client field to new client for all these tables.

Thanks and best regards,

Aman

Former Member
0 Kudos

Hello,

The best way would be doing Client copy. As you do not know internally there may be dependancies for the table and also you are not aware what happens behind the scenes of a client copy. I guess just changing the name in client field of the tables is not going to help you.

best regards,

swanand