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 use my MBP 15 (late 2011) with 24" Apple LED Cinema display in a clamshell mode. After disconnecting external display, and opening display, it shows horizontal shifted bars, so it becomes completely unusable. Have to hard reset laptop. Any hints on [More]
Hi, up until recently Mail would politely prompt me to choose an alternate SMTP setting if I had sent an email using a non-available server setting. Example: When at home my ISP requires me to use smtp.johndoe.com but when at work I use their relay s [More]
Hi, I have a Manager when he clicks on the calender option he is unable to see all the activities scheduled for a particular employee in his calender viwe whereas if i check that particular employee's calender he has all the details of the activities [More]
Hi experts, While doing upgrade from OIM 10g to OIM 11g, I am not able to upgrade OIM Middletier. Steps performed till now 1. Run OSI Upgrade Utility in OIM 10g. 2. Export OIM 10g DB Schema from Oracle database version 10.2.0.2. 3. Run prepare_xl_db. [More]
Hi, I hope anyone with experience with the extraction of purchasing can help: We want to determine the quantity to be delivered/quantity to be invoiced per vendor in BW (just like the R/3 ME2L report). We get wrong results, since items that are clear [More]
I want to add new rows to a JTable dynamically based on my resultset from the database . How to do ? Please help me Thanks in advanceThank u for ur reply .But still i need to clarify something. I've used the below code to create a basic table within [More]
Hi! I have BT Sport on my iPhone as well, which works fine. Problem is it doesn't load on my laptop. It just loads and loads and loads and then nothing, and then when I go to leave the page it tells me that Silverlight is either busy or stopped respo [More]
hi all,           I have a file-rfc-file scenario.After this XI needs to call the commit rfc QIRF_SEND_COMMIT_TO_QM.From the forum i came to know that it can be done in RFC receiver  Advanced mode.But my doubt is do we have to call this commit RFC ju [More]
hi Is it possible to improve the LMP Bluetooth in iMac from x4 to x6It can only be swapped out for GPU chips that were available for that model at the time. The only two options were a 256 or 512 VRAM ATI GPU. If you have never done any type of compu [More]
IN ITUNES I KEEP GETTING AN ERROR MESSAGE THAT READS: "WE COULD NOT COMPLETE YOUR ITUNES STORE REQUEST. tHE NETWORK CONNECTION WAS RESET. MAKE SURE YOUR NETWORK CONNECTION IS ACTIVE AND TRY AGAIN." WHAT SHOULD I DO? I'VE BEEN TRYING TO ACTIVATE [More]