07-24-2007 9:02 AM
Hi ,
I created a customer from XD01 and also filled the street field in same transaction but i did not fill street2 and street3 fields. I want to update street2 and street3 fields from an abap program.
I am trying to fill the customer's street2 and street3 field in ADRC table.
But sy-subrc = 4. It is failing.
UPDATE adrc SET str_suppl1 = 'street1'
str_suppl2 = 'street2'
WHERE addrnumber = 63534.
can someone tell y subrc is 4? why it is not getting updated?
Thank u
07-24-2007 9:10 AM
ADDRNUMBER is Character typr field. So you have to prefix with zero or to provide same ADDRNUMBER value getting from KNA1 Customer Master.
UPDATE ADRC SET STR_SUPPL1 = 'street1'
STR_SUPPL2 = 'street2'
WHERE ADDRNUMBER = '0000009941'.
07-24-2007 9:09 AM
Hi,
The address number should be in quotes.
UPDATE adrc SET str_suppl1 = 'street1'
str_suppl2 = 'street2'
WHERE addrnumber = <b>'63534'</b>.
Reward if helpful.
07-24-2007 9:10 AM
ADDRNUMBER is Character typr field. So you have to prefix with zero or to provide same ADDRNUMBER value getting from KNA1 Customer Master.
UPDATE ADRC SET STR_SUPPL1 = 'street1'
STR_SUPPL2 = 'street2'
WHERE ADDRNUMBER = '0000009941'.
07-24-2007 9:21 AM
Thanks, Nilesh. The problem was with prefixing zeros.
And I believe if i update ADRC(master table for address), all the other tables refer to this table for address....if iam not correct please reply
Thank u
07-24-2007 9:47 AM
First of all, SAP never recommands direct Databast table through any report.
Anyway still if you want to update all ADRC related table it will be the same. Just check the type of the field which you are updating and comparing in where clause.
07-24-2007 9:12 AM
Hi,
Rather going to update adrc table directly, go for BDC of XD02 to update street2 and street3 into ADRC table. it will update into all relative tables of customer master like knc1. And if u use update query only on ADRC then it will show inconsistancy into data base and give u sy-subrc = 4.
<b>Rewards points if it is useful.</b>
Regards,
Kinjal Rathod
07-24-2007 9:19 AM
Hi,
problem is the addrnumber-field. try this:
SELECT SINGLE * FROM ADRC WHERE ADDRNUMBER = '0000012427'.
Regards, Dieter