cancel
Showing results for 
Search instead for 
Did you mean: 

webdynpro inputfield is not editable

0 Kudos

hi,

i created some input fields and bind them with the value field at the specific bapi_field. all went fine except for the two fields for the materialdescription (i'm trying to create a new material with the bapi_material_savedata). these two input fields are not editable and i don't know why. everything seems similiar to the other input fields.

do you hav any idea?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

excuse me, i've never worked before with web dynpro. and i think i know what you mean. i did this in implementation:

Bapi_Material_Savedata_Input input = new Bapi_Material_Savedata_Input();

wdContext.nodeBapi_Material_Savedata_Input().bind(input);

Bapimathead bapihead = new Bapimathead();

input.setHeaddata(bapihead);

Bapi_Mara bapiclient = new Bapi_Mara();

input.setClientdata(bapiclient);

Bapi_Makt_List bapidescr = new Bapi_Makt_List();

input.setMaterialdescription(bapidescr);

so, there i created the node and bind the elements.

junwu
Active Contributor
0 Kudos

but you have to check if the node element whose attribute is bind to the input field is created

Former Member
0 Kudos

According to [http://www.se80.co.uk/sapfms/b/bapi/bapi_material_savedata.htm], the BAPI parameter "materialdescription" is a TABLES parameter and has type "bapi_makt".

In the Web Dynpro model classes you will then get a corresponding subclass of AbstractList where you can add the "table rows".


Bapi_Material_Savedata_Input input = new Bapi_Material_Savedata_Input();
wdContext.nodeBapi_Material_Savedata_Input().bind(input);

Bapimathead bapihead = new Bapimathead();
input.setHeaddata(bapihead);

Bapi_Mara bapiclient = new Bapi_Mara();
input.setClientdata(bapiclient);

/* add "rows" to table "materialdescription": */
{
  Bapi_Makt materialDescription = new Bapi_Makt();
  materialDescription.set<AttributeName>(<value1>);
  input.addMaterialdescription(materialDescription);
}
{
  Bapi_Makt materialDescription = new Bapi_Makt();
  materialDescription.set<AttributeName>(<value2>);
  input.addMaterialdescription(materialDescription);
}

See

Answers (14)

Answers (14)

0 Kudos

could you please help me? is the solution the cardinality? and if it so, what do i have to do to solve this problem?

0 Kudos

cardinality is 0..n. is this the solution of my problem? but my application is just like a prototyp, so it would be enough, if i can type in one description and language.

what have i to do? implement a table? i tried this before, but i was not able to make a editable cell field.

0 Kudos

@john wu: do you have an idea what i have to change now?

0 Kudos

where do i check them? i think i can create more material_descriptions in different languages. because of this the type of the material_descriptions implements the abstract list.

change this something?

junwu
Active Contributor
0 Kudos

click the node, and check the property

0 Kudos

so, i just looked the flights example up and compared it with my application. there are no differences. the flight example has also a parent node with some child nodes/folders where the attributes are. same as mine. and they also do not create a child node. i tried it, but there is no child node available only the parent node.

so there has to be another reason. do you or anyone have an idea?

0 Kudos

are you sure? because in the flights example from sap, they don't create the child node. they only add the attributes at the parent node like me.

and if i have to create the child nodes, why are there only problems with my material_description and not with the headdata etc, which are also child nodes?

and if you are right, how do i create the child node? because webdynpro tells me that there is no completion availabe only the one which i had created.

junwu
Active Contributor
0 Kudos

can you check the cardinality of material_description and headdata ?

any difference?

0 Kudos

i thought with

Bapi_Material_Savedata_Input input = new Bapi_Material_Savedata_Input();

wdContext.nodeBapi_Material_Savedata_Input().bind(input);

i created the node.

i think i still don't understand the whole thing. could you please tell me exactly where i have to create which nodes or where i can look which nodes i have created?

junwu
Active Contributor
0 Kudos

that coding only cover the creation of parent node,

you have to write code to take care of the child node.

0 Kudos

well, the main node is the Bapi_Material_Savedata_Input(), which is created as you can see. this contains different children, like the material_description and the material_description contains the 2 attributes which i'm trying to set with the not editable input fields. do i have to create another node element?

junwu
Active Contributor
0 Kudos

you haven't created one, what do you mean creating another one?

0 Kudos

as i told you, there is the element. i created it with the wizard and i can see it. there is the element in the controller and there is the element in the view. and because there are the elements i can choose the element in the value. if it was't there, i couldnt choose it, am i right?

and if not, i still dont understand where i have to create the element, because in my oppinion, it is there.

junwu
Active Contributor
0 Kudos

MY GOD..........

what you have done is creating context structure

creating element means:

wdContext.node<NodeName>().createAndAdd<NodeName>Element()

0 Kudos

so, is there any idea what i miss?

junwu
Active Contributor
0 Kudos

just create the element.

if you still don't understand, make a simple test

create node A under root context.

create Attribute A1 under node A

bind the A1 to an inputfield

run your application, what you will see?

create a button , in the action handler, create a node element for node A. run your application again and click the button, try to see what happen.

0 Kudos

do you mean the node in the controller context? there is one for material_description. and there is also one in the view.

i created them with the wizard where i marked the parts of the bapi which i want.

0 Kudos

what do you mean with create it? and why is it only by one inputfield that it doesn't work? where can i see if there exists one?

junwu
Active Contributor
0 Kudos

create node element.

for others which is editable, i think your code already created node element.

have you generated code using the wizard? init<abapi>, this method create node element, but not for all node.

0 Kudos

well, i bind it to the context node. but i don't think that there are any elements, because i'm going to fill them with the input data or am i wrong?

the values are all from the bapi_material_savedata which is from sap.

junwu
Active Contributor
0 Kudos

if so, create it.

0 Kudos

what do you mean with this? for the value of the inputfield i selected the value Bapi_Material_Savedata_Input.Materialdescription.Matl_Desc. similar to the other inputfields. there i selected for example value Bapi_Material_Savedata_Input.Headdata.Matl_Type.

junwu
Active Contributor
0 Kudos

you bind the input field to an attribute of a context node.

to make the input field enabled, the context node at least has one element.

junwu
Active Contributor
0 Kudos

the context you bind to at least has one element.

if not, please create it.