cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Required Parameter in Bapi Call

todd_fisher
Explorer
0 Kudos

Hi all,

I have a Bapi that I am calling where I am filling the required structures, but I continue to get the "Missing required parameter HEADER in Method Z_....".

The parameter header is a structure, and it appears correctly under the Input node.

I have gone to the point of creating and binding the element directly in the executeZ_Fuji_Cm_Sales_Start_Input( ) to prove that I am filling this:

<b>public void executeZ_Fuji_Cm_Sales_Start_Input( )

{

//@@begin executeZ_Fuji_Cm_Sales_Start_Input()

//$$begin Service Controller(-781629941)

Ztsd_Cm_Header head = new Ztsd_Cm_Header();

head.setCm_Mode("CREATE");

wdContext.nodeHeader().bind(head);

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentZ_Fuji_Cm_Sales_Start_InputElement ().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch(WDDynamicRFCExecuteException ce) {

manager.reportException(ce.getMessage(), false);

}

//$$end

//@@end

}</b>

I continue to get the missing HEADER parameter error and it does not even try the RFC. Am I missing something in the above code?

It may be of note that HEADER is a CHANGING parameter of the Function Module, and that when I went to map the binding it made me change the name in the OUTPUT node to something else as it saw this node as a duplicate. It is still named Header in the Input node and is mapped to the Bapi parameter HEADER.

Any thoughts?Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Todd,

Write the below code in wdDoInit() of component controller:

public void wdDoInit(){

Z_Fuji_Cm_Sales_Start_Input input = new Z_Fuji_Cm_Sales_Start_Input();

wdContext.nodeZ_Fuji_Cm_Sales_Start_Input().bind(input);

Ztsd_Cm_Header head = new Ztsd_Cm_Header();

head.setCm_Mode("CREATE");

<b>input.add<table>(head ); / input.set<Structure>(head );</b>

}

Regards,

Jhansi

todd_fisher
Explorer
0 Kudos

Hi - thanks to all that replied. As usual, I found the solution just after I posted the question.

What confused me is the fact that the NWDS generates the binding of the input node automatically in the wdDoInit of the service controller

<b>wdContext.nodeZ_Fuji_Cm_Sales_Start_Input().bind(new Z_Fuji_Cm_Sales_Start_Input );</b>

When I commented this line out and coded it as you ended up suggesting, things started working. Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

If i am not worng you are creating the HEADER instace correctly in your code but you are not adding this instance to the currentZ_Fuji_Cm_Sales_Start_InputElement().

So try adding/setting this HEADER to the Input .

Regards,Anilkumar