Am trying to fetch company name while am dealing with a cross company task.
I used the following code to get the company name which has the current comapny as invoice company.
CrossCompanyPostingRules crossCompanyPostingRulesLoc;
int i;
Container Comp;
dataArea dataArea1;
companyID company;
;
company = curExt();
while select dataArea1 where dataArea1.id != curExt()
{
comp += [dataArea1.id];
}
for(i=1;i<=conlen(comp);i++)
{
com = conpeek(comp,i);
element.company(com,company);
}
void company(companyID name,companyID company)
{
CompanyName companyNameLoc;
LedgerEmSysParameters_EMS ledgerEmSysParameters_EMSLoc;
;
changeCompany(name)
{
select ledgerEmSysParameters_EMSLoc;
if(ledgerEmSysParameters_EMSLoc.Invoicecompany == company)
{
changecompany(company)
{
companyNameLoc.Name = name;
companyNameLoc.insert();
}
}
}
}
in the above code am storing it in a table but i need not want to use table. Rather than that i need to use companyInfo table and filter out the records into the lookup.