cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Model help

former_member422932
Participant
0 Kudos

I have a Web Dynpro application in which a user will enter information and click a button to call an RFC. The RFC then returns data to a new view. The user can make changes to this view, and will hit a button to call a BAPI. I am using a custom controller. I am not sure how to feed the results from my RFC to my BAPI. Can someone give me some pointers as to where to begin?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Mazurek,

No problem at all -- just copy attributes between 2 model nodes (output of RFC and input of BAPI). After call to RFC execute:

-- invalidate output of RFC so fresh results get into node, kind of

wdContext.node<RFC-OUTPUT-NODE>().invalide();

-- bind fresh BAPI model object to BAPI input node, like

wdContext.node<BAPI-INPUT-NODE>().bind( new <BapiInputModelClass>() );

-- copy attributes of RFC output to BAPI input like


   wdContext.current<BAPI-INPUT>Element().setBapiAttr1(
     wdContext.current<RFC-OUTPUT>Element().getRfcAttrA()
   );
   wdContext.current<BAPI-INPUT>Element().setBapiAttr2(
     wdContext.current<RFC-OUTPUT>Element().getRfcAttrB()
   );

Now you are ready to execute BAPI, or you may let user alter values populated above.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (5)

Answers (5)

former_member422932
Participant
0 Kudos

Issue solved

former_member422932
Participant
0 Kudos

How does the logic you provided Valery relate if the input fields to my BAPI are two structures? Do I use this logic to populate the two structures, and then need to use different logic to set these structures to the BAPI? The BAPI I am using is BAPI_REPMANCONF1_CREATE_MTS?

former_member189631
Active Contributor
0 Kudos

Hi Maz,

Follow This Procedure,

Create Model:

  • Create a new Model for Your Webdynpro Project.

  • Name your Model and Give The R/3 Login details

  • After successful login select your RFC FM module/BAPI

  • Add your Model to component.

Mapping:

  • Do Mapping between Model and Your component controller.

  • Do Mapping Between your component Controller and View

Binding:

  • Create Required UI elements.

  • Bind your UI elements

Code:

  • Write a method to execute You BAPI.

  • Create a Model Object in InitView and Bind it.

  • Call execution method.

Regards,

<b>Ramganesan K</b>

Former Member
0 Kudos
abhijeet_mukkawar
Active Contributor
0 Kudos