Reg:doubt in dynamic generated internal table
hi everyone,
i generated a internal table dynamically,the output is in fied symbol,i want to create a internal table using the field symbol sturture,how to create that????
plz tell me how to create a internal table referencing field symbol structure........
very urgent plz help.........
thanks in advance....
regards,
balaji.s
Hi ,
check out a small part of an alv report which is using dynamic internal table
data: dy_table type ref to data,
dy_line type ref to data.
field-symbols: <dyn_table> type standard table,
<dyn_wa> type any,
<dyn_line> type any.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
CREATE A DYNAMIC WORK AREA.
create data dy_line like line of <dyn_table>.
sort it_mard by matnr werks.
loop at it_mard into wa_mard.
at new matnr.
assign dy_line->* to <dyn_wa>.
assign component 'MATNR' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard-matnr.
read table it_mard2 into wa_mard1 with key matnr = wa_mard-matnr.
v_amount = wa_mard1-v_total * p_unit.
call function 'SPELL_AMOUNT'
exporting
amount = v_amount
currency = 'INR'
FILLER = ' '
language = sy-langu
importing
in_words = v_price
exceptions
not_found = 1
too_large = 2
others = 3
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
assign component 'V_TOTAL' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard1-v_total.
assign component 'V_PRICE' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = v_price-word.
endat.
concatenate 'STOCK' '-' 'IN' '-' wa_mard-werks into v_new.
assign component v_new of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard-labst.
at end of matnr.
append <dyn_wa> to <dyn_table>.
clear wa_mard.
clear <dyn_wa>.
unassign <dyn_line>.
unassign <dyn_wa>.
endat.
endloop.
rewards points if helpful.
Similar Messages
-
Populating values in dynamically generated internal table
Hi,
We can generate internal tables dynamically and also populate them with values from database.But is there any way to populate the dynamically generated internal table(has 2-3 selected fields) with values from another internal table(has all fields required by the program) being populated within the same program?
Thanks & Regards,
SavithaHi
Dynamic internal table is internal table that we create on the fly with flexible column numbers.
For sample code, please look at this code tutorial. Hopefully it can help you
Check this link:
http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
Reward points if useful
Regards
Anji -
How to upload an excel to a dynamically generated internal table?
Hi,
I have an excel sheet. I have to create an internal table dynamically according to the fields of the excel sheet. The internal table i have created successfully, the fields are exactly coming as the excel sheet. I need to upload the excel sheet directly to my Internal table.
Similar to the FM GUI_UPLOAD, which directly uploads the text document into the internal table
I am not able to pass my dynamic internal table to the GUI_UPLOAD, The tables parameter in the GUI_UPLOAD is accepting only the standard tables.
How to do?
-SudheerHi,
Use TEXT_CONVERT_XLS_TO_SAP Function Module.
AWARD POINTS IF USEFUL -
Uploading data from excel file to a dynamically created internal table
Hi,
I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
Could anyone please show me a way around this.
Thanks in advance,
HarshaSure, check this out.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: it_fldcat type lvc_t_fcat,
wa_it_fldcat type lvc_s_fcat.
type-pools : abap.
data: new_table type ref to data,
new_line type ref to data.
data: iflat type table of string.
data: xflat type string.
data: irec type table of string with header line.
data: tabix type sy-tabix.
data: file type string.
selection-screen begin of block b1 with frame title text .
parameters: p_file type rlgrap-filename default 'c:Test.csv'.
parameters: p_flds type i.
selection-screen end of block b1.
start-of-selection.
* Add X number of fields to the dynamic itab cataelog
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'C'.
wa_it_fldcat-inttype = 'C'.
wa_it_fldcat-intlen = 10.
append wa_it_fldcat to it_fldcat .
enddo.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
file = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file
changing
data_tab = iflat
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
loop at iflat into xflat.
clear irec. refresh irec.
split xflat at ',' into table irec.
loop at irec.
tabix = sy-tabix.
assign component tabix of structure <dyn_wa> to <dyn_field>.
<dyn_field> = irec.
endloop.
append <dyn_wa> to <dyn_table>.
endloop.
* 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.
Regards,
Rich Heilman -
Appending column to an dynamically created internal table
Hi folks,
i have an dynamically created internal table <dyn_tab> which is based on a parameter p_table ( containing the table name ). now i want to add one more column to this <dyn_tab> table where i can store further information in. how can i do that ?
i appreciate your help!Hi,
Please check this sample program.
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab.
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
* Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
*Add your new field(s) into table ifc here.
endform.
form create_dynamic_itab.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
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.
Regards,
Ferry Lianto -
How to create dynamic nested internal table
Hi Experts,
Pleae tell me or give sample code, how to create dynamic nested internal table ?
I have seen threads saying creation of dynamic internal tables using some table structure only. But now the requirement is to create dynamic nested internal table.
For example the internal table contains two fields viz., one is field1 of dynamic internal table and other is normal field2 and values as shown below:
Nested internal table:
field1 | field2 ...
<table content1> | value2..
<table content1> | value2..
Here the [table content] should also a dynamic internal table.
Let me know if you need any other info.
regards
Saravanan Rsee the complete code..i am currently working in ECC6.0 EHP4. just check which version you are using..
REPORT yst_test_000.
DATA:
lt_comptab TYPE cl_abap_structdescr=>component_table,
ls_comp LIKE LINE OF lt_comptab,
lref_newstr TYPE REF TO cl_abap_structdescr,
lref_tab_type TYPE REF TO cl_abap_tabledescr,
lt_fcat TYPE lvc_t_fcat,
ls_fcat TYPE lvc_s_fcat,
ls_dd03p TYPE dd03p,
lt_data type ref to data.
field-symbols: <fs_table> type standard table.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SCARR'
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT lt_fcat INTO ls_fcat.
IF ls_fcat-ref_table IS NOT INITIAL.
CLEAR ls_dd03p.
CALL FUNCTION 'BUS_DDFIELD_GET'
EXPORTING
i_tabnm = ls_fcat-ref_table
i_fldnm = ls_fcat-fieldname
IMPORTING
e_dd03p = ls_dd03p
EXCEPTIONS
field_not_found = 1
OTHERS = 2.
IF sy-subrc EQ 0.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_dd03p-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
ENDIF.
ELSE.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
ENDIF.
ENDLOOP.
*Now for the Field which you want deep table then you can do like this
ls_fcat-fieldname = 'NESTED_TABLE'.
ls_fcat-inttype = 'C'.
ls_fcat-intlen = '000006'.
ls_fcat-rollname = 'SFLIGHT_TAB1'. "For SFLIGHT
APPEND ls_fcat TO lt_fcat.
ls_comp-name = ls_fcat-fieldname.
ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
APPEND ls_comp TO lt_comptab.
CLEAR ls_comp.
lref_newstr = cl_abap_structdescr=>create( lt_comptab ).
lref_tab_type = cl_abap_tabledescr=>create( lref_newstr ).
create data lt_data type handle lref_tab_type.
assign lt_data->* to <fs_table>.
break-point.
Edited by: Vijay Babu Dudla on Apr 28, 2009 8:05 AM -
Dynamically changing internal table in 'gui_download'
Hi Experts,
i have to download 4 internal tables, each with different structures, to the presentation server using 'gui_download', based on which radio-button is selected in the selection screen. I am hoping to use a single 'form' and 4 'perform' calls. how can I dynamically change the tables in the 'gui_download' function modules.
plz help.....................Hi ,
Build the field catalog dynamically based on the internal table structure based on the radio button selected.Use the dynamic internal table generated from the filedcatalog and use in GUI_DOWNLOAD.
See the below code:
*& Report ZRAJESH02
REPORT zrajesh02.
Dynamic internal table
TYPE-POOLS: slis.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>.
DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
it_fldcat TYPE lvc_t_fcat.
DATA: lv_monate TYPE f,
lv_months TYPE i,
lv_date TYPE sy-datum,
p_check1 type n value '1'.
lv_date = sy-datum + 360.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_check TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_date
i_datum_von = sy-datum
i_kz_incl_bis = ' '
IMPORTING
e_monate = lv_monate.
lv_months = lv_monate.
PERFORM f_fcat USING 'AUFNR' 'CHAR' '12'.
PERFORM f_fcat USING 'POSNR' 'CHAR' '06'.
while p_check1 LE p_check.
PERFORM f_fcat USING p_check1 'CHAR' '1'.
p_check1 = p_check1 + 1.
endwhile.
PERFORM build_dyn_itab.
LOOP AT <dyn_table> INTO <dyn_wa>.
WRITE:/ <dyn_wa>.
ENDLOOP.
FORM f_fcat USING fieldname dattyp length.
DATA:wa_it_fldcat TYPE lvc_s_fcat.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = fieldname.
wa_it_fldcat-datatype = dattyp.
wa_it_fldcat-intlen = length.
APPEND wa_it_fldcat TO it_fldcat .
ENDFORM. "f_fcat
*& Form build_dyn_itab
text
FORM build_dyn_itab.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data.
wa_it_fldcat TYPE lvc_s_fcat.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = 'AUFNR'.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 12.
APPEND wa_it_fldcat TO it_fldcat .
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = 'POSNR'.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 6.
APPEND wa_it_fldcat TO it_fldcat .
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fldcat
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <dyn_table>.
Create dynamic work area and assign to FS
CREATE DATA new_line LIKE LINE OF <dyn_table>.
ASSIGN new_line->* TO <dyn_wa>.
ENDFORM. "build_dyn_itab
Thanks,
Rajesh. -
How to delete a field from a Dynamically created internal table
Hi friends,
I have got a requirement in which, I will be entering the table name and Excel file from seletion-screen.
based on the Table I have entered in the selection-screen I need to create a dynamic internal table so that I can fill that Execel data into that internal table and later i using BDC i can I can fill the database table using SM30 transaction.
here. my problem is that, When I am creating internal table dynamically, MANDT filed is also getting created in the internal table.
please, help in deleteing the filed MANDT from the internal able.
following is the code which creates the dynamic internal table.
CREATE DATA dy_table TYPE TABLE OF (p_tabname).
assign dy_table->* to <dyn_table>.
please provide, if any sample code is available.
Regards,
Xavier.PHi,
You can use this logic,
While creating the Dynamic filed catalog try to avoid MANDT field.
Ex:
*Dynamic creation of a structure
CREATE DATA LP_STRUCT TYPE (V_TABLE).
ASSIGN LP_STRUCT->* TO <FS>.
*Fields Structure
OF_SDESCR ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <FS> ).
LOOP AT OF_SDESCR->COMPONENTS ASSIGNING <COMPONENTS>.
*Field MANDT not displayed
IF SY-TABIX = 1 AND <COMPONENTS>-NAME = 'MANDT'.
CONTINUE. " Next loop
ENDIF.
*Build Fieldcatalog
LS_LVC_CAT-FIELDNAME = <COMPONENTS>-NAME.
LS_LVC_CAT-REF_TABLE = V_TABLE.
APPEND LS_LVC_CAT TO LT_LVC_CAT.
CLEAR LS_LVC_CAT.
ENDLOOP. -
Passing values to dynamically created internal table
Hi,
I have the flat file data as
f1,f2,f3........so on
where f1 f2 and f3 are field names.
I have a variable var which contains the data
V1,0001,0002.........so on
data: var type string.
The value of field f1 is v1
The value of field f2 is 0001
The value of field f3 is 0002.......so on
FIELD-SYMBOLS: <fs_1> TYPE STANDARD TABLE
I have dynamically created an internal table for fields f1 f2 f3 ...... using
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ASSIGN <fs_data>->* TO <fs_1>.
Now for <fs_1> I have to pass the corresponding values of the fields f1 f2 f3 .
How can i solve this.
Thanks and regards ,
Parvatha ReddyHi,
There is no data in <fs_1>.
I need to pass the data form the string var to the fields of <fs_1>..
I understand that you want to populate the internal table <fs_1>.
for that you fist need work area.. use below statement to create work area..
DATA: new_line TYPE REF TO data.
CREATE DATA new_line LIKE LINE OF <fs_1>.
ASSIGN new_line->* TO <fs_2>.
<fs_2> is not your work aread...
to assign value to each field of you work aread <fs_2>. use statement
ASSIGN COMPONENT 1 OF STRUCTURE <fs_2> TO <fs_3>.
<fs_3> = f1 .
now <fs_3> will point to the first field of work area <fs_2>, f1 is value from your string .. repeat above for each field in workarea, by increasing the component number. Once your work area is filled
append it to table.
append <fs_2> to <fs_1>
apologies if I am not getting the requiremnt correctly.. -
Dynamic ALV Internal table Problem
Hi all,I have successfully built an IT using method 'create_dynamic_table'.But my problems are :
1)When Iam trying to select the data with multiple tables then it is short dumping.
2)I tried to oselect the data using one table,after selecting the data if I use FM REUSE_ALV_Grid_Display then it is showing short dump with error 'type conflict when calling FM'.
I never used field symbols before.PLZ complete my program or give me suffecient feedback.Here is my program :
DATA : g_tdref TYPE REF TO data,
g_wdref TYPE REF TO data.
DATA : dats LIKE vbbe-mbdat,
t_fieldcat TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
FIELD-SYMBOLS : <it_dyn> TYPE STANDARD TABLE,
<wa_dyn>,
<dyn_field>.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_mbdat FOR dats.
SELECTION-SCREEN END OF BLOCK blk1.
wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-seltext = 'Material Number'.
wa_fieldcat-intlen = '18'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'MAKT'.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = 'MBDAT'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = 'OMENG'.
wa_fieldcat-datatype = 'QUAN'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
DATA : d TYPE i,
v(02) TYPE n VALUE '0',
day(8) TYPE c.
d = s_mbdat-high - s_mbdat-low + 1.
DO d TIMES.
v = v + 1.
CONCATENATE 'Day' v INTO day.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = day.
wa_fieldcat-datatype = 'DATS'.
wa_fieldcat-seltext = day.
wa_fieldcat-intlen = '8'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
ENDDO.
*-----Building Dynamic internal table.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = g_tdref.
ASSIGN g_tdref->* TO <it_dyn>.
CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
ASSIGN g_wdref->* TO <wa_dyn>.
SELECT m~werks m~matnr v~omeng v~mbdat INTO CORRESPONDING FIELDS
OF TABLE <it_dyn> FROM mska AS m INNER JOIN vbbe AS v
ON m~posnr = v~posnr WHERE v~mbdat IN s_mbdat.*DATA : d TYPE i,
v(02) TYPE n VALUE '0',
day(8) TYPE c.
*d = s_mbdat-high - s_mbdat-low + 1.
*DO d TIMES.
v = v + 1.
CONCATENATE 'Day' v INTO day.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = day.
wa_fieldcat-datatype = 'DATS'.
wa_fieldcat-seltext = day.
wa_fieldcat-intlen = '8'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
*ENDDO.
*-----Building Dynamic internal table.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = g_tdref.
ASSIGN g_tdref->* TO <it_dyn>.
CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
ASSIGN g_wdref->* TO <wa_dyn>.
SELECT OMENG FROM VBBE INTO CORRESPONDING FIELDS OF TABLE <IT_DYN> WHERE MBDAT IN S_MBDAT.
BREAK-POINT.
YOU WILL GET VALUES IN INTERNAL TABLE.
TO SOLVE YOUR ISSUE YOU SHOULD USE NUM INSTEAD OF DATS. -
Search Help doesn't work with a dynamically created internal table
Hi Gurus,
I have a custom report that will display the output through edittable ALV.
My issue is, even though I've already did the FOREIGN KEY assisgnment to each fields of my custom table,
when I run my report,some fields F$ functionality aint working.
In my report, I've declared the table to be passed to ALV display dynamically as below:
*_Create dynamic internal tables for the Final INTERNAL TABLE
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fldcatfin
IMPORTING
ep_table = gp_fintab
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN gp_fintab->* TO <i_xfintab>.
Where gt_fldcatfin is a modified fieldcatalog (combination of the cutom table fields and 1 column for CELLCOLOR)
Please help me with this. Thanks a lot.This is one way.
Import photo into illustrator.
Draw box around photo, no fill ,no stroke colour and place on top of photo.
Menu - Object - Envelope Distort - Make with Warp - (warp option will appear)
Use ‘Direct Selection Tool’ (white arrow)
Select/click on anchor points to alter, you can also use the rotation tool to turn to required position.
Hope this info' is of help. -
Uploading Dynamically created Internal table form Flat file
I am creating dynamic internal table as follows:
*-create dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fldcat[]
IMPORTING
ep_table = i_modify.
ASSIGN i_modify->* TO <fs_tab>.
The dymamic internal table is created with the given Ztable in the selection screen.
Now the problem is when I try to upload this table <fs_table> using function module Call function 'UPLOAD'.
The first column of flat file is getting updated in Mandt of <fs_table>.
I want to update sy-mandt in MANDT of <fs_table> and the rest of the fields with flat file data.
e.g.
Flat file data:
100 white
101 black
<fs_table> structure is getting uploaded as below
mandt zcode zdesc
100 white
101 black
if the clint is 700
it has to be uploaded as
mandt zcode zdesc
700 100 white
700 101 black
Can someone knows what should be the approach or any other function module to be used ?
Message was edited by:
Mahesh SahuSee the answer in your previous thread and close this thread. why do you want to have many threads for one question.
-
Dynamically create Internal Table
Hi,
I have a parameter in the program table name.
I want to create an Internal Table like the table name entered for this parameter.
Is this kind of dynamic creation of internal table from a variable possible.
If yes, can you guys please help me with it.
Thanks,
CDSure, its possible. HEre is an example. And you will find thousands more, when you search this forum.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: alv_fldcat type slis_t_fieldcat_alv,
it_fldcat type lvc_t_fcat.
type-pools : abap.
data : it_details type abap_compdescr_tab,
wa_details type abap_compdescr.
data : ref_descr type ref to cl_abap_structdescr.
data: new_table type ref to data,
new_line type ref to data,
wa_it_fldcat type lvc_s_fcat.
selection-screen begin of block b1 with frame title text .
parameters: p_table(30) type c.
selection-screen end of block b1.
* Get the structure of the table.
ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
it_details[] = ref_descr->components[].
loop at it_details into wa_details.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = wa_details-name .
wa_it_fldcat-datatype = wa_details-type_kind.
wa_it_fldcat-inttype = wa_details-type_kind.
wa_it_fldcat-intlen = wa_details-length.
wa_it_fldcat-decimals = wa_details-decimals.
append wa_it_fldcat to it_fldcat .
endloop.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
* Select Data from table.
select * into corresponding fields of table <dyn_table>
from (p_table).
* 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.
Regards,
Rich Heilman -
Fill data in table( on view ) dynamically from internal table
Hi,
How can I populate a table on view with data from an internal table?
Thanks,
RonitaHi,
if you have an internal table named xyz.
Then create a structure in se11 for this internal table.
Then create a node with this structure with cardinality 0:n
Navigate into method WDDOMODIFYVIEW of view MAIN_VIEW. Insert coding for:
- Create a new context node for the table
Hint: Use method Create_nodeinfo_from_struct of class Cl_wd_dynamic_tool.
- Remove old dynamic table IE element from view , if one exists. If it exists, it is a child of group GROUP_1 and has the name TESTTAB.
- Create a new UI element for a table named TESTTAB
- Create an internal table, fill it with the data from the database table and bind it to the newly created dynamic context node.
METHOD wddomodifyview .
DATA:
UI Elements
group_1 TYPE REF TO cl_wd_uielement_container,
new_tab TYPE REF TO cl_wd_table,
Context Nodes
dyn_node TYPE REF TO if_wd_context_node,
tabname_node TYPE REF TO if_wd_context_node,
Node Info
rootnode_info TYPE REF TO if_wd_context_node_info,
Data Reference (for internal table)
stru_tab TYPE REF TO data,
String (for table name)
tablename TYPE string.
FIELD-SYMBOLS:
<tab> TYPE table.
create context node ***************************************************************
get node info of context root node
rootnode_info = wd_context->get_node_info( ).
Get the name of the table to be created
tabname_node = wd_context->get_child_node( name = 'TABLE_DATA' ).
tabname_node->get_attribute( EXPORTING name = 'NAME' IMPORTING value = tablename ).
translate tablename to upper case.
create sub node named TEST1 of structure (tablename)
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).
get instance of new node
dyn_node = wd_context->get_child_node( name = tablename ).
remove "old" table UI element from view , if necessary ****************************
group_1 ?= view->get_element( 'GROUP_1' ).
group_1->remove_child( id = 'TESTTAB' ).
create new UI element table *******************************************************
new_tab = cl_wd_dynamic_tool=>create_table_from_node(
ui_parent = group_1
table_id = 'TESTTAB'
node = dyn_node ).
fill context node with data *******************************************************
create internal table of (tabletype)
CREATE DATA stru_tab TYPE TABLE OF (tablename).
ASSIGN stru_tab->* TO <tab>.
Get table content
SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
Bind internal table to context node.
dyn_node->bind_table( <tab> ).
ENDMETHOD.
Edited by: Sridevi D on Apr 19, 2008 10:30 AM -
Question reg. modifying latest record in internal table
Can you tell me if it is possible to modify the last appended record to the internal table?
I just want to modify the record in the internal table which is appended at the latest. Please tell me the logic for this.
Thanks a lot,
KrishenHi try with this:
DATA line TYPE I.
DATA wa_itab TYPE LINE OF it_itab.
DESCRIBE TABLE IT_TABLE LINE line.
READ TABLE IT_TABLE INTO wa_itab INDEX line.
WA_TABLE-FIELD = 'new value'.
MODIFY TABLE IT_TABLE FROM wa_itab
TRANSPORTING field.
Best regards.
Maybe you are looking for
-
Find status of a sales order created using EDI IDOC
Hello everyone, I have IDOC created for incoming sales order using FM 'IDOC_INPUT_ORDERS'. When a sales order is created manually iva VA01, it prevents the order from being saved when a specific error is hit unless user resolved it first. Howeve
-
How to proceed in case of an infected HD before Lion could be installed
My infected hard disk MacbookPro has to be formatted anew. MUST OS 10.6.8 become first installed and afterwards Lion from the " Lion USB Stick"? HD was saved in the TimeMachine, but it seemed to be also infected. What is to do before and after the H
-
Problem with payment to vendor with cheque
To all SAP GURU'S, Hi i facing a problem relates with payment with cheque payment print out: when i entered T.Code: f-58 enter all related data like company code, pyament method, house bank, check lot no and printre for forms i getting a error msz th
-
Java.lang.NullPointerException is thrown when packaging Adobe AIR application for iOS
Hi All, https://bugbase.adobe.com/index.cfm?event=bug&id=3071298 As per above link this bug resolve(latest build) but i am facing Java.lang.NullPointerException is thrown when packaging Adobe AIR application for iOS, using the packaging tools. (for
-
Does anyone know what is the situation with the Glonass support in Lumia 800? According ot Wikipedia the support is there. However, it is not listed in the speca in Nokia pages. Apparently the Snapdragon processor does support Glonass and since Nokia