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

Logic required

Former Member
0 Likes
878

Hi,

I have a very urgent requirment i need to extract data from r/3 into legacy system. I have to upload data into 5 files

i have 5 tables consisting of many fields.

Kindly send me the logic urgently.

Rewards will be given.

Regards,

Sindhu

7 REPLIES 7
Read only

Former Member
Read only

Former Member
0 Likes
852

hi Jagdish kumar Raju,

I havent received any logic.

Please forward me it is very urgent.

Regards,

Sindhu

Read only

0 Likes
852

Dandu,

To write ur file into the apps server u can use the following logic.

OPEN DATASET <File with Path> FOR OUTPUT IN TEXT MODE.

IF sy-subrc = 0.

LOOP AT <int table>.

TRANSFER <inttable-record> TO <File>.

ENDLOOP.

CLOSE DATASET <File>.

MESSAGE s000(zmamic) WITH c_msg1.

ENDIF.

Then u can call the transaction cg3y to download this file into any location u want.

Else make use of some FM like gui_download or something.

Thanx.

Read only

0 Likes
852

Hi,

For this u need to use GUI_DOWNLOAD function module.

for this u need to populate ur internal table using select query and then use GUI_Download

to transfer data from ur r/3 system to the legacy system.

If u feel this explaination is not sufficient let me know.

Any way i will sent u the code in few min.

Regards,

Jagadish

Read only

0 Likes
852

hi,

Please help me with the code iam given 5 tables Knvh, kna1, adrc, knvv, and 2 ztables and i have to move to the file plantcust.txt

Knvh kna1 adrc knvv z tab1

hityp Loevm street kalks zz_attrbt

vkorg Ktokd city1 zz_fvalue vtweg Kunnr region

spart name1 counrty

datab pstlz sort1

datab1 bran1

hkkunnr

ztab2

zterr

z_dteff_from

z_dteff_to

kindly give me the logic.

Regards

Sindhu

Read only

0 Likes
852

Check this sample program.

REPORT ztest_l.

DATA: BEGIN OF itab OCCURS 0,

a TYPE i,

c TYPE c,

d TYPE i,

e TYPE i,

b TYPE i,

END OF itab.

DATA: BEGIN OF xyz OCCURS 0,

d1 TYPE i,

END OF xyz.

DATA: filename TYPE string.

DATA: filename1 type IBIPPARMS-PATH.

itab-a = 1.

itab-c = 'A'.

itab-d = 123.

itab-e = 10.

itab-b = 10.

APPEND itab.

itab-a = 1.

itab-c = 'A'.

itab-d = 123.

itab-e = 20.

itab-b = 20.

APPEND itab.

itab-a = 1.

itab-c = 'A'.

itab-d = 456.

itab-e = 10.

itab-b = 30.

APPEND itab.

itab-a = 1.

itab-c = 'A'.

itab-d = 456.

itab-e = 20.

itab-b = 40.

APPEND itab.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

file_name = filename1

.

filename = filename1.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = filename

FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab

  • 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.

Reward points if useful.

Read only

Former Member
0 Likes
852

Hello guys,

My requirement is to fetch data from internal tables and then place in files form there i need to place the files in shared folder?

How to approach?

regards

sindhu