My answer would look a little ridiculous, but I don't see why it is going to be any different in a BSP Layout. So if you can expand or let us know more about the problem, perhaps a better solution can be put forth(or someone here can teach me something new).
Just use the <% %> for your ABAP code and you can write the same ABAP code which you wrote in the event handler.
And at the same time do not forget to put the page attribute at the top mentioning abap.
If you have any issues with the dynamic table, perhaps you might look into this weblog:
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
Regards,
Subramanian V.
Message was edited by: Subramanian Venkateswaran(Just had to add that last line 😉
I explain it more clearly.
I want to migrate some report in ABAP to BSP. The ABAP report will output many kinds of internal table into cluster table. I try to export the fieldcategory and internal table from cluster table and put it on BSP page by using field-symbols. But any variable used in layout must be declared in page attribute. But it's impossible to delcare field-symbols in page attribute.
-
Sample Code----
TYPE-POOLS slis.
FIELD-SYMBOLS: <in_table> TYPE TABLE.
DATA: called_from TYPE SY-REPID,
called_screen TYPE SY-DYNNR,
called_uuid(22) TYPE C,
called_data(1) TYPE C,
timestamp TYPE BALTIMSTMP,
gt_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF gt_fieldcat.
DATA: field_category TYPE lvc_t_fcat,
wa_field_category LIKE LINE OF field_Category.
DATA: POINTER TYPE REF TO DATA.
GET TIME STAMP FIELD timestamp.
WRITE timestamp TO called_uuid.
called_from = SY-REPID.
called_data = 'X'.
called_screen = 500.
EXPORT called_from FROM called_from
called_screen FROM called_screen
called_uuid FROM called_uuid
called_data FROM called_data
TO MEMORY ID 'YQMDMSCLAIM01'.
SUBMIT YQMDMSCLAIM USING SELECTION-SET '100TEST'
AND RETURN.
IMPORT field_category TO field_category
FROM DATABASE INDX(QM) ID called_uuid.
*Create a table dynamically
CALL FUNCTION 'Y_CREATE_TABLE'
EXPORTING rt_fieldcat = field_category
IMPORTING pointer = pointer.
*Import from cluster table
CALL FUNCTION 'Y_IMPORT_TABLE_FROM_CLUSTER'
EXPORTING
rt_fieldcat = field_category
area = 'QM'
called_uuid = called_uuid
IMPORTING
pointer = pointer.
ASSIGN pointer->* TO <in_table>.
Message was edited by: Paul Lee
Add a comment