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

download cluster data

Former Member
0 Likes
2,063

Hi All,

Can we download <b>PCL4</b> cluster data into a file? What are the various options available to download/upload cluster table data.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,744

Hi Ravi,

You will have to write an Abap to download data from a cluster table into a file.

Regards,

John.

6 REPLIES 6
Read only

Former Member
0 Likes
1,745

Hi Ravi,

You will have to write an Abap to download data from a cluster table into a file.

Regards,

John.

Read only

Former Member
0 Likes
1,744

Cluster tables can be treated similar to other tables from UPLAOD/DOWNLOAD stand point.

Few ways to download.

1) As usual using <b>SE16</b> and give the table name and then display the data and goto-->DOwnload..

2) Programatically. Get data in your program using SELECT statements and use GUI_DOWNLOAD values.

Upload I believe, you can use BDC technique in the respective transaction.

Cheers,

Thomas.

Read only

0 Likes
1,744

Hi John/George,

My requirement is to move the infotype change log data

(REPORT: RPUAUDOO)which is stored in the cluster PCL4 from one system to another system. Can i use GUI_DOWNLOAD/UPLOAD for this?

Read only

0 Likes
1,744

Ravi,

Yes you can. I do not think there is a way of attaching data of a cluster table to a transport request and then transport it to another system.

So you may need to adopt the perviously mentioned solutions.

Cheers,

Thomas.

Read only

0 Likes
1,744

Hi ravi,

1. Since PCL4 is a cluster table,

a) we have to use IMPORT statement (see F1 help on it)

to get / read the data

into our internal table.

b) then we can use GUI_DOWNLOAD

to download the data

from our internal table.

regards,

amit m.

Read only

0 Likes
1,504

I created 2 programs to download and upload and they worked for a test that I did (I cannot guarantee they will work in all situations so it would be under your responsibility to test them):

REPORT zdownload_pcl4.

DATA: lt_pcl4        TYPE TABLE OF pcl4,
      lv_srtfd       LIKE pcl4-srtfd,
      pptemp         TYPE string,
      msgline        TYPE i,
      my_range       TYPE range of pcl4-srtfd with header line,
      lv_cluster_key TYPE pcl4-relid VALUE 'LA'.

PARAMETERS: p_pernr like pernr-pernr,
            p_path LIKE cffile-filename default 'c:\temp\myfile.txt'.

START-OF-SELECTION.

  lv_srtfd(1) = 'A'.
  lv_srtfd+1(8) = p_pernr.
  lv_srtfd+9(1) = '*'.

  my_range-sign = 'I'.
  my_range-option = 'CP'.
  my_range-low = lv_srtfd.
  append my_range.

  SELECT * FROM pcl4
    INTO TABLE lt_pcl4
      WHERE relid = lv_cluster_key and
            srtfd in my_range.


  IF lt_pcl4 IS NOT INITIAL.

    MOVE p_path TO pptemp.

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = pptemp
        filetype                = 'DAT'
*        codepage                = '1800'
      IMPORTING
        filelength              = msgline
      TABLES
        data_tab                = lt_pcl4
*       FIELDNAMES              =
      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.

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      WRITE: / 'file created'.
    ENDIF.
  ELSE.
    WRITE: / 'no records selected'.
  ENDIF.

REPORT zupload_pcl4.

DATA: lt_pcl4        TYPE TABLE OF pcl4,
      pptemp         TYPE string,
      my_range       TYPE range of pcl4-srtfd with header line.

PARAMETERS: p_path LIKE cffile-filename default 'c:\temp\myfile.txt'.

START-OF-SELECTION.

    MOVE p_path TO pptemp.

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = pptemp
        filetype                = 'DAT'
*      IMPORTING
*        filelength              = lv_filelength
*        header                  = lv_headerxstring
      TABLES
        data_tab                = lt_pcl4
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    insert pcl4 from table lt_pcl4[] ACCEPTING DUPLICATE KEYS.