cancel
Showing results for 
Search instead for 
Did you mean: 

Models in Abap Webdynpro.

konchada_saikrishna
Active Participant
0 Kudos

Hi All,

I am a Java guy having knowledge in Java webdynpro, it happend for me to get into ABAP webdynpro just had a small query here.

How does models functionality work in ABAp Webdynpro.

How do we access RFC, BAPI, web services, EJBs etc in ABAP web dynpro.

Thanks in Advance,

Sai Krishna.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sai,

Model is nothing but the business logic similar to the Java webdynpro . I guess you have seen those Hook methods like WD_doinit, WD DOmodifyView some standard default methods which we get according to the requirement we write our code as and where we want . One basic thing is u must be aware of the Context which is the heart of the webdynpro abap applications the interaction between the screen and the database is done by this .

Let me take a small example of how are we going to use the RFC or Bapis.

EG:

We have a screen UI elemnets in which we have one input field and a table our aim is to fetch the data into the table depending upon the input field or say selection field . and here we will be using say RFC or it may be a BAPI.

SO step1. Intially we desing the screen UI elements , create a Node for the input field with cardinality (0:1). and create another node for the table binding with cardinality as (0:n).then bind the values of the screen .

step2: Now since after giving the value in the input filed we want to fetch the data. On action of the Button or on enter of the input filed we need to write our code.

That means here our bapi or RFC comes into picture . what we need to do is get_attribute of the input field and call that RFC in import values pass the get_attribute value and see that it returns some table

say lt_table.

Now when you debug you can see the table values which we need to bind it to the table.

lo_nd_table->bind_table( lt_table ).

This will fetch the table values depending upon the input field values you giv .

Hope it is clear and helpful.

Have A GoodDay:)

Regards,

Sana.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sai Krishna,

Misbha has stated correctly regarding Model.In WDA generally uses service call to access the BAPI/RFC and also classes with methods to write the back end logic.

Check the below article how to create a service call

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc57c23f...

konchada_saikrishna
Active Participant
0 Kudos

Hi Suman / Mishab,

If i could understand correctly since ABAP is an external source in JAVA web dynpro we add BAPIs as models and then use them in Componet / Custom controllers.

So in ABAP Web dynpro all the objacts are avaialable locally we can stright away call them in Component / Custom controllers and thus no need to add them as Models. Is that right.

If this the case my query is completly answered.

Thanks & Regards,

Sai Krishna

Former Member
0 Kudos

Hi Sai ,

Yes you are exaclty right we are already in abap so no need to calll them externally you can staraight away call the bapi or rfc or so directly and use them .

Regards,

Sana.

konchada_saikrishna
Active Participant
0 Kudos

Thanks Mishab,

cheers,

Sai krishna