‎2008 Mar 04 7:27 PM
Hello friends,
I am having Problem in Uploading the long text.
I have done a BDC for IA01. after that I am trying to upload the Long text using the FM Save_text and it returns with sy-subrc = 0 but when I go to the transaction and see the ling text it dosent have it.
So i have tried a different approach. During the BDC i go to the long text screen put 2 dummy lines and come back. Now in IA01 for this operation it shows the long text check box checked.
Now when I run the program to Upload the long text it uploads the long text with the FM save_text.
Can any one suggest me a way to upload with out the check box checked but still I can upload the long text.
Any Suggestions.
Ster.
‎2008 Mar 04 7:33 PM
Do a COMMIT WORK before the call to SAVE_TEXT.
Greetings,
Blag.
‎2008 Mar 04 7:35 PM
I have done the Commit work after the save text.
Ster.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
* CLIENT = CLIENT
HEADER = HEADER
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = 'X'
* LOCAL_CAT = 'X'
IMPORTING
FUNCTION = STATUS
NEWHEADER = HEADER
TABLES
LINES = LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 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'.
COMMIT WORK AND WAIT.
‎2008 Mar 04 8:01 PM
‎2008 Mar 04 8:42 PM
‎2008 Mar 04 8:57 PM
I had the same problem when I called CREATE_TEXT until I added the call to COMMIT_TEXT as shown below. Then I was able to see the long text in the transaction. Hope this helps.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = c_tdid "KOPF
FLANGUAGE = c_tdspras
FNAME = LV_TXTNAME "CLIENT + PO NUMBER
FOBJECT = c_tdobject "AUKF
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = LT_TXTLINES "LONG TEXT TABLE
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
if text is not created append to the error internal table
s_error-aufnr = it_input-aufnr.
s_error-text = it_input-longtext.
APPEND s_error TO i_error.
ELSE.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = c_tdobject
NAME = LV_TXTNAME
ID = c_tdid
LANGUAGE = 'S'
SAVEMODE_DIRECT = 'X'.
g_plnnr_count = g_plnnr_count + 1.
ENDIF.
‎2008 Mar 04 9:02 PM
Thanks ROn.
When you had this issue did the check box for the Long text was checked before you uploaded the long text or did it happen automatic after you uploaded the long text.
Ster
‎2008 Mar 04 9:08 PM
‎2008 Mar 11 1:44 PM
The check box was checked before I executed CREATE_TEXT. After further investigation, I found that CREATE_TEXT and SAVE_TEXT do not display on the screen if a value was not prevously entered on the screen to set the indicator that a long text exists. To get around this, I executed a dynpro in my ABAP program to put an "" in the Long Text field. After doing this, I was then able to add multiple lines to the Long Text for the Production Order which overlayed the "" by executing CREATE_TEXT. .
‎2008 May 20 3:41 AM
I found the same problem at RFC_SAVE_TEXT. Is that you call the batch input to add "" to long text? Seem it is not good to use batch input
‎2008 May 20 4:29 AM
DATA : TP_TEXT TYPE STRING,
TP_LONGTX(40),
TP_POS TYPE I,
TP_OFFSET TYPE I,
TP_MAX TYPE I,
TP_FIRSTLT,
TP_13(2) TYPE N,
TP_LASTCH,
TP_LASTPO(2) TYPE N,
TP_LASTTX TYPE STRING,
TP_CUMLEN TYPE I.
DATA: TP_LENM TYPE P. "length of line
DATA: TP_TEXT1 TYPE STRING. "for paragraph
DATA: TP_TEXT2 TYPE STRING. "for line
DATA: TP_LEN TYPE I. "total length of line
DATA: TP_DIV TYPE P DECIMALS 2. "length divided by 40
this is code u paste where long text is recorded
LOOP AT TA_TEXT INTO WA_TEXT WHERE PLNNR = WA_ITEM-PLNNR AND VORNR = WA_ITEM-VORNR.
TP_13 = 15.
TP_POS = 0.
TP_OFFSET = 40.
TP_LENM = 0.
*****getting the length of text
TP_LEN = STRLEN( WA_TEXT-TXLINE ).
TP_MAX = TP_LEN - 1.
total length divided by 40
TP_DIV = TP_LEN DIV 40.
TP_TEXT = TP_LEN MOD 40.
IF TP_LEN <> 0.
IF TP_OFFSET > TP_LEN.
TP_OFFSET = TP_LEN.
ENDIF.
CLEAR TP_FIRSTLT.
WHILE TP_DIV >= 0.
TP_FIRSTLT = CN_Y.
********when number of line will be less than 10 concatenate with zero
CONCATENATE 'RSTXT-TXPARGRAPH(' TP_13 ')' INTO TP_TEXT1.
CONCATENATE 'RSTXT-TXLINE(' TP_13 ')' INTO TP_TEXT2.
PERFORM BDC_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
TP_TEXT2.
IF TP_FIRSTLT IS INITIAL.
TP_LONGTX = WA_TEXT-TXLINE+TP_POS(TP_OFFSET).
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=EDNL'.
PERFORM BDC_FIELD USING TP_TEXT2
TP_LONGTX.
TP_FIRSTLT = CN_N.
ELSE.
TP_CUMLEN = TP_POS + 40.
IF TP_CUMLEN > TP_LEN.
TP_OFFSET = TP_LEN - TP_POS.
ENDIF.
TP_LONGTX = WA_TEXT-TXLINE+TP_POS(TP_OFFSET).
PERFORM BDC_FIELD USING 'BDC_CURSOR'
TP_TEXT2.
PERFORM BDC_FIELD USING TP_TEXT2
TP_LONGTX.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
TP_TEXT1.
IF TP_LASTCH = ' '.
PERFORM BDC_FIELD USING TP_TEXT1
' '.
ELSE.
PERFORM BDC_FIELD USING TP_TEXT1
'='.
ENDIF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=EDIN'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=EDIO'.
ENDIF.
TP_POS = TP_POS + 40.
TP_OFFSET = 40.
TP_13 = TP_13 + 1.
TP_DIV = TP_DIV - 1.
tp_lastpo = tp_offset - 1.
concatenate 'tp_longtx+' tp_lastpo '(1)' into tp_lasttx.
TP_LASTCH = TP_LONGTX+39(1).
ENDWHILE.
CLEAR: TP_POS, TP_OFFSET, TP_DIV.
ENDIF.
ENDLOOP.
PERFORM BDC_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TXBA'. "back
‎2008 May 20 4:55 AM
But it is still BDC Call Transaction method.
Any BAPI function can help?
‎2008 Mar 04 9:29 PM