How to upload long text using BAPI_SERVICE_CREATE

Hi,
I'm uploading service master records (transaction AC03) through my program using function BAPI_SERVICE_CREATE. As per the requirements, for each service number, I've to pass long text also (refer to the last text area on the transaction screen).
In the tables section of the bapi BAPI_SERVICE_CREATE, there is a provision for an internal table on the form SERVICE_LONG_TEXTS. But it is of no use as even if I pass data to it, it is not written to the database.
Can anyone tell me solution for my problem?
Thanks.
Anuj.

Anuj,
Create a new program using the following code and run it using an existing service number to see if the longtext gets updated. I ran it in my system and it is working fine. If it works for you, then you can modify your code accordingly.
report zlongtext.
data: header like thead,
      ilines like tline occurs 0 with header line.
parameters: asnum like asmd-asnum.
start-of-selection.
  header-tdobject = 'ASMD'.
  header-tdname = asnum.            " Make sure it has leading zeroes.
  header-tdid = 'LTXT'.
  header-tdspras = sy-langu.
  ilines-tdformat = '*'.
  ilines-tdline = 'Just a test to see how it works'.
  append ilines.
  clear ilines.
  call function 'SAVE_TEXT'
    exporting
      header                = header
   INSERT                = ' '
      savemode_direct       = 'X'
    tables
      lines                 = ilines
   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.
  else.
    call function 'COMMIT_TEXT'.
    if sy-subrc = 0.
      write: / 'updated successfully'.
    endif.
  endif.

