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: 

open dataset file transfer problem

Former Member
0 Kudos

Hi ,

when i tried to write the data in application server using open dataset concept ,

while transfering the data to file (Transfer string to file ) the program is giving dump if the file size is less than 8 MB. The program is run by batchjob. If the file size is greater than 8 MB it is not giving any dump .The data is stored in the global directory in the application server .

15 REPLIES 15

Former Member
0 Kudos

Hi !

Could you please add the text of the dump .... or parts of it ... ??

I do not think that the different size is the reason for that dumps !

Regards

rainer

Former Member
0 Kudos

CONCATENATE wa_zwpkhdr-aufnr

wa_zwpkhdr-compno

wa_zwpkhdr-silo

wa_zwpkhdr-lotnumber

wa_zwpkhdr-matnr

v_psmng

wa_zwpkhdr-meins

wa_zwpkhdr-batch

wa_zwpkhdr-datum

INTO field SEPARATED BY semicolon.

>>>>>>>TRANSFER field TO file.

This is the place where it went to dump .

Dump text : The current program has to be terminated because a capacity limit has reached .

0 Kudos

Hi,

This seems to be a weird problem

First check sy-subrc after your Open dataset statement to ensure that the file is getting created properly

Former Member
0 Kudos

There is no problem with file opening .

Some times it is writing into application serevr .

Some times it is giving a dump .

Former Member
0 Kudos

If the size is more than 8 MB it is allowing ,if the file size is less than 8 mb then it is giving a dump .

0 Kudos

clear the field before populating it and check for sy-subrc after opening the file .

sastry

0 Kudos

can you paste your code including the loop structure.

Former Member
0 Kudos

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

  • CLIENT = SY-MANDT

logical_filename = file1

  • OPERATING_SYSTEM = SY-OPSYS

  • PARAMETER_1 = ' '

  • PARAMETER_2 = ' '

  • USE_PRESENTATION_SERVER = ' '

  • WITH_FILE_EXTENSION = ' '

  • USE_BUFFER = ' '

IMPORTING

  • EMERGENCY_FLAG =

  • FILE_FORMAT =

file_name = file

EXCEPTIONS

file_not_found = 1

OTHERS = 2.

IF sy-subrc eq 0.

OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT it_zwpkhdr INTO wa_zwpkhdr.

SHIFT wa_zwpkhdr-compno LEFT DELETING LEADING C_ZERO.

MOVE WA_ZWPKHDR-PSMNG TO V_PSMNG.

SHIFT V_psmng LEFT DELETING LEADING C_ZERO.

WRITE:/ wa_zwpkhdr-aufnr,

16 wa_zwpkhdr-compno,

26 wa_zwpkhdr-silo,

68 wa_zwpkhdr-lotnumber,

88 wa_zwpkhdr-matnr,

108 V_psmng,

126 wa_zwpkhdr-meins,

132 wa_zwpkhdr-batch,

144 wa_zwpkhdr-datum.

CONCATENATE wa_zwpkhdr-aufnr

wa_zwpkhdr-compno

wa_zwpkhdr-silo

wa_zwpkhdr-lotnumber

wa_zwpkhdr-matnr

v_psmng

wa_zwpkhdr-meins

wa_zwpkhdr-batch

wa_zwpkhdr-datum

INTO field SEPARATED BY semicolon.

TRANSFER field TO file.

clear: V_PSMNG,

wa_zwpkhdr.

ENDLOOP.

endif.

0 Kudos

OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT it_zwpkhdr INTO wa_zwpkhdr.

SHIFT wa_zwpkhdr-compno LEFT DELETING LEADING C_ZERO.

MOVE WA_ZWPKHDR-PSMNG TO V_PSMNG.

SHIFT V_psmng LEFT DELETING LEADING C_ZERO.

CONCATENATE wa_zwpkhdr-aufnr

wa_zwpkhdr-compno

wa_zwpkhdr-silo

wa_zwpkhdr-lotnumber

wa_zwpkhdr-matnr

v_psmng

wa_zwpkhdr-meins

wa_zwpkhdr-batch

wa_zwpkhdr-datum

INTO field SEPARATED BY semicolon.

<b>if not field is initial.</b>

<b>condense field.</b>

TRANSFER field TO file.

<b>endif.</b>

clear: V_PSMNG,

wa_zwpkhdr,

field.

ENDLOOP.

<b>close datase file</b>

endif.

you can use write after testing above code currently i have removed it you can comment (as u r running it in background bettoer dont use)it .

try & let us know output.

reward points if helpful

Former Member
0 Kudos

I pasted the code please advice what to do to avoid dumps

Former Member
0 Kudos

Can anybody suggest me the solution its a bit urgent

0 Kudos

Soumya,

Do you have authorization to write files to app server? And are you working in a Unicode enabled system?

Former Member
0 Kudos

Try top use WRITE after the TRANSFER...

OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT it_zwpkhdr INTO wa_zwpkhdr.

SHIFT wa_zwpkhdr-compno LEFT DELETING LEADING C_ZERO.

MOVE WA_ZWPKHDR-PSMNG TO V_PSMNG.

SHIFT V_psmng LEFT DELETING LEADING C_ZERO.

CONCATENATE wa_zwpkhdr-aufnr

wa_zwpkhdr-compno

wa_zwpkhdr-silo

wa_zwpkhdr-lotnumber

wa_zwpkhdr-matnr

v_psmng

wa_zwpkhdr-meins

wa_zwpkhdr-batch

wa_zwpkhdr-datum

INTO field SEPARATED BY semicolon.

TRANSFER field TO file.

WRITE:/ wa_zwpkhdr-aufnr,

16 wa_zwpkhdr-compno,

26 wa_zwpkhdr-silo,

68 wa_zwpkhdr-lotnumber,

88 wa_zwpkhdr-matnr,

108 V_psmng,

126 wa_zwpkhdr-meins,

132 wa_zwpkhdr-batch,

144 wa_zwpkhdr-datum.

clear: V_PSMNG,

wa_zwpkhdr.

ENDLOOP.

thanks,

Chetan Shah

Former Member
0 Kudos

The code is working for the file size greater than 8 MB and giving a dump for file size less than 8 mb

0 Kudos

the file size <b>cannot</b> be the reason!