Application Development 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: 

how to add long text in bdc for transaction fb01 ?

Former Member
0 Kudos

IN the existing program of bdc fb01

i have to add a long text field

but it gets stuck while i process in sm35

is there a fm to add the field directly

thanks in a advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You need to convert the session method to call transaction method.

use call transaction method ,update mode is 'S',then you get document number,pass the document number to SAVE_TEXT FM..

I am sure that if you use session method,then you can't.

Thanks

Seshu

8 REPLIES 8

Former Member
0 Kudos

You need to convert the session method to call transaction method.

use call transaction method ,update mode is 'S',then you get document number,pass the document number to SAVE_TEXT FM..

I am sure that if you use session method,then you can't.

Thanks

Seshu

Former Member
0 Kudos

Hi,

cannot record long text using BDC, so once the BDC for a particular transaction is complete, then read the contents of the created file from database then use function module SAVE_TEXT to upload long text. you cannot upload long text using BDC.

<b>Reward points</b>

Regards

Former Member
0 Kudos

Hi

You can upload the Long texts separately into the transaction using the CREATE_TEXT fun module

Need to pass the correct parameters like OBJECT,ID, OBJECTNAME and LANGuage with the proper declarations.

see the sample code and do accordingly

REPORT zmm_longtext_sm

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Description : This Program is used to Upload the Service Master

  • : Long Texts using the Fun Module CREATE_TEXT

  • 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

CONSTANTS:

  • Object ID for Long Text of Service Master

c_best TYPE thead-tdid VALUE 'LTXT',

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

  • Parameters

PARAMETERS p_file LIKE rlgrap-filename.

  • 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 = 'ST'.

dt_lines-tdline = itab-text.

APPEND dt_lines.

dl_lan = sy-langu.

concatenate '00000000000' itab-asnum into dl_name.

  • Call the Function Module to Create Text

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.

AT END OF asnum.

REFRESH dt_lines.

ENDAT.

ENDLOOP.

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

as per ur suggestion i am supposed to 1st supposed to make the postings in bdc without long text and then add the long text with seperate program (so i need to write this separate prog)

the field name is EENO_DYNP-ZEILE

field description for batch input

Program Name:SAPLFTXT

Screen Number 0110

how do i get the parameters required to fill in the exporting parameters .

Former Member
0 Kudos

the isssue got solved...

there was a tcode ltxt which was to be called

i have done done the changed in the session method itself and it works

the issue was to call ltxt at right place!!!!!

0 Kudos

Rohit,

Can you please let me know where you used ltxt in this scenario? Or if you can email me the code.

Sangeeta

0 Kudos

Hi I am in need of the same requirement..I tried this tcode LTXT but it is not available...can u plz help me??

Former Member
0 Kudos

i have given the summary in the post above