Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Re: Dynamic Type Declaration.

Former Member
0 Likes
1,555

HI.

I wanted to download file to Application Server..

I looped the internal table and concatenating with seperated by..

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

Now the issue is.. i have to download almost 8 to 9 internal tables in seperate files.. for which.. i created the subroutine to populate the same..

For Presentation Server.. using field symbol i downloaded the file successfully.. but in application server .. to loop at the internal table and i have to pass it to the work area to proceed with..

The work area declared should be dynamically taking the new structure. from the sub routine..

Can Any one please guide me

Thanks & Regards

Guhapriyan..

1 ACCEPTED SOLUTION
Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,501

in the subroutine parameters , dont pass work area , instead pass a variable of <b>type ref to data</b>.

let <fs> be a field symbol declared inside the form representing the work area

assign data->* to <fs>.

12 REPLIES 12
Read only

Former Member
0 Likes
1,501

Hi,

Did you try doing this inside the sub routine where p_table is the name of the table.

DATA : WA_TABLE LIKE LINE OF (P_TABLE)

Regards,

Ravi

Note : Please mark the helpful answers

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,502

in the subroutine parameters , dont pass work area , instead pass a variable of <b>type ref to data</b>.

let <fs> be a field symbol declared inside the form representing the work area

assign data->* to <fs>.

Read only

0 Likes
1,501

HI..

THANK YOU CAN YOU PLEASE SEND SOME CODE SNIPPET..

COZ.. I AM TRYING TO DECLARE THE VARIABLE IN THE PARAMETER

IT IS GIVING.. SYNTAX ERROR..

pLZ..

aDVANCE THANKS

gUHAPRIYAN

Read only

0 Likes
1,501

Hi,

Take a look at thse weblogs.

/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically

/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table

Regards,

Ravi

Note : Pleasse mark all the helpful answers

Read only

Former Member
0 Likes
1,501

HI.

i WANTED TO DECLARE A TYPE USING THE FIELD SYMBOL

cAN ANYONE PLEASE GUIDE ME..

thANKS IN ADVANCE

gUHAPRIYAN

Read only

0 Likes
1,501

Hi

FIELD-SYMBOLS : <FS_WORK_AREA> LIKE LINE OF TABLE (P_TABLE).

Is this what you are lookin for?

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,501

hI,

nO.. ACTUALLY.. I AM DOWNLOADING SOME 10 INTERNAL TABLE .

SO I USED FIELDSYMBOL.. THE FIELDSYMBOL IS GLOBALLY DECLARED.. AND EVERYTIME THE DOWNLOAD SUBROUTINE. THE FIELD SYMBOL DATA AND STRUCTURE CHANGES..

BUT. NOW I WANTED TO DECLARE AN WORK AREA WITH THIS FIELD SYMBOL..

cANY YOU PLEASE GUIDE ME

thANKS IN aDVANCE

gUHAPRIYA

Read only

0 Likes
1,501

Hi,

If you have declared your field symbols like this

FIELD-SYMBOLS : <FS_TABLE> TYPE ANY TABLE,

THEN

DATA : WA_TABLE LIKE LIKE OF TABLE <FS_TABLE>.

If not, then please post the code here.

Regards,

Ravi

Read only

0 Likes
1,501

HI..

its not working..

**********************************************************

F I E L D S Y M B O L S *

**********************************************************

  • gLOBAL DECLARATION.

FIELD-SYMBOLS: <FS_ITAB> TYPE STANDARD TABLE

  • Sub routine Declaration.

  • Local Inside the subroutine..

Data: l_r_output LIKE LINE OF <FS_ITAB>.

Thanks in advance

Guhapriyan

Read only

0 Likes
1,501

Hi,

Try this.

DATA : T_DATA TYPE REF TO DATA.

FIELD-SYMBOLS : <FT_TABLE> TYPE ANY TABLE.

CREATE DATA T_DATA TYPE (P_TABLE).

ASSIGN T_DATA->* TO <FT_TABLE>.

FIELD-SYMBOLS : <FS_ANY>.

LOOP AT <FT_TABLE> ASSIGNING <FS_ANY>.

ENDLOOP.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
1,501

Hi..

i have populated an internal table of a big structure (custom table) which has more than 100 fields.

i wanted to download it into the application server.. as a tab de-limited file..

Can anyone guide me how to proceed with

Thanks In Advance

Guhapriyan..

Read only

0 Likes
1,501

Hi,

Use the following

1. OPEN DATASET

2. TRANSFER DATASET

3. CLOSE DATASET

This will write the table contents to the file on the app server. Here is a example from help.sap.com

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3c8c358411d1829f0000e829fbfe/frameset.htm

DATA FNAME(60) VALUE 'myfile'.

DATA NUM TYPE I.

OPEN DATASET FNAME FOR OUTPUT.

DO 10 TIMES.

NUM = NUM + 1.

TRANSFER NUM TO FNAME.

ENDDO.

PERFORM INPUT.

OPEN DATASET FNAME FOR OUTPUT.

NUM = 0.

DO 5 TIMES.

NUM = NUM + 10.

TRANSFER NUM TO FNAME.

ENDDO.

PERFORM INPUT.

CLOSE DATASET FNAME.

Regards,

Ravi

Note : Please mark the helpful answers.