Field symbol assign problem
Hi ,
Please find below code when I tried in version 4.6 code works correctly . but in 6.0 it gives short dump..
Here.
FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE.
FIELD-SYMBOLS : <fs_work_area> TYPE yatsdzz00.
ASSIGN pr_data_changed->mp_mod_rows->* TO <fs_table>.
LOOP AT <fs_table> ASSIGNING <fs_work_area>. (In there system gives short dump)
Thanks in advance.
Hai,
Use CASTING or CASTING TYPE (mytype) after LOOP AT <fs_table> ASSIGNING <fs_work_area>.
ie:
FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE.
FIELD-SYMBOLS : <fs_work_area> TYPE yatsdzz00.
ASSIGN pr_data_changed->mp_mod_rows->* TO <fs_table>.
LOOP AT <fs_table> ASSIGNING <fs_work_area> <b>CASTING or CASTING TYPE (mytype).</b>
For more information click the below link:
http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb35de358411d1829f0000e829fbfe/frameset.htm
I hope it helps you.
Reward points if it helps you.
Regds,
Rama chary.Pammi
Similar Messages
-
DATA_OFFSET_TOO_LARGE dump for field symbol assignment/offset
Hi,
I am getting a DATA_OFFSET_TOO_LARGE dump for field symbol assignment/offset.
Dump says, 'In the running program "ZTEST", the field "<WA_FINAL>" of the type "u" and length 2174 was to be accessed with the offset 2204. However, subfield accesses with an offset specification that is not smaller than the field length are not permitted.'
Here <WA_FINAL> have to be 'TYPE any' to avoid assignment conflicts later in the logic.
It's basically dumping at <WA_FINAL>+V_LEN(V_OFF) = WA_DATA-FIELD1.
Here V_LEN LIKE DD03L-LENG & V_OFF LIKE DD03L-LENG.
Please suggest how to get rid of this dump.
Regards,
Ritesh.The dump is very clear, your field is smaller than the offset.
The problem is most likely how you are calculating v_len and v_off.
You could change that, but there is probably an easier and faster way to do what you are trying there. Is <wa_final> something like a line from a file or what? -
Hi,
I have a doubt regarding the field symbol assignment.
In my program, I have logic as below.
<b> W_1STCNTFLD = 'E_INV_AGING_STRU-PDISCCNTP1'.
W_2NDCNTFLD = 'E_INV_AGING_STRU-PDISCCNTP2'.
ASSIGN (W_1STCNTFLD) TO <FS1>.
ASSIGN (W_2NDCNTFLD) TO <FS2>.</b>
While debugging, when I see the values of the Field Symbols <b><FS1></b> and <b><FS2></b> after assignment, they are <b>0, 0</b>. Why is it like that..?
In general, what does a Field Symbol hold..? the value of the variable being assigned or the Memory location of that variable..?
When I remove the paranthesis while assigning like below,
<b>ASSIGN W_1STCNTFLD TO <FS1>.</b>
it is storing the value of the variable(<b>E_INV_AGING_STRU-PDISCCNTP1</b>) to <b><FS1></b> instead of '0'.
And what is the difference between <b>ASSIGN (W_1STCNTFLD) TO <FS1></b> and <b>ASSIGN W_1STCNTFLD TO <FS1></b>..? I mean, when we put paranthesis to the variable and when we remove the paranthesis.
Please clarify my doubts. Thanks in advance.
Thanks & Regards,
Paddu.when you use the paranthesis,(W_1STCNTFLD) actually equals to ('E_INV_AGING_STRU-PDISCCNTP1'),and the 'E_INV_AGING_STRU-PDISCCNTP1' must be the label of a data object,it can't be a string!
please refer to the following document(coming from sap abap keywords document):
Alternative 2
... [TABLE FIELD] (name)
Alternative 3
... oref->(attr_name)
Alternative 4
... {class|(class_name)}=>{attr|(attr_name)}
Effect
There are three dynamic variants for mem_area, where the storage area is not specified directly, but as the content of character/type data objects enclosed within parentheses.
In the first variant (name), the label in name is built exacltly like the direct specification. When the statement is executed, the content of name must be the label of a data object that can contain offset/length specifications, strucuture component selectors, and component selectors for the assignment of attributes in classes or objects (since Release 6.10). The content of name must be specified in uppercase letters.
The optional addition TABLE FIELD before (name) is only possible outside of classes. This addition limits the search area - where the data object specified in (name) is searched for (see below) - to the interface work areas for the current program group declared using TABLES. If TABLE FIELD is specified, casting_spec and range_spec cannot be specified explicitly.
If the label in name is a field symbol or a form parameter with an unstructured type, components can be addressed, as of Release 6.10, through structure component selectors. The components must exist when the statement is executed.
The second variant oref->(attr_name) is a special case of the first variant for the assignment of an instance attribute to a field symbol - where the object reference variable oref is specified statically. The label of the attribute is specified dynamically in the character-type field attr_name and must not be specified in uppercase letters.
The third variant {class|(class_name)}=>{name|(attr_name)} is a special case of the first variant for the assignment of a static attribute to a field symbol where the class name class and the name of the attribute name can be specified both directly and dynamically in character-type fields class_name or attr_name. The contents of attr_name and class_name do not have to be in uppercase letters. If the class name is specified dynamically and the attribute is specified directly, no offset/length specifications can be made for the attribute.
If a data object is specified dynamically, this is searched for in accordance with the following hierarchy.
Within the local data objects of the current procedure
Within the attributes, visible in a method, of the actual class, where , in instance methods, the self reference me-> is set explicitly before the label
Within the global data of the current program
Within the interface work areas of the main program of the current program group declared with TABLES
Within the attributes of the object to which oref refers, if the label has the expression oref-> (as of Release 6.10)
Note
Only for internal use can the label in name also have the form (PROG)DOBJ, whereby PROG is the name of an ABAP program and DOBJ is the name of a global data object of this program. If the program PROG is loaded during execution of the statement ASSIGN in the same internal mode as the current program is loaded, the data object (PROG)DOBJ in this program is searched for and the field symbol points to this data object after successful assignment.
Example
Dynamic access to an attribute of an object (Dynamic Access) through a field symbol.
CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS m1 IMPORTING oref TYPE REF TO object
attr TYPE string.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD m1.
FIELD-SYMBOLS <attr> TYPE ANY.
ASSIGN oref->(attr) TO <attr>.
WRITE <attr> ...
ENDMETHOD.
ENDCLASS. -
Problem with slis_t_specialcol_alv Field Symbol Assignment
I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. Ive also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>CINFO</b> to contain color information for that particular row. In the code below the dynamic itab is pointed to by field symbol <dyn_table> while the work area for it would be <dyn_wa>.
Somewhere down the line I attempt to assign the CINFO component of the current row of the itab to a field symbol called <fs_cinfo> typed as slist_t_specialcol_alv (Same as CINFO).
I used the code:
ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
This gives me the runtime error:
<i>Type conflict in the ASSIGN statement in the program "ZHRR001_TEMMATRIX".
You attempted to assign a field to a typed field symbol,
but the field does not have the required type. </i>
I am unsure why this happens as both the component CINFO and FS <fs_cinfo> are of type slist_t_specialcol_alv.
For some odd reason though during debugging, I took a look at the <dyn_wa> structure and the component type of CINFO was displayed as C???
Here is the relevant portion of code (creation of dynamic itab and attempting to assign <fs_cinfo>)
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>.
FIELD-SYMBOLS: <fs_cinfo> TYPE slist_t_specialcol_alv.
DATA: lw_cinfo TYPE slis_specialcol_alv.
DATA: li_fldcat TYPE lvc_t_fcat,
lw_fldcat TYPE lvc_s_fcat.
*Create internal table fields (they will be called Field1, Field2, etc)
*Last column will be named 'CINFO' to contain row color information
DO l_alvcolumncount TIMES.
index = sy-index.
IF index <> l_alvcolumncount.
CLEAR lw_fldcat.
CONCATENATE 'Field' index INTO lw_fldcat-fieldname .
CONDENSE lw_fldcat-fieldname NO-GAPS.
lw_fldcat-datatype = 'STRING'.
* lw_fldcat-intlen = 5.
APPEND lw_fldcat TO li_fldcat .
ELSE.
CLEAR lw_fldcat.
lw_fldcat-fieldname = 'CINFO'.
CONDENSE lw_fldcat-fieldname NO-GAPS.
lw_fldcat-datatype = 'slis_t_specialcol_alv'.
APPEND lw_fldcat TO li_fldcat.
ENDIF.
ENDDO.
* Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = li_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>.
ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
* Color this cell
lw_cinfo-fieldname = fieldname.
lw_cinfo-color-col = 6.
APPEND lw_cinfo TO <fs_cinfo>.
Message was edited by: Sow Yong WongHello Sow
There is a big problem in the program: you are mixing types used for FM-based ALV (SLIS_...) and ABAP-OO based ALV (LVC_...).
For ABAP-OO based row colouring you have to define your itab like this:
TYPES: ty_s_outtab.
INCLUDE TYPE kna1. " just an example
TYPES: rowcolor(4) TYPE c.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab TYPE STANDARD TABLE of ty_s_outtab
WITH DEFAULT KEY.
In the layout (LVC_S_LAYO) you have to set <b>ls_layout-info_fname = 'ROWCOLOR'</b>.
ROWCOLOR has to be filled according to <b>Cxyz</b> whereas
- x = color
- y = inverse on/off
- z = intensified on/off
For documentation please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference to ALV Grid Control</a>
Regards
Uwe -
Field Symbol - Assign type conflict.
Hi, i active successfully my program. This is the code:
DATA ls_g_oref_appl(21) TYPE C.
FIELD-SYMBOLS: <fs_appl> TYPE REF TO cl_ftr_mj_appl.
ls_g_oref_appl = '(SAPLTB4E)g_oref_appl'.
ASSIGN (ls_g_oref_appl) TO <fs_appl>.
But when i execute it, i get a dump with this message:
"ASSIGN_TYPE_CONFLICT : You attempted to assign a field to a typed field symbol,but the field does not have the required type. "
Also, i get sy-subrc = 0, so the field symbol <fs_appl> has a value assign.
Any suggestions? I tried by changing the type of the field to ANY, but it didnt compile.
Thanks for the help,
KarlaHi Daniel, I verified again the type of g_oref_appl, and it is : cl_ftr_mj_appl. I check the top of the include and g_oref_appl is there :
' DATA g_oref_appl TYPE REF TO cl_ftr_mj_appl. '
Hi, Naren, also i tried with the TYPE ANY, but it doesnt compile.
I notice this:
CLASS cl_ftr_mj_appl DEFINITION ABSTRACT.
Is there a problem with field symbols and abstracts class???
Thanks for all your help,
Karla.
Edited by: Karla Tinoco on Mar 5, 2008 11:46 PM -
Field Symbols Assign Type Conflict
Hi,
I am working on a BAdi Implementation and have the following code.
<b>method IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION .
FIELD-SYMBOLS:
<ls_attributes> TYPE dpr_ts_project_ext.
ASSIGN cs_attributes TO <ls_attributes> .
CASE flt_val.
WHEN cl_dpr_co=>sc_ot_project.
<ls_attributes>-extended_attributes-ZZSOL_PRJ_ID = 'C0001'.
ENDCASE.
ENDMETHOD.</b>
This is the sample implementation code provided by SAP. However, when I implement the above code, the system dumps at the statement
<i> ASSIGN cs_attributes TO <ls_attributes> .</i>
and cs_attributes is of type any.
I tried the same code by adding "CASTING" at the end of above line. But, it still gives the dump. Below, is the dump message.
Note
The following error text was processed in the system BS3 : Error in ASSIGN in the program ZCL_IM_DPR_ATTRIBUTES=========CP .
The error occurred on the application server acequad_BS3_30 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Form: IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION of program ZCL_IM_DPR_ATTRIBUTES=========CP
Form: IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION of program CL_EX_DPR_ATTRIBUTES==========CP
Form: ATTRIBUTES_DEFLTS_UPON_ACTION of program CL_DPR_BADI_SERVICES==========CP
Form: ATTRIBUTES_DEFAULTS_UPON_CREA of program CL_DPR_BADI_SERVICES==========CP
Form: SET_DEFAULTS_UPON_CREATION of program CL_DPR_PROJECT================CP
Form: SET_DEFAULTS_UPON_CREATION of program CL_DPR_PROJECT_O==============CP
Form: CONSTRUCTOR of program CL_DPR_PROJECT_O==============CP
Form: IF_DPR_APPL_OBJECT_FACTORY~CREATE_PROJECT of program CL_DPR_APPL_OBJECT_FACTORY====CP
Form: CREATE of program CL_DPR_BSP_APPLICATION========CP
Form: DO_HANDLE_EVENT of program CL_DPR_BSP_C_TOOLS============CP
Any ideas on how to use field symbols in the above context??
Thanks,
RajeshHi Rajesh,
The reason it is dumping is because the actually type of the variable passed in CS_ATTRIBUTES is not fixed this is why they have specified it's type as type any.
The sample code in this regard is not correct, you should fist check the value of FLT_VAL to determine what type of variable CS_ATTRIBUTES actually is.
In the BADI documentation there is a list of values for field FLT_VALUE and the corresponding data type of CS_ATTRIBUTES for that value (According to the documentation the data type for FLT_VAL sc_ot_project is DPR_TS_PROJECT_INT).
method IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION .
FIELD-SYMBOLS:
<ls_attributes> TYPE dpr_ts_project_int.
<i><b>* ASSIGN cs_attributes TO <ls_attributes> .</b></i>
CASE flt_val.
WHEN cl_dpr_co=>sc_ot_project.
<i><b>ASSIGN cs_attributes TO <ls_attributes> .</b></i>
<ls_attributes>-extended_attributes-ZZSOL_PRJ_ID
= 'C0001'.
ENDCASE.
ENDMETHOD.
In this example you will ultimately end up with multiple field symbols for representing the CS_ATTRIBUTES parameter, one field symbol for each filter value you intend handling.
From
De Wildt -
Error in Field symbol assignment
What is wrong in following code ???
At line --> (Bold) I am gettin sy-subrc 4.
field-symbols: <F> type any,
<FSVALUE> type any.
SPLIT P_QUOTATION_TEXT-TEXT_LINE AT CRLF INTO TABLE I_SPLIT.
IF NOT I_SPLIT[] IS INITIAL.
LOOP AT I_SPLIT ASSIGNING <F>.
--> ASSIGN COMPONENT SY-TABIX OF STRUCTURE <F> TO <FSVALUE>.
IF SY-SUBRC = 0.
WA_TEXT-ITM_NUMBER = P_QUOTATION_TEXT-ITM_NUMBER.
WA_TEXT-TEXT_ID = C_HEADERTEXT.
WA_TEXT-LANGU = 'EN'.
WA_TEXT-FORMAT_COL = '*'.
WA_TEXT-TEXT_LINE = <FSVALUE>.
APPEND WA_TEXT TO I_TEXT.
CLEAR WA_TEXT.
ENDIF.
ENDLOOP.I'll try to get clearer
SPLIT P_QUOTATION_TEXT-TEXT_LINE AT CRLF INTO TABLE I_SPLIT.
You are splitting at CRLF, fine. I_split has only one field or none if you want to get more thecnical.
LOOP AT I_SPLIT ASSIGNING <F>.
Here you are starting to loop at each entry of i_split, assigning each entry to , again only one field
ASSIGN COMPONENT SY-TABIX OF STRUCTURE <F> TO <FSVALUE>.
Again, this will never work because as you are declaring it i_split doesn't have an structure, also doesn´t have an structure only one field
It doesn't make any sense that you are assigning the same field to another field-symbol when you already have one.
And even if you used the type I told you, it would only work in the first pass because only in the first pass you can assign the component 1 of the structure because the structure only has one field, there would not be any component 2,3... etc.
Again I don't understand what you are trying to do, if you want to assign that loop pass text to a table, just pass the field-symbol you already have -
Deal All,
i am using field symbol here,while trying to assign the character value into field smybol.
It is generating the error.cannot be converted into number ..so wht should be the type of the field symbol.
field-symbol : <RATING> TYPE ANY.
CONCATENATE 'wa_final1-f' V_COUNT INTO V_FIELD.
CONDENSE V_FIELD.
ASSIGN (V_FIELD) TO <RATING>.
WRITE WA_FINAL-RATING1 TO V_PAK .
<RATING> = V_PAK. "ERROR GENERATING HERE WHILE ASSIGNING VALUE OF V_PAK TO <RATING>
VALUE OF V_PAK = 'DME' ( I.E CHARACTER FIELD).
thanks in advance..field-symbol : <RATING> TYPE ANY.
CONCATENATE 'wa_final1-f' V_COUNT INTO V_FIELD.
CONDENSE V_FIELD.
ASSIGN (V_FIELD) TO <RATING>.
WRITE WA_FINAL-RATING1 TO V_PAK .
UNASSIGN <RATING>.
ASSIGN V_PAK TO <RATING>.
Edited by: vijetasap on Jun 4, 2009 7:11 AM -
hi masters,
i have a statement like this.
MODIFY (p_table) FROM TABLE <ntab>.
now i have values in <NTAB> so how can i read this can anyone tel me pls?
thank you,
pasala.Hi pasalabasker,
this code will help you.
FIELD-SYMBOLS <lt_any> TYPE ANY TABLE.
FIELD-SYMBOLS <ls_any> TYPE ANY.
DATA:
lr_data TYPE REF TO data,
ls_mara TYPE mara,
lt_mara TYPE STANDARD TABLE OF mara.
SELECT *
FROM mara
INTO TABLE lt_mara
UP TO 10 ROWS.
ASSIGN ('LT_MARA') TO <lt_any>.
CREATE DATA lr_data LIKE LINE OF <lt_any>.
ASSIGN lr_data->* TO <ls_any>.
LOOP AT <lt_any> ASSIGNING <ls_any>.
MOVE-CORRESPONDING <ls_any> TO ls_mara.
WRITE: ls_mara-matnr, /.
ENDLOOP.
regards Marcel -
Dynamic Field-Symbol assignment - Short Dump
Create three programs as mentioned:
REPORT zforms.
*& Form form_fs_assign
* text
FORM form_fs_assign.
FIELD-SYMBOLS <fs> TYPE table.
DATA: fs_itab LIKE STANDARD TABLE OF tab_matnr WITH HEADER LINE.
break-point.
ASSIGN ('(ZPROGRAM1)ITAB[]') TO <fs>.
IF sy-subrc EQ 0.
fs_itab[] = <fs>[].
LOOP AT fs_itab.
WRITE / fs_itab-matnr.
ENDLOOP.
ELSE.
Write:/ sy-repid, 'field-symbol not assigned'.
ENDIF.
ENDFORM. "form_fs_assign
REPORT zprogram1.
DATA: itab LIKE STANDARD TABLE OF tab_matnr WITH HEADER LINE.
itab-matnr = '1111'.
APPEND itab.
itab-matnr = '2222'.
APPEND itab.
WRITE:/ sy-repid.
PERFORM form_fs_assign IN PROGRAM zforms.
SUBMIT zprogram2.
REPORT zprogram2.
break-point.
*-- enter (ZPROGRAM1)ITAB[] in the variable and press enter
* the yellow icon stating that it doesn't exist appears
* but when the following form is called, it does checks
* the <fs> assign and doesnt gives any runtime error
* while in Pricing routine, the similar situation
* does gives the error
PERFORM form_fs_assign IN PROGRAM zforms.
*Execute zprogram1 and debug, works fine..*
*Execute zprogram2, (ZPROGRAM1)ITAB[] doesn't exist, still it doesn't leads to short dump*
*BUT, a very similar situation in a Pricing Requirment Routine leads to a short dump:*
*Runtime Error GETWA_NOT_ASSIGNED*
*ShrtText Field symbol has not yet been assigned.*
*Pricing Routine Code Snippet:*
*-- {3. -
determine qualifying prior invoices in memory----
FIELD-SYMBOLS: <fs_vbrk> TYPE table.
FIELD-SYMBOLS: <fs_vbpa> TYPE table.
FIELD-SYMBOLS: <fs_komv> TYPE table.
DATA g_it_vbrk LIKE STANDARD TABLE OF vbrkvb WITH HEADER LINE.
DATA g_it_vbpa LIKE STANDARD TABLE OF vbpavb WITH HEADER LINE.
DATA g_it_komv LIKE STANDARD TABLE OF konv WITH HEADER LINE.
DATA: l_vbrk_lines TYPE i.
ASSIGN ('(SAPLV60A)XVBRK[]') TO <fs_vbrk>. <- "Error occurs here
ASSIGN ('(SAPLV60A)XVBPA[]') TO <fs_vbpa>.
ASSIGN ('(SAPLV60A)XKOMV[]') TO <fs_komv>.
g_it_vbrk[] = <fs_vbrk>.
g_it_vbpa[] = <fs_vbpa>.
g_it_komv[] = <fs_komv>.
DESCRIBE TABLE g_it_vbrk LINES l_vbrk_lines.
READ TABLE g_it_vbrk INDEX l_vbrk_lines.
** remember to make vkorg and vtweg check for vbrk invoices
DELETE g_it_vbrk WHERE vbeln = g_it_vbrk-vbeln.
DELETE g_it_vbpa WHERE vbeln = g_it_vbrk-vbeln OR parvw <> 'WE'.
DELETE g_it_komv WHERE knumv = g_it_vbrk-vbeln OR kschl <> 'ZF02' OR kbetr = 0.Hello friends,
Rich,
The piece of code you suggested didn't work, and still led to the short dump.
Naimesh,
I agree that XVBRK is not declared globally, and if it is a Table, and declared as global work area using Tables, we could have used it directly using ASSIGN (VBRK)...
But, since its not the case, I am not able to do so...
Still, my requirement remains the same. I have to get the invoices created (in memory) but not saved during a collective billing run.
And the required data is available in the (SAPLV60A)XVBRK internal table, from which I am able to retrieve it for the first time, but clicking on the conditions tab in the item details leads to this short dump, becs (SAPLV60A)XVBRK[] isn't available at that moment. Still, if it is not available I suppose it should just set the sy-subrc to 4 instead of ending into a short-dump.
Jürgen Hartwig,
I know ZPROGRAM 1 can't work in ZPROGRAM 2, but it doesnt leads to the short dump either, does it? But in case of pricing it gives the run time error, this is exception I want to handle!
XVBRK is not declared globally, but since SAPLV60A calls a perform in SAPLV61A, it remains in the ABAP stack and we can access it using (SAPLV60A)XVBRK[] kind of assignment.
When the same is called during Item Conditions display, its PBO is in the stack but not other forms (in which it might have defined).
Rich, is there a way to get all the variables available in scope at any instance during runtime?
Well, Jürgen, I though it Germany it was called "schmutzig zuweisen" :-)... by the way, the same method has been used at several places in standard SAP programs with the sy-subrc check.
Reference Data:
when the assignment happens successfully, the ABAP Stack looks similar to:
Call | Program | Subroutine
10 | SAPLV61A | some_subrountine
09 | SAPLV61A | some_subrountine
08 | SAPLV61A | some_subrountine
07 | SAPLV60A | some_subrountine
06 | SAPLV60A | some_subrountine
05 | SAPLV60A | some_subrountine
04 | SAPLV60A | some_subrountine
03 | SAPLV60A | some_subrountine
02 | SAPLV60A | some_XKOMV_AUBE..subrountine
01 | SAPLV60A | PAI_some_subrountine
when the assignment doesnt happens, the ABAP Stack looks similar to:
04 | SAPLV61A | some_subrountine
03 | SAPLV61A | some_subrountine
02 | SAPLV61A | some_subrountine
01 | SAPLV60A | PBO_some_subrountine -
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 -
HI. Problem in concatenating a field symbol
Hi,
I used the following code... for downloading the file in application server..
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT.
IF SY-SUBRC EQ 0.
LOOP AT <FS_ITAB> ASSIGNING <FS_TAB>.
DO.
To Assign the Field Symbol
ASSIGN COMPONENT SY-INDEX OF STRUCTURE
<FS_TAB> TO <FS_LINE> .
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
To Type Cast the retrieved data.
CONCATENATE L_R_FILE <FS_LINE>INTO L_R_FILE
SEPARATED BY
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
ENDDO.
TRANSFER L_R_FILE TO P_FILE.
CLEAR: L_R_FILE.
ENDLOOP.
CLOSE DATASET P_FILE.
IF SY-SUBRC <> 0.
Unable to close the file in application server
Message e057.
ELSE.
WRITE:/(30) V_FILE,
(30) 'Generated successfully'(M02).
ENDIF. "IF SY-SUBRC <> 0.
ENDIF. "if not rb_pres is initial.
ENDIF. " IF NOT RB_PRES IS INITIAL.
ENDIF. " if not <fs_tab> is initial.
It Gave a dump saying the conversion to standard type not possible. (like C,N,T..)..
So I changed the following part as
L_V_FILE = <FS_LINE>.
CONCATENATE L_R_FILE L_V_FILE INTO L_R_FILE
SEPARATED BY
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
Now the Problem is when the File is downloaded.. there is an #(Space/Tab) in the first column..
Can Any one help me in soliving this issue..
Thanks In Advance..
Guhapriyan Subrahmanyam..Hi,
Can you try the same with <b>SPACE_STR</b> instead of HORIZONTAL_TAB?
Also,
If only the tab(#) in the first column is the only problem..then, after the DO..ENDO... truncate the first # and then proceed further...
Regards,
Raj
Message was edited by: Rajasekhar Dinavahi -
BPC NW: Field symbol not assigned in BADi as Endroutine
HI Experts,
I have a problem when working with BADis as Endroutines in a TransformationFile.
Guided by the "How To... Use Start and End Routine" I followed the different steps and for the Start Routine everything works fine. My problem is when trying to call the TransformationFile with the Endroutine I get a GETWA_NOT_ASSIGNED dump telling me that: Field symbol has not yet been assigned.
I'm using quite the same code as given in the How To. I introduced some checks, but I did not get any positive results. Can anybody help, please? The How To is made for master data, I assume the error comes from this side, but I can't assure it.
The code in the Badi is:
field-symbols:
type any.
data: lt_columns type table of string.
data: lt_column_data type table of string.
data: lt_message type uj0_t_message.
data: lt_error_reason type uj0_t_message,
lv_tabix like sy-tabix.
data:
lo_dataref type ref to data,
lv_cuenta_asig type zmap_cuentas-cuenta_asignado.
Assign importing data reference to field symbol
assign ir_data->* to IS ASSIGNED.
Create work area for importing data
create data lo_dataref like line of .
Create new internal table for exporting data
check .
Get CUENTA value from custom table or other datasource
loop at .
The error occurs when assigning the first pointer.
By the way, I'm working on BPC 7.5 SP07 for NW.
Hope someone can help. Thanks very much in advance,
ÀlexHi Kaylan,
thank you very much for your quick answer.
Sorry, I think I haven't made quite clear my point.
I want to use the Endroutine BADi in a Transformation File for Transaction Data, therefor there is no InfoObject directly involved. I use the Transformation File in the Package "Import Transaction Data". The How To I mentioned, and the only one I found that is more or less near to my problem describes how to use Endroutines and BADis for the Import of Master Data.
Looking at the different tests I have done, as our system team is not giving us a debug user, the dump happens at the assignment of the first field symbol: assign ir_data->* to . Therefor I assume that ir_data contains no data and this causes the dump.
My main question is, can I use the code of the mentioned How To for the package "Import Transaction Data" at all? Or do I have to use different tables or table names for this package? How and where do I get them?
You have an idea? Would be very helpful! Thanks in advance!
Cheers
Àlex -
Problem With Insert statement using field symbols with unicode enabled
I was writng a function module for dyanamic operations on the table. We are using the field symbols, function module is unicode enabled.
Assign statements are working fine, with which we created work are <fs_wa_header> and internal table <fs_tb_item> dynamically based on the table name (IM_TB_HENAME) which we get as import parameter.
we have query which is giving us dump.
INSERT (IM_TB_HENAME) FROM <FS_WA_HEADER>.Hi
INSERT (IM_TB_HENAME) FROM <FS_WA_HEADER> is good for inserting a line in the database, so IM_TB_HENAME has to have the name of dictionary table.
U should write:
INSERT <FS_WA_HEADER> INTO (IM_TB_HENAME).
But I believe you can't use the variable IM_TB_HENAME, you should use another field-symbols:
ASSIGN (IM_TB_HNAME) TO <FS_TB_ITEM>.
INSERT <FS_WA_HEADER> INTO <FS_TB_ITEM>.
Max -
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
Maybe you are looking for
-
Well i have to redownload my printer HP DeskJet 3512. I have done it once before, but something is really wrong with the drivers or something. Last time it went flawlessly not one problem. Now on the same computer i can't get the printer to be recogn
-
Error in mapping the BAPI to the model in vc
Hi all, I am new to the visual composer. I have created the new model, i am trying to map the bapi to the model. iam getting the followin error when tried to select the avialable bapi in the VC error : Failed to fetch the meta data This selected e
-
Not able to deploy MDM Enrichment Controller.
Hi Guys, I am not able to deploy the MDM Enrichment controller, i get ServerDeploymentException. I tried Deploying using the JSPM tool. I doubt whether is it due to the mismatch is SP level of my MDM server and the Netweaver installation. MDM version
-
CRMXIF_ORDER_SAVE - not getting any error log
Hi, I am using the FM CRMXIF_ORDER_SAVE for creating a quotation in CRM. I have poplulated all the required fileds but the FM is not returning any error value. Kindly help me in solving the problem. Please find the sample code below. Correct answe
-
Hi, I have a view that is handling touches. I have a tabbar in the same view. I can determine when touch is made in the area where there is a tabbar . The problem is that I want the events inside the tabbar area to be handled by tabbar did select met