Sitemap

Amicuk Programming Answers

Field-Symbols as Method Parameter

-0001-11-30   Views:0

Advertisement

Hi all, is there a way to create a field symbol within a method and export this field-symbol directly as a method parameter? The problem is that we can't pass a field symbol as method parameter unless it's assigned, but we would like to assign the fi

Hi all,
is there a way to create a field symbol within a method and export this field-symbol directly as a method parameter?
The problem is that we can't pass a field symbol as method parameter unless it's assigned, but we would like to assign the field symbol within a method and give the result back to the calling program.
We have managed to create a field symbol within the method and give back the result as a reference (we used the type ANY).
We would like to pass the result field-symbol directly as a Method parameter.
Any ideas?
Best regards Dominik

The replay answer
Advertisement
Hi all,
thanks for you help. I managed to do the method calls with reference parameters but I'd like to do it with fieldsymbols instead.
Your suggentions for field-symbold worked, but I could use them only with primitive datatypes.
In my requirements the table must be created within the method, so the caller doesn't know the tablestructure.
If a dummy table is assigned to the field-symbol before the call, the error "Two internal tables are neither compatible nor convertible" is produced.
Is there a solution?
Thanks in advance
Dominik
class ZZX0_CL_TEST definition
  public
  final
  create public .
public section.
  class-methods FIELD_SYMBOLS_TAB_TEST
    changing
      !FS type ANY .
METHOD FIELD_SYMBOLS_TAB_TEST .
  DATA: it_t000 TYPE TABLE OF t000.
  FIELD-SYMBOLS <field_symbol> TYPE ANY TABLE.
  ASSIGN it_t000 TO <field_symbol>.
  fs = <field_symbol>.
  EXIT.
ENDMETHOD.
REPORT zzx0_mini.
DATA: it_mara  TYPE TABLE OF mara.
START-OF-SELECTION.
* Tabellen test
  FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
  ASSIGN it_mara TO <fs>.
*  ASSIGN it_t000 TO <fs>.
  CALL METHOD zzx0_cl_test=>field_symbols_tab_test
    CHANGING
      fs = <fs>.
  EXIT.

Go to See the other 9 answers

Field-Symbols as Method Parameter

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, is there a way to create a field symbol within a method and export this field-symbol directly as a method parameter? The problem is that we can't pass a field symbol as method parameter unless it's assigned, but we would like to assign the fi[More]

Field symbol as import parameter in class method ???

Category:DefaultRelease time:2015-10-11Views:130

Hi everyone, is it possible to pass a field symbol as an import parameter to a method in a class? If yes, how do I define the data type of the import parameter? I'm trying to work with field symbols as the program doesn't know what kind of structure[More]

Using field symbol on export parameter

Category:DefaultRelease time:-0001-11-30Views:130

HI All, I am using this logic In few methods of mine and I wonder if there is option the create one method and every time that I need it just call it. The issue is that <lt_output> is not assign yet (this need to happen in the method itself )so And[More]

Field Symbols in methods

Category:DefaultRelease time:2015-10-11Views:130

Hi all, i'm working with classes and interfaces.i have a class and some methods in it.in one of the method i create a new transaction number and this transaction number should be stored in some structures.there are 6 structures.in OO Abap internal ta[More]

Using field symbols in method issue

Category:DefaultRelease time:-0001-11-30Views:130

HI All I created a method as follows and the problem is that when i enter to the method the i have dump since the field symbol is not assigned there is a nice way that i can by-pass this issue , the reason that i created a method for that is that i n[More]

Field-symbols as parameters to the method of a class

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I am having an doubt regarding the field-symbols.Can we pass the field-symbols as a parameter to the method of a class.If yes can anyone tell me how to do this. Before posting I have searched regarding it in google but I did not find any bett[More]

Field symbols inside class

Category:DefaultRelease time:-0001-11-30Views:130

Is it possible to declare field symbols inside classes? Thanks in advance. Hema Moderator message: please search for information and try yourself before asking. Edited by: Thomas Zloch on Dec 23, 2010 10:55 AMHi Hemalatha, We can use Field Symbols in[More]

Problem trying to create FIELD SYMBOLS in BADI.

Category:DefaultRelease time:-0001-11-30Views:130

Hi guys! I'm trying to create a Field Symbol in method CHECK of BADI me_process_req_cust (well, I'm working on a Z implementation). The problem is that I'm trying to create a FIELD SYMBOL and when I check the syntaxsis, I receive the next error: Clas[More]

How to move a dynamic variable to a FIELD-SYMBOL

Category:DefaultRelease time:-0001-11-30Views:130

Hello: i would like to ask a favor i have been trying to move a dynamic variable to a FIELD-SYMBOL but, when i compile the programm it send a error message that say 'error with assign'. The FS is declared like this FIELD-SYMBOLS: <dyn_table> TYPE ST[More]

Field symbols values passing as parameter to Methods

Category:DefaultRelease time:2015-10-11Views:130

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 hav[More]

How to pass field symbol as parameter to a method

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have a field symbol of type table,also i have a method with parameter (say vbeln), i need to pass the range value in <fs> as the parametrs to the method., How can I acheive this, A code snippet eill help me a lot., Thank you. Arjun.GHi, Exampl[More]

Hot
Hello All, I have a production order with 5 subordinate production orders . For the order header there is a WBS element assigned . But for the subordinate orders, WBS should be the same as that of order header WBS. My problem here is , PO is created [More]
Hello, We have a customer who has an ERP system with a transport route which is the following: One single Development system which feeds, 2 QA systems and then 2 PRD systems. We are to implement ChaRM and we want to customize the tickets so that ever [More]
When I hit the FnF5 button, I only get the Wireless LAN Radio option and not the BlueTooth. What should I do or check to enable my Bluetooth radio? When I first got my new laptop the radio was on by default and working. Since then I have turned off a [More]
Oracle application server 10.1.2.3 using ssl. Im seeing this in my event_log for webcache over and over. Dosent seem to be service impacting, just curious why im getting them? [error 11321] [ecid: 130119394485,0] Connection from browser cannot be est [More]
when using apps or running safari my iphone glitches then takes an age to reboot,done a full restore but still getting same problems any ideasThe Basic Troubleshooting Steps are: Restart... Reset... Restore from Backup...  Restore as New... If you ha [More]
Hi. I called Nokia customer service on Wed/Thursday (My phone company instructed me to do this because of an issue i was having with the phone) and after explaining my problem, was told to follow the instructions I was given. Turns out, all this did [More]
Hi, I am trying to run reconciliation on a DB Table as the target resource. It is linking the user accounts that are present in the target resource. But for the user accounts that are deleted on the target resource Reconciliation is not showing any a [More]
hi all i have a table like this EMPNO NOT NULL NUMBER(4) HIREDATE DATE OFF_DAY NUMBER(3) now what i want is i want to restrict the user with out entering the data in off_day column continuesly for three days ex 10 22-09-2004 8 10 23-09-2004 8 10 24-0 [More]
Hi, I have a Product Table, and using properties on the table, I developed level based hierarchy(not manually). I also have a sales fact table, and partner table. I have multiple products, and for each product there are multiple partners. My requirem [More]
I purchased music on a new computer that I have allowed access to for my ipod but now because my library is on my other computer it says this computer is not synced to my ipod so now I can't even sync my purchased music unless I want to erase all of [More]