cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Usage

Former Member
0 Kudos

Hello Everyone,

I am new to Webdynpro ABAP. I have been looking in to the creation of Webdynpro Component using a BAPI. I have created an application which uses the BAPI (BAPI_PO_CREATE). But when I test the application after desigining the view and assiging the component to an application. The application is throwing the following error message in the browser. Could anyone please help in resolving this issue. I would appreciate your help.

The following error text was processed in the system DV1 : Adapter error in &VIEW_ELEMENT_TYPE& "G_L_ACCT_LBL" of view "ZPO_CREATE.V_MAIN": Context binding of property TEXT cannot be resolved: Node COMPONENTCONTROLLER.1.BAPI_PO_CREATE.1.CHANGING.1.PO_ITEM_ACCOUNT_ASSI does not contain any elements

The error occurred on the application server sapdv5_DV1_00 and in the work process 0 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP

Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP

Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP

Regards,

Gopal.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello ,

i think you have problem at service call please follow the following way

1. when you go to service call wizard it will take to different steps like strat, select controller,select service, ......

2.now you might be doing some mistake at adapttive Context step

when you go to this step you will get

a. node type

b..node name

c.object type -


> here you have to select c(contextnode/Attribute).

3.then follow the way which your doing

i think it will solve your problem.

Thanks,

Shaik Shadulla.

Former Member
0 Kudos

Hi Shadulla,

Thanks a lot for your reply. I did exactly what you mentioned. I dont really understand what's going on wrong. The BAPI that I am trying to use is "BAPI_PO_CREATE" i.e to create a Purchase Order. I dont really understand why the context elements i.e internal tables should have some values if i am trying to input the values from the webdynpro form. Do you get my point?

Regards,

Gopal.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

> I dont really understand why the context elements i.e internal tables should have some values if i am trying to input the values from the webdynpro form. Do you get my point?

You may not understand it, but that is the way it works. There has to be at least an empty element for the intput fields to bind to.

Former Member
0 Kudos

Hi Thomas,

Thanks a lot for your reply. If you dont mind, could you please explain me how to create a Webdynpro Application for creating a purchase order using ABAP Webdynpro so that I dont get the error message that I am getting. Because I have given up now. I would really appreciate your help.

Regards,

Gopal.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't think I can teach you Web Dynpro Context concepts via a forum. You should study up on how the context works. Consider not using the generated context of the BAPI service call if that is too complex for you. Create your own context. Also have you even tried doing a bind_element on the context node in question?

Former Member
0 Kudos

Hi,

When you run ME21N Tcode, what all are required to generate a PO those needs to be passed to BAPI right.

Test this BAPI in se37 by giving the inputs. Then you will get to know the values returend.

Regards,

Lekha.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Gopal,

When ever you try to use any BAPI, first check the mandatory parameters to be passed inorder to get the data.

There could be some mapping issue with the nodes that are created by BAPI in WDA.

The BAPI(IMPORTING) node that is created as EXPORTING in WDA has no data/elements in it which is used for further processing.

First try to create a view for Input that BAPI requires and bind these values to the necessary parameters of the VBAPI node in WDA.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks a lot for your reply. So, are you asking me to Create a View first and then bind the View UI elements to the Context of the View Controller?

Could you please give me a bit of explanation about selecting the BAPI nodes while creating the Service call with the BAPI Wizard in Webdynpro ABAP. Because it is a bit confusing for me as I have been working on Webdynpro Java for a while and it is bit different with "Calling a BAPI" into Webdynpro. Please help me understand the concept of calling a BAPI and mapping the BAPI nodes with the Component Controller Context. I would appreciate your help.

Regards,

Gopal.

Former Member
Former Member
0 Kudos

Hi Lekha,

Thanks for your reply. I have already had a look at the SAP article about BAPI Usage. But, it didn't make any clear explanation for me! May be some one on SDN can explain me about this in detail for me. I would appreciate your help.

Regards,

Gopal.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Looks like you data bound to a context node that is type 0:1 or 0:n. In other words it is context node that is allowed to be empty. However when you UI element tries to attach itself, it needs at least one empty element in the node. You will either need to structure a different context (I can tell the current one is the generated one from the BAPI wizard - it might be better to create your own input context manually), or to fill the context with initial records.

Former Member
0 Kudos

Hi Thomas,

Thanks a lot for your reply. I didn't understand what you mean. Could you please explain me in more detail. I dont really see any problem in my context binding between Component Context and the View Context because I just DRAG and DROPed the context from Controller context to the View Context. So, how would it not be able to see the Node attributes.

Please explain me about this problem so that I can resolve this issue. I would appreciate your help.

Regards,

Gopal.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is nothing wrong with the binding itself. As I said, you have a node with no elements. That is stated directly in the error message:

COMPONENTCONTROLLER.1.BAPI_PO_CREATE.1.CHANGING.1.PO_ITEM_ACCOUNT_ASSI does not contain any elements

You can't data bind to a node that has no elements. No can you navigate from a node to a subnode if the higher level node has no elements. Think of the node as the internal table definition and the elements as the actual records in the internal table.

My suggestion if you don't want to restructure your context, then you are going to have use your WDDOINIT to bind an empty element to the node. Use the context API BIND_ELEMENT to do so.

Former Member
0 Kudos

Hi Thomas,

Thanks a lot for your reply. The error says I have a node with no elements. But, in nodes of Component Controller Context I can see all the attributes present. Why do you think this is happening. How should I restructure my the Context of my Component Controller. Please let me know about this. I would appreciate your help.

Regards,

Gopal.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I think you need to read up a little more on WD Context. You are missing an important concept. You can't look at the context at design time and know there are elements. There are three separate parts to a context. The node is like an internal table or structure. The attributes are the columns in the internal table/structure. Elements are the individual records in the internal table. You have to add elements at runtime. I would suggest that you study this help document:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/1d8aa2d66f4250e10000000a1553f6/frameset.htm