cancel
Showing results for 
Search instead for 
Did you mean: 

Cardinality Issue - WD Model (Form) Integration with BAPI

Former Member
0 Kudos

Hi -

We have an issue with our forms editable fields are getting disabled (read only, we can not enter data) even though we have proper properties set.

Our developers are looking into a possible cardinality issue i.e. our form fields are test field and have a cardinality of 0..1, where as our bapi structure is showing a cardinality of 0..n for the corresponding field in bapi.

We had internal table as an export parameter so we though may be because of that we are getting 0..n. However we have changed the internal table to a type of structure and recreated a model mapped all the controller and context nodes back to the new structure and still get 0..n cardinality.

We have already researched on SDN logs and did not find any relevant answers.

Any one have any idea please make our weekend happy Developers are really working hard on Friday to close on this before they go home.

Thanks

Shahid

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member4529
Active Contributor
0 Kudos

Hi Shahid,

If the context node cardinality is 0...1 or 0...n then you need to first create or bind an element to the node to make the form fields editable to which those nodes are bound to. If it's a model node then you need to instantiate a new model node object and bind it to the node e.g.:

Bapi_xxx_Input input = new Bapi_xxx_Input();

wdContext.nodeBapi_xxx_Input().bind(input);

Or if it's a value node then you need to instantiate the node element as below:

wdContext.nodemyNode().addElement(wdContext.nodemyNode().createElement());

Hope this helps.

thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

Thanks for your spontanous reply. We are binding the element to the node as described in your email. But when we call the bapi since the cardinality on the form text field is 0..1 and the cardinality on the bapi is 0..n our call to save results to the bapi fails.

Your guidance is really really appreciated.

Have a great weekend

Shahid

former_member4529
Active Contributor
0 Kudos

Hi Shahid,

Ideally you should not bind a bapi node of cardinality 0...n to a form context node of cardinality 0...1. Also please check whether the context node is properly instantiated as mentioned in my last message.

Thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

You are correct we should not bind a bapi node of cardinality 0..n to a form context node of cardinality 0..1.

Question is now what should we do in the back end so the bapi node has the cardinality 0..1 not 0..n? Any one have any idea.

Thanks

Shahid

former_member4529
Active Contributor
0 Kudos

Hi Shahib,

If you are using a standard SAP BAPI then you can't do anything at the backend. As as the BAPI expects 0...n cardinality data there's obviously a reason for it. So pls bind it to a node of 0...n

Thanks,

Dipankar

Former Member
0 Kudos

Thanks for your spontanous responses. we have resolved this issue on the backend in bapi signature (design) by moving the input structure from the tables TAB to the import TAB.

Now we see the cardinality of 0..1 in our data model.

Shahid

Former Member
0 Kudos

hi

it is not a good practice to have structures in import/export parameters. Have it in the tables tab and fill in the only record from your test form fields onto the bapi table. It saves a lot of processing time.

reg

vln