Field symbol value
Hi experts ,
in FS <fs_date> i am having the date value in the type of select option structure sign , option ,low , high .
i want to move to the <fs_date>-sign to other range table . how to perform this , below is the sample code i tried .
DATA: rt_date TYPE REF TO data,
DATA:rt_dat TYPE /sdf/sel_tabtype,
FIELD-SYMBOLS: <fs_date> TYPE TABLE ,
ASSIGN rt_date->* TO <fs_date>.
error is comming if i perform like this .
LOOP AT <fs_date> .
rt_dat-sign = <fs_date>-sign.
rt_dat-option = <fs_date>-option.
rt_dat-low = <fs_date>-low.
rt_dat-high = <fs_date>-high.
ENDLOOP.
thanks
chinnaiya P
For what you are trying to do, you don't need field symbols or dynamic data creation. But, if you insist on that path, you are missing a CREATE DATA statement. Try the following code:
DATA: rt_date TYPE REF TO data.
DATA: rt_dat TYPE /sdf/sel_tabtype.
FIELD-SYMBOLS: <fs_date> TYPE TABLE,
<fs_row> type any.
CREATE DATA rt_date type /sdf/sel_tabtype.
ASSIGN rt_date->* TO <fs_date>.
loop at <fs_date> ASSIGNING <fs_row>.
append <fs_row> to rt_dat.
ENDLOOP.
Similar Messages
-
Field symbols values passing as parameter to Methods
Hi ,
Can we pass fields symbols as parameter to methods ? I want to use field symbols values in my where in clause in methods, thereafter I want to pass my internal table to calling method.
Thanks,
UjjwalHi,
I have create an class in which have I have create a method to written a select query to extract value from a table. The table name is passed by user. the select used is:
select * from (tab) into CORRESPONDING FIELDS OF TABLE data.
this method has 2 parameter:
tab of type sting (importing).
data of type ANY TABLE (exporting).
and i am using the following code to get the data:
data: itab TYPE TABLE OF t578w.
field-SYMBOLS <ab> TYPE any.
ASSIGN 'T578W' to <ab>.
CALL METHOD Z_GET_TABLE_DATA=>GET_TABLE " Z_GET_TABLE_DATA is the class name & GET_TABLE is method name
EXPORTING
tab = <ab>
IMPORTING
data = itab.
You can code in similar way.
I hope it helps.
Regards
Arjun
Edited by: Arjun Thakur on Apr 23, 2009 3:16 PM -
How to check the length of a field symbol value
hi all,
i have a problem with string function, i have assined table fields to a field symbol in a loop i want check the length of the assigned fields symbol value in every loop . i have written like ,,,,,len = strlen( <fs>). then i am getting the length of the field label what i ahve assigned to fiels symbol not the field value lenght ,
please advise me on this,
thanks,
sreI think you're on the right track. This should work:
data: len type i.
data: begin of itab OCCURS 1,
a type string value '1',
b type string value '12',
c type string value '123',
end of itab.
FIELD-SYMBOLS: <fs> type ANY.
do 3 times.
assign component sy-index of STRUCTURE itab to <fs>.
len = strlen( <fs> ).
enddo. -
Passing field symbol value to a variable
Hi All,
I have a value in Field Symbol declared as <FS-STATUS> TYPE STANDARD TABLE.
I want to use the value <fs-status> -low in a case statement.
For this i think i have to pass the <fs-status> -low into a variable and then use in case statement.
Can anyone explain how to pass values in field symbol to variable? Or if this is not possible is there any other solution.
Thanks in advance.Hi ,
I have give some code sample ; just check ..
DATA: BEGIN OF line,
col1(1) TYPE c,
col2(1) TYPE c VALUE 'X',
END OF line.
FIELD-SYMBOLS <fs> LIKE line.
ASSIGN line TO <fs>.
MOVE <fs>-col2 TO <fs>-col1.
WRITE: <fs>-col1, <fs>-col2.
Or u can check this link :
http://www.erpgenie.com/abaptips/content/view/401/62/ -
Problem with field-symbol values not updating
H i ,
I have following piece of code :
Assigning Dynamic Table to Field Symbol
ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
* Creating Structure for dynamic table
CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
* Creating line type for the Dynamic Values
ASSIGN gs_dyn_line->* TO <gs_line>.
* Populating values in the dynamic table
LOOP AT ist_pwcl_main INTO wa_pwcl_main.
ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
1 IF sy-subrc EQ 0.
2 <gs_field> = wa_pwcl_main-werks.
3 ENDIF.
5 IF <gs_field> IS ASSIGNED.
6 <gs_field> = wa_pwcl_main-vbeln.
ENDIF.
7 IF <gs_field> IS ASSIGNED.
8 <gs_field> = wa_pwcl_main-posnr.
ENDIF.
IF <gs_field> IS ASSIGNED.
<gs_field> = wa_pwcl_main-quant.
ENDIF.
on debugging at line 2 <gs_filed> contains the value of werks .
but at line 6 <gs_field> contains value of vbeln as 0 and at 8 of posnr as 0 .
What can be the problem ? Other values are getting assigned properly .
Plz help ...
Regards .Hi,
Assigning Dynamic Table to Field Symbol
ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
Creating Structure for dynamic table
CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
Creating line type for the Dynamic Values
ASSIGN gs_dyn_line->* TO <gs_line>.
Populating values in the dynamic table
LOOP AT ist_pwcl_main INTO wa_pwcl_main.
ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
1 IF sy-subrc EQ 0.
2 <gs_field> = wa_pwcl_main-werks.
3 ENDIF.
5 IF <gs_field> IS ASSIGNED.
6 <gs_field> = wa_pwcl_main-vbeln.
ENDIF.
7 IF <gs_field> IS ASSIGNED.
8 <gs_field> = wa_pwcl_main-posnr.
ENDIF.
IF <gs_field> IS ASSIGNED.
<gs_field> = wa_pwcl_main-quant.
ENDIF.
Based on your coding above, <gs_field> has been assigned with data type 'WERKS' (i'd assume component gc_fld_werks found from structure <gs_line> is a plant typed), which is a CHAR(4) data type.
Meaning, if <gs_field> is assigned with Plant type value, e.g. <gs_field> = '1000', field symbol <gs_field> will contain 4 character only.
At line 6, if wa_pwcl_main-vbeln = '0000201000', <gs_field> is only capturing '0000' only. This is also happened to line 8.
However, it looks like that <gs_field> is getting over-write if ASSIGNED statement returns SY-SUBRC = 0.
Hope this helps.
Regards,
Patrick -
Reg Field-Symbol value trasfer into variable
Hi,
I'm using one FIELD-SYMBOL in one of my program. I used this to catch Hotspot Fields in List Report. It catches that required field of BELNR.
I read the Click event through that FIELD-SYMBOL. Now I used
DATA: HOTSPOT(18) , "VALUE 'Document No',
F(18), OFF TYPE I, LIN TYPE I, VAL(40), LEN TYPE I.
FIELD-SYMBOLS <FS>.
ASSIGN HOTSPOT TO <FS>.
WRITE <FS> HOTSPOT COLOR 3 INVERSE ON.
AT LINE-SELECTION.
*WINDOW STARTING AT 5 6 ENDING AT 45 20.
GET CURSOR FIELD F OFFSET OFF
LINE LIN
VALUE VAL
LENGTH LEN.
data: click_item type bsid-belnr.
move val to click_item.
It moves the value into CLICK_ITEM variable. But when I try to run SELECT query with condition BELNR = CLICK_ITEM, query gives no result.
Can you please point out my fault?
Thanks.
Kumar saurav.Try using Conversion Routine before the Select Query.
DATA : T_BELNR TYPE BSID_BELNR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = CLICK_ITEM
IMPORTING
OUTPUT = T_BELNR
and pass T_BELNR to the where condition.
Hope this helps. -
In webdynpro ,Passing field symbols as values to class methods
Hi
Please tell me the ways of accessing database in webdynpro abap(not directly). I am calling Class method for accessing database. As currently I am directly accessing database in my webdynpro application. I have created a class and method for the same.
In my method I want to use select statement which will return table with values to webdynpro application. So for select statement(Calling Method) I need to use my field symbol values as where in clause .
Could anyone please help with example code?
Thanks,
Ujjwaldata: in_line type ref to data.
CREATE DATA in_line LIKE LINE OF <dyn_tab>.
ASSIGN in_line->* TO <dyn_wa>.
You can create a data reference and assign it to a field symbol and change the values. direclty passing field symbols is not possible.
Abhi -
Field-symbol in user_exit
Hi,
I have access one field-symbol which is populated in satndard sap program in my user_exit.
Done some data change in that field-symbol but data is getting lost when that field-symbol is afgain moving back to sap program.
please suggestHi,
I am not sure about this but you can also try with the below solution.
Try to define one more field symbol of type the existing one. Before leave the user exit just pass your field symbol value to the newly created one.
Rgds,
Bujji -
Hello ,
I have a field symbol where i am not aware of fields (Column Name) , i mean column names are Dynamic.
Problem is i need to read this field symbol value , how can i do it . It will always have 1 record
Example
Field Symbol looks something like this
<FS> Column Name dynamic -
>
A B C
Record
1 2 3
So now i have to refer to Second Column (i.e. is B in this case) , how should i do
What i tried .
1. <FS>-(Column Name in variable in brackets) - It doesnt work , Error Message unable to interpret the number B
2. <FS>[1] - Error out.For a structured data object <s>, you can use the statement
<b>
ASSIGN COMPONENT <comp> OF STRUCTURE <s> TO <FS>.
</b>
to assign one of its components <comp> to the field symbol <FS>. You can specify the
component <comp> either as a literal or a variable. If <comp> is of type C or a structure which
has no internal tables as components, it specifies the name of the component. If <comp> has any
other elementary data type, it is converted to type I and specifies the number of the component.
In the assignment is successful, SY-SUBRC is set to 0. Otherwise, it returns 4. -
Assigning a value to a field-symbol (workarea of type any)
Dear forumers,
I'm having a bit of difficulty in assigning a value to a field-symbol (it should be treated as a workarea of type any), but I'm given a syntax error instead:-
The data object "<LFS_WORKAREA>" has no structure and therefore no component called "LFMON".
What could have gone wrong and how may I resolve this (I must have missed something out)? I will still need <LFS_WORKAREA> to be defined as TYPE ANY.
Please help. I'd appreciate any inputs at all. Thanks.
*& Form FORMAT_POST_PERIOD
* Subroutine to format the posting period data
* --> PI_MBEW Material valuation data (internal table)
FORM format_post_period CHANGING pi_mbew TYPE ANY TABLE.
" Create local field symbols
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
" Create local variables
DATA: lv_index TYPE sy-tabix.
DATA: lv_lfmon TYPE ckmlcr-poper.
" Format posting periods
LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
lv_index = sy-tabix.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
MOVE lv_lfmon TO <lfs_workarea>-lfmon. " the syntax error occurs here :(
MODIFY pi_mbew FROM <lfs_workarea>
INDEX lv_index
TRANSPORTING lfmon.
CLEAR: <lfs_workarea>,
<lfs_lfmon>
lv_lfmon,
lv_index.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIODMost of us aren't in it for the points in any case...
For your solution you've redundant code:
*& Form FORMAT_POST_PERIOD
* Subroutine to format the posting period data
* --> PI_MBEW Material valuation data (internal table)
FORM format_post_period CHANGING pi_mbew TYPE ANY TABLE.
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
DATA: lv_lfmon TYPE ckmlcr-poper.
* DATA: lo_workarea TYPE REF TO data. "<--Not needed, because the LOOP AT ASSIGNING below does the work
* CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
* ASSIGN lo_workarea->* TO <lfs_workarea>.
LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
<lfs_lfmon> = lv_lfmon.
CLEAR lv_lfmon.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIOD
Here's a couple of more efficient solutions, using LOOP AT INTO.
FORM format_post_period CHANGING pi_mbew TYPE INDEX TABLE. " <-- Table type a little more specific
"<--now you can use index operations
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
DATA: lv_lfmon TYPE ckmlcr-poper,
lv_index TYPE sytabix.
DATA: lo_workarea TYPE REF TO data.
CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
ASSIGN lo_workarea->* TO <lfs_workarea>.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
LOOP AT pi_mbew INTO <lfs_workarea>.
lv_index = sy-tabix.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
<lfs_lfmon> = lv_lfmon.
MODIFY pi_mbew FROM <lfs_workarea>
INDEX lv_index. " <--INDEX TABLE, so this is permitted.
CLEAR lv_lfmon.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIOD -
Assigning value to Field - Symbol ( which is type of internal table field )
Hi All,
I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
So i declared an internal table it_tab with this structure.
I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
For this i created field-symbol .
Here, t_deployment table will have the plants 1,2,3...and
t_devobject will have some records for these plants.
LOOP AT T_DEPLOYMENT.
clear w_count.
LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
ZADSTATUS = '10'.
w_count = w_count + 1.
ENDLOOP.
concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
assign var_bet_name to <bet_var_name>.
now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
at last what i need is it_tab-plant1 = w_count.
whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
I tried the following statement.
(<bet_var_name>) = w_count. But its not working.
Please let me know how i can get this.
Thanks in Advance.
Pavan.Hi pavan,
As ur requirement is creating a dynamic internal table,
try the following way,
remember the fieldcat should be of type LVC not SLIS.
BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
ex:-
loop at it_models INTO WA_MODELS.
LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
append ls_lvcfieldcat to lt_lvcfieldcat.
endloop.
DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = LT_LVCFIELDCAT
IMPORTING
EP_TABLE = DREF.
ASSIGN dref->* TO <TEMP_TAB>.
now basing on the fieldcatalog <temp_tab> is build.
NOW FILL <TEMP_TAB>.
WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
this statement will be very usefull.
i hope this will be help full.
pls reward the points if it helps u.
regards
Hyma -
How to populate values of field symbols?
HI,
I need to pass values into a field-symbol (defined as a dynamic Work Area) and append the values later on into another field-symbol (defined as a dynamic Table) by inserting the work area to the table. The insert statement in the screen shot below is syntetically correct but when I uncomment
* <gw_itab>-tplnr = 'TPLNR'.
* <gw_itab>-pmsog = 'PMSOG'.
* <gw_itab>-k_pro = 'K_PRO'.
I get a syntax error. During debugging if I pass the values of the work area, they are properly appended into the table.
Could somebody show me the code on how to atain this programatically?
Thanks for your help
CarlFrom the short dump:
"<GT_ITAB> has line type "v" and the length 24, but the work area has line type "g" and the length 8".
The code you included in your first screenshot is not the code that it dumped on... Looking at the shortdump here's what you have.
lv_fieldname = '<GW_ITAB>-TPLNR'.
assign (lv_fieldname) to <gw_itab>.
<gw_itab> = 'TPLNR'.
insert <gw_itab> into table <gt_itab>.
This code doesn't make any sense...
What you're saying is:
<gw_itab> points to <gw_itab>-tplnr. So now it points to just a field of the structure, not the whole structure.... Then you say that field is set to 'TPLNR'. So you set the field of the original structure called TPLNR to be the string "TPLNR"...
If that's really what you're trying to do then try changing it to:
field-symbols: <field> type any.
lv_fieldname = '<GW_ITAB>-TPLNR'.
assign (lv_fieldname) to <field>.
<field> = 'TPLNR'.
insert <gw_itab> into table <gt_itab>. -
How to access the value of a field of a field symbol.
Hello All,
i need to access the value of a field in a field symbol. But when i am trying to get the value like <FS>-POSNR, it's showing that that the <FS> has no structure.
In my program, the field itself that i need to check should be dynamic. ie i'll get the field in a variable and i need to find the value of that field.
Am pasting my code below, please tell me what needs to be done.
here in my sample code i am moving the entry of the <FS> into a work area structure. But in my actual program, i gets the structure as a parameter. So is there any way i can declare a work area dynamically...
FUNCTION z_39181_dyn_fs_60758.
""Local interface:
*" IMPORTING
*" REFERENCE(PARAMETER) TYPE VBELN
*" TABLES
*" DATA_TAB
BREAK-POINT.
FIELD-SYMBOLS <fs> TYPE ANY.
FIELD-SYMBOLS <fs1> TYPE ANY.
FIELD-SYMBOLS <fstab> TYPE ANY TABLE.
DATA name(5) VALUE 'POSNR'.
FIELD-SYMBOLS <f> TYPE ANY.
DATA: dref TYPE REF TO data,
dref1 TYPE REF TO data,
dref2 TYPE REF TO data.
DATA: lv_lips TYPE string.
DATA: lv_lipsfld TYPE string,
lv_fld TYPE string,
lw_lips TYPE lips.
lv_lips = 'LIPS'.
lv_fld = 'LW_lips-POSNR'.
CREATE DATA dref1 TYPE (lv_lips).
CREATE DATA dref TYPE STANDARD TABLE OF (lv_lips).
CREATE DATA dref2 LIKE LINE OF data_tab.
ASSIGN dref->* TO <fstab>.
ASSIGN dref1->* TO <fs>.
assign dref2->* to <fs
<fstab> = data_tab[].
LOOP AT <fstab> INTO <fs>.
lw_lips = <fs>.
WRITE lw_lips-vbeln.
ASSIGN (lv_fld) TO <fs1>.
write <fs>
ENDLOOP.
Helpful answers will be rewarded...Use syntax
ASSIGN COMPONENT name OF STRUCTURE struc TO <fs>. -
To Modify a field value with field symbols
we had a requirement like we are getting in a floating point value in a field of an IDoc segment like 12.327- .Here if we see that the negative sign is after the floating point value and if we try to insert this into a database then it will throw out an error.Before inserting the value we need to covert the incoming value in the form -12.327.
I used the field symbols inorder to get the values and to change them.
But iam not able to modify the internal table from the new value.
Here is my sample code.
DATA: IT_MBEW TYPE TABLE OF MBEW,
WA_MBEW TYPE MBEW,
IT_DFIES TYPE TABLE OF DFIES,
WA_DFIES TYPE DFIES,
IT_DD03L TYPE TABLE OF DD03L,
WA_DD03L TYPE DD03L,
L_FIELD TYPE VALUE,
WA_VALUE TYPE mbew,
L_MBEW TYPE DDOBJNAME VALUE 'MBEW'.
FIELD-SYMBOLS: <FS1> TYPE ANY.
FIELD-SYMBOLS: <FS3> TYPE ANY.
FIELD-SYMBOLS: <FS2> TYPE ANY.
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_MBEW
FROM MBEW WHERE MATNR = '000000000000100110'.
LOOP AT IT_MBEW INTO WA_MBEW.
WA_MBEW-SALK3 = - 354471.
MODIFY IT_MBEW FROM WA_MBEW.
ENDLOOP.
To call the FM inorder to get the fieldnames for MBEW table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = L_MBEW
FIELDNAME = ' '
LANGU = SY-LANGU
LFIELDNAME = ' '
ALL_TYPES = ' '
GROUP_NAMES = ' '
UCLEN =
IMPORTING
X030L_WA =
DDOBJTYPE =
DFIES_WA =
LINES_DESCR =
TABLES
DFIES_TAB = IT_DFIES
FIXED_VALUES =
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 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.
SELECT TABNAME FIELDNAME DATATYPE POSITION INTO CORRESPONDING FIELDS OF TABLE
IT_DD03L FROM DD03L
WHERE TABNAME = 'MBEW'
AND DATATYPE = 'CURR'
ORDER BY POSITION ASCENDING.
*LOOP AT IT_MBEW INTO WA_MBEW.
LOOP AT IT_MBEW assigning <fs1>.
ASSIGN WA_MBEW TO <FS1>.
do.
LOOP AT IT_DD03L INTO WA_DD03L.
READ TABLE IT_DFIES INTO WA_DFIES WITH KEY FIELDNAME = WA_DD03L-FIELDNAME
DATATYPE = WA_DD03L-DATATYPE.
IF SY-SUBRC = 0.
ASSIGN WA_DFIES-FIELDNAME TO <FS2>.
ASSIGN COMPONENT SY-TABIX OF STRUCTURE <FS1> TO <FS3>.
MOVE <FS3> TO L_FIELD.
CONDENSE L_FIELD.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = L_FIELD.
IF SY-SUBRC = 0.
ASSIGN L_FIELD TO <FS3>.
MODIFY ITMBEW INDEX SY-TABIX FROM <FS3>._
ENDIF.
ENDIF.
ENDLOOP.
*enddo.
ENDLOOP.
The Modify statement is not working.....Plesae help me in this regard.
Thanks
SrinivasHello.
When you write,
LOOP AT it_mbew ASSIGNING <fs1>.
ENDLOOP.
you don't need to use statements:
ASSIGN WA_MBEW TO <FS1>
nor
MODIFY it_mbew
after that.
If you just write:
LOOP AT it_mbew ASSIGNING <fs1>.
<fs1>-field1 = 'A'.
<fs1>-field2 = 'B'.
ENDLOOP.
all records of it_mbew will have field1 = 'A' and field2 = 'B'.
The point is, statement LOOP assigning <fs1> will make the field symbol to became a pointer to the records of the internal table. So, if you change the field symbol, you are changing the internal table already.
Regards.
Valter Oliveira. -
How to get values from dynamically populated field symbol
Hi all,
I am having a field symbol <fs_table> type standard table, which is getting populated dynamically.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fieldcat[]
IMPORTING
ep_table = is_eptab.
ASSIGN is_eptab->* TO <fs_table> .
After the ALV display i am making some changes in the ALV and getting a new internal table <fst_table>,which is having changed values.
Now the problem is that i am not able to get the changed values from <fst_table> as it is not of any structure type and cant associate it with any field like we do in normal internal table and work areas like, wa-fieldname.
All the fields are dynamic.
Regards,
AnantHello Anant
You have to access to access the fields of your dynamic outtab dynamically as well.
DATA: ls_fcat TYPE lvc_s_fcat.
FIELD-SYMBOLS:
<ls_struc> TYPE any,
<ld_fld> TYPE any.
LOOP AT <fs_table> ASSIGNING <ls_struc>.
LOOP AT i_fieldcat INTO ls_fcat.
ASSIGN COMPONENT ls_fcat-fieldname OF STRUCTURE <ls_struc> TO <ld_fld>.
... " do processing
ENDLOOP.
ENDLOOP.
Regards
Uwe
Maybe you are looking for
-
I have a 2010 macbook pro currently running 10.6.8 that has served me very well over the last 4 years, except in recent months it has been getting frequent kernel panics. Started every few weeks, now happens multiple times a day. It seems to happen m
-
There is an error in the order submission.
Hi, While placing order in iStore(11.5.7 vis) i got the following error."Error messages from Order Management. The item specified is invalid or does not exist in the warehouse you specified. Please Enter a valid item- warehouse combination. Invalid u
-
A few months ago, my power cord stopped working correctly. I have to jiggle it before I get the green/orange light and many times the only way for it to stay lighted is to put a heavy book on top of the plug. I know this pressure cannot be good for t
-
On wake, MBAir can't see network resources?
I've been pulling my hair out trying to figure this out, but basically I just close my MBAir when I'm done and I don't shut it down - so it's just sleeping. Well, when I wake it up it gets a network connection and everything works... except that it
-
Unable to sync all apps into itouch
I just brought newest itouch online two weeks ago, and everytime when I try to sync my itouch, the apps cannot be transfered into my itouch. I really have no idea about this.