cancel
Showing results for 
Search instead for 
Did you mean: 

Pls help - error with execution of bapi thru RFC

Former Member
0 Kudos

Dear all,

I'm having this error Mandatory parameter HEAD of method BAPI_MATPHYSINV_CREATE missing. for the parameters of head,it haf:

PLANT

STGE_LOC

SPEC_STOCK

DOC_DATE

PLAN_DATE

POST_BLOCK

FREEZEBOOKINV

DEL_BATCHES

PHYS_INV_NO

PHYS_INV_REF

GROUPING_TYPE

PHYS_INV_NO_LONG

PHYS_INV_REF_LONG

some of the above parameters is user input,some i have already hardcoded it as follow :

Bapi_Physinv_Create_Head head =new Bapi_Physinv_Create_Head();

head.setPlant("1000");

head.setSpec_Stock("");

head.setPost_Block(false);

head.setFreezebookinv(false);

head.setDel_Batches(true);

head.setPhys_Inv_No("");

head.setPhys_Inv_Ref("");

head.setGrouping_Type("");

head.setPhys_Inv_No_Long("");

head.setPhys_Inv_Ref_Long("");

input.setHead(new Bapi_Physinv_Create_Head());

Anyone pls advice me how to deal wif this error? thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joan,

Change this line

input.setHead(new Bapi_Physinv_Create_Head());

to

input.setHead(head);

Warm Regards,

Murtuza

Former Member
0 Kudos

Hie Murtuza,

Thx for the fast reply. I had change to input.setHead(head);

but i am still getting the same error

Former Member
0 Kudos

Hi Joan,

Just have a look at your RFC in R/3. You might be missing some of the mandatory parameter that needs to be set for successful execution of the RFC.

Try setting all the parameters and execute.

Hope you have binded your input node also.

wdContext.node<InputNode>().bind(input)();

//execute RFC Code

Warm Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

I've treid run in se37 using those inputs tat i hardcoded or key in for this web dynpro application,this FM module can be executed succesfully...

below is my code for init(),

Bapi_Matphysinv_Create_Input input = new Bapi_Matphysinv_Create_Input();

wdContext.nodeBapi_Matphysinv_Create_Input().bind(input);

Bapi_Physinv_Create_Head head =new Bapi_Physinv_Create_Head();

head.setPlant("1000");

head.setSpec_Stock("");

head.setPost_Block(false);

head.setFreezebookinv(false);

head.setDel_Batches(true);

head.setPhys_Inv_No("");

head.setPhys_Inv_Ref("");

head.setGrouping_Type("");

head.setPhys_Inv_No_Long("");

head.setPhys_Inv_Ref_Long("");

input.setHead(head);

is there anything tat i left out?

or for null value, i should use "" ? thanks

Former Member
0 Kudos

Joan,

Do 2 things.

1. Check that all your mappings from view>controller>Model are proper.

2. Display all the values that you have set before executing RFC

wdComponentAPI.getMessageManager().reportSuccess(wdContext.CurrentBapi_Physinv_Create_HeadElement().getPlant());

.........

........ for all the parameters

this is to confirm that the values being set by us are passed correctly to the model node.

Regards,

Murtuza

Former Member
0 Kudos

hi Murtuza,

thanks! i guess it works d.coz no error msg shown. By the way,this bapi is to create a PI doc...if this FM executed sucessfuly,a PI doc number wl be generated.Is it possible for me to get this PI doc number shown in my web dynpro application after i had executed this FM thru RFC? Many thanks

Former Member
0 Kudos

Hi Joan,

There would be an output node inside your input node which will give the output of your RFC after its execution.

Bind the attribute <PI Doc number> to a UI element say Text View's text property.

Also, invalidate the output node after execution of your RFC.

eg. Output node is output1

wdContext.nodeOutput1().invalidate();

You will see the result returned by the RFC in your text view that has been binded to the attribute of your output node.

Regards,

Murtuza

Former Member
0 Kudos

Dear Murtuza,

thank you so much!

Answers (0)