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

file with Vertical Format

Former Member
0 Likes
950

Hey Folks,

I have a requiremnet where i have to produce 2 flat files one for current year and another for last year . I have to download it to the presentation server .Could somebody send me the sample code to download it to presentation server.

And i need format like this

Regarsd

Rock

Hey Folks,

I have a requiremnet where i have to produce 2 flat files one for current year and another for last year . I have to download it to the presentation server .Could somebody send me the sample code to download it to presentation server.

And i need format like this

Regarsd

Rock

7 REPLIES 7
Read only

Former Member
0 Likes
935

Use the method

>GUI_DOWNLOAD in the Class

>CL_GUI_FRONTEND_SERVICES.

OR

> CALL FUNCTION 'GUI_DOWNLOAD'

> EXPORTING

> filename = v_file " file Name

> filetype = 'ASC'

> TABLES

> data_tab = i_error_file " Table to be Downloaded

> EXCEPTIONS

> file_write_error = 1

> no_batch = 2

> gui_refuse_filetransfer = 3

> invalid_type = 4

> no_authority = 5

> unknown_error = 6

> header_not_allowed = 7

> separator_not_allowed = 8

> filesize_not_allowed = 9

> header_too_long = 10

> dp_error_create = 11

> dp_error_send = 12

> dp_error_write = 13

> unknown_dp_error = 14

> access_denied = 15

> dp_out_of_memory = 16

> disk_full = 17

> dp_timeout = 18

> file_not_found = 19

> dataprovider_exception = 20

> control_flush_error = 21

> OTHERS = 22.

Hope this Helps.

Amandeep

Read only

0 Likes
935

Hey,

I need it in the vertical format how wud i do it.

Regards

Rock

Read only

0 Likes
935

Please give an example of Vertical format. I really didn't get.

A

Read only

0 Likes
935

Hey Aman,

Actually i m having the internal table like

having fields

vkorg , vbeln, matnr , prodh etc.,

and I need to display them as

aa01 company

90000012 billing doc

2209 material number

0031 product id

Regards

Rock

Read only

0 Likes
935

sample Code.


TYPES: BEGIN OF ty,
        vkorg TYPE vkorg ,
        vbeln TYPE vbeln,
        matnr TYPE matnr,
        prodh TYPE prodh1,
        END OF ty.

DATA: ls TYPE string,
      lt TYPE string_table,
      itab TYPE TABLE OF ty WITH HEADER LINE.
FIELD-SYMBOLS: <dat> TYPE ANY.


DO 3 TIMES.
ADD 12 TO itab-vbeln.
ADD 142 TO itab-MATNR.
  itab-vkorg = 'DUMM'.
  itab-vbeln = itab-vbeln.
  itab-matnr  = itab-matnr.
  itab-prodh = 'DUMMY'.
  APPEND  itab.
ENDDO.


LOOP AT itab.
  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE itab TO <dat>.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      CASE sy-index.
        WHEN 1.
          CONCATENATE <dat> 'company' INTO ls SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN 2.
          CONCATENATE <dat> 'billing doc' INTO ls SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN 3.
          CONCATENATE <dat> 'material number' INTO ls SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN 4.
          CONCATENATE <dat> 'product id' INTO ls SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      ENDCASE.
    ENDIF.
    SHIFT ls LEFT DELETING LEADING SPACE.
    APPEND ls TO lt.
  ENDDO.
ENDLOOP.

Read only

0 Likes
935

Hey Aman,

i ahve a requirement like this

01 9100 kathy

01 9200 gret

01 9300 mike

02 100 Foods

02 200 taco

02 300 beef

03 501 customer group1

03 502 customer group2

03 503 customer group3

04 1301 material1

04 1302 material2

04 1303 material3

basically its the same data we get in the internal table as

01 9100 foods customer group1 material1

How wud i achieve this ..

Regards

Rock

Read only

0 Likes
935

Hey Ama,

If i want to add header say

H1 H2 H3

1102 redf 22

How wud i do it.

Regards

Rock