Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Sirs,
I have coding in the script below.
mapKUND:Mapping LOAD %LIFNR,
text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0)) as KNVP.KUNNR FROM
[..\..\..\..\Source Data\QVD\SAP\EMB\Marknad\SPEDITÖR_202_KNVP.QVD]
(qvd);
Speditör:LOAD %LIFNR,
LFA1.Namn_SP,
applymap('mapKUND',%LIFNR) AS [KUNNR]
FROM$(QVD_Path_SD_EMB)Speditör_202_LFA1.QVD
(qvd);
The result in the table is:
%LIFNR LFA1.Namn_SP KUNNR
0001043199 Schenker 0001043199
The result I really want is that KUNNR should display value from KNVP.KUNNR = Customer number in order.
Could anyone please help me?
Regards Magnus
your code looks right to me.
please check result of below code
text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0)) as KNVP.KUNNR
weither its calculating correct
the result depend on the above calculaton.
or you can share sample file
hope this help
Hi Magnus,
It looks like that the %LIFNR don't have the same format or something.
I say this because the KUNNR get's the %LIFNR when there's no match and you don't have a default expression on the applymap.
You should always use a default expression (even null() is more usefull than nothing).
My advice is load the mapping table without the mapping to check what
text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0))
is returning and if %LIFNR have the same format.
Regards,
Carlos
Hi Carlos,
Sorry for the late reply. You where correct. I needed to ad the same trim function as KUNNR in order to trim the leading zeros.
text
(replace(ltrim(replace(%LIFNR, '0', ' ')), ' ', 0)) as [%LIFNR]
Regards Magnus