Similar Messages

  • How to upload long texts to project definitions?

    Hi everyone,
    Does any of you know a program for uploading long texts to project definitions?
    Thanks in advance and best regards.
    Txema.

    Found this post in SDN ABAP forum on the similar issue , check this out it might be helpful
    Project Systems WBS, Long Text Field
    Regards
    Sreenivas

  • How to UPLOAD Long Text in QS21

    Dear All,
    I have written BDC to upload Master Inspection Characterstics,
    The Problem is I need to upload the long Text, (which is of some 250 chars).
    How to do this.
    Help is appriciated.
    Thanks in advance
    Arun

    Hi,
      I think there is an ICON to enter the long text.
      U can start filling the LONG text here using
      RSTXT-TXLINE(03) - this takes around 70 chars the next
      chars in RSTXT-TXLINE(04) and so on. U can get this
      in SHDB recording.
    Regards,
    GSR.

  • How to upload long text in CA02 Transaction

    Hi,
    I am getting a file with the following format.
    Input File Record Layout:
    Group#                  like PLKO-PLNNR,     
    Group Counter             like PLKO-PLNAL,
    Operation#          like PLPO-VORNR,     
    Work Center#          like PLPOD-ARBPL,
    Control Key          like PLPO-STEUS,     
    Short-text          like PLPO-LTXA1,
    Long-text          type c(1000).     
    i have to upload the long text in the CA02 transaction. Could you please let me know the procedure that i should follow in uploading this in doing a call transaction in BDC.
    Thanks in Advance,
    Suresh

    Take a look at FM SAVE_TEXT
    To get the parameters of the FM :
    Goto the long text in CA02 and then via the menu :
    Goto --> Header .
    A popup is displayed containing the input parameters  :
    Text Name
    Language
    Text ID 
    Text object.
    Hope it helps,
    Erwan.
    Message was edited by: Erwan LE BRUN

  • How to keep long text in bdc using create_text  function module

    hi,
    ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
    i need some other information like how can i pass this to BDC i got like this .
    can u plz check it.
    its a length of 255 chaters
    perform bdc_field using 'RSTXT-TXLINE(02)'
    'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
    & 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
    perform bdc_field using 'RSTXT-TXLINE(03)'
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    & 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
    perform bdc_field using 'RSTXT-TXLINE(04)'
    'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
    & 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
    perform bdc_field using 'RSTXT-TXLINE(05)'
    'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
    & 'hhhhhhhhhhhhhhhhhhhhhh'.

    Hi,
    Use this coding where do u want,
    data: begin of textline occurs 10.
            include structure tline.
    data: end of textline.
    start-of-selection.
    textline-tdformat = '*'.
    textline-tdline = 'TESTING FOR CREATION OF TEXT'.
    append textline.
    clear textline.
        call function 'CREATE_TEXT'
             exporting
                  fid       = '0013'
                  flanguage = sy-langu
                  fname     = '0095000501'
                  fobject   = 'VBBK'
             tables
                  flines    = textline
             exceptions
                  no_init   = 01
                  no_save   = 02.
    end-of-selection.

  • Upload Material master with long text using LSMW

    Hello,
    i want ot upload material master data via MM01 using LSMW in following views: basic data 1 ,2,  purchasing, purchase order text, plant data 1,2.
    i have to upload long text in purchase order text with length more then 132 char. (approx 700 char long text). and i have text file in which long text is maintained in a single row. then how can i do it without formating text file or anyother possible solution.
    please help.

    ca u clarify how can i do it.
    suppos i have longtext   "Air cooled type air-conditioning unit complete with following components & distance between indoor & outdoor unit is  10 RMT.  A).Indoor evaporating unit comprising of cooling coils,insulated drain tray,20 micron HDPE washable filters,blower,motor,electical junction box etc. B).Outdoor condensing unit comprising of hermatic/semiharmetic compressor's.condenser coils,propeller/axial fans,motors,pressure switches/cutout etc.C).Charging of refrigerant gas & oil.D).Inter connecting refrigerating piping  of copper duly insulated with EXPANDED POLYETHYLENE tubing.E).Complete electical power wiring of AL.&Control wirng of copper required from indoor & outdoor units.Earthing of the complete system with 8 G G.I.wire.  F).Electrical panel will be completed with necessary starter,fuses,switches,timers,over-load relays,contactors,push button and indicating lamps,single phasing preventer etc..and also with remote control with cording. G).The panel should have 1 no.potential free contactor to connect with central fire detection system.The panel should have voltage scanner to ensure stabilized power input to the machine.H).Outdoor unit shall be mounted on MS angle base frame structure duly black painted with synthetic epoxy paint.I).The frame structure shall be mounted on MS plate & serrated rubber pads."
    then what i have to do changes in lsmw.?

  • Upload Task List Operation long Text using SAVE_TEXT-Urgent

    Hi ,
    I am trying to create Task List Operation Long text using the function module ..
    SAVE_TEXT .I am passing the following keys
    Text Name       300ATEST057 0000000900000009
    Language        EN
    Text ID            PLPO Long Text
    Text Object     ROUTING    Texts for task list types
    But the long texts are not getting updated in the Task lists operations .
    Can anyone please suggest whether SAVE_TEXT will work for Operation long Texts or not Are we missing something
    .This is pretty urgent requirement .Award points are assured.
    Regards
    Sam

    hi,
    use function module create text
    check the sample code
    DATA: BEGIN OF itab OCCURS 0,
          asnum LIKE asmd-asnum, " Service No
          text(5000)  TYPE c, " Long Text
          END OF itab.
    *DATA: itab1 LIKE itab OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF itab1 OCCURS 0,
          asnum LIKE asmd-asnum, " Service No
          sequ  type i,          " Text Sequence
          text(5000)  TYPE c, " Long Text
          END OF itab1.
    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
    for file splitting.
    DATA: start TYPE i,
          len   TYPE i VALUE 92,
          totlen TYPE i,
          n TYPE i.
    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.
      LOOP AT itab.
        itab1-asnum = itab-asnum.
        CLEAR: totlen,n, start.
        totlen = STRLEN( itab-text ).
        n = totlen / len.
        n = n + 1.
        DO n TIMES.
          itab1-text  = itab-text+start(len).
          itab1-sequ  = sy-index.
          start = start + len.
          APPEND itab1.
        ENDDO.
      ENDLOOP.
      delete itab1 where text is initial.
      SORT itab1 BY asnum sequ.
      LOOP AT itab1.
        dt_lines-tdformat = '*'.
        dt_lines-tdline = itab1-text.
        APPEND dt_lines.
    Call the Function Module to Create Text
        AT END OF asnum.
          dl_lan = sy-langu.
          WRITE : / itab-asnum.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = itab1-asnum
            IMPORTING
              output = itab1-asnum.
          MOVE itab1-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),
            itab1-asnum.
          ELSE.
            WRITE:/ 'Long Text Created Successfully for Service No'(002),
            itab1-asnum.
          ENDIF.
          REFRESH dt_lines.
        ENDAT.
      ENDLOOP.
    in text file give first field records in capitals
    regards
    siva

  • How to activate Long Text of Order Header in IW31/32

    Hi Expert,
    I have one reqm. like want to upload Long Text in Order Header.
    I have used FM 'Create_Text', its working f9 i.e. creating Long Text for Order Header but not displaying it
    in IW32/33 transaction. Entry for Long Text is available in Table STXL and STXH.
    Please advice me how to activate that Header Long Text which I uploaded earlier.
    Thanks,
    Jay.

    Hi Madhukar,
    Yes I am passing everything correctly, as I am getting Long Text record created in Table STXL & STXH, but not able to see in IW32/33 at the header long text.
    So this is my doubt like how 2 update or activate long text of Order Header?
    Thanks,
    Jay.

  • How to print long text in scripts

    plzzzzzzzzz answer this qestion
    how to print long text in scripts

    Hi Kranthi,
    You can create Text Id and include that in your script.
    For example:
    /E TEXT
    /: INCLUDE ZTEXT OBJECT TEXT ID ST
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • How to upload a text file from a shared folder and provide an o/p

    how to upload a text file from a shared folder and provide an o/p  containing the details in each order in the text file

    Hi,
    Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
    Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
    Now, I hope the code for data fetching, if required, is already present in the report.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • Tcode FV50: How to find long text in FI Document line item Before Saving.

    Hi,
    How to find long text in FI Document line item.
    During Parking of the FI document through Tcode FV50 i m giving the some text in the long text not in the text field.
    I would like to validate the Long Text Before Saving in user exit "U300" under  the  "Sunstitution" .
    Please anybody can be help me out where exactly this long text is going to be stored or in which internal table or memory id.
    Please give me the answer as soon as possible .
    Note:- Read_Text function module is not useful. Because Read_text useful after saving document.

    Hi Amit,
    In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
    Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
    Just try to explore in your system how the other validations are maintained.
    After you are done with all your code, you have to run the regeneration program RGUGBR00.
    Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except  GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS  & TRACE PROG. GENERATE CALLS .
    Hope this make your doubt clear.
    Regards
    Abhii

  • How to add long text in bdc for transaction fb01 ?

    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

    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

  • How to create Long Text in Module Pool Program

    Hi all,
    I want to develop a new module pool program and I want to use Long text screen in this program and also want this text will store in table.I never develop such type of module pool before.This long text will like sales order long text.Please let me know the steps how I can develop such type of program and how I save long text huge data in table.
    Thanks & Regards
    Nirmal

    Hai ,
    here you have to use custom control, for this
    DATA: line(256) TYPE c,
          text_tab LIKE STANDARD TABLE OF line,
          field LIKE line.
    1)  Create custom control in your screen
    2)   CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',   "--> (this is custom control name in screen)
                       editor    EXPORTING parent = container.
    3)  CALL METHOD editor->get_text_as_stream  "This method reads data from custom control , inserts into itab 'text_tab' 
             IMPORTING       
              text = text_tab.                                       "
          READ TABLE text_tab  INTO line INDEX 1. read the text into wa 'line'
    if you want more clarity , see  'ABAPDOCU' >ABAP USER DIALOGS>    COMPLEXSCREEN ELEMENTS-->  DEMO CUSTOM_CONTROL

  • How to read long text in Document line item

    Hi,
    How to read long text in FI Document line item.

    Use Read_text function module.
    you need to pass
    ID
    LANGUAGE
    NAME
    OBJECT   to the function moduel
    To find the Text id name language and object these are the following steps. Example: FB02
    1. goto FB02, Enter Document number
    2. from menuselect Goto>Header-->header Text..... New window will be displayed 
    3. select the Header Text. here you can see all the text. 
    4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper. 
    5. in the Next window you will find Text Name. Text ID, Language. etc...
    Regards,
    Lalit Mohan Gupta.

  • How to upload PO text of material master ?

    dear gurus,
    how to upload PO text in material master in mass , can i use LSMW or BDC ? if yes then how?
    I have done the recording but LSMW is not working for PO text.
    Upesh khairnar.

    Hi!
    try using Purchasing Inforecord for this. in here you maintain master data linkage for Material Master and Vendor Master. You will just have to input the Material Number, the Vendor Account, and the Purchasing Org. In here you can maintain the PO text defaulted per Material Number. After the maintenance of Inforecord, the PO text will be reflected on the PO document.
    Here is the ff Transaction Code:
    - ME11 (Create Inforecord)
    - ME12 (Change Inforecord)
    - ME13 (Display Inforecord)
    Hope this helps, Thank you.
    Mik

