Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

pb7 setvalue for compute field not working

Friends,

string ls_user

ls_user=get_user();

messagebox("test",ls_user)   ====== this is working..

i tried with two different ways...both are not working..the dw_1 is in the crosstab report.

i want to send this user name either to the compute field or to the datawindow query directly in the where condition...

whichever is possible , pls provide me the solution.

dw_1.SetItem(1,'compute_1',ls_user)   ==== Not working

dw_1.object.compute_1.expression="'"+ls_user+"'"  === Not working..

thanks

Tags:
replied

No, this is not possible this way.

As bind variables (e.g. :a ) you can only use arguments that you have specified in the dw sql painter.

Without bindung you can only use somewhat the database knows. SQLCA is a powerbuilder object, not a database one.

But the database knows the name of the connected user. The way to get it depends on your database. For MS SQL Server it should be SYSTEM_USER.

So you can write:

where mentor = SYSTEM_USER

So you don't need a retrieval argument.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question