Retrieving the quantity of a purchase order that has already been received English

From Theobald Software

Jump to: navigation, search

German Version: Die bereits gelieferte Menge zu einer Bestellung ermitteln


This function shows how to get the history of a purchase order to find out which part of the quantity has already been received.

public Decimal HoleWEZurBestellung(string BestellNr, string BestellPos)
{
	// FuBa zum Lesen der Bestellentwicklung vorbereiten, Parameter füllen und ausführen
	RFCFunction func = Con.CreateFunction("BAPI_PO_GETDETAIL");
	func.Exports["PURCHASEORDER"].ParamValue = BestellNr;
	func.Exports["HISTORY"].ParamValue = "X";
	func.Exports["ITEMS"].ParamValue = " ";
	func.Execute();
 
	// Rückgabetabelle der Bestellentwciklung auswerten
	for(int i=0; i < func.Tables["PO_ITEM_HISTORY_TOTALS"].RowCount; i++)
	{
		if (func.Tables["PO_ITEM_HISTORY_TOTALS"].Rows[i,"PO_ITEM"].ToString().Equals(BestellPos))
		{
			return (decimal)func.Tables["PO_ITEM_HISTORY_TOTALS"].Rows[i,"DELIV_QTY"];
		}
	}
	return 0;
}
DeutschEnglish
Personal tools
Navigation
XtractQL Provider
Xtract RS