2008 Feb 27 8:36 PM
Hi all,
I have a sub-routine which passes a table as a parameter.
This routine is called using different tables at different times.
What I want to do is create a work area for this table in the subroutine.
I tried doing it like this:
FORM download TABLES p_down USING p_file.
DATA: wa_tab like line of p_down.
.....
But I am getting a syntax error saying
the field 'P_DOWN' specified under LIKE either has no type or a generic type
Can somebody tell me how to create a workarea of these kinds of tables?
Thanks in advance.
goldie.
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 3:54 PM
2008 Feb 27 9:01 PM
Why don't you use a Field-Symbol...This code works nice -:)
DATA: t_spfli TYPE STANDARD TABLE OF spfli.
PERFORM download TABLES t_spfli USING 'C:\Test\Test.txt'.
FORM download TABLES p_down USING p_file.
FIELD-SYMBOLS: <fs_down> TYPE ANY.
ASSIGN p_down TO <fs_down>.
ENDFORM.
<FS_DOWN> will have the structure of T_SPFLI...
Greetings,
Blag.
Why don't you use a Field-Symbol...This code works nice -:)
DATA: t_spfli TYPE STANDARD TABLE OF spfli.
PERFORM download TABLES t_spfli USING 'C:\Test\Test.txt'.
FORM download TABLES p_down USING p_file.
FIELD-SYMBOLS: <fs_down> TYPE ANY.
ASSIGN p_down TO <fs_down>.
ENDFORM.
<FS_DOWN> will have the structure of T_SPFLI...
Greetings,
Blag.
2008 Feb 27 8:42 PM
Try this .
FORM download TABLES p_down structure p_file.
DATA: wa_tab like line of p_down.
.....
2008 Feb 27 8:48 PM
Hi Karthik,
The FORM is being called more than once using different tables.
So I don't think we can use the addition structure/ TYPE.
Unless we can declare some thing like ANY TABLE.
Do you think we can do that?
goldie.
2008 Feb 27 8:49 PM
make sure that P_down is defined..
then you can simply use wa_area type p_down...
2008 Feb 27 8:59 PM
HI sumeet,
Your idea sounds good.
But, how can we declare P_DOWN as a generic type?
Please tell me if you know how to do that?
thanks,
goldie
2008 Feb 27 9:01 PM
Why don't you use a Field-Symbol...This code works nice -:)
DATA: t_spfli TYPE STANDARD TABLE OF spfli.
PERFORM download TABLES t_spfli USING 'C:\Test\Test.txt'.
FORM download TABLES p_down USING p_file.
FIELD-SYMBOLS: <fs_down> TYPE ANY.
ASSIGN p_down TO <fs_down>.
ENDFORM.
<FS_DOWN> will have the structure of T_SPFLI...
Greetings,
Blag.
2008 Feb 27 9:24 PM
Hi Blag,
I tried your suggestion.
But I am still not able to create a work area.
FORM download TABLES p_down USING p_file.
FIELD-SYMBOLS: <fs_down> TYPE ANY.
ASSIGN p_down TO <fs_down>.
" DATA: wa_tab LIKE LINE OF <fs>. "
ENDFORM.
Can you tell me if the statement in quotes is right?
because that is where I am getting the error saying that
" <fs_down> is not an internal table."
Thanks,
goldie.
2008 Feb 27 9:34 PM
Goldie:
You can't create a workarea from a field-symbol...So...Why you need a workarea anyway??? Field-Symbols are better and faster...
Let me do some more tests and write back if I get something new -:)
Greetings,
Blag.
2008 Feb 27 9:37 PM
if you are using field symbols, why u require a work area.??
2008 Feb 27 9:43 PM
Blag,
The FORM download uses the method GUI_DOWNLOAD of CL_GUI_FRONTEND_SERVICES
It previously used WS_DOWNLOD.
I changed this, because I am doing unicode conversion.
The tables that are being passed into the form are not compatible with the component DATA_TAB of GUI_DOWNLOAD as a result there was an ABAP DUMP.
That is why I have to create a work area and the create a internal table using that workarea.
So, I hope your tests are successful and you come up with something that works for me
goldie.
2008 Feb 27 9:57 PM
Goldie...
Just to be sure...Do you need something like this???
[Taking good care of Z Data|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3340] [original link is broken] [original link is broken] [original link is broken];
Greetings,
Blag.
2008 Feb 27 10:09 PM
This is exactly what I want.
I'll try it right away.
Thanks Blag, you r the man!!
goldie.
2008 Feb 27 10:15 PM
Goldie:
I'm glad you like it -:)
I have wrote a lot of blogs, so next time you need something, browse them first -;)
[Blag Blogs|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/u/48024] [original link is broken] [original link is broken];
Greetings,
Blag.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |