I'm experiencing some behavior in 10.5.2 that if anyone has
an explanation I would very much like to hear. I have a
dataobject which at run-time I modify the SQL (I'm adding
additional criteria to the where clause) and create a report
object in. I need to apply the same SQL changes to the
inserted report object. I've simplified the process for
demonstration purposes but consider the following....

datawindowchild ldwc_report
string ls_SQL, ls_Where

ls_SQL = dw_1.object.Datawindow.Table.Select
ls_where = "Some logic here to modify the where clause"
dw_1.object.Datawindow.Table.Select = ls_SQL + ls_Where

// This is a simplified create syntax with the relevant
parts
dw_1.Modify('create report(band=detail dataobject="d_sample"
nest_arguments=((" Arg1 "),(" Arg2 ")) name=dw_2')

dw_1.GetChild( "dw_2", ldwc_report )
ls_SQL = ldwc_report.describe("datawindow.table.select")
ldwc_report.modify( 'Datawindow.Table.Select ="' + ls_SQL +
ls_Where + '"')

Looking at ldwc_report.object.Datawindow.Table.Select at
run-time shows the modified SQL but when retrieved the
original SQL is being executed.

Then I added this code.
LibraryImport("C:\MyTest.PBL", "d_sample_my_test",
ImportDataWindow!,
ldwc_report.Describe("datawindow.syntax"), ErrorBuffer )

Opening this dataobject I can see the modified SQL as the
datasource. This should verify everything worked (except the
original SQL is executing).

Then I added this after the LibraryImport( ).
dw_1.Modify( 'dw_2.dataobject="d_sample_my_test" )

Then the modified SQL is executed as the source. Why is all
this necessary?

Russ