Is there a way to programatically, at run-time, set the data source for a Business View on a form or a UBE section?
I have not seen a way to do this within an app or UBE context. Of course, you can override the datasource in JDB_OpenTable etc. and have your app/UBE communicate through BSFNs. But the loss of built in APPL/UBE functionality is obvious. Perhaps hacking around with OCM at a user level would work? Caching would be a hurdle, I suppose.
There is a BSFN that overrides the data source when access the WSJ (Work with submitted jobs). Would it be possible to copy and modify the c code for that BSFN to do what you want?
You want to change the datasource your UBE gets data from?
Same as R98403XA and XB. Have a look how R98403XA handles PO szSourceDataSource as it will get data from PY even if being run in DV.
GetTargetDataSource(B9840E.GetTargetDataSource) It uses the API JDB_OpenTable
JDEDB_RESULT JDB_OpenTable(HUSER hUser, NID szTable, ID idIndex, NID *lpColSelect, unsigned short nNumCols, JCHAR * szOverrideDS, HREQUEST * hRequest);
So have a gander at how they handle it all
I did write a UBE that listed PO differences across environments? So we can do it. I just can't remember how I did it
I think that is the bsfn. I realise that it is very specific to the F986110 data source. However I was thinking that it might be possible for something could be learned from how it does it. However if the code that actually changes the data source is not accessible then it's probably not possible.