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

Open Dataset- Issue with record having multiple language

Former Member
0 Likes
987

Hello experts,

I read the different discussions regarding the open data set issue. I tried the different solutions posted by experts.

I am unable to solve my issue.

Currently I am trying to load the notes in to an activity in CRM, and the notes contains English and Chinese mix. I tried loading with language En, Zh etc and used

Encoding non-unicode,ignoring conversion errors, UTF-8, binary mode, codepage cp  etc.

The record is read to the string, but when I am using a split statement to populate the Object ID and note in to different fields, the last character of object ID is getting truncated.

ie 0000004533 becomes 000000453

This error is not there for the code, when I was using Gui-upload, but I want to run the program in background now, where gui-upload is not working.

Please suggest a solution for this issue.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
775

Hi , Solved the issue myself using the below logic.



OPEN DATASET gv_dir FOR INPUT IN TEXT MODE "IGNORING CONVERSION ERRORS
ENCODING UTF-8.


IF sy-subrc NE 0.
MESSAGE 'File not found' TYPE 'E'.
EXIT.
ENDIF.

lv_go
= 'X'.
gv_count
= 0.
DATA:lv_upload    TYPE string,
lv_objectid 
TYPE char10,
lv_tmp_objectid 
TYPE char11,
lv_lang     
TYPE char2,
lv_note1    
TYPE string,
lv_note2    
TYPE string,
lv_crid     
TYPE char10.

WHILE lv_go EQ 'X'.

READ DATASET gv_dir INTO lv_input_record.

IF sy-subrc NE 0.
CLEAR lv_go.
CONTINUE.
ENDIF.


SPLIT lv_input_record AT c_tab1
INTO lv_objectid
lv_lang
lv_note1
lv_note2
.

lv_tmp_objectid
= lv_input_record+0(11).
lv_objectid
= lv_tmp_objectid+1(10).

The object ID is first splitted in to a 11 char variable and then taken the part of string which contains the original object ID.

Hi , Solved the issue myself using the below logic.



OPEN DATASET gv_dir FOR INPUT IN TEXT MODE "IGNORING CONVERSION ERRORS
ENCODING UTF-8.


IF sy-subrc NE 0.
MESSAGE 'File not found' TYPE 'E'.
EXIT.
ENDIF.

lv_go
= 'X'.
gv_count
= 0.
DATA:lv_upload    TYPE string,
lv_objectid 
TYPE char10,
lv_tmp_objectid 
TYPE char11,
lv_lang     
TYPE char2,
lv_note1    
TYPE string,
lv_note2    
TYPE string,
lv_crid     
TYPE char10.

WHILE lv_go EQ 'X'.

READ DATASET gv_dir INTO lv_input_record.

IF sy-subrc NE 0.
CLEAR lv_go.
CONTINUE.
ENDIF.


SPLIT lv_input_record AT c_tab1
INTO lv_objectid
lv_lang
lv_note1
lv_note2
.

lv_tmp_objectid
= lv_input_record+0(11).
lv_objectid
= lv_tmp_objectid+1(10).

The object ID is first splitted in to a 11 char variable and then taken the part of string which contains the original object ID.

4 REPLIES 4
Read only

Former Member
0 Likes
775

Hi Niveditha,

I had a similar issue. I had raised a message eith SAP. SAP looked at the file and gave me a code page. Once I maintained the correct code page in user settings, the problem got solved.

Regards

Felix

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
775

Hi Niveditha

Check my Wiki below link

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=317161540

that will solve your issue.

Read only

Former Member
0 Likes
775

Thank you so much everyone.

Read only

Former Member
0 Likes
776

Hi , Solved the issue myself using the below logic.



OPEN DATASET gv_dir FOR INPUT IN TEXT MODE "IGNORING CONVERSION ERRORS
ENCODING UTF-8.


IF sy-subrc NE 0.
MESSAGE 'File not found' TYPE 'E'.
EXIT.
ENDIF.

lv_go
= 'X'.
gv_count
= 0.
DATA:lv_upload    TYPE string,
lv_objectid 
TYPE char10,
lv_tmp_objectid 
TYPE char11,
lv_lang     
TYPE char2,
lv_note1    
TYPE string,
lv_note2    
TYPE string,
lv_crid     
TYPE char10.

WHILE lv_go EQ 'X'.

READ DATASET gv_dir INTO lv_input_record.

IF sy-subrc NE 0.
CLEAR lv_go.
CONTINUE.
ENDIF.


SPLIT lv_input_record AT c_tab1
INTO lv_objectid
lv_lang
lv_note1
lv_note2
.

lv_tmp_objectid
= lv_input_record+0(11).
lv_objectid
= lv_tmp_objectid+1(10).

The object ID is first splitted in to a 11 char variable and then taken the part of string which contains the original object ID.