Dynamic itab creation
Hi friends,
Have run into to trouble trying to create a dynamic structure as follows
"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"
The dates are created dynamically with regard to the time period entered in the select options.
The first 2 fields("Material","Land" and the last field "TotalCount") will always be there.The date fields have to change according to the dates entered.
The code Iam attaching is a compilable code with which Iam trying for this purpose.
Would be helpful and I would really appreciate it if someone could change the code I attached and show it how it works....
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code, butr search before posting - locked
The code gives a dump at the call
"CALL METHOD cl_alv_table_create=>create_dynamic_table"
Please advice what iam doing wrong.
->If the dynamic itab is created ,how to fill it with values.
For example.- I want to access specifically the field names like itab-dez.09 or itab-Feb.10 to put values in it.Is it possible?
->If I write this itab using "Write" statement - Will the field names be written
For example - the following field names.
"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"
Thanks
P
Edited by: pazzuzu on Mar 16, 2010 1:43 PM
Edited by: pazzuzu on Mar 16, 2010 1:44 PM
Edited by: pazzuzu on Mar 16, 2010 1:44 PM
Edited by: pazzuzu on Mar 16, 2010 1:45 PM
Edited by: Rob Burbank on Mar 16, 2010 9:14 AM
Edited by: kk.adhvaryu on Mar 16, 2010 1:54 PM
Similar Messages
-
Excel Upload and moving the data to dynamic itab
Hi Folks,
I am building a fieldcatalog dynamically based on the table name and then creating a dynamic internal table based on the fieldcatalog.Now I have a excel sheet having the fields in the same structure as the fieldcatalog that I built.I want to upload the data in the excel to an internal table having the structure of the fieldcatalog I built.I am having a problem in moving the data from the excel to the itab (dynamic itab built based on the fieldcatalog)
1.Building the fieldcatalog.
data:gt_fieldcat TYPE lvc_t_fcat.
ls_fieldcat-tabname = p_tabname.
ls_fieldcat-fieldname = p_fieldname.
ls_fieldcat-inttype = 'C'.
ls_fieldcat-outputlen = wa_dfies-outputlen.
ls_fieldcat-coltext = wa_dfies-fieldtext.
APPEND: ls_fieldcat TO gt_fieldcat.
CLEAR : ls_fieldcat.
2.Building the dynamic itab
DATA:gp_table TYPE REF TO data.
FIELD-SYMBOLS: <gt_table> TYPE table,
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
ep_table = gp_table.
ASSIGN gp_table->* TO <gt_table>.
3.Now I have an excel with a similar structure with data.Uploading the excel data into itab.
DATA: g_t_xltab TYPE STANDARD TABLE OF ty_xltab,
it_rawdata TYPE truxs_t_text_data,
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_rawdata
i_filename = xls_filename
TABLES
i_tab_converted_data = g_t_xltab[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Endif.
*Move the data that got uploaded from excel into
*respective internal tables.
LOOP AT g_t_xltab
here I want move the data into an internal table having the structure I built using
the fieldcatalog/dynamic itab ie <gt_table>.
Endloop.
I tried using ASSIGN COMPONENT sy-index of <gt_table> and move-corresponding but in vain as I am not that much familiar with dynamic itab using field symbols.Kindly let me know how the excel data can be moved to dynamic itab.
Thanks,
K.Kiran.Hi,
you can try some logic like this. Please note this is just an example
TYPE-POOLS:truxs.
TYPES:BEGIN OF ty_xltab,
field TYPE string,
END OF ty_xltab.
DATA:wa TYPE ty_xltab.
DATA:lv_len TYPE i.
DATA:startpos TYPE i.
FIELD-SYMBOLS:<fs_line> TYPE mara.
FIELD-SYMBOLS:<fs> TYPE ANY.
DATA: g_t_xltab TYPE STANDARD TABLE OF ty_xltab,
it_rawdata TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_rawdata
i_filename = ' '
TABLES
i_tab_converted_data = g_t_xltab[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
startpos = 0.
LOOP AT g_t_xltab INTO wa.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_line> TO <fs>.
IF sy-subrc = 0.
DESCRIBE FIELD <fs> OUTPUT-LENGTH lv_len.
IF lv_len > 0.
<fs> = wa-field+startpos(lv_len).
startpos = startpos + lv_len.
ENDIF.
ELSE.
append <fs_line> to <fs_tab>.
EXIT.
ENDIF.
ENDDO.
ENDLOOP.
Sorry my answer is not for you requirement..Please Ignore.
Your solution can be easily solved by looking at the concept Assign component . Please search
Edited by: Keshav.T on Nov 7, 2011 1:42 PM -
How to add a checkbox to dynamic itab so that i can select some records
How to add a checkbox to dynamic itab so that i can select some records in the alv and can display them in another alv using a button
I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)Hi,
I tried and finally i got it , Just try for it.
type-pools : slis.
PARAMETERS : p_tab type dd02l-tabname.
data : ref_tabletype type REF TO cl_abap_tabledescr,
ref_rowtype TYPE REF TO cl_abap_structdescr.
field-symbols : <lt_table> type standard TABLE ,
<fwa> type any,
<field> type abap_compdescr.
data : lt_fcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat,
lt_fldcat type SLIS_T_FIELDCAT_ALV,
ls_fldcat like line of lt_fldcat.
data : ref_data type REF TO data,
ref_wa type ref to data.
ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
TRY.
CALL METHOD cl_abap_tabledescr=>create
EXPORTING
p_line_type = ref_rowtype
receiving
p_result = ref_tabletype.
CATCH cx_sy_table_creation .
write : / 'Object Not Found'.
ENDTRY.
*creating object.
create data ref_data type handle ref_tabletype.
create data ref_wa type handle ref_rowtype.
*value assignment.
ASSIGN ref_data->* to <lt_table>.
assign ref_wa->* to <fwa>.
loop at ref_rowtype->components ASSIGNING <field>.
ls_fcat-fieldname = <field>-name.
ls_fcat-ref_table = p_tab.
append ls_fcat to lt_fcat.
if lt_fldcat[] is INITIAL.
ls_fldcat-fieldname = 'CHECKBOX'.
ls_fldcat-checkbox = 'X'.
ls_fldcat-edit = 'X'.
ls_fldcat-seltext_m = 'Checkbox'.
append ls_fldcat to lt_fldcat.
endif.
clear ls_fldcat.
ls_fldcat-fieldname = <field>-name.
ls_fldcat-ref_tabname = p_tab.
append ls_fldcat to lt_fldcat.
endloop.
loop at lt_fldcat into ls_fldcat.
if sy-tabix = 1.
ls_fldcat-checkbox = 'X'.
ls_fldcat-edit = 'X'.
modify lt_fldcat FROM ls_fldcat
TRANSPORTING checkbox edit.
endif.
endloop.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fcat[]
IMPORTING
ep_table = ref_data.
assign ref_data->* to <lt_table>.
select * FROM (p_tab) into table <lt_table>.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = lt_fldcat[]
TABLES
t_outtab = <lt_table>.
Thanks & Regards,
Raghunadh .K -
How to MODIFY a dynamic ITAB...
Hi!!!
I wants to modify a dynamic itab in a Z-programme which takes inputs. But I can not use the normal itab modifying syntax for it. Therefore I needs to find out a way to modify this itab and it is really essential for my programme.
Please help me on this...
Thanking You,
Yohan.Thanks for the prompt replies.
Dear Amit,
I have already done the things mention in the link you sent me. This is ok for when I loop the dynamic itab step by step. So it will modify the itab, line by line. But, what I wants to do is modify an itab field which have the same key in multiple lines.
For an example say in my structure I have material #. I wants to update all the rows of column 'material description' which have the same material #.
This is where I have stucked...
Please help me...
Thanking you,
Yohan. -
Dynamic Table Creation & Fill Up
Hello,
Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
All programmatic.
Using JSF, ADF BC
JDeveloper 10.1.3.1
Thanks
Message was edited by:
RJundiHi,
Meybe this article helps: http://technology.amis.nl/blog/?p=2306
Kuba -
Hi friends,
Have run into to trouble trying to create a dynamic structure as follows
"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"
The dates are created dynamically with regard to the time period entered in the select options.
The first 2 fields("Material","Land" and the last field "TotalCount") will always be there.The date fields have to change according to the dates entered.
Runtime error - "Load_PROGRAM_NOT_FOUND"
Exception - CX_SY_PROGRAM_NOT_FOUND
on calling
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
Have filled by field catalog as follows:
xfc-fieldname = 'Material'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.
xfc-fieldname = 'Opco'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.
LOOP AT gt_monthcalc INTO gs_monthcalc.
xfc-fieldname = gs_monthcalc-month.
xfc-datatype = 'CHAR'.
xfc-intlen = '10'.
APPEND xfc TO ifc.
CLEAR xfc.
ENDLOOP.
xfc-fieldname = 'Totalcount'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.
Please advice what iam doing wrong.
->If the dynamic itab is created ,how to fill it with values.
For example.- I want to access specifically the field names like itab-dez.09 or itab-Feb.10 to put values in it.Is it possible?
->If I write this itab using "Write" statement - Will the field names be written
For example - the following field names.
"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"
Thanks
PHi
I thought my sample was clear:
The "GT_MONTHCALC" itab we dont need anymore,as It was used only to fill in the fieldcatalog with months.
If I rember a your requisition is to create the name of the month concatening the short name and the year, something like this:
NOV09 DEC09 GEN10 FEB10 MAR10 APR10 ..........
In this case the fieldname of month of your dynamic table doesn't corrispond to value in gs_tab-month as here you have stored the short name of the month only.
I suppose if gs_tab-month is nov, the quantity has to move in the field called NOV09, if it's so it needs to get a link in order to know the real name of the moth field of dynamic table.
This link can be in GT_MONTHCALC only, because you've used it to create dynamic table.
Now I've create a routine to transfer the value from GS_TAN to <FS_WA>:
FORM MOVE_VALUE USING P_FIELD
P_VALUE.
ASSIGN COMPONENT P_FIELD OF STRUCTURE <FS_WA> TO <FS_VAL>.
MOVE P_VALUE TO <FS_VAL>.
ENDFORM.
P_FIELD is the name of dynamic table field
P_VALUE is the value to be transfered
Now I want to
copy the contents of the field "matnummer" to "mat" in fS_itab
copy the contents of the field "soldto" to "OPCO" in fS_itab
This requirement is easy because the name of the dynamic table are constant:
loop gt_tab into gs_tab.
CLEAR <FS_WA>.
* Move material code
PERFORM MOVE_VALUE USING 'MAT' GS_TAB-MATNUMMER.
* Move soldto
PERFORM MOVE_VALUE USING 'OPCO' GS_TAB-SOLDTO.
copy the contents of the field "dqty" to "NOV" in fS_itab
In this case you need to move the value to FS_ITAB-NOV09, so:
Found the name of dynamic table:
TRANSLATE FS_ITAB-MONTH TO UPPER CASE.
LOOP AT GT_MONTHCALC INTO GS_MONTHCALC.
IF GS_MONTHCALC-MONTH(3) = FS_ITAB-MONTH.
* I found the right name
EXIT.
ENDIF.
ENDLOOP.
* Move qty
PERFORM MOVE_VALUE USING GS_MONTHCALC-MONTH GS_TAB-DQTY.
I hope it's clear now
Max -
EASY General Class for structure of ITAB / dynamic ITAB / FCAT
Hi Guys.
Seeing all the convoluted posts about Dynamic ITABS, getting the structure of ANY ITAB (whether or not it's in the dictionary) building Dynamic FCATS etc. I'm actually very puzzled as the whole concept is CHILDISHLY SIMPLE.
If you model this code here then you can use this for ANY ITAB, DYNAMIC TABLE and FCAT you care to name and it's only a few lines of code.
The bits you can use in almost any program are shown <b>in BOLD</b>
Program ZGENTABCREATE.
<b>FIELD-SYMBOLS :
<fs1> type any,
<fs2> type standard table,
<dyn_table> type standard table,</b>
<dyn_field>,
<dyn_wa>.
<b>CLASS zcl_dog DEFINITION.
PUBLIC SECTION.
METHODS:
return_structure, "returns structure of ANY table
create_dynamic_fcat "Create dynamic FCAT
EXPORTING it_fldcat TYPE lvc_t_fcat.
PRIVATE SECTION.
DATA:
lr_rtti_struc TYPE REF TO cl_abap_structdescr, "RTTI
zog LIKE LINE OF lr_rtti_struc->components, "RTTI
wa_it_fldcat TYPE lvc_s_fcat.
TYPES: struc like zog.
DATA: : zogt type table of struc.
ENDCLASS.
CLASS zcl_dog IMPLEMENTATION.
METHOD return_structure.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( <fs1> ).
zogt[] = lr_rtti_struc->components.
assign zogt[] to <fs2>.
ENDMETHOD.
METHOD create_dynamic_fcat.
LOOP AT <fs2> INTO zog.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = zog-name .
wa_it_fldcat-datatype = zog-type_kind.
wa_it_fldcat-inttype = zog-type_kind.
wa_it_fldcat-intlen = zog-length.
wa_it_fldcat-decimals = zog-decimals.
wa_it_fldcat-coltext = zog-name.
wa_it_fldcat-lowercase = 'X'.
APPEND wa_it_fldcat TO it_fldcat .
ENDLOOP.
ENDMETHOD.
ENDCLASS.</b>
start of program data to demo use of above class ****
INCLUDE <icon>.
TABLES : kna1.
TYPES: BEGIN OF s_elements, "Any old ITAB define structure
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
stras TYPE kna1-stras,
telf1 TYPE kna1-telf1,
ort01 TYPE kna1-ort01,
pstlz TYPE kna1-pstlz,
END OF s_elements.
DATA: <b>z_object type ref to zcl_dog, "Instantiate our class
t_elements TYPE TABLE OF s_elements, "refers to our ITAB
wa_elements TYPE s_elements, "Structure definition
wa_dyn_table_line TYPE REF TO DATA,
it_fldcat TYPE lvc_t_fcat,</b>
dy_table TYPE REF TO data,
start-of-selection.
<b>assign wa_elements to <fs1>.
This is IMPORTANT. Your ITAB structure must
be assigned to <fs1> which will be
used in the return_structure method.
The internal structure definition (field-names)
will be returned in <fs2> which is used for
dynamically building the field catalog.
You only need this section to get your
structure build your FCAT
and create the dynamic table
If you want to see the actual structure of
your table or how the FCAT looks
the field_symbols <fs1> and <fs2> have
the data in them.
Get variable structure names.
<b>create object
z_object.
call method z_object->return_structure.
build fcat.
CALL METHOD z_object->create_dynamic_fcat
IMPORTING
it_fldcat = it_fldcat.
build dynamic table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fldcat
IMPORTING
ep_table = dy_table.</b>
Now fill and display it
You can use it in a GRID or whatever.</b>
ASSIGN dy_table->* TO <dyn_table>.
Create dynamic work area and assign to FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
fill it
perform populate_dynamic_itab.
end-of-selection.
end of main logic ***************
FORM populate_dynamic_itab.
just read 200 lines as a demo from KNA1
assign dynamic table created to <field symbol>
so you can fill it with data.
SELECT kunnr name1 stras telf1 ort01 pstlz
UP TO 200 rows
FROM KNA1
INTO CORRESPONDING FIELDS OF TABLE <dyn_table>.
LOOP AT <dyn_table> INTO <dyn_wa>.
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE <dyn_wa> TO <dyn_field>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-index = 1.
WRITE:/ <dyn_field>.
ELSE.
WRITE: <dyn_field>.
ENDIF.
ENDDO.
ENDLOOP.
ENDFORM.
********************END OF CODE***********
Now NOBODY should have any probs with this stuff.
Simple isn't it.
Cheers
and have fun.
JimboHi Shinjan,
One of the ways to achieve this is by creating ranges. Try this code,
TABLES: dbtab2.
FIELD-SYMBOLS: <l_line> TYPE ANY,
<l_field> TYPE ANY.
DATA: new_line TYPE REF TO data.
RANGES: r_f1 FOR dbtab2-f1. "Create ranges for the particular field say f1
"Creating work area for your dynamic int table
CREATE DATA new_line LIKE LINE OF <fs_itab>.
ASSIGN new_line->* TO <l_line> .
LOOP AT <fs_itab> ASSIGNING <l_line>.
ASSIGN COMPONENT 'F1' OF STRUCTURE <l_line> TO <l_field>. "Now <l_field> contains the value
"Append the range from the values in dynamic tab
r_f1-sign = 'I'.
r_f1-option = 'EQ'.
r_f1-low = <l_field>.
APPEND r_f1.
ENDLOOP.
SELECT *
FROM dbtab2
INTO t_dbtab2
WHERE f1 IN r_f1. "write the select query using the ranges
Hope this helps you.
Regards,
Manoj Kumar P -
Does Seeburger's SFTP adapter support dynamic filename creation
Hi all,
Does the SFTP adapter support dynamic filename creation.
If yes, then do we have to use UDF's and are there any specific settings that have to be done in the SFTP communication channel.
Please provide a blog which helps in the configuration process of the above case.
thanks,
younusDynamic Creation of File using counter in Seeburger Variable:
1. Configuration Needed in the Communication Channel:
The process of dynamic creation of files can be done we have to select the following checkbox in the receiver channel:
Dynamic Attribute in receiver Channel:
Import the following modules:
Localejbs/Seeburger/solution/sftp
Localejbs/Seeburger/AttribMapper
Localejbs/ModuleProcessorExitBean
Enter the desired file naming convention:
Use the Parameter GetCounter("ID") to the place where the counter is expected to come.
2. Configuration Needed in the SeeBurger Workbench:
If the J2EE server is listening on a port different from 50000 (which is the standard for the SAP client 000), the port number must be configured:
Login into the seeburger workbench using the URL
http://<localhost>:<port number>/seeburger/index.html
Select Property Store.
Create or edit the following property:
Parameter
Value
Namespace
http://seeburger.com/xi/SeeFunctions
Key
provider.servlet.server
Value
http://localhost:50000/ (where the port number 50000 must be set
accordingly to the J2EE server configuration).
Note: The configured value (server URL) has to end with a slash (/). Otherwise,
SeeFunctions will not work correctly.
If we need to start the counter from any specific value , it can be configured in the SeeBurger workbench, this value can be maintained in Mapping Variables : -
Dynamic itab with Dynamic Where clause
Hi, Dear All,
Can someone provide a code extract for Dynamic where clause, i had already done with dynamic itab for a given set of fields, and i need to add where clause dynamically for a given field for a given range of values.
select (i_fields) into table <dyn_table>
from (p_table)
where (v_where).
In the above except the where clause, everything is done. Please help me.
with best regards
MaheshHi,
here is the code extract for your reference.Pl. correct me.
with regards
REPORT Z_DYN_ITAB .
TYPE-POOLS: SLIS.
DATA:NAME(100) TYPE C.
TYPES: BEGIN OF ITAB_TYPE,
WORD(20),
END OF ITAB_TYPE.
DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH HEADER LINE.
DATA: vg_fields(255) TYPE c,
i_fields LIKE TABLE OF vg_fields.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
is_fcat LIKE LINE OF it_fcat,
ls_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE lvc_t_fcat,
is_fieldcat LIKE LINE OF it_fieldcat.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data.
data: dy_line type ref to data,
xfc type lvc_s_fcat.
DATA: v_where TYPE string, " Variable for storing where clause.
v_dynamic(18) TYPE c, "variable to store select option datatype
o_field TYPE REF TO cx_root," object to catch exception
text TYPE string. "string variable to store exception text.
CONSTANTS: c_var(15) TYPE c VALUE ' IN S_RANGE'.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001',
p_name(100) type c,
p_field(10) TYPE c. " Parameter to capture field name.
SELECT-OPTIONS: s_range FOR v_dynamic. " Select-option for range.
selection-screen end of block b1.
start-of-selection.
NAME = p_name.
SPLIT NAME AT ',' INTO TABLE ITAB.
LOOP AT ITAB.
is_fcat-fieldname = itab-word.
is_fcat-tabname = p_table.
APPEND is_fcat to it_fcat.
ENDLOOP.
LOOP AT it_fcat INTO is_fcat.
is_fieldcat-fieldname = is_fcat-fieldname.
is_fieldcat-tabname = is_fcat-tabname.
APPEND is_fieldcat TO it_fieldcat.
CONCATENATE is_fieldcat-tabname is_fieldcat-fieldname INTO
vg_fields SEPARATED BY '~'.
APPEND vg_fields TO i_fields.
ENDLOOP.
perform create_dynamic_itab.
perform get_data.
Create dynamic internal table and assign to FS
form create_dynamic_itab.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fieldcat
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
form get_data.
Select Data from table.
CONCATENATE p_field c_var INTO v_where.
TRY.
select (i_fields) into table <dyn_table>
from (p_table)
where (v_where).
if sy-dbcnt = 0.
write : text-t02.
endif.
*Write out data from table.
Loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Exception Catching.
CATCH cx_root INTO o_field.
text = o_field->get_text( ).
Calling Function to give information message regarding Exception
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-t03
txt1 = text
txt2 = text-t04.
TXT3 = ' '
TXT4 = ' '
LEAVE TO LIST-PROCESSING.
ENDTRY.
endform. -
Does UCM support dynamic page creation on contributor mode.?
Hi All,
Does UCM support dynamic page creation on contributor mode.
We want to create new pages and link it into the existing pages
is that possible?
Thanks
~HariYou can create new secondary pages in contributor mode - you would normally do this via a dynamic list fragment though technically you could also achieve it by switching region content and creating new data files. You can then use the linz wizard to link between pages.
If you are talking about creating new primary pages and sections in your site then you would need to use something like Site Studio Manager fragment.
Tim -
RE: dynamic widget creation
This is a good tech note about this on the Forte website.
-----Original Message-----
From: Matthew Middleton [SMTP:[email protected]]
Sent: Friday, 25 June 1999 11:11
To: [email protected]
Subject: dynamic widget creation
I have done a few windows with dynamic widget creation. Sometimes it
seems I have to have done self.Open before, to get things to appear
properly, and sometimes not.
What I would like is a summation of the issues involved here so I can
write such code without resorting to trial and error.
with advance appreciation,
Matthew
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive
<URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Tech Note 5156, which I have attached for your information.
-----Original Message-----
From: Foster, Todd [SMTP:[email protected]]
Sent: Saturday, 26 June 1999 1:27
To: 'Jason de Cean'
Subject: RE: dynamic widget creation
? What technote ?
-----Original Message-----
From: Jason de Cean [SMTP:[email protected]]
Sent: Thursday, June 24, 1999 9:19 PM
To: 'Matthew Middleton'
Cc: 'Forte Users'
Subject: RE: dynamic widget creation
This is a good tech note about this on the Forte website.
-----Original Message-----
From: Matthew Middleton [SMTP:[email protected]]
Sent: Friday, 25 June 1999 11:11
To: [email protected]
Subject: dynamic widget creation
I have done a few windows with dynamic widget creation. Sometimes
it
seems I have to have done self.Open before, to get things toappear
properly, and sometimes not.
What I would like is a summation of the issues involved here so Ican
write such code without resorting to trial and error.
with advance appreciation,
Matthew
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive
<URL:http://pinehurst.sageit.com/listarchive/>-
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/> -
Dynamic Event Creation and Handling the events
Hi All
I am using WAS 6.4.
I have two components say Component A and Component B in which Component A is a reusable component and is used by other components say for e.g the Component B.
The following is the requirement.
Component A should create buttons for other components dynamically.
As an example, Component B specifies to Component A the buttons required say button B1 and button B2.
Component B also contains methods M1 and M2 for the buttons created by the component A.
Now I would like to associate these buttons created by component A with the methods created in Component B
The number of buttons that are to be created may vary from component to component.
If any one as any suggestion or solution, help me out.
Thanks
Regards
NagaKishoreHi NagaKishore,
I'm not exactly sure why you want to do this, but it is pretty easy if I switch it up a bit. (Maybe you are trying to create a navigation page or something?)
Instead of your component B using component A, if you define a Web Dynpro interface in component A, then implement this interface in component B (or all component Bs), achieving your goal would not be too difficult. It could define a generic method (or event) with a "button key" as an argument that would tell component B which button was pressed and allow it to behave as desired. The Web Dynpro interface defined in A could also have an interface context that would allow the the button text to be passed along with (for the sake of simplicity) a "button key" that component that should be triggered when the button is pressed. (Note this could be a varying size list as required.)
The component B(s) need not be known until run-time. They can be created using something like:
wdThis.wdGet<Used Compontne Name>ComponentUsage().createComponent(<Component Name>,<Object Name (if in a different component)>)
Once the component is created, the context can be accessed giving the list of buttons to create and the values. The buttons can be created in the wdModifyView during the first pass of the creation of the view displaying the buttons (after the dynamic creation of the used components which can occur in the wdDoInit of the component controller).
If the user presses a chosen button on component A, then the generic method (most likely an event) of component Bs interface is called and passed the "button key", component B then takes over. Note this would also work if component B had a visualization component that must be displayed through an interface view that is defined on the web dynpro component interface that is implemented by B.
Hope this helps or at least triggers discussion that will answer your question,
--Greg -
Dynamic ITAB in function module parameter
Hi
How to define in FM dynamic internal table returning some values in.
For example I want to call FM with any internal table structure and FM must return fill in ITAB.I got it.
I added type standard table to parameter. -
Dynamic ITAB copy problem with field type P
Hello everyone
I need to copy the structure of an internal table that is pass by reference into a method.
Actually everything is fine else than the field type P with decimal is not created properly in the new itab.
Scenario:
An internal table is pass by reference to a method. We need to trait the data without modifying the original table. The Idea is to copy the structure and the data of the referenced internal table into an internal table created dymanically in the method.
Here is what I did and working fine when there are no field of data type "CURR".
Extract the structure of the reference data.
Create a dynamic internal table.
So far so good. Everything seams to work fine. BUT
when I am trying to copy the data from the reference table to the just created internal table the field with data type "CURR" doesn't work.
Here is my example:
FIELD-SYMBOLS: <FS_TABLE> TYPE STANDARD TABLE,
<TMP_TABLE> TYPE STANDARD TABLE,
<LS_TMP_TABLE> TYPE ANY,
<LS_TABLE> TYPE ANY,
<LS_VALUE> TYPE ANY.
DATA: lt_data TYPE STANDARD TABLE OF vbak,
ls_data LIKE LINE OF lt_sortfield,
ref_data TYPE REF TO data,
l_structure TYPE REF TO DATA,
lv_ltname TYPE string.
select * from vbak UP TO 10 rows INTO CORRESPONDING FIELDS OF TABLE lt_data.
* --- Assign the reference variable to the table
* ---- Only use to simulate a parameter that is assign to a reference to a internal table
unassign <FS_TABLE>.
lv_ltname = 'lt_data[]'.
ASSIGN (lv_ltname) to <FS_TABLE>.
GET REFERENCE OF <FS_TABLE>[] INTO ref_data.
* --- Assign the reference to the field-symbol
UNASSIGN <FS_TABLE>.
ASSIGN ref_data->* TO <FS_TABLE>.
* --- Create a working area for the reference table to a field-table
CREATE DATA l_structure LIKE LINE OF <FS_TABLE>.
ASSIGN l_structure->* TO <LS_TABLE>.
* --- Retrieve the structure of the field-symbol pointing to the internal table
DATA: lr_tabledescr TYPE REF TO cl_abap_tabledescr, " Internal Table description
_r_structdescr TYPE REF TO cl_abap_structdescr.
lr_tabledescr ?= cl_abap_tabledescr=>describe_by_data( <fs_table> ).
_r_structdescr ?= lr_tabledescr->get_table_line_type( ).
* --- Read internal table structure to create dynamic internal table
data: ls_struc like LINE OF _r_structdescr->components,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
* --- Why the field (component) NETWR length is now 8 instead of 15?
LOOP AT _r_structdescr->components into ls_struc.
clear xfc.
xfc-fieldname = ls_struc-name .
xfc-datatype = ls_struc-type_kind.
xfc-inttype = ls_struc-type_kind.
xfc-intlen = ls_struc-length.
xfc-decimals = ls_struc-decimals.
append xfc to ifc.
ENDLOOP.
DATA: dy_table type ref to data,
* --- Create dynamic internal table
call method cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
* --- assign reference internal table to Field-symbol
assign dy_table->* to <tmp_table>.
unassign <ls_tmp_table>.
DATA: ls_tmp_struc type REF TO DATA.
CREATE DATA ls_tmp_struc like LINE OF <tmp_table>.
ASSIGN ls_tmp_struc->* TO <ls_tmp_table>.
Loop at <fs_table> INTO <LS_TABLE>.
MOVE-CORRESPONDING <ls_table> TO <ls_tmp_table>.
APPEND <ls_tmp_table> TO <tmp_table>.
ENDLOOP.
* <fs_table>-netwr length is 15
* <ls_tmp_table>-netwr length is 8
* ??????????? Why the length is different?
* ??????????? It should a structure copy and have the
* ??????????? same length
I use VBAK as example, and the field NETWR is using data type "NETWR_AK" where it us a data type "CURR" with length 15 and decimal 2.
When reading the structure, the method get_table_line_type of the class cl_abap_tabledescr return a length of 8 instead of 15.
Any idea how to get the exact structure of a variable that is refering to a data type?
Regards
DanielHello Everyone
Thank you for your replies.
I think I didn't explain myself clearly.
My goal is to be able to create an exact structure copy of a "Type ref to data" into a new internal table that is not defined yet.
Example:
A method contain a parameter that is a ref to DATA type.
That parameter is refering to an internal table from the calling program.
Now I want to create an internal table into the method where this one will be an exact structure copy of the parameter.
So, lets put some name here.
parameter: ip_data type ref to data.
FIELD-SYMBOLS: <FS_REF_DATA> TYPE STANDARD TABLE,
<FS_CP_DATA> TYPE STANDARD TABLE.
ASSIGN ip_data->* TO <FS_REF_DATA>.
" some code to assign the same structure to <FS_CP_DATA> from <FS_REF_DATA>
" than copy the data from <FS_REF_DATA> to <FS_CP_DATA>.
<FS_CP_DATA> [ ] = <FS_REF_DATA> [ ]. " This is working if no type P with decimal exist into the structure
" Than I can play with the data of <FS_CP_DATA> without modifying the data of <FS_REF_DATA>.
My problem would be solved if I can create dynamically an internal table that has an exact structure copy of the passed parameter.
Regards
Daniel -
Dynamic Type creation: structure
Hey,
I made a dynamic table and now I want to loop this table.
But I can't seem to make a structure to use in the loop.
I get the error 'data object has no structure'.
This is what I already have.
data: linetype type ref to cl_abap_structdescr,
tabletype type ref to cl_abap_tabledescr,
lt_comp type cl_abap_structdescr=>component_table,
lr_table type ref to data,
lr_line type ref to data.
field-symbols: <lt_data> type table,
<ls_data> type any.
...first I fill lt_comp ...
linetype = cl_abap_structdescr=>create( lt_comp ).
tabletype = cl_abap_tabledescr=>create( p_line_type = linetype p_table_kind = 'S' ).
create data lr_table type handle tabletype.
assign lr_table->* to <lt_data> casting type handle tabletype.
create data lr_line like line of <lt_data>.
assign lr_line->* to <ls_data> casting type handle linetype.
... filling the table <lt_data> ....
loop at lt_data assigning <ls_data>.
... when I try to access a field of <ls_data>, I get the error '<ls_data> is no structure'.
endloop.Hello Steven
If you are going for dynamic programming then you have to use "the full monty" meaning field-symbols for:
- itab
- structure AND
- fields
FIELD-SYMBOLS:
<ld_fld> TYPE any.
LOOP AT <lt_data> ASSIGNING <ls_data>.
UNASSIGN <ld_fld>.
ASSIGN COMPONENT '<name of field OR sy-index>' OF STRUCTURE <ls_data>
TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
" do something...
ENDIF.
ENDLOOP.
Regards,
Uwe
Maybe you are looking for
-
Pick up the input file if delta betweeb two files is 30%
Hi Experts, A file is placed at the source folder..will it be possible for XI to check if previous file exists in that folder.. If yes then if th diffrence between both fields is greater than 30 % then pick up the file??? I do not see any which way i
-
Persistent​ly lock function keys!?
Hello, I would like to persistently lock the function keys at my E531 laptop. I know you can switch between function keys and multimedia functions by setting FnLock (Fn+ESC), but unfortunately this setting is volatile: everytime I restart the system
-
Doubt in Paint Oracle Example with red numbers
Hi experts, I have a virtual machine with the ORACLE BIEE and I'm taking a look the PAINT example. In the third dashboard page called Year over Year Analysis, there is a Pivot table with different rows and columns. I just want to know how I'm looking
-
Where the smart forms stored in Package
Hi, Where the Smart forms are stored in package, In package only following option is there, 1.Dictionary Object. 2.Programs, 3.Includes, 4.Transactions, 5.Message class.
-
My hard drive recently went bad and files were not recoverable. My most recent downloads were not backed up and some of them were my ringtones. How can I get those ringtones back without having to purchase them again? Thanks in advance for any help o