on 12-08-2004 12:30 AM
Hi,
Does BSP support ITAB (with header line)? If NO, then how can the data be appended to ITAB with LOOP AT in the event handler?
Is there any equivalent component for ITAB in BSP?
Thank you
arun
As far as possible avoid Internal table with Header lines. Since a lot of object oriented technology is used in BSP.
I suggest you use the following methodology:
TYPES: begin of ty_mytype
myfirstfield type myfirstdatatype,
mysecndfield type mysecnddatatype,
end of ty_mytpe.
For workarea,
DATA: wa_myworkarea type ty_mytype.
For internal table,
DATA: lt_myinternaltable type table of ty_mytype.
Field-Symbols,
FIELD-SYMBOLS: <FS> TYPE ty_mytype.
In order to loop at internal table.
LOOP AT lt_myinternaltable to wa_myworkarea.
*** process with wa_myworkarea
ENDLOOP.
or
LOOP AT lt_myinternaltable ASSIGNING <FS>
*** process with <FS>
ENDLOOP.
Regards,
Subramanian V.
P.S. - Habits die hard. Bad Habits die harder.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<b>As far as possible avoid Internal table with Header lines. Since a lot of object oriented technology is used in BSP.</b>
There is no question of avoiding, you simply can't use it in BSPs.
In BSPs if you declare itab with header line
you will get the following syntax error.
<b><i>Tables with headers are no longer supported in the OO context. </i></b>
Regards
Raja
If you want to get really fancy you could use MVC and databind directly into the individual cells in your internal table. If you can get past the bad humor, the following weblog has an example of this:
/people/thomas.jung3/blog/2004/09/24/important-lessons-involving-bsp-model-view-binding-and-a-frozen-burrito
This can be a short cut when you are dealing with a large number of input fields or if the input fields are created dynamically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now let me put my question in different way. I have 10 <htmlb:inputfield> in my page and in my Event handler i want to call a BAPI which will return values for those 10 Input fields. In this case it is an ITAB.
I need to assign First field of ITAB to First inputfield and 10 field of ITAB to 10 inputfield. How do i do that? I cannot assign directly <%= ITAB-field1%>
I tried to use 10 seperate page attribute fields and assign inputfields value as "<% = field1 %>" etc. But in my event handler when i assign ITABS first field to page attributes first field it says "ITAB has no header line"
What is the best way to handle this situation? Is there any better way to do this process.
Thank you
arun
Message was edited by: Arun Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai arun,
I am also new to BSP, But i have good friends like subramaniyan,creg..etc.
try this,
first capture values into internal table...
and now you have 10 input fields and each one has id.and only one record can place into input fields at a time.
now READ TABLE ITAB INDEX 1 (assume this)
and pass values to all input fields
input1 = <%=itab-val1%>
input2 = <%=itab-val2%>
---
-
-
like wise.
try this, it will work
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.