Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Update table with the table type structure

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos


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.

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

For example : sap retail client 100 to sap fico client 200 , so conflicit willl happen , so i dont wnat to transfer mandt field

rosenberg_eitan
Active Contributor
0 Kudos

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.

Former Member
0 Kudos


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.

rosenberg_eitan
Active Contributor
0 Kudos

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.