2014 Jul 25 5:26 AM
Hi All ,
I have a ztable which has MANDT field , i have to update the ztable from one system to another system via RFC function module ,
Now , i dont want to transfer the MANDT field because it will mess with the other system , so it should automatically update.
So i have created a structure and table type for internal table declaration ( without MANDT). so while inser statement its giving struture conflict error.
Please share your ideas!
How to update the ztable which has MANDT field with the tabletype (internal table without mandt filed) , if have done the similar kind of work , please share !!
e.g INSERT ZTABLE FROM table Itab( data : itab type tabletypewithout mandt).
Thanks,
Pradeep.
2014 Jul 25 7:44 AM
Dear Pradeep,
I got the answer for your query after doing R&D.
You need to switch off automatic client handling.
What is automatic client handling:
Whenever you use:
INSERT
DELETE
UPDATE
MODIFY statements on database table which has MANDT field, then system will check client automatically. I mean when u insert record from 100 client then system will insert records only in 100 client.
Use the below syntax for switching off automatic client handling:
In ZTABLE you have mandt field, fill this field in ITAB with required client.
For Example:
ITAB-MANDT = '100'. " you need to transfer records only in 100 client
ITAB-FIELD1 = ''.
APPEND ITAB.
then use insert statement like this:
INSERT ZTABLE CLIENT SPECIFIED FROM table Itab.
This will insert records in the client which you have specified in ITAB.
This will help you.
regards,
Rajesh Sadula.
2014 Jul 25 5:40 AM
Hi Pradeep,
You can probably get the RFC destination including the client prior to the FM call. Then you can update the MANDT field for your ZTABLE so you can completely pass all fields.
2014 Jul 25 5:42 AM
Dear Pradeep,
When u use INSERT TABLE_NAME FROM TABLE INTERNAL_TABLE syntax; then your INTERNAL_TABLE must be of type TABLE_NAME only.
Can u please explain this in more details??
"one system to another system"
regards,
Rajesh Sadula.
2014 Jul 25 6:03 AM
For example : sap retail client 100 to sap fico client 200 , so conflicit willl happen , so i dont wnat to transfer mandt field
2014 Jul 25 5:53 AM
Hi,
I have not done any kind of this development but usually when using CRUD statements
we do not use "CLIENT SPECIFIED" are you using it ?
Regards.
2014 Jul 25 7:44 AM
Dear Pradeep,
I got the answer for your query after doing R&D.
You need to switch off automatic client handling.
What is automatic client handling:
Whenever you use:
INSERT
DELETE
UPDATE
MODIFY statements on database table which has MANDT field, then system will check client automatically. I mean when u insert record from 100 client then system will insert records only in 100 client.
Use the below syntax for switching off automatic client handling:
In ZTABLE you have mandt field, fill this field in ITAB with required client.
For Example:
ITAB-MANDT = '100'. " you need to transfer records only in 100 client
ITAB-FIELD1 = ''.
APPEND ITAB.
then use insert statement like this:
INSERT ZTABLE CLIENT SPECIFIED FROM table Itab.
This will insert records in the client which you have specified in ITAB.
This will help you.
regards,
Rajesh Sadula.
2014 Jul 25 8:21 AM
Hi,
A small test.
Code:
FORM test_07 .
DATA: it_scarr TYPE TABLE OF scarr .
DATA: st_scarr LIKE LINE OF it_scarr .
DO 10 TIMES .
st_scarr-carrid = sy-index .
st_scarr-mandt = sy-index .
APPEND st_scarr TO it_scarr .
ENDDO .
INSERT scarr FROM TABLE it_scarr ACCEPTING DUPLICATE KEYS .
INSERT scarr CLIENT SPECIFIED FROM TABLE it_scarr ACCEPTING DUPLICATE KEYS .
ENDFORM. "test_07
Affect of NOT using CLIENT SPECIFIED .
Note that even I deliberately enter some garbage into MANDT the insert enter the correct value.
Affect of USING CLIENT SPECIFIED .
Regards.