cancel
Showing results for 
Search instead for 
Did you mean: 

Data is not storing in SAP......

Former Member
0 Kudos

Hi,

I have written the following code for stroing the data in SAP directly which i have taken from R/3.....

But data is not storing in SAP.....

public void execute_Create( )

{

//@@begin execute_Create()

Y_Ep_Demo_Material_Create_Input input = new Y_Ep_Demo_Material_Create_Input();

IWDMessageManager msg = wdThis.wdGetAPI().getComponent().getMessageManager();

msg.reportSuccess(" Brgew "+wdContext.currentOutputDataElement().getBrgew());

input.setMatnr("MAT3006");

input.setBrgew(wdContext.currentOutputDataElement().getBrgew());

input.setAumng(wdContext.currentOutputDataElement().getAumng());

input.setDwerk(wdContext.currentOutputDataElement().getDwerk());

input.setGewei(wdContext.currentOutputDataElement().getGewei());

input.setKosch(wdContext.currentOutputDataElement().getKosch());

input.setLfmng(wdContext.currentOutputDataElement().getLfmng());

input.setMaktx(wdContext.currentOutputDataElement().getMaktx());

input.setMatkl(wdContext.currentOutputDataElement().getMatkl());

input.setMbrsh(wdContext.currentOutputDataElement().getMbrsh());

input.setMeins(wdContext.currentOutputDataElement().getMeins());

input.setMtart(wdContext.currentOutputDataElement().getMtart());

input.setNtgew(wdContext.currentOutputDataElement().getNtgew());

input.setPrdha(wdContext.currentOutputDataElement().getPrdha());

input.setSktof(wdContext.currentOutputDataElement().getSktof());

input.setSpart(wdContext.currentOutputDataElement().getSpart());

input.setVkorg(wdContext.currentOutputDataElement().getVkorg());

input.setVrkme(wdContext.currentOutputDataElement().getVrkme());

input.setVtweg(wdContext.currentOutputDataElement().getVtweg());

input.setWerks(wdContext.currentOutputDataElement().getWerks());

wdContext.nodeMaterial_Create().bind(input);

try{

wdContext.currentMaterial_CreateElement().modelObject().execute();

msg.reportSuccess("successfully stored in SAP");

}catch(Exception e){

msg.reportSuccess("exception "+e.getCause());

}

//@@end

}

Thanks & Regards

Ravi Shankar B

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Check if you are supposed to commit the transaction by calling the Commit BAPI.

Regards,

Ajay

Former Member
0 Kudos

Hi..

Please tell me the code which i have written is correct or not...

I am not getting any exception... in this block of code

try{

wdContext.currentMaterial_CreateElement().modelObject().execute();

msg.reportSuccess("successfully stored in SAP");

}catch(Exception e){

msg.reportSuccess("exception "+e.getCause());

}

Thanks & Regards

Ravi Shankar B

Message was edited by: RaviShankar B

Former Member
0 Kudos

Hi

Some times you can get the message from the R3 that should come by the "Return" node's message attribute.

try to get the message from the Bapi's "Rerurn" node's element Message. you can track the error from it.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

Try calling BAPI_TRANSACTION_COMMIT after you execute the other BAPI. (You might have to extend your RFC model with this BAPI.)

Regards

Markus

Former Member
0 Kudos

Hi

1. Check all the non optional values(Bapi Import Parameters) are bind with the value(without the null and empty).

2.Are you got any error message from the Bapi?(try to get the message from the return node)

Kind Regards

Mukesh