cancel
Showing results for 
Search instead for 
Did you mean: 

how to crate multiple items via bapi?

Former Member
0 Kudos

Hello All,

I have created a Web Dynpro application which makes BAPI calls.

I need to pass data to the BAPI as input parameter, but I am failing to do so.

I tried to execute "Bapi_Requisition_Create". But I saw Table Cell editors are disabled. I tried to bind "Requisition_Items" structure which is cardinality 0..n.

Could you help me about this problem? Please anyone can give sample codes or have any idea for solution?

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

i am assuming that you are binding tableui with Requisition_Items node.

since Requisition_Items is structure it will be treated as class in web dynpro.

so if you want add records to your table you have to create object for this class.

please use following code.

Bapi_Requisition_Create_Input input2 = new Bapi_Requisition_Create_Input();

wdContext.nodeBapi_Requisition_Create_Input().bind(input2);

Requisition_Items obj = new Requisition_Items ();

input2.add<Requisition_Items>(obj);

wdcontext.nodeRequisition_Items.addElement(wdcontext.createRequisition_Itemselement(obj));

it will allow you enter one record

if you want more records repeat the code that i added.

With Regards

Balaram Naidu

|

|

Former Member
0 Kudos

Thanks Balaram.

I have been using these tutorials and They are very helpful.

Kind Regards,

Rasim

Former Member
0 Kudos

Hi Rasim,

I have a similar requirement. Could you please explain me the way you resolved your problem. I would appreciate your help.

Regards,

Gopal.

Former Member
0 Kudos

Dear,

I'm facing Similar kind of problem.

Could you please help me,how can i create the object for Requisition_Item class.I'm getting error on that area.

I will appreciate if you provide input ASAP.

Thanks in advance:)

Regards,

Santhosh

Former Member
0 Kudos

HI Rasim,

Will you send me ur Structure of ur context

With Regards

Naidu

Former Member
0 Kudos

Hi Balaram

You can find my structure of context:

Context |

--- Bapi_Requisition_Create_Input (cardinality 0..n)

---Output (cardinality 0..1)

---Requisition_Items (cardinality 0..n)

I added following code inside CustomController wddoInit section:

Bapi_Requisition_Create_Input input2 = new Bapi_Requisition_Create_Input();

wdContext.nodeBapi_Requisition_Create_Input().bind(input2);

Could you tell me my mistake?

Kind Regards,

Rasim

Former Member
0 Kudos

HI Rasim,

what dio u mean by 'table in the form'

are you passing internal tabel data to BAPI

With Regards

Naidu

Former Member
0 Kudos

Hi Balaram

I am sorry mistake. Because I am new developer in WebDynpro. I used another programming terms.

it means i used UI Table in my view. I created context mapping via BAPI. Then I saw my table input fields are disable. Normally I should enter data in Table Edit fields.

Do you have any idea why they are disabled?

Thanks

Best Regards,

Rasim

Former Member
0 Kudos

Hi,

Add your BAPI to controllers and views and in customcontroller init method write the code like this.

thru context mapping u can pass the node structure controller to View.

Once it has done.

goto the Init mehtod of the View and menthion the following code.

FNModule_Input input = new FNModule_Input();

wdContext.nodeFNModule_Input().bind(input);

// pass the input

input.setZ_Kunnr("0000000001");

try {

wdContext.currentFNModule_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch (WDDynamicRFCExecuteException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Thanks,

Lohi.

Former Member
0 Kudos

Hi Lohitha

I have already done your advise. But my problem is different. I have table in form. But Table Input fields are disabled. I cant enter any data and save it.

Do you have any idea how can create multiple items in BAPI?

Thanks for your response.

Kind Regards

Rasim