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

How to upload data with dynamic internal table

Former Member
0 Likes
842

Hi,

I have to upload the basic , sales, purchasing view data by using bapi depend on check box selected for views.

i have filled fieldcatalog for selected views and pass the field catalog structure to dynamic int table and

import it into the field symbol <fs_data>. this field symbol assigned to <fs_1>.

then callED the 'GUI_UPLOAD ' and when i pass field symbo for function module i am getting first 10 rows 0f the file .

flat file has basic data,sales ,purchase fields data

ex: i was selected basicview and purchase view and execute i am getting basic,sales view data.

how can i get only basic and purchase data.

Hi,

I have to upload the basic , sales, purchasing view data by using bapi depend on check box selected for views.

i have filled fieldcatalog for selected views and pass the field catalog structure to dynamic int table and

import it into the field symbol <fs_data>. this field symbol assigned to <fs_1>.

then callED the 'GUI_UPLOAD ' and when i pass field symbo for function module i am getting first 10 rows 0f the file .

flat file has basic data,sales ,purchase fields data

ex: i was selected basicview and purchase view and execute i am getting basic,sales view data.

how can i get only basic and purchase data.

2 REPLIES 2
Read only

Former Member
0 Likes
540

Hi,

Can you post the part of the code where you need modification?

Regards,

Manoj Kumar P

Read only

0 Likes
540

hi ,

please find code.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = lt_fieldcatalog

IMPORTING

ep_table = <fs_data>

EXCEPTIONS

generate_subpool_dir_full = 1

OTHERS = 2.

IF sy-subrc <> 0. "#EC NEEDED

ENDIF.

      • So <FS_1> now points to our dynamic internal table.

ASSIGN <fs_data>->* TO <fs_1>.

      • Next step is to create a work area for our dynamic internal table.

CREATE DATA new_line LIKE LINE OF <fs_1>.

      • A field-symbol to access that work area

ASSIGN new_line->* TO <fs_2>.

ASSIGN new_line->* TO <fs_3>.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = p_f

filetype = 'DAT'

TABLES

data_tab = <fs_1>

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.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.