Skip to Content
0
Former Member
Jan 09, 2008 at 05:25 PM

read system datasource in the moment "action success"

28 Views

Hi all,

For example i have a goods receipt po form open with data.I push add button.Its posible to read from the datasources(OPDN,PDN1) of form in the moment of the action succes. What is the best way to obtain the head and lines data of the created document?.

if (pVal.FormTypeEx == "143" & pVal.ItemUID == "1" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED & !pVal.Before_Action & pVal.ActionSuccess & pVal.FormMode == 3) {

string cod_artikulo, descripcion_artikulo, cod_documento, n_linea, cantidad, cod_proveedor, nom_proveedor, aa, fecha_documento;

int resint;

bool linea_inputlisth_insertada = false;

oDBDataSource = oForm.DataSources.DBDataSources.Item("PDN1");

oDBDataSource1 = oForm.DataSources.DBDataSources.Item("OPDN");

cod_documento = oDBDataSource1.GetValue("docnum", 0).ToString().Trim();

cod_proveedor = oDBDataSource1.GetValue("cardcode", 0).ToString().Trim();

for (int i = 0; i < oDBDataSource.Size; i++)

{

aa = oDBDataSource.GetValue("u_aa", i).ToString().Trim();

...

...

}

In that case the datasources are empty because already there is no information in the form.

If i catch the same event with this code (only to have information in the form):

if (pVal.FormTypeEx == "143" & pVal.ItemUID == "1" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED & pVal.Before_Action & pVal.FormMode == 3) {

...

...

I see that cod_proveedor has the correct data (head data,from datasource1), but "aa" (from datasource) only have the empty row of the matrix. Why? How is the best way to solve this (to obtain the data of the successfully created document)?

The last solution is to use SQL sentences to obtain all data of the created document, but no exist other best way?.

Sorry for my poor english.

Thank you and regards.