on 06-28-2016 12:54 PM
Hi,
I m a SAP Newbie.
I've a problem with BAPI_GOODSMVT_CREATE
BAPI_GOODSMVT_CREATE is not working fine.
In the Return-Vars I've a message "No goods receipt possible for purchase order 2100021747 00000 '.
and
I got some more information
MaterialDocument = ""
strReturnType = E
strReturnID = M7
strReturnNumber = 036
strReturnMessage = No goods receipt possible for purchase order 2100021747 00000
Many many thanks in advance for helping.
CODE:
static bool GoodsReceipt101(RfcDestination rfcDestination)
{
RfcRepository repository = rfcDestination.Repository;
IRfcFunction rfcfunc = repository.CreateFunction("BAPI_GOODSMVT_CREATE");
IRfcFunction funcCommit = repository.CreateFunction("BAPI_TRANSACTION_COMMIT");
funcCommit.SetValue("WAIT", "X");
IRfcStructure Header = rfcfunc.GetStructure("GOODSMVT_HEADER");
Header.SetValue("PSTNG_DATE", DateTime.Now);
IRfcStructure Code = rfcfunc.GetStructure("GOODSMVT_CODE");
Code.SetValue("GM_CODE", "02");
IRfcTable table = rfcfunc.GetTable("GOODSMVT_ITEM");
table.Insert();
table.SetValue("MATERIAL", "B01000");
table.SetValue("PLANT", "BCC2");
table.SetValue("PO_NUMBER", "2100021747");
table.SetValue("ENTRY_QNT", "8000");
table.SetValue("BATCH", "2280616001");
table.SetValue("MOVE_TYPE", "101");
table.SetValue("MVT_IND", "B");
table.SetValue("STGE_LOC", "WH02");
RfcSessionManager.BeginContext(rfcDestination);
rfcfunc.Invoke(rfcDestination);
funcCommit.Invoke(rfcDestination);
RfcSessionManager.EndContext(rfcDestination);
string MaterialDocument = rfcfunc.GetValue("MATERIALDOCUMENT").ToString();
string strReturnType = rfcfunc.GetTable("RETURN").GetString("TYPE");
string strReturnID = rfcfunc.GetTable("RETURN").GetString("ID");
string strReturnNumber = rfcfunc.GetTable("RETURN").GetString("NUMBER");
string strReturnMessage = rfcfunc.GetTable("RETURN").GetString("MESSAGE");
string strReturnType2 = funcCommit.GetStructure("RETURN").GetString("TYPE");
string strReturnID2 = funcCommit.GetStructure("RETURN").GetString("ID");
string strReturnNumber2 = funcCommit.GetStructure("RETURN").GetString("NUMBER");
string strReturnMessage2 = funcCommit.GetStructure("RETURN").GetString("MESSAGE");
return true;
}
Hello Kitthapat,
Either this BAPI requires some additional inputs or it has some language-dependent conversions for inputs in the SAP GUI and you use one of them, perhaps GM_CODE is one of them. SAP note 206068 describes how to proceed in such a case.
Best regards,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.