Quantcast
Channel: SCN : Unanswered Discussions - Interoperability .NET
Viewing all articles
Browse latest Browse all 45

SAP .NET 3.0 Connector : BAPI_GOODSMVT_CREATE Issue

$
0
0

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;

 

        }


Viewing all articles
Browse latest Browse all 45

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>