Skip to Content
author's profile photo Former Member
Former Member

Update table with the table type structure

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2014 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2014 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2014 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2014 at 04: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.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2014 at 07: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.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.