2007 Nov 01 10:20 AM
Hi Friends,
im writting a report pgm to upload some data into ztable from sapia directory.
the code is given below...
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-028.
PARAMETERS: p_file_p(30) DEFAULT '/sapia/iface/in/comm/sapfin/' LOWER CASE.
PARAMETERS: p_file_n(30) DEFAULT 'ac1018pl'.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-029.
PARAMETERS: p_file_1(30) DEFAULT '/sapia/iface/in/arch/sapfin/' LOWER CASE.
SELECTION-SCREEN: END OF BLOCK b3.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-030.
PARAMETERS: p_file_d(30) DEFAULT 'zace1018'.
SELECTION-SCREEN: END OF BLOCK b2.
CONCATENATE p_file_p p_file_n INTO v_infile.
TRANSLATE v_infile TO LOWER CASE.
OPEN DATASET v_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT. " Opening the file/Checking for file existence
IF sy-subrc <> 0.
MESSAGE e012 WITH v_infile. " Error occured while opening the file <file name>
EXIT.
ELSE.
DO.
READ DATASET v_infile INTO wa_file. " Reading file contents
IF sy-subrc <> 0.
CLOSE DATASET v_infile.
IF n_counter = 0.
MESSAGE e013 WITH v_infile.
ENDIF.
EXIT.
ELSE.
APPEND wa_file TO it_file.
CLEAR wa_file.
n_counter = n_counter + 1.
ENDIF.
ENDDO.
ENDIF.
If i run this im getting dump error at run time as follows,
Runtime error : CONVT_CODEPAGE
Except :CX_SY_CONVERSION_CODEPAGE
Cause: Conversion is not possible. The data is read as far as possible. Text data where the conversion has failed is undefined (see also note below).
Plz sole the problem... i need it urgent... Helpful answers will be rewarded...
2007 Nov 01 10:33 AM
Try changing
OPEN DATASET v_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT.to be
open dataset v_infile for input in text mode encoding default ignoring conversion errorsGareth.
Hi Friends,
im writting a report pgm to upload some data into ztable from sapia directory.
the code is given below...
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-028.
PARAMETERS: p_file_p(30) DEFAULT '/sapia/iface/in/comm/sapfin/' LOWER CASE.
PARAMETERS: p_file_n(30) DEFAULT 'ac1018pl'.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-029.
PARAMETERS: p_file_1(30) DEFAULT '/sapia/iface/in/arch/sapfin/' LOWER CASE.
SELECTION-SCREEN: END OF BLOCK b3.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-030.
PARAMETERS: p_file_d(30) DEFAULT 'zace1018'.
SELECTION-SCREEN: END OF BLOCK b2.
CONCATENATE p_file_p p_file_n INTO v_infile.
TRANSLATE v_infile TO LOWER CASE.
OPEN DATASET v_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT. " Opening the file/Checking for file existence
IF sy-subrc <> 0.
MESSAGE e012 WITH v_infile. " Error occured while opening the file <file name>
EXIT.
ELSE.
DO.
READ DATASET v_infile INTO wa_file. " Reading file contents
IF sy-subrc <> 0.
CLOSE DATASET v_infile.
IF n_counter = 0.
MESSAGE e013 WITH v_infile.
ENDIF.
EXIT.
ELSE.
APPEND wa_file TO it_file.
CLEAR wa_file.
n_counter = n_counter + 1.
ENDIF.
ENDDO.
ENDIF.
If i run this im getting dump error at run time as follows,
Runtime error : CONVT_CODEPAGE
Except :CX_SY_CONVERSION_CODEPAGE
Cause: Conversion is not possible. The data is read as far as possible. Text data where the conversion has failed is undefined (see also note below).
Plz sole the problem... i need it urgent... Helpful answers will be rewarded...
2007 Nov 01 10:29 AM
Hi,
change the code and try..remove the lower case statement and also the translate statement.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-028.
PARAMETERS: p_file_p(30) DEFAULT '/sapia/iface/in/comm/sapfin/' .
PARAMETERS: p_file_n(30) DEFAULT 'ac1018pl'.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-029.
PARAMETERS: p_file_1(30) DEFAULT '/sapia/iface/in/arch/sapfin/' .
SELECTION-SCREEN: END OF BLOCK b3.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-030.
PARAMETERS: p_file_d(30) DEFAULT 'zace1018'.
SELECTION-SCREEN: END OF BLOCK b2.
CONCATENATE p_file_p p_file_n INTO v_infile.
Regards,
Nagaraj
2007 Nov 01 10:33 AM
Try changing
OPEN DATASET v_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT.to be
open dataset v_infile for input in text mode encoding default ignoring conversion errorsGareth.
2007 Nov 01 1:37 PM
Hi Gareth,
ur answer was highly valuable to me.It had solved my problem.i hv rewarded u the maximum 10 points.... appart from this... My hearty wishes to u...
2007 Nov 01 2:14 PM
2007 Nov 01 10:36 AM
Code seems to be ok. Check in debugging mode and confirm at what step the run time error occurs.
It seems the problem is somewhere else.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |