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

long text

Former Member
0 Likes
502

Hi all,

i am having problem in uploading text to ac03 transaction.

to this transaction i have uploaded five fields using bdc program,and long text by another program.this program is pasted below.

initially

bdc input file is:

3000170 zcol sevice 0003 3200

long text file is

3000170 test for bdcs for aco3.

its working file i am able upload the bdc and long text is also displaying.

but my requirement is to upload folowing data.

col-jal-10 1.1 zcol service 0003 3200

long text file.

col-jal-10 1.1 test for bdcs for ac03.

but this file its not taking.

i am able to upload the first file. this data i am able to get it in aco3 but i am not able to get the long text to the corresponding asnum(col-jal-10 1.1)

i am unable to upload long text for alpha numeric character as input.

can any body help me in this regard. is there any modifications neccessary for this in this program. please correct it.

  • Internal Table for Upload of Long Texts Data

DATA: BEGIN OF itab OCCURS 0,

asnum like asmd-asnum, " Service No

text LIKE tline-tdline, " Long Text

END OF itab.

  • To create Long Text lines for CREATE_TEXT function module

DATA:BEGIN OF dt_lines OCCURS 0.

INCLUDE STRUCTURE tline. " Long Text

DATA:END OF dt_lines.

  • Variable declarations for CREATE_TEXT function module

DATA : dl_name TYPE thead-tdname, " Object Name

dl_lan TYPE thead-tdspras. " Language

  • Constants

  • Object ID for Long Text of Service Master

CONSTANTS:c_best TYPE thead-tdid VALUE 'LTXT',

c_material TYPE thead-tdobject VALUE 'ASMD'. " Object

PARAMETERS p_file LIKE rlgrap-filename."input file

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start Of Selection

START-OF-SELECTION.

*To Upload Flat file

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = itab

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

  • Upload the Texts

SORT itab BY asnum.

LOOP AT itab.

dt_lines-tdformat = '*'.

dt_lines-tdline = itab-text.

APPEND dt_lines.

*endloop.

  • Call the Function Module to Create Text

AT END OF asnum.

dl_lan = sy-langu.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = itab-asnum

IMPORTING

OUTPUT = itab-asnum .

move itab-asnum to dl_name.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_best

flanguage = dl_lan

fname = dl_name

fobject = c_material

save_direct = 'X'

fformat = '*'

TABLES

flines = dt_lines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Long Text Creation failed for Service No'(001),

itab-asnum.

ELSE.

WRITE:/ 'Long Text Created Successfully for Service No'(002),

itab-asnum.

ENDIF.

REFRESH dt_lines.

ENDAT.

endloop.

thanks in advance.

siva

2 REPLIES 2
Read only

Former Member
0 Likes
458

Hi Siva,

As you said the problem is not with the program

the problem is with the field (key) col-jal-10 1.1 which is used as distinguishing factor to know the related Long text

as you said if it is a full number field it is working fine and I feel that problem is with the characters like '-' and '.' and space.

if there is any other field which is used instead of this field to distinguish the log text better to use that

try that way.

reward if useful

regards

Anji

Read only

0 Likes
458

hi anji,

thanks for ur response. it is also not taking characters also like coljal10.

and also wat is the maximum character length of long text that can be uploaded.

thanks in advance.

siva