Problem with field symbols
Hi ,
I have to use an internal table in a form which can have differnet structures at diffrenet points of time.
As the internal table is dynamic , I have declared a field symbol for this.I need to use th efields in this internal table for processing inside a loop.But because i have to use an untyped field symbol , I am getting an error that the field QUANT is not there in <fs_order_tab>.
Please let me know what to do in such a situation.Thanks in advance.
FIELD-SYMBOLS :<fs_order_tab> TYPE STANDARD TABLE,
<fs_order_wa> TYPE ANY.
ASSIGN i_so TO <fs_order_tab>.
ASSIGN wa_so TO <fs_order_wa>.
LOOP AT<fs_order_tab> into <fs_order_wa>..
l_quant = <fs_order_wa>-QUANT.
ENDLOOP.
Hi Rashmi,
Kindly follow the steps given below.
After assigning the internal table to the field symbol,
create 1 more field symbols of the following type
<fs_quant> TYPE vbep-bmeng,
Create 1 constant.
CONSTANTS: lc_quant TYPE c LENGTH 5 VALUE 'QUANT'.
and then assign the field quantity to the field symbol
ASSIGN COMPONENT lc_quant OF STRUCTURE <fs_order_wa> TO <fs_quant>.
Inside the loop write the following statement
l_quant = <fs_quant>
Hope this helps in solving your query.
Edited by: Kadian.Arjun on Nov 22, 2010 9:56 AM
Similar Messages
-
Problem with field symbols in ecc 6.0
i have the following code written in 4.6 version now i am executing the old report in 6.0 but i am facing with some unicode error.
FIELD-SYMBOLS:
<line_of_bs_table> LIKE tbl1024,
READ TABLE bs_table INDEX row_bst ASSIGNING <line_of_bs_table> .
buffer_bsbuffer_ptr(aux) = <line_of_bs_table> >col_bst.
tb1024 is standard sap structure for storing buffer contents
i have the following error in ecc 6.0
structure type '<line_of_bs_table> >+col_bst' does not start with a charecter type field in unicode programs in such cases
offset/ length declarations are not allowed.
can any one tell how can a field symbol structure is changed to charecter type.Hi elinuk,
you have already posted this thread in the ABAP general forum under problem in field symbols in ecc6.0 and I think that this forum is more related to this issue than the DMS forum. So please close this thread and investigate this issue further in the ABAP general forum.
Best regards,
Christoph -
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 -
Problem with FIELD SYMBOL upgrading from 46c to ECC6.0
Hi people... i'm having big trouble making an upgrade from 4.6c to ECC6.0 with this portion of code of Z's programm.
In the line
ASSIGN (w_field) TO <fs_field>.
i don't see any assigment, so <fs_field> remains empty, when enters into firts IF conditions it is TRUE, then go into second IF condition, it is FALSE, and finally assing
<fs_field> = '/'.
, at this point i have a DUMP telling me MOVE_TO_LIT_NOTALLOWED_NODATA
I'm try any way of definition, assigment, but always i have a DUMP.
Someone can give a hand with this issue!
Thanks in advance!!!
This is the full code from the FORM with the problem.
* FORM GRABA *
* --> VALUE(P_TABLE) *
FORM graba USING value(p_table) TYPE c.
DATA:
w_field(60),
w_dd03l TYPE dd03l.
FIELD-SYMBOLS <fs_field>.
CLEAR w_flag.
CASE p_table.
WHEN 'BGR00'.
d_bgr00-group = w_batin.
d_bgr00-mandt = sy-mandt.
d_bgr00-usnam = sy-uname.
d_bgr00-xkeep = 'X'.
d_bgr00-nodata = '/'.
d_bgr00-stype = 0.
TRANSFER d_bgr00 TO w_fname.
WHEN 'BBKPF'.
LOOP AT gt_dd03l INTO w_dd03l WHERE tabname EQ p_table.
CONCATENATE
'd_'
w_dd03l-tabname
w_dd03l-fieldname
INTO w_field.
ASSIGN (w_field) TO <fs_field>.
IF <fs_field> IS INITIAL OR <fs_field> EQ '/'.
IF w_dd03l-fieldname EQ 'TBNAM'.
<fs_field> = p_table.
ELSE.
<fs_field> = '/'.
ENDIF.
ELSE.
w_flag = 'X'.
ENDIF.
ENDLOOP.
TRANSFER d_bbkpf TO w_fname.
WHEN 'BBSEG'.
LOOP AT gt_dd03l INTO w_dd03l WHERE tabname EQ p_table.
CONCATENATE
'd_'
w_dd03l-tabname
w_dd03l-fieldname
INTO w_field.
ASSIGN (w_field) TO <fs_field>.
IF <fs_field> IS INITIAL OR <fs_field> EQ '/'.
IF w_dd03l-fieldname EQ 'TBNAM'.
<fs_field> = p_table.
ELSE.
<fs_field> = '/'.
ENDIF.
ELSE.
w_flag = 'X'.
ENDIF.
ENDLOOP.
TRANSFER d_bbseg TO w_fname.
ENDCASE.
ENDFORM.
Edited by: Matt on Dec 15, 2008 5:03 PM - Made subject more informativeGentlemen:
The problem around this statement:
ASSIGN (w_field) TO <fs_field>
is explained as follows:
1. In ABAP language, there are two ways for assigning a new value to a field-symbol.
- Sentence: ASSIGN (values) TO <my_field_symbol>.
In this case, the <my_field_symbol> receives from (w_field) the data type and value content of this variable. So, we keep that a FSymbol is assigned and, at the same time, receives an initial value.
- Sentence: <my_field_symbol> = '/' or <my_field_symbol> = my_var.
In this way, we only pass the content of the variable next to = sign. But before this, the field-symbol must had been assigned (using ASSIGN statement), in another case, the compiler raises an exception.
Following the example of Federico... I think he tried to assign a field like this (please, supose the program imports the structure of a database table with a standard function, into a internal table which is looped by the work area w_field ):
- If w_field contains 'BKPF-WERKS', so sentence ASSIGN will affect the field symbol, passing to this the data type and current content of table field BKPF-WERKS.
- If w_field contains 'BKPF-.INCLUDE': *the column .INCLUDE obviously is not associated with a data type... so our statement ASSIGN... TO... never pass any data type or value to our field-symbol. So that, this field is never initialized properly, and when inmmediately you try to execute something like this: <my_field_symbol> = '/', the game (program) is over.. XD
I hope this post was helpful for anyone...
Best Regards!!
RRG
ABAPer(u) - EVOLution -
Problem with field-symbols in UNICODE conversion
Hi all.
I'm in a UNICODE conversion project and I have a problem with a program that uses field-symbols.
DATA: BEGIN OF wa_data_aux,
mandt LIKE zindices-mandt,
kschl LIKE zindices-kschl,
datab LIKE zindices-datab,
valor LIKE zindices-valor,
descripcion LIKE zindices-descripcion,
ernam LIKE zindices-ernam,
erdat LIKE zindices-erdat,
waers LIKE zindices-waers,
END OF wa_data_aux.
FIELD-SYMBOLS:
<fs2> TYPE ANY,
<fs3> LIKE wa_data_aux.
<fs2> = <fs3>.
This assignment results in a DUMP.
Can anybody help me to solve this problem?
Thanks!!TYPES: BEGIN OF wa_data_aux,
mandt TYPE mandt,
kschl TYPE kschl,
erdat TYPE d,
waers TYPE waers,
END OF wa_data_aux.
DATA: w_aux TYPE wa_data_aux.
FIELD-SYMBOLS:
<fs2> TYPE ANY,
<fs3> TYPE wa_data_aux.
w_aux-mandt = '300'.
ASSIGN w_aux TO <fs3>.
ASSIGN <fs3> TO <fs2>.
WRITE : / <fs2>.
GBY. -
Hi!
I have a problem with a field-symbol like this:
DATA: gt_coep_ext TYPE kaep_t_coep_ext.
field-symbols <gt_data> type table.
ASSIGN gt_coep_ext TO <gt_pos_data>
This field symbol is used in the FM REUSE_ALV_GRID_DISPLAY as output table. I need add two fields in this <gt_data>. Is there any way to add new fields in the <gt_data> structure.
Thanks!!Create your one Fieldcat
Global data declaration ***
TYPE-POOLS: SLIS.
<types: ... . " user definded types>
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: G_REPID LIKE SY-REPID.
DATA: GT_OUTTAB TYPE <UD_STRUCT> OCCURS 0 WITH HEADER LINE.
<data: ... . " user specific data>
Initialization field catalog ***
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
Data selection ***
START-OF-SELECTION.
PERFORM SELECT_DATA TABLES GT_OUTTAB.
Display list ***
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
IT_FIELDCAT = GT_FIELDCAT[]
TABLES
T_OUTTAB = GT_OUTTAB.
FORMS ***
FORM FIELDCAT_INIT USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: POS TYPE I VALUE 1.
Initialize keyfield(s)
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COL_POS = POS.
LS_FIELDCAT-FIELDNAME = <GT_OUTTAB_FIELD_NAME>.
LS_FIELDCAT-REF_FIELDNAME = <DDIC_REF_FIELD_NAME>.
LS_FIELDCAT-REF_TABNAME = <DDIC_REF_TABLE_NAME>.
LS_FIELDCAT-KEY = 'X'. " sets key field
APPEND LS_FIELDCAT TO RT_FIELDCAT.
Initialize normal field(s)
POS = POS + 1.
clear ls_fieldcat.
ls_fieldcat-col_pos = pos.
LS_FIELDCAT-FIELDNAME = <GT_OUTTAB_FIELD_NAME>.
LS_FIELDCAT-REF_FIELDNAME = <DDIC_REF_FIELD_NAME>.
LS_FIELDCAT-REF_TABNAME = <DDIC_REF_TABLE_NAME>.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
Initialize hidden field(s)
POS = POS + 1.
clear ls_fieldcat.
ls_fieldcat-col_pos = pos.
LS_FIELDCAT-FIELDNAME = <GT_OUTTAB_FIELD_NAME>.
LS_FIELDCAT-REF_FIELDNAME = <DDIC_REF_FIELD_NAME>.
LS_FIELDCAT-REF_TABNAME = <DDIC_REF_TABLE_NAME>.
LS_FIELDCAT-NO_OUT = 'X'. " sets hidden field
APPEND LS_FIELDCAT TO RT_FIELDCAT.
ENDFORM. " fieldcat_init
FORM SELECT_DATA TABLES RT_OUTTAB LIKE GT_OUTTAB[].
<user specific data selection>
ENDFORM. " select_data -
Problem with Field-symbols when copying code from 4.7 to 4.6C
Dear SDN
I developed the code below for 4.7 system. It works fine on 4.7, but it is failing to compile on 4.6C.
field-symbols : <pnnnn> type any.
assign ('wa') to <pnnnn>.
move-corresponding p0001 to <pnnnn>. " <i>Error <pnnnn> is not an internal table with a header line</i>
unassign <pnnnn>.
Can anyone please assist?
Regards
KrigerYou cannot use MOVE-CORRESPONDING with untyped variables in 4.6c. If you move infotype data between infotype buffer (of type PRELP) and infotype workarea, then you should use MOVE.
-
Problem with field-symbols usage
Hi guys,
I am trying to read a record of table gi_outtab as follows:
read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
And now i want the value of a field of wa_outtab and this field is contained in a field-symbol <field> .
I thought wa_outtab-<field> would give the value for that field. But it gives syntax error saying component doesn't exist.How do I fix it ? Any help or sample code to fix this error is greatly appreciated.The code is below.
Thanks,
SHK
I have fieldname info and row index info in wa_ir2_data_changed.I assign field-name info to a field-symbol.wa_outtab-<field> gives error saying no component like that exists. <field> dynamically changes for ever iteration of the loop below.How do I fix it ?
data : wa_ir2_data_changed like line of ir2_data_changed->mt_good_cells.
field-symbols : <field> type ANY .
loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
assign wa_ir2_data_changed-fieldname to <field> .
read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
call method ir2_data_changed->modify_cell
exporting i_row_id = wa_ir2_data_changed-row_id
i_fieldname = wa_ir2_data_changed-fieldname
i_value = wa_outtab-<field>.
endloop.
wa_ir2_data_changed has 3 components.
a) row_id
b) fieldname
c) valueThe following code fixed it.Thanks Suresh for the tip.
loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
ASSIGN COMPONENT wa_ir2_data_changed-fieldname of structure wa_outtab to
<field>.
call method ir2_data_changed->modify_cell
exporting i_row_id = wa_ir2_data_changed-row_id
i_fieldname = wa_ir2_data_changed-fieldname
i_value = <field>.
endloop. -
Dynamic select with field symbols
Hi guys,
I have 2 tables.
First table is the popup fields using fm popup_get_values:
tab1-tabname
tab1-fieldname
tab1-value
Second table is the input fields to be displayed in the popup box:
tab2-transactno
tab2-docno
tab2-customer
tab2-postdate
etc... (it has many fields)
Let's say currently i loop at tab2 and assign each value of the individual fields to a variable each:
loop at tab2
v_transactno = tab2-transactno
v_docno = tab2-docno
etc...
endloop.
My question is how do i assign each variable to the popup fields according to the fieldname so that it can get its corresponding value correctly?
How can this be done dynamically?
Can the loop above be done dynamically as well coz it has alot of fields to cater for?
Please help me solve this problem. Futher similar examples would be much appreciated as well.
Thank you very much!Hi
see the concept of field sysmbols and do accordingly
Field Symbols
Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
Field symbols provide greater flexibility when you address data objects:
If you want to process sections of fields, you can specify the offset and length of the field dynamically.
You can assign one field symbol to another, which allows you to address parts of fields.
Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
You can also force a field symbol to take different technical attributes from those of the field assigned to it.
The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
check the below links u will get the answers for your questions
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
Syntax Diagram
FIELD-SYMBOLS
Basic form
FIELD-SYMBOLS <fs>.
Extras:
1. ... TYPE type
2. ... TYPE REF TO cif
3. ... TYPE REF TO DATA
4. ... TYPE LINE OF type
5. ... LIKE s
6. ... LIKE LINE OF s
7. ... TYPE tabkind
8. ... STRUCTURE s DEFAULT wa
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
Effect
This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
You can only use one of the additions.
Example
Output aircraft type from the table SFLIGHT using a field symbol:
FIELD-SYMBOLS <PT> TYPE ANY.
DATA SFLIGHT_WA TYPE SFLIGHT.
ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
WRITE <PT>.
Addition 1
... TYPE type
Addition 2
... TYPE REF TO cif
Addition 3
... TYPE REF TO DATA
Addition 4
... TYPE LINE OF type
Addition 5
... LIKE s
Addition 6
... LIKE LINE OF s
Addition 7
... TYPE tabkind
Effect
You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
Effect
Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
Example
Address components of the flight bookings table SBOOK using a field symbol:
DATA SBOOK_WA LIKE SBOOK.
FIELD-SYMBOLS <SB> STRUCTURE SBOOK
DEFAULT SBOOK_WA.
WRITE: <SB>-BOOKID, <SB>-FLDATE.
Regards
Anji -
Very urgent : Problem with field attributes in Datasource
Hi
I am getting a problem with field attributes in the datasource.
The issue came up after i modified the extract structure-i modified one field and
added one field to the structure.Now those two fields are not visible in BW.
When i checked with transaction rsa2, i could find that for those two fields , the
field attribute is <b>'A'</b> which is <b>'Field in OLTP and BW Hidden by SAP'</b>.
I tried to modify the field attribute to make it visible.Now the issue is that it is not getting reflected after transport in the Q system.What can be the issue.In the Q system its still the old value 'A' ,which makes the fields invisible.
Please let me know what can be the issue.
Regards
LeonHi,
did you change this attribute via RSA2?
you need to change your datasource via postprocessing (RSA6); then transport your DS to your Q source system.
Replicate your datasources in your BW.
Finally modifiy your Transfer Structure by editing your TRules ( tab Datasource/Tran structure), move your new fields from the right frame to the left frame)
Maintain your TRules
Activate
hope this helps...
Olivier. -
Problem with field GL Account is that it shows concatenated Chart of Accoun
Hello . Please help me. We have sap BI olap universe . problem with field GL Account is that it shows concatenated Chart of Accounts. But user want to trim the chart of account and show only account in list of values in webi report.
So What code I can put in Universe to remove this " 9000/" WHICH IS Chart of acct from GL Account
example List of values shows
9000/99030
9000/99070
I want to show as below
99030
99070
I tried replace function in universe it does not work. Pls help.
Thanks
soniyaHi,
You can do it in Web Intelligence using the function Right().
Depending on the SAP BW version you have it is possible to build such calculated expression in universe on uniquename or name:
<EXPRESSION>RIGHT[0CALMONTH].currentmember.uniquename,5)</EXPRESSION>
OR
<EXPRESSION>RIGHT([0CALMONTH].currentmember.name,5)</EXPRESSION>
You have to replace 0CALMONTH by the unique definition of GL Accounts and you also need to use the object referencing GL Accounts in your query in addtion to the calculated expression.
Regatds
Didier -
Hello All,
I am having a strange problem with field label? I have created a table with three fields one is MANDT and and the remaining fields as PATID and PATNA.
I am maintaining the field label for these fields, but still i am not getting the names of the fields while i am calling the structure in my alv tree.
I d'nt know what is the problem here?
can any one tell me how can i solve this issue?
Regards,
LisaHi lisa,
This is not the problem with Data Dictionary,
While declaring the fieldcatalogue for thr GRID.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'ZTABLE'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_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.
If gt_fieldcat-fieldname = 'PATID'.
gs_fieldcat-ref_field = 'ZTABLE'.
modify gt_fieldcat from gs_fieldcat.
clear gs_fieldcat.
endif.
Because while calling the FM it is populatinh the fieldname
so you need to modify the fieldcatalogue with fieldname then it will pick the field labels from the Dictionary.
Hope this will solve your problem.
Regards, -
Problem with field KONWA-Rate Unit(Currency or Percentage) of table KONP
Hi Gurus,
I m facing problem with field 'KONWA -Rate Unit (Currency or Percentage)' of table KONP. This field is showing Currency and '%' both in table KONP. For some materials its showing currency value and for some its showing '%'. Due to which its creating load problems. My question is how this '%' is coming (means is there any calculation behind that or something else) in table KONP and how can I identify this.
I am sure u will have the answer for this question so Thanks in advance.
Message was edited by:
Amit Rajput
Message was edited by:
Amit Rajput
nullHi,
take the following example: you sell liquor to customers; in your country, when you sell liquor your company is entitled to pay customs and excise fees to governamental authorities.
These excises and duties are a percentage of the retail price. You'll then create such a condition record with this rate so that you calculation schema will post the correct value during the processing of billing documents...
hope this shed light
Olivier.
Message was edited by:
Olivier Cora -
Problem with populating internal with field-symbol
hi all,
I have following structure of internal table .
internal Table 1(int1) : source,source_field, and other fields.
internal Table 2 (int2): x1,x2,x3,x4,x5,x6 .
Read table 1 assigning <gs_t1> with....
assign ( <gs_t1>-source_field ) to <ld_char> .
case <gs_t1>-source.
when 'int1'.
Read int1 assgining <gs_int1> .
ASSIGN COMPONENT <ld_char> OF STRUCTURE <gs_int1>
TO <fs_char>.
wa_output-x1 = <fs_char>.
simillarly,
ASSIGN COMPONENT <ld_char> OF STRUCTURE <gs_int1>
TO <fs_char>.
wa_output-x2 = <fs_char>.
The source_field of int1 contains any value either it can be x2,x3,x4 .
Now the problem is how my work wa_output should know that <fs_char> contains value of field x1 .
I mean to say how we willl determine that value to be passed is to wa_output-x1 or wa_output-x2 as <ld_char> is just a pointer we cannot determine anything .
so how should i make my workarea . It can be made as a fields-symbol but how to that .
As it is having a strucutre of like :
componenet component_type
CONTROLLER PRXCTRLTAB<-this is also a line type having value two fields
x1 char5
x2 char5
Plz help...Hi all,
i have to pass all field values after obtaining them to a workarea wa_output .
data : wa_output type xyz.
READ TABLE ist_smp_tst ASSIGNING <gs_smp_tst>
WITH KEY iden_no =
<gs_smp_tst_dtl>-iden_no
BINARY SEARCH.
ASSIGN COMPONENT <ld_char_val> OF STRUCTURE
<gs_smp_tst_lab> TO <fs_char>.
CONCATENATE 'WA_OUTPUT-' <fs_char> INTO l_field.
ASSIGN (l_field) TO <wa_field>.
<wa_field> = <fs_char>.
read table ist_temp .........
<wa_field> = <fs_char>.
I have done this but <wa_field> actually holds the current data of <fs_char>
it should be like
wa_ouput-f1 = <fs_char>..
wa_output-f2 = <fs_char>.
and the appending it to wa_output to i_output .
How we can do this using field-symbol.
Plz required help.
Regards. -
Sum for Dynamic Fields in a Dynamic Table with Field Symbol
Hi All,
I currently have an report which I am looking to update with some totals. The information is currently output in an ALV which is fed data from a dynamic table defined with a field symbol. The modification that needs to be applied is a summation per currency code where each of the fields to be summed is a dynamically named field at runtime. I am now just looking to see if anyone has any recommendations on how to obtain these totals it would be appreciated. I have no problem doing the leg work in piecing the solution together but am just stuck on which approach I should be investigating here. I have looked into several options but do to the fact that the totals are for dynamic fields in a dynamic table and it is a field symbol I am having some difficulties thinking of the easiest approach to obtain these totals.
Below is a simple sample of what the report currently looks like and what we are looking to add.
====================================================================================
As-Is Report:
DETAILED DATA ALV
Company Code | Plant | 2006 Total | 2007 Total | 2008 Total | CURRENCY
0001 | ABCD | 1,500 | 1,200 | 1,700 | USD
0001 | BCDE | 2,300 | 4,100 | 3,600 | GBP
0003 | DBCA | 3,200 | 1,600 | 6,200 | USD
Addition 1:
TOTALS PER CURRENCY
Currency | 2006 Total | 2007 Total | 2008 Total |
USD | 4,700 | 2,800 | 7,900 |
GBP | 2,300 | 4,100 | 3,600 |
Addition 2:
CONVERSIONS TO USD
| 2006 Curr | 2006 USD | 2008 Curr | 2006 USD |
USD | 4,700 USD | 4,700 USD | 7,900 USD | 7,900 USD |
GBP (1.5GBP/1 USD) | 2,300 GBP | 1,150 USD | 2,300 GBP | 1,800 USD |
====================================================================================
Any recommendations will be appreciated.Hi,
We cannot use the key word SUM in the loop at assigning statement.
The way i see is
When you are creating the first dynamic internal table , create one more with the structure below:
Currency | 2006 Total | 2007 Total | 2008 Total |
Then while populating the data into first itab,also move the contents to the second itab using collect statement.
Maybe you are looking for
-
Images not centred when placed into InDesign CC 2014
Hello, Since updating to InDesign CC every time I place a new image into a doc it drops down within the containing box a by a few mm. Auto fit is not on and the problem happens when placing an image via cmd + d or dragging and dropping from bridge or
-
Network don't play my music from Itunes
Hi everybody on this line... I have a wireless network with one Airport extreme and two Airport Express in my flat. One express is in the living room and one express in my bedroom -both connected with speakers. If I play music from my Powerbook the m
-
Hi I'm thinking of replacing our MS Office suite with pages (iwork) or Open Office. There are a few reasons I would like iwork but there is one thing that bothers me and thats the proprietary fileformats. I would like to be able to use python, perl,
-
This is very annoying, whenever I refresh a site, a window pops up on the left side of my screen of related searches, I want to turn this OFF
-
Discoverer 10g Plus and Viewer
I have installed Discoverer Admin and Desktop, Can someone please guide me the links to download Discoverer Plus and Viewer.