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've read a million different posts on this subject, but they all seem to differ a little from our issue. We have a Lync 2013 setup, with Lync Hosting Pack. Our setup is pretty basic, with a front end server, a backend, edge. We also deployed an AD F [More]
I have tried to start the mixer and equalizer and get the following messege "unable to change sound device to your selected device." All was working just fine yesterday. Also, I was unable to configure the speaker setup. I had to go to the audio [More]
I fill in the text boxes in a pdf in Adobe Reader on the Ipad, save the document however when I go to email the aforementioned document the contect boxes are blank - help please...You won't be able to view the filled in document in most iOS apps. How [More]
Hi all,         how will we attach pdf file to a tasklist?Hi, 1. Using General Object services, u can attach pdf to tasklist : http://help.sap.com/saphelp_nw70/helpdata/EN/be/3fe63659241157e10000009b38f889/frameset.htm 2. U can create a document info [More]
<- jb:/home/jbsnake/.ssh -> sudo pacman -Syu :: Synchronizing package databases... current [################] 100% 37K 70.5K/s 00:00:00 extra [################] 100% 143K 76.6K/s 00:00:01 :: xorg conflicts with ttf-bitstream-vera. Remove ttf-bitstre [More]
I want to cancel my subsrciption . periodHi John Gorski, Please use this Link to cancel your subscription : Cancel your membership or subscription | Acrobat, Acrobat.com online services In case you are having any issues while accessing or using Adobe [More]
Oracle Apps v 11.5.1, OS HP-UX 11.0 64 bit. I am trying to create a date related hold in OM. The order should not be executed if the pick release or ship confirm date exceeds the order expiry date. In OM I will define a hold, and assign a responsibil [More]
Hello all, Can anyone help me in stopping oc4j services... Problem desc: when i starting windows oc4j starts automatically. I need it stop it and it should be started when i require...i mean i will start it maually. Thanks ACheck this link, http://ge [More]
Since upgrading to Lion I cannot connect to my Buffalo Terastation and get the following message. "The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem".  I have [More]
Hi!. Yosemite make my Mac very, very slow I repair permission in  Single user mode : speedier Run this test with Etrecheck : So slow that I can't type more than one character  every 4 seconds Thanks Problem description: need to know what is obsolete [More]