2010 Jun 04 3:21 PM
I have some data in a database table in xxx client . I want to copy the data to another client yyy .What is the possible way .
I have some data in a database table in xxx client . I want to copy the data to another client yyy .What is the possible way .
2010 Jun 04 3:33 PM
One possible way would be to write a program to do it. There are probably other ways to do it as well.
Rob
2010 Jun 05 12:23 AM
Hi,
You can write an ABAP program using SELECT statment like sample below:
SELECT * FROM T001 INTO TABLE t_mytable CLIENT SPECIFIED WHERE (where condition) AND mandt = xxx.Afte that you can replace MANDT from internal table generated with new cliente YYY.
And just update the table
Kind regards
2010 Jun 07 5:12 PM
hello, you could do this program. But you must also be careful with the data you want to copy. Usually, when we clic SAVE button on a transaction, several tables are updated and we, as abap programmers, doesn't know how many database tables are involved!!!
Example: if you want to copy one material from client "xxx" to client "yyy", you must copy the data from "mara" but also makt, mard, etc...
be carefull, the Integrity of ERP could be compromised. The best way to do this i guess it would be a transport order
2010 Jun 14 12:01 PM
Hi ,
one can not write Mandt in select statement , so passing the data from one client to another will not be accomplished with select query.
You will have to check something with BASIS person i guess.
Regards,
Uma Dave
2010 Aug 19 4:34 PM
Hi Anindya,
Its possible very easily, please refer the code below:-
Types
TYPES : BEGIN OF ty_zpmpartloc,
mandt TYPE mandt,
part_class TYPE zpmpartloc-part_class,
werks TYPE zpmpartloc-werks,
lgort TYPE zpmpartloc-lgort,
ekgrp TYPE zpmpartloc-ekgrp,
prctr TYPE zpmpartloc-prctr,
mtvfp TYPE zpmpartloc-mtvfp,
END OF ty_zpmpartloc,
BEGIN OF ty_zpmpartcls,
mandt TYPE mandt,
parts TYPE zpmpartcls-parts,
part_class TYPE zpmpartcls-part_class,
END OF ty_zpmpartcls.
Internal tables
DATA: it_zpmpartcls TYPE TABLE OF ty_zpmpartcls,
it_zpmpartloc TYPE TABLE OF ty_zpmpartloc,
cursor1 TYPE cursor,
cursor2 TYPE cursor.
Work Area
DATA : wa_zpmpartcls TYPE zpmpartcls,
wa_zpmpartloc TYPE zpmpartloc.
PARAMETER : p_mandt TYPE mandt.
START-OF-SELECTION.
__BEGIN_OF_PROCESSING__
OPEN CURSOR cursor1 for
SELECT mandt parts part_class FROM zpmpartcls CLIENT SPECIFIED
WHERE mandt = p_mandt.
IF sy-subrc EQ 0.
DO.
FETCH NEXT CURSOR cursor1 into wa_zpmpartcls.
IF sy-subrc <> 0.
CLOSE CURSOR cursor1.
EXIT.
ENDIF.
wa_zpmpartcls-mandt = sy-mandt.
APPEND wa_zpmpartcls to it_zpmpartcls.
ENDDO.
ELSE.
ENDIF.
OPEN CURSOR cursor2 for
SELECT mandt PART_CLASS WERKS LGORT EKGRP PRCTR MTVFP
FROM zpmpartloc CLIENT SPECIFIED
WHERE mandt = p_mandt.
IF sy-subrc EQ 0.
DO.
FETCH NEXT CURSOR cursor2 into wa_zpmpartloc.
IF sy-subrc <> 0.
CLOSE CURSOR cursor2.
EXIT.
ENDIF.
wa_zpmpartloc-mandt = sy-mandt.
APPEND wa_zpmpartloc to it_zpmpartloc.
ENDDO.
ENDIF.
END-OF-SELECTION.
MODIFY zpmpartcls FROM TABLE it_zpmpartcls.
MODIFY zpmpartloc FROM TABLE it_zpmpartloc.
COMMIT WORK.
Cheers...
Dhirendra
2010 Aug 20 4:56 PM
Hi,
Please go through the following link...
http://wiki.sdn.sap.com/wiki/display/Snippets/CopyTablecontentfromsourceclienttotarget+client
Hope this thing helps you in solving your problem.
Best Regarrs,
Venkat.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |