on 03-03-2008 10:14 PM
Hi Gurus
I have selected the customer list from sap with operating system mmsql , but I want to update or used the select statement in such a way that if there is street already in the list then relaced with postbox(pfach) and the field must replace or change the street field as in eg P.O.BOX:+pfach
if the pobox is not there then address must not change or update
Can anyone send me the sql statement toupdate please
SELECT KUNNR, NAME1, STRAS,PFACH, MCOD3, PSTL2,TELF1
FROM wg4.KNA1
Hi Gurus
Thanks for your help , the problem is solved
regards
Piroz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You probably want to do this via LSMW or some other SAP delivered solution and not a straight update to the database, but if you really need the SQL I included it below.
I dont know which field you are trying to update, but if would be something like:
update wg4.KNA1 set Field = case when Isnull(PFACH, '') = '' then Field else 'P.O.Box:' + PFACH end
The update will work if your PFACH is set to '' or null, if it can have other values that you don't want you would have to add those to the clause.
For a select (and to check if the update will work) it would be:
select case when PFACH = '' then Field else 'P.O.Box:' + PFACH end as NewPFACH from wg4.KNA1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.