cancel
Showing results for 
Search instead for 
Did you mean: 

Formatted Search - Restrict to Only One Customer on Activity Window

zal_parchem2
Active Contributor
0 Kudos

Hello Experts:

Am trying to create a formatted search to provide a suggested RMA Number on the Business Partners > Activity window in a UDF.

While in Activity, the user should get a list of ONLY the one customer they are currently working with. So if C0001 is being used in the Activity window, the list should show all suggested RMA numbers just for that customer of C0001, not any other customer.

When I use the following it shows all customers.

--FMS 6BP Automated RMA Number

SELECT

T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode]))

FROM OCLG T0

INNER JOIN OCRD T1

ON T0.CardCode = T1.CardCode

ORDER BY

T1.CardCode Desc,

T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode])) Desc

When I put in WHERE T1.CardCode = $[$ 9.0.0 ] in the right place it shows nothing...

Any ideas on how to make only the one current customer in Activity window appear in the list???

Thanks in Advance - Zal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You may try this one:

SELECT T0.CardCode + ' - ' + ltrim(str(T0.ClgCode))

FROM OCLG T0

WHERE T0.CardCode = $[$9.0.0\]

ORDER BY ltrim(str(T0.ClgCode)) Desc

Thanks,

Gordon

zal_parchem2
Active Contributor
0 Kudos

Thanks Istvan and Gordon...

Istvan - that is the same as my SQL - just do not know how to show the $[$... correctly in this forum - it always goes to that http thing.

Gordon - tried to use your SQL but it gave me an error of "Internal Error (-1003) Occured [Message 131-183] every time I tried to click on the magnifying glass. However, due to your last line in the SQL it gave me an idea that eventually they were OK with - namely, the highest number to the top of T0.ClgCode...

Thanks again guys - Zal

former_member204969
Active Contributor
0 Kudos

To show the code without http, you should select it and use

the Click to display text as code icon : <\> (Without the \ ) at the top of the message window

Answers (2)

Answers (2)

zal_parchem2
Active Contributor
0 Kudos

trying to give pnts but the system is not letting me...ohhhhhhhh - I see what is happening - the system has taken everyone's pnts away and they are down to zero - sorry guys - SAP has changed something...

Edited by: Zal Parchem on Mar 20, 2010 6:10 AM

former_member204969
Active Contributor
0 Kudos

I tried this one and it worked:

SELECT 
T1.CardCode + ' - ' + ltrim(str(T0.ClgCode)) 
FROM OCLG T0
INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
Where T1.CardCode= $[$9.0.0]
ORDER BY T1.CardCode + ' - ' + ltrim(str(T0.ClgCode)) Desc

Edited by: István K#rös on Mar 19, 2010 3:48 PM

Sorry, at first I copied here the query with the replaced value!