Maybe you are looking for

  • Problem with repaint of display after a click event

    Hi, I have a problem with repaint of display. In particular in method keyPressed() i inserted a statement that, after i clicked bottom 2 of phone, must draw a string. But this string doesn't drawing. Instead if i reduce to icon the window, which emul

  • JTree in JScrollPane doesn't scroll

    I have a JTree in a JScrollPane that doesn't scroll. Background: it used to! History: I moved the creation of the JTree to inside an Object that returns it with a ".getTree()" method. Since then, it hasn't been scrolling. I even set the JScrollPane t

  • SEARCH feature in NOTES is missing

    Let's say I add a note each day for 2 years on my iPod touch. Then one day I seem to recall a note I wrote approxinmately a year ago that involved the name Billy Bob. Wouldn't it be nice to select SEARCH and type in 'Billy Bob' to find all records th

  • Bootcamp on MacPro

    Does anyone know if Bootcamp will work on the MacPro. Since it is a 64 bit archetecture, will Windows Pro 64bit need to be used, or can it also support standard Windows XP Pro? I'd love to get rid of my XP box that's sitting here in case I need to fi

  • Won't remember number of prints

    Photoshop CS5 Win 7 x64 Epson R1900 All latest updates-PS, printer and OS Select print--quanty 3 for example in the PS print dialog box. When the print preview comes up, status bar shows it's only going to print 1 copy which is what was printed last