cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

I'm working on rebuilding a complex BW transformation that we have, in Datasphere. The transformation has an expert routine which I'm trying to recreate using Python script inside a Data Flow. In the ABAP expert routine, I have access to the target structure via 

 

RESULT_PACKAGE

 

and I can use 

 

ASSIGN COMPONENT x OF STRUCTURE RESULT_FIELDS

 

 to access a component of the structure if it exists. This is convenient as I can use this to ignore fields from the source which I'm not interested in.

The question is, is there a similar mechanism in Datasphere? Can I somehow access the target structure within the script? My assumption is that it's not possible as there is only one Dataframe called 'data' to begin with. With that said, if there is no other way, is my only option to hardcode the columns of the result DataFrame with all the fields that I expect and check for each column before assigning any values. Is there a more elegant way? 

Thanks in advance.

View Entire Topic
CLTGravesen
Active Participant

Hello @mitko1994 ,

The short answer to your question is: No.
The Python editor is incredible simple, and is executed in it's own environment, separate from the data flow in general.  

Another fun note: the dataflow matches your columns on the order in the dataframe, not by texts or keys. 

So, not only can't you access the target structure - you have to manually create it, and make sure the output of your script matches the output exactly. 

Sorry I can't be more helpful 😞