Skip to Content
author's profile photo Former Member
Former Member

How-To : bapi export table > webdynpro > bapi import table

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>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2005 at 09:47 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I don't know the structure of your model and context, but the most probable reason for this is you did not choose the first parameter of the setRelatedModelObjects method correctly.

      This must be the name of the <b>model</b> relation from the Input model class to the import table for the second RFC.

      In my sample the relation from

      RFC2_Input --> TblImport

      so the parameter is "TblImport".

      Regards,

      Patric.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2005 at 01:08 PM

    I am facing exactly the same issue. Passing a table to function module is not working with adaptive RFC, but giving import parameters is no problem.

    This cannot be found in any of the wd examples either.

    Thanks in advance,

    Tomas.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2005 at 01:35 PM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.