cancel
Showing results for 
Search instead for 
Did you mean: 

Error in viewing smartform after downloading it to unix

Former Member
0 Kudos

Dear All,

I have a requirement to download the smartform to unix server.

As per the requirement i am converting smartform to pdf and saving the file to unix server.

its working fine when we are downloading it to local desktop.

but when the user is opening the file in unix they are getting decoding error.

step 1: conversion to pdf.

step 2: by using open dataset we are writing that file in to unix.

Please let me know if any solution is there.

Regards,

Prathima.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check with below code.

<< Cut and paste without attribution from http://saplab.blogspot.com/2007/10/sample-abap-program-to-execute-unix.html removed. >>

<< Points unassigned >>

Thanks,

Neelima.

Edited by: Rob Burbank on Feb 13, 2009 10:12 AM

Former Member
0 Kudos

Hi ,

Please see the following code. i am not able to write it in the text mode as given in the sample by you . Please let me know what the error is.

DATA : w_time_nm TYPE syuzeit.

DATA : w_date_nm TYPE sydatum.

DATA : w_path_unix_ch TYPE string.

DATA : w_path_unix_temp_ch TYPE string.

DATA : w_stime_ch TYPE string.

DATA : w_sdate_ch TYPE string.

DATA : w_bcode_txt TYPE ztecfg-itvnm.

DATA : w_dsn_ch(100) ,

w_length1_nm LIKE sy-tabix,

w_lengthn1_nm LIKE sy-tabix.

TYPES: BEGIN OF w_itab_ty ,

field(256),

END OF w_itab_ty.

DATA : w_itab_ds TYPE w_itab_ty.

DATA : w_file_name_ch TYPE fileextern.

w_time_nm = sy-uzeit.

w_date_nm = sy-datum.

w_stime_ch = w_time_nm.

w_sdate_ch = w_date_nm.

CONCATENATE c_path p_qmnum c_formname w_sdate_ch w_stime_ch INTO

w_path_unix_temp_ch

SEPARATED BY c_un.

CONCATENATE w_path_unix_temp_ch

c_pdf INTO

w_path_unix_ch.

w_dsn_ch = w_path_unix_ch.

w_dsn_ch = w_path_unix_ch.

w_file_name_ch = w_path_unix_ch.

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'

EXPORTING

activity = c_write

filename = w_file_name_ch

EXCEPTIONS

NO_AUTHORITY = 1 .

IF sy-subrc EQ 0.

OPEN DATASET w_dsn_ch FOR OUTPUT IN BINARY MODE.

LOOP AT t_gs_pdfdata INTO w_gs_pdfdata_ds.

TRANSFER w_gs_pdfdata_ds-tdline TO w_dsn_ch.

ENDLOOP.

CLOSE DATASET w_dsn_ch.

ENDIF.

Regards,

Prathima

Former Member
0 Kudos

Hi,

Can u please Specific about

CONCATENATE c_path p_qmnum c_formname w_sdate_ch w_stime_ch INTO

w_path_unix_temp_ch

SEPARATED BY c_un.

Regards,

Neelima.

Former Member
0 Kudos

Hi,

The variables are the file name and the path of the unix server.

currently i am not getting the OTF data properly so i guess the error is coming.

Please let me know if any workaround is there .. it was working fine earlier.

Regards,

Prathima..

Former Member
0 Kudos

hi,

I think the problem is in the way u r concatenating the filename.

insert a breakpoint at the point and the check the value of path generated at runtime.

w_path_unix_ch. <----this value.

See if the ".pdf" is getting concatenated properly in the path.

кu03B1ятu03B9к

Former Member
0 Kudos

Hi Karthik,

path is correct only.. i have checked it in debugging mode..

earlier it was working fine , when i developed it and demonstrated to client.

Now the OTF data itself is getting corrupted and the data is showing as all # characters and all.

Please suggest if any solution is there.

Regards,

Prathima....

Former Member
0 Kudos

Dear All,

when i am using the open dataset with binary mode. i am able to download it to the unix server but when i am opening the file its giving an error message unable to open the file.

Please suggest me the correct mode so that my issue will be solved.

Thanking you.

Prathima...

Former Member
0 Kudos

Hi

Check the open dataset when your writing to the unix server.

Refer this sample code:

[ABAP progrm to unix command|http://saplab.blogspot.com/2007/10/sample-abap-program-to-execute-unix.html]

Regards,

Sravanthi

Former Member
0 Kudos

try to open any normal pdf file in the unix system so u wud know whetehr odf files are being correctly read or not.

can u show the code u have written using open dataset.

Edited by: kartik tarla on Feb 12, 2009 11:48 AM