cancel
Showing results for 
Search instead for 
Did you mean: 

ASP.Net Web App

Former Member
0 Kudos

Hi Reiner,

I am trying to create a Web App (yes i have moved on from my web service!!..exploring more..) and incorporated my proxy for my BAPI using NCo 2.0.

I am puzzled i have been trying to create a document but required to insert line items. So, I decided to take the web-friendly approach and create a button where i will call the 2nd Web form using the <b><i>Response.Redirect("WFrmCreateItem.aspx")</i></b> command. As you know with SAP table structures, I have declared a <b><i>Dim tblXXXItems As New BAPIXXXTable</i></b> in globally in my first form. I know want to pass this table into the 2nd form for me to add items to the BAPIXXXTable which is required when i call the BAPI.

What is the best approach in designing a Header-Item WebApp?

Thanks in advance...

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

As ASP.NET is normally stateless, you need a place to store objects that survive round-trips. Typical way is to store the table in session state:

Sessione.Item("MyTable") = tblXXXItems;

... and on the othe page:

Dim tblXXXItems As BAPIXXXTable

tblXXXItems = CType(Sessione.Item("MyTable"), BAPIXXXTable)

Former Member
0 Kudos

Yes, i have tried that but somehow it does not really work.

on the 2nd page when i press the button:..

i try adding the items to the table via the structure which has been declared as:

Dim strXXXItems As BAPIXXX

strXXXItems.Item = text1.text

strXXXItems.Doc_Date = text2.text

...

tblXXXItems.Add(strXXXItems)

-


I get an error - Object reference not set to an instance of an object.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 61: strXXXItems.Orderpr_Un = 1

Line 62: strXXXItems.Tax_Code = txtTaxCode.Text

<b>Line 63: tblXXXItems.Add(strXXXItems)</b>

-


and do i need to do another Session.Item("MyTable") = tblXXXItems; on the 2nd page after that for the first page to receive?

Former Member
0 Kudos

okay i changed the code to:

Dim strXXXItems As <b>New</b> BAPIXXX

strXXXItems.Item = text1.text

strXXXItems.Doc_Date = text2.text

...

tblXXXItems.Add(strXXXItems)

and it runs...

thanks

Answers (0)