SAO PAULO, Aug 13 (Reuters) - Food company BRF SA , which processes poultry and pork and makes most of its sales in home market Brazil, struggled to pass on higher grain costs to product prices in the second quarter, Chief Executive Lorival Luz told analysts.

BRF on Thursday reported a net loss of 240 million reais ($46 million), driven by higher feed costs and financial expenses. The company's shares fell by as much 3.5% but pared losses to 0.59% around midday.

The world's largest chicken exporter pointed to high product inventories in certain markets as a reason for not being able to raise prices in its home market, citing Japan's chicken stocks specifically.

As global meat inventories drop, BRF hopes to adjust prices and recover some of the margins lost in coming quarters.

"The adverse environment from the point of view of cost structure affected all companies in the sector," CEO Luz said.

Luz said the rise in grain costs was unprecedented, recognizing that it affected some markets more than others.

In the United States, for example, food companies were able to pass on high costs to prices more quickly, but that was not the case in Brazil.

BRF has plants in Brazil and in the Middle East, and calls itself a leading global halal food supplier.

In a call with journalists, Luz reiterated plans to set up production facilities in at least one country in North America, Europe or even in China, but provided no timeline for it.

Chief Financial Officer Carlos de Moura said a rise in diesel prices also raised costs in Brazil, as the company faced higher freight costs.

BRF also said the pandemic hampered its financial performance in certain markets, with vaccination likely providing a silver lining.

Rival JBS reported a 4.38 billion real ($834.19 million) gain in the second quarter, almost 30% higher than in the same period a year ago, partly driven by its U.S. meat business. ($1 = 5.2506 reais) (Reporting by Ana Mano; editing by Jane Merriman and Jonathan Oatis)