05-30-2008 7:48 AM
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
05-30-2008 7:52 AM
Hi,
Check your declaration for WA_RDATA, how the MANDT field was declared. It should be MANDT TYPE SY-MANDT.
Rgds,
Bujji
05-30-2008 7: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.
05-30-2008 8: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
05-30-2008 8: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
05-30-2008 8: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
05-30-2008 8: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.
05-30-2008 10:04 AM