cancel
Showing results for 
Search instead for 
Did you mean: 

create text in log text field fb03

0 Kudos

Hello,

I want to add a long text in "long text field" to test in tocde in FB03 with FM Create_text, any help please? I'm using the table FEBRE:

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

Hi Ouail Roukbi,

Better you can go for BAPI Function Module : "BAPI_ACC_DOCUMENT_POST"

*Logic
wa_bapi_item-item_text = wa_final-item_text. 
APPEND wa_bapi_item TO it_bapi_item. 

(It gets saved in Text-Field in DB Table: BSEG, Field Text: SGTXT)

Hope this helps you.

If any clarifications comment below.

Thanks & Regards,

Niyas

0 Kudos

You can do the same as me.

Step 1: goto fb03: you need to check with a document code has been posted.

Step 2: You can select 1 line and goto 'long text' >> click 'EDITOR'

STEP 3: Go to >> Header . You find other infor.

Step 4:Please code as below

REPORT ZDEMO_QUYNHBC.
DATA: LV_ID TYPE THEAD-TDID VALUE '0001',
LV_LAN TYPE THEAD-TDSPRAS,
LV_NAME TYPE THEAD-TDNAME VALUE '810014000000442021001', "company_code+documenNo+year+itemline
LV_OBJECT TYPE THEAD-TDOBJECT VALUE 'DOC_ITEM',
LT_FLINES TYPE TABLE OF TLINE,
LS_FLINES LIKE LINE OF LT_FLINES.
LV_LAN = SY-LANGU.
LS_FLINES-TDFORMAT = '01'.
LS_FLINES-TDLINE = 'Test FM '.
APPEND LS_FLINES TO LT_FLINES.
CLEAR: LS_FLINES.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = LV_ID " Text ID of the text to be created
FLANGUAGE = LV_LAN " Language of the text to be created
FNAME = LV_NAME " Name of the text to be created
FOBJECT = LV_OBJECT " Object of the text to be created
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = LT_FLINES " Lines of the text to be created
EXCEPTIONS
NO_INIT = 1 " Creation of text did not work
NO_SAVE = 2 " Saving of the text did not work
OTHERS = 3.

IF SY-SUBRC = 0.
COMMIT WORK AND WAIT.
ELSE.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
0 Kudos

Thank u, Mohamed.

But I'm looking to create text in the input field "long text For Document line item"

I'm using the FM Create_Text with the following code:

CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = fid
flanguage = sy-langu
fname = fname
fobject = 'FEBRE'
* save_direct = 'X'
* fformat = '*'
TABLES
flines = textline
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here

ELSE.

COMMIT WORK AND WAIT.
ENDIF.

but I don't know if the correct fobject is FEBRE ? I think that finally the text should be saved in the structure table TLINE.

Wat do you think ?

Ouail.