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 Upload Problem

Former Member
0 Likes
427

HI

Thanks for reply .. follworing is code .

but text is not getting created ...

o bytes transfered-- message.

using save_text.

FORM cr_text.

LOOP AT i_text ."WHERE plnnr = p_plnnr

"AND merknr = p_merknr.

CLEAR ilines.

ilines-tdline = i_text-tdline.

ilines-tdformat = '*'.

APPEND ilines.

ENDLOOP.

int_header-tdobject = 'QSS'.

int_header-tdid = 'QM'.

int_header-tdspras = 'E'.

int_header-tdname = key.

int_header-tdlinesize = '072'.

int_header-tdversion = '00001'.

int_header-mandt = sy-mandt.

int_header-tdmacode1 = 'QP01SAPLCPDI'.

REFRESH catalog.

CLEAR catalog.

catalog-tdobject = 'QSS'.

catalog-tdname = key.

catalog-tdid = 'QM'.

catalog-tdspras = 'E'.

catalog-function = 'U'.

catalog-id = '00001'.

APPEND catalog.

  • EXPORT catalog TO MEMORY ID 'SAPLSTXD'.

CALL FUNCTION 'CHECK_TEXT_OBJECT'

EXPORTING

object = catalog-tdobject

IMPORTING

object_info = wa_ttxob

EXCEPTIONS

object = 01.

DESCRIBE TABLE ilines LINES int_header-tdtxtlines.

MOVE-CORRESPONDING wa_ttxob TO int_header.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = int_header

insert = 'X' "KREUZ

savemode_direct = ''

  • LOCAL_CAT = CATALOG

  • IMPORTING

  • FUNCTION = ''

TABLES

lines = ilines

EXCEPTIONS

id = 1

language = 2

name = 3

object = 5.

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

object = int_header-tdobject

name = key.

ENDFORM. "cr_text

using create_text.

FORM cr_text. " using p_plnnr P_merknr.

REFRESH ilines.

LOOP AT i_text ."WHERE plnnr = p_plnnr

"AND merknr = p_merknr.

CLEAR ilines.

ilines-tdline = i_text-tdline.

ilines-tdformat = '*'.

APPEND ilines.

ENDLOOP.

*

IF NOT ilines[] IS INITIAL.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = 'QM'

flanguage = sy-langu

fname = key

fobject = 'QSS'

  • SAVE_DIRECT = 'X'

  • FFORMAT = '*'

TABLES

flines = ilines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

ENDIF.

ENDFORM. "cr_text

2 REPLIES 2
Read only

Former Member
0 Likes
374

Hello in your code remove the following code which is displayed in BOLD.

using save_text.

FORM cr_text.

LOOP AT i_text ."WHERE plnnr = p_plnnr

"AND merknr = p_merknr.

CLEAR ilines.

ilines-tdline = i_text-tdline.

ilines-tdformat = '*'.

APPEND ilines.

ENDLOOP.

int_header-tdobject = 'QSS'.

int_header-tdid = 'QM'.

int_header-tdspras = 'E'.

int_header-tdname = key.

int_header-tdlinesize = '072'.

int_header-tdversion = '00001'.

int_header-mandt = sy-mandt.

int_header-tdmacode1 = 'QP01SAPLCPDI'.

REFRESH catalog.

CLEAR catalog.

catalog-tdobject = 'QSS'.

catalog-tdname = key.

catalog-tdid = 'QM'.

catalog-tdspras = 'E'.

catalog-function = 'U'.

catalog-id = '00001'.

APPEND catalog.

  • EXPORT catalog TO MEMORY ID 'SAPLSTXD'.

CALL FUNCTION 'CHECK_TEXT_OBJECT'

EXPORTING

object = catalog-tdobject

IMPORTING

object_info = wa_ttxob

EXCEPTIONS

object = 01.

DESCRIBE TABLE ilines LINES int_header-tdtxtlines.

MOVE-CORRESPONDING wa_ttxob TO int_header.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = int_header

insert = 'X' "KREUZ

savemode_direct = ''

  • LOCAL_CAT = CATALOG

  • IMPORTING

  • FUNCTION = ''

TABLES

lines = ilines

EXCEPTIONS

id = 1

language = 2

name = 3

object = 5.

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

<b>CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

object = int_header-tdobject

name = key.</b>

ENDFORM. "cr_text

using create_text.

FORM cr_text. " using p_plnnr P_merknr.

REFRESH ilines.

LOOP AT i_text ."WHERE plnnr = p_plnnr

"AND merknr = p_merknr.

CLEAR ilines.

ilines-tdline = i_text-tdline.

ilines-tdformat = '*'.

APPEND ilines.

ENDLOOP.

*

IF NOT ilines[] IS INITIAL.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = 'QM'

flanguage = sy-langu

fname = key

fobject = 'QSS'

  • SAVE_DIRECT = 'X'

  • FFORMAT = '*'

TABLES

flines = ilines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

ENDIF.

ENDFORM. "cr_text

Read only

0 Likes
374

Hi Thks for reply ,

krishna i removed it then too its not working iam debuggin it but unable to find what the problem is till

now .is there any other method to upload txt.

regards