Application Development 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: 

Problem downloading (nested type) internal table into file..

Former Member
0 Kudos
120

Hi all,

I wanted to download an file in the following structure

Rect TYp

H ..............

KK ..............

KA ..............

for which i have declared an internal table as below in the source code.. When i download the file

the file is not coming in the above format the KK record is getting merged with H and comes in single line..

how to get it in the above format.. can anyone help me

  • Type declaration for the header record

TYPES: BEGIN OF TY_Header,

RECTY TYPE CHAR2, "Record ype

LGSID TYPE CHAR10, "Legacy ystem ID

RLOUT TYPE CHAR8, "Rollout ID

ACTIO TYPE CHAR1, "Action Flag

KUNNR TYPE CHAR30, "Customer

KKBER TYPE CHAR4, "Credit Control Area

KRAUS TYPE CHAR11, "Credit Information No.

END OF TY_header.

  • Type declaration for the Knkk records of the output

"input table

TypeS: Begin of TY_KNKK,

RECTY TYPE CHAR2, "Record Type

kraus type kraus_cm. "Credit info number

INCLUDE STRUCTURE J_1FAKNKK.

"Credit control mgmnt

TypeS: END OF TY_KNKK.

  • Type declaration for the Knka records of the output

  • input table

TYPES: BEGIN OF TY_KNKA,

RECTY TYPE CHAR2. "Record Type

INCLUDE STRUCTURE J_1FAKNKA."Credit.Contl Extn

TYPES END OF TY_KNKA.

  • Type declaration for defining structured type

TYPES: BEGIN OF TY_OUT.

INCLUDE TYPE TY_HEADER

as ty_rec renaming with suffix ty_rech.

INCLUDE TYPE TY_KNKK

as ty_KNK renaming with suffix ty_sKNKk.

INCLUDE TYPE TY_KNKA

as ty_KKA renaming with suffix ty_sknka.

TYPES END OF TY_OUT.

Thanks in advance

Guhapriyan

3 REPLIES 3

jayanthi_jayaraman
Active Contributor
0 Kudos
74

Hi,

Declare the output type as

BEGIN OF ty_output,

field(500) TYPE c,

END OF ty_output.

Declare the internal table that refer the above.

Try appending the lines from those internal tables to the output.

0 Kudos
74

HI, Thank you very much,

actually i want to download the file in this format..

H there will be 10 fields

KK there are 100 fields

KA there are 100 fields

it is coming in this format

but inbetween each line there are more lines of white space is getting added when i check in notepad but in excel it is giving the correct output.

how to correct it..

Thanks In advance

Guhapriyan Subrahmanyam

0 Kudos
74

Hi,

Before downloading,just check the internal table,whether it is having blank lines.

Before calling the FM for download,check it.

If there is blank lines,just delete the blank lines before downloading using delete command.