Hi folks!
This is proving to be very difficult. my appreciation is <b>10 points to the first helpful answer!!</b>
I am receiving an export table from one bapi (z_xxx_getlist) into my webdynpro. I want to then import the same table into another bapi (z_xxx_savelist) so it can be saved in R/3.
- firstly I tried to map the the view's context attributes to the 2nd bapi, but that didn't work because it deleted the original mapping.
- then I created a new context node for the save bapi and tried to sync data between the nodes, but only ran into nullpointer exceptions.
What's the standard procedure for such a requirement?
Great thanks,
faB
ps. this is related to this previously posted topic:
copying data of 1 view context node to another></b><b></b><b></b>
Patric,
Thanks for the indepth reply. I will try you suggestion and the notify of the results.
One question in the meantime:
I have done the mappings a little bit differently (as demonstrated in the wd tutorials). Instead of mapping <b>RFC1_Output</b> to the custom controller I have mapped <b>RFC1_Input\Output</b> to it.
Does this matter?
Regards,
faB
Hi,
let's assume you have the following structure of your model (as seen under node "Model classes" in NWDS):
RowStruct (model class, row type both for export and import table)
... (attributes for structure)
RFC1_Input (model class, input RFC1)
...
RFC1_Output (model class, output RFC1)
Tbl_Export (:n relation to RowStruct from export)
RFC2_Input
Output (:1 relation to Output)
Tbl_Import (:n relation to RowStruct for import)
RFC2_Output
...
You now create a context bound to this model (note that it's recommended to create this in a custom controller
- usually the component controller - to be easily able to distribute data to several views).
Map the view context to this context; the context structure can then be as follows (only relevant parts shown):
Context
...
RFC1_Input
RFC1_Output
Tbl_Export
... (attributes of row structure)
RFC2_Input
RFC2_Output
...
Tbl_Import
... (attributes of row structure)
What is needed now - if I understand your question right - is to copy everything from TblExport to TblImport
(e.g. in the action event handler triggering the call of RFC2). The code snippet doing this is:
//copy list of model objects from RFC1 export to RFC2 import table wdContext.currentRFC2_InputElement().modelObject().setRelatedModelObjects("Tbl_Import", wdContext.currentRFC1_OutputElement().modelObject().getTbl_Export()); wdContext.nodeTbl_Import().invalidate(); //sync context with model
Note that this assumes your input elements bound to the respective model
objects have been created and RFC1 has been executed.
Regards,
Patric.
Add a comment