cancel
Showing results for 
Search instead for 
Did you mean: 

combobox to textbox c# sapb1

Former Member
0 Kudos

I woud like to when i selected a value in combobox allow m populate certain text boxes such as, textBox1, textBox2 , how can i do that? it's an addon.

I'm creating an addon, and this time im working with form similar to bp, and payment run, So can get the information on my combo boxes, bur for example in sucursal its the defualt value, i would like to get the value from the combobox "cuenta" in the same time fill bic/swift code textbox and control no.... that's all

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Can we have some screenshots about the issue?

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

Sorry, I'm creating an addon, and this time im working with form similar to bp, and payment run, So can get the information on my combo boxes, bur for example in sucursal its the defualt value, i would like to get the value from the combobox "cuenta" in the same time fill bic/swift code textbox and control no.... that's all

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi,

It can be done something like this:

SAPbouiCOM.Form oForm = (SAPbouiCOM.Form)SBO_Application.Forms.GetForm(BusinessObjectInfo.FormTypeEx, 1);
SAPbouiCOM.ComboBox oComboApproval = (SAPbouiCOM.ComboBox)oForm.Items.Item("23").Specific;
if (oComboApproval.Value.Trim() == "Approved")
{
	SAPbouiCOM.EditText oEditStatus = (SAPbouiCOM.EditText)oForm.Items.Item("46").Specific;
	oEditStatus.Value = "Test";
}

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

if the value with a query for example, how can i get the changed?

 string SqlCad5 = "select distinct DSC1.BRANCH  from DSC1  inner join ODSC ON DSC1.BankCode=DSC1.BankCode  where='" + ComboBox3.Value.ToString() + "'";
//oEditStatus.Value = SqlCad5;
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Try this:

SAPbobsCOM.Recordset oRecSet = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(BoObjectTypes.BoRecordset);
oRecSet.DoQuery(Query);
string ValueToExtractFromQueryResult = oRecSet.Fields.Item("BRANCH").Value.ToString();

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

error.pngit gave me an error on the doquery 😕

    SAPbobsCOM.Recordset oRecordset = ((SAPbobsCOM.Recordset) (oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            SAPbouiCOM.ComboBox oComboApproval = (SAPbouiCOM.ComboBox)oForm.Items.Item("cmbctbc").Specific;
            if (oComboApproval.Value.Trim() != "")
            {




              
                string SqlCad5 = "select distinct DSC1.BRANCH , DSC1.Account from DSC1  inner join ODSC ON DSC1.BankCode=DSC1.BankCode  where='" + ComboBox3.Value.ToString() + "'";
                oRecordset.DoQuery(SqlCad5);
                string ValueToExtractFromQueryResult = oRecordset.Fields.Item("BRANCH").Value.ToString();


            }
        }

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Error message shows there is an exception while executing your query. Please check your query.

There is nothing after "Where" clause which is the problem.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

yeah, maybe it's because i get the value in the comebobox

 "select distinct DSC1.BRANCH as sucursal , DSC1.Account as cuenta from DSC1  inner join ODSC ON DSC1.BankCode=ODSC.BankCode  where DSC1.BankCode='" + ComboBox3.Value.ToString() + "'"<br>
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi,

Check the "Where" clause in the query which is the problem for you.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

THANK YOU! sorry did`t see my mistake, thank you so much ANKIT CHAUHAN

Answers (0)