cancel
Showing results for 
Search instead for 
Did you mean: 

Short Description of bapi

Former Member
0 Kudos

Hi i am new to webdynpro. I have some doubts on bapi.

I created models for bapi (ex. bapi_fl_list which has optional import, optional export and tables parameter.the bapi purpose is to retrieve all the records if no parameter is passed. in the webdynpro when creating model binding from model node i am choosing bapi's input-output- parameters and assinging the context to table control. but records are not retrieved. am i right in mapping the parameter of bapi(under root input - under input output - parameters). i created jco(selected dictionary data) too its fine. connections are ok. should i need to write the code to display the data. (ex. initializing bapi's) to retrieve the data.

Awaiting for early reply,

Ganesh.D

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Thanks for early reply. i did that application too already. all pdf describe the steps to do the partricular example. but not the usage of bapi(i mean which parameter to select or description of why we are selecting the bapi's input - output - params. and i said that i mapped context to table and binded the context to bapi's input - output - params. but i am not geting the output. are you clear about my question.

regards,

ganesh.d

Former Member
0 Kudos

Hi,

Suppose u want to display material list.

bapi :Z_Matnr.

In your View init method.u can write the code like this.

Z_Matnr_Input input = Z_Matnr_Input();

wdContext.node<Z_Matnr_Input>.bind(input);

Do u have any input params send here.

input.set<param>();

Otherwise u do not have params.

wdContext.current< Z_Matnr_Input()>.modelObject().execute();

wdContext.node<OutPutNode>.invalidate();

This will help.

Map the out node to you View.

Thanks,

Lohi.

Former Member
0 Kudos

Hi Lohi,

Many thanks to you. I tried it already but i hav confusion in concept. i tried to initialize the input. but it is not recognizing. i dont know which file to import. and i gave * to so that u it uses all. and another thing i am not geting that execute option when i try to enter modelobject.execute() option is not comming. thats why i am confused. wher i am wrong.

regards,

Ganesh.

Former Member
0 Kudos

Hi,

give me your BAPI and import and export params and what your looking for.

Such that I will give you the code then it should work.

Thanks,

Lohi.

Former Member
0 Kudos

Hi,

Bapi: bapi_projectdef_getlist

i need to display project definition and description in value help of a text box and return the project definition value in text box.

the fields are in bapi_projectdef_getlist_input -- output -- bapi_projectdef_getlist_output -- project_definition_list -- bapiprexp

hope its clear.

regards,

Ganesh.

Former Member
0 Kudos

Hi,

When you import BAPI into WD through Model U have to get the two model classes.

bapi_projectdef_getlist_input

and

bapi_projectdef_getlist_output

Here we have to use the only First class one only for sending the input and displaying output.

Here your ur not passing any params.

then in the bapi_projectdef_getlist_input ur getting your table node suppose some output.

this out put node map to the out put view.

In the init method u have to write the code like this.

Z_Matnr_Input input = Z_Matnr_Input();

wdContext.node<Z_Matnr_Input>.bind(input);

wdContext.current< Z_Matnr_Input()>.modelObject().execute();

wdContext.node<OutPutNode>.invalidate();

This might helps you .

If any issues post me.

Thanks

Lohi.

Former Member
0 Kudos

Hi Lohi,

I forgot to bind the input. now it working fine. thanks a lot. i have another doubt. only under input - output we can use those parameters for output display or under input all the parameters available we can use for out put display.

thanks,

regards,

Ganesh.

Former Member
0 Kudos

Hi

For input to BAPI and output to display we are using only.

ur first class.

BAPI_input() only.

thanks

Lohi.

Former Member
0 Kudos

Hi Lohi,

I have 2 textbox with value help option. 1st text box has value help i successfully displayed the records as per your tips. In the second text box i hav another value help which displays the records based on the 1st text box. both retrieves records using different bapi's.

both bapi has key fields to compare. that is the first textbox element. for example emp id in first textbox. and department in the second textbox. the second value help should show only the records relevant to particulare emp id which is selected in the emp id value help. i hav two different custom controller. Help me out in this Lohi. i could't able map the value help attribute field to custom controller value attribute.

The only option is passing value of empid to second bapi. that can be done as follows.

.......bind(new bapi's)

//pass the parameter to bapi

input.setDeptid( <get 1st textbox value which is

selected from value help> ) remember the codes are in doInit(). i am unable to retrieve the value attribute of the view. the codes are done in second custom controller with respective to second textbox.

awaiting for your reply,

regards,

Ganesh.D

Former Member
0 Kudos

Hi,

Open a new thread and expalin your requirement once again.

Thanks,

Lohi.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

This is PDF for accessing data from the back end go through this it should help you.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating...

for ready use code and creation Jco and SLD help.

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715

Othere wise let me know any issues post those.

Thanks

Lohi.