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

Error when Updating Ztable.....

Hi,

i am trying to update one ztable by uploading data from flat file. the data was uploading correctly into the internal table.

But it was not inserting into the ztable and when the MANDT field was empty in the WA_RDATA i wrote the following logic to update the client number but it was showing error(STATEMENT "WA_RDATA-MANDT" is not defined. Check your spelling....).

WA_RDATA and IT_RDATA was similar to ZTFI_KHALIX table.

Can any one let me know why this error was coming and also why the Ztable was not inserting.

LOOP AT it_rdata INTO wa_rdata.

IF wa_rdata-mandt EQ space.

wa_rdata-mandt eq sy-mandt.

ENDIF.

break rtarpatl.

IF sy-subrc EQ 0.

INSERT into ztfi_khalix values wa_rdata.

ENDIF.

ENDLOOP.

Thanks & Regards,

Ramana

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 06:52 AM

    Hi,

    Check your declaration for WA_RDATA, how the MANDT field was declared. It should be MANDT TYPE SY-MANDT.

    Rgds,

    Bujji

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 30, 2008 at 06:56 AM

    Hi Ramana,

    How u declared ur work area WA_RDATA. Client field is not required actually. It will automatically fills from log on client. It is required only if u want to insert data for the client which is different from log on client.

    Do like this.

    *Change ur declaration like below.

    DATA: WA_RDATA TYPE ztfi_khalix ,

    it_rdata TYPE STANDARD TABLE OF ztfi_khalix .

    It will work.

    Thanks,

    Vinod.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 07:00 AM

    Hi,

    You need to define the internal table with the same structure of the Z* table.

    When you are uploading the data from the text file, specify the mandt value in that.

    LOOP AT it_rdata INTO wa_rdata.

    INSERT into ztfi_khalix values wa_rdata.

    if sy-subrc = 0.

    commit work.

    else.

    rollback work.

    endif.

    endloop.

    Hope it helps.

    Thanks

    Yogesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 07:00 AM

    Make these changes in your code

    IF wa_rdata-mandt EQ space.

    wa_rdata-mandt = sy-mandt.

    ENDIF.

    You have put

    wa_rdata-mandt eq sy-mandt.

    awrd points if useful

    Bhupal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 07:02 AM

    loop at itab into wa.

    wa_zefl_ib_data_two-mandt = sy-mandt

    wa_zefl_ib_data_two-w_wa_type = wa-type.

    wa_zefl_ib_data_two-w_part_fct = 'SOLD_TO_PARTY'.

    wa_zefl_ib_data_two-w_sp_no = wa-part_no.

    wa_zefl_ib_data_two-w_sp_fct = 'SHIP_TO_PARTY'.

    wa_zefl_ib_data_two-w_bp_no = wa-partner.

    wa_zefl_ib_data_two-w_bp_fct = 'SERVICE_BP'.

    wa_zefl_ib_data_two-w_serv_org = wa-augrp1.

    MODIFY zefl_ib_data_two FROM wa_zefl_ib_data_two.

    try this...i think this will help u

    if it usefull.plz reward

    Regards

    Anbu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 07:06 AM

    Hi Ramana,

    I have modified ur code .Plz check.

    LOOP AT it_rdata INTO wa_rdata.

    IF wa_rdata-mandt EQ space.

    wa_rdata-mandt = sy-mandt.

    modify it_rdata from wa_rdata.

    ENDIF.

    break rtarpatl.

    IF sy-subrc EQ 0.

    INSERT into ztfi_khalix values wa_rdata.

    ENDIF.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 09:04 AM

    Use the Option client specified in the Insert statement

    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.