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
I have a number of projects created on Adobe Draw using a different Adobe ID from the Adobe ID that is associated with my Creative Cloud subscription.  How do i get these assets moved over to the correct account (i.e. the one with the subscription)?Y [More]
Hi, In Dashboard , I have two Qaawses (Qaaws1 and Qaaws2). When I am trying to generate SWF file both the qaawses are running. My requirement is, in Excel file I will set a flag value in one cell (0/1). If the cell value is '0' then the Dashboard sho [More]
Hello All, While doing a interim invoice, the system is generating an error "G/L account  does not exist". All the G/L are maintained. Can anyone guide what the issue could be. thanx.Hi, The GL account is determined based on the following combin [More]
My laptop's keyboard is not working in Mozilla at all but works anywhere else. I am currently writing this in Word and cut and pasting it into the feedback box. I really need to fix this because it's really making things difficult because I really do [More]
Hello! I bought a new Wiretek VE492 Hard Drive Docking Station to use my Hitachi Deskstar™ 7K2000 2TB HDD like external drive, but have a little problem in use: don't work the eSATA hot swappable function! What is the problem? (The docking station is [More]
          I am looking to use Weblogic 6.0 in a multi locale environment           where the user input from the browser could be in different encodings           (the encoding would be known for a given session). However request.getParameter()       [More]
My notes keep getting deleted from my iPhone 4S and my iPad 2. How do I recover them?They are synced through iCloud. How can I view if they appear in iCloud? Because they don't appear in my notes, and I have not checked my Mac to see.Read other 4 ans [More]
Hello Guru, I have a requirement to create custom scheme with totally new custom function , rules . my question is it is possible to declare custom internal tables like TIP, TOP and cutom cluster to store results. if yes then how ? Thanks in adanceMy [More]
Hello every one, In my project, my client is asking for plant availabilty report. Now in this report they want availabilty of the report at plant level in percentage. I am not getting how to get these figures becoz in PP there is nothing like monthly [More]
my airport extreme is model number A1408 and I am using a windows 8 pc to try and use the Airport utility app to connect to my base station to port forward and ive done it before but now it wont detect my router even though im connected to the wifi f [More]