Long Text - XLS to SAP

Hi experts,
I'm importing data from an *.xls file (Excel) to SAP. For this I'm using the function
TEXT_CONVERT_XLS_TO_SAP, but in my *.xls there is a field that has a lot of
data. The purpose is to storage that field in a long text using the function
SAVE_TEXT. But the problem is when I import the XLS file to my internal table
(I_TAB_CONVERTED_DATA), the field that has a large amount of data, do not
support that type. I've tried with STRING, RAWSTRING, C(1024). Someone know
how can I handle that amount of data in a data type?
Regards,
Isaac Melendez

Hi check this code... it will be helpful
* Upload data direct from excel.xls file to SAP
REPORT ZEXCELUPLOAD.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
            begcol TYPE i DEFAULT 1 NO-DISPLAY,
            begrow TYPE i DEFAULT 1 NO-DISPLAY,
            endcol TYPE i DEFAULT 100 NO-DISPLAY,
            endrow TYPE i DEFAULT 32000 NO-DISPLAY.
* Tick don't append header
PARAMETERS: kzheader AS CHECKBOX.
DATA: BEGIN OF intern OCCURS 0.
        INCLUDE STRUCTURE  alsmex_tabline.
DATA: END OF intern.
DATA: BEGIN OF intern1 OCCURS 0.
        INCLUDE STRUCTURE  alsmex_tabline.
DATA: END OF intern1.
DATA: BEGIN OF t_col OCCURS 0,
       col LIKE alsmex_tabline-col,
       size TYPE i.
DATA: END OF t_col.
DATA: zwlen TYPE i,
      zwlines TYPE i.
DATA: BEGIN OF fieldnames OCCURS 3,
        title(60),
        table(6),
        field(10),
        kz(1),
      END OF fieldnames.
* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
       value_0001(50),
       value_0002(50),
       value_0003(50),
       value_0004(50),
       value_0005(50),
       value_0006(50),
       value_0007(50),
       value_0008(50),
       value_0009(50),
       value_0010(50),
       value_0011(50),
       value_0012(50),
       value_0013(50),
       value_0014(50),
       value_0015(50),
       value_0016(50),
       value_0017(50),
       value_0018(50),
       value_0019(50),
       value_0020(50),
       value_0021(50),
       value_0022(50),
       value_0023(50),
       value_0024(50),
       value_0025(50),
       value_0026(50),
       value_0027(50),
       value_0028(50),
       value_0029(50),
       value_0030(50),
       value_0031(50),
       value_0032(50),
       value_0033(50),
       value_0034(50),
       value_0035(50),
       value_0036(50),
       value_0037(50),
       value_0038(50),
       value_0039(50),
       value_0040(50),
       value_0041(50),
       value_0042(50),
       value_0043(50),
       value_0044(50),
       value_0045(50),
       value_0046(50),
       value_0047(50),
       value_0048(50),
       value_0049(50),
       value_0050(50),
       value_0051(50),
       value_0052(50),
       value_0053(50),
       value_0054(50),
       value_0055(50),
       value_0056(50),
       value_0057(50),
       value_0058(50),
       value_0059(50),
       value_0060(50),
       value_0061(50),
       value_0062(50),
       value_0063(50),
       value_0064(50),
       value_0065(50),
       value_0066(50),
       value_0067(50),
       value_0068(50),
       value_0069(50),
       value_0070(50),
       value_0071(50),
       value_0072(50),
       value_0073(50),
       value_0074(50),
       value_0075(50),
       value_0076(50),
       value_0077(50),
       value_0078(50),
       value_0079(50),
       value_0080(50),
       value_0081(50),
       value_0082(50),
       value_0083(50),
       value_0084(50),
       value_0085(50),
       value_0086(50),
       value_0087(50),
       value_0088(50),
       value_0089(50),
       value_0090(50),
       value_0091(50),
       value_0092(50),
       value_0093(50),
       value_0094(50),
       value_0095(50),
       value_0096(50),
       value_0097(50),
       value_0098(50),
       value_0099(50),
       value_0100(50).
DATA: END OF data_tab.
DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: <fs1>.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
            mask      = '*.xls'
            static    = 'X'
       CHANGING
            file_name = filename.
START-OF-SELECTION.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       EXPORTING
            filename                = filename
            i_begin_col             = begcol
            i_begin_row             = begrow
            i_end_col               = endcol
            i_end_row               = endrow
       TABLES
            intern                  = intern
       EXCEPTIONS
            inconsistent_parameters = 1
            upload_ole              = 2
            OTHERS                  = 3.
  IF sy-subrc <> 0.
    WRITE:/ 'Upload Error ', SY-SUBRC.
  ENDIF.
END-OF-SELECTION.
  LOOP AT intern.
    intern1 = intern.
    CLEAR intern1-row.
    APPEND intern1.
  ENDLOOP.
  SORT intern1 BY col.
  LOOP AT intern1.
    AT NEW col.
      t_col-col = intern1-col.
      APPEND t_col.
    ENDAT.
    zwlen = strlen( intern1-value ).
    READ TABLE t_col WITH KEY col = intern1-col.
    IF sy-subrc EQ 0.
      IF zwlen > t_col-size.
        t_col-size = zwlen.
*                          Internal Table, Current Row Index
        MODIFY t_col INDEX sy-tabix.
      ENDIF.
    ENDIF.
  ENDLOOP.
  DESCRIBE TABLE t_col LINES zwlines.
  SORT intern BY row col.
  IF kzheader = 'X'.
    LOOP AT intern.
      fieldnames-title = intern-value.
      APPEND fieldnames.
      AT END OF row.
        EXIT.
      ENDAT.
    ENDLOOP.
  ELSE.
    DO zwlines TIMES.
      WRITE sy-index TO fieldnames-title.
      APPEND fieldnames.
    ENDDO.
  ENDIF.
  SORT intern BY row col.
  LOOP AT intern.
    IF kzheader = 'X'
    AND intern-row = 1.
      CONTINUE.
    ENDIF.
    tind = intern-col.
    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
    ASSIGN (zwfeld) TO <fs1>.
    <fs1> = intern-value.
    AT END OF row.
      APPEND data_tab.
      CLEAR data_tab.
    ENDAT.
  ENDLOOP.
  CALL FUNCTION 'DISPLAY_BASIC_LIST'
       EXPORTING
            file_name     = filename
       TABLES
            data_tab      = data_tab
            fieldname_tab = fieldnames.

Similar Messages

  • Functionality in long text  -- include -- characters-- SAP Icons

    Can any one please tell me the functionality in long text  -->include >characters>SAP Icons. Is it possible to include any icon in longtext.
    regards
    Ravikumar

    Hi,
    The standard icons should be available. If not, see note [1067936|https://service.sap.com/sap/support/notes/1067936] that explains how they can be made available.
    -Paul

  • Long Text printing in SAP SCRIPT

    Hi Experts,
    I have a requirement of printing long text in sapscript.
    There are 15 condition types for each item in sales order and one long text for each condition record.
    Each long text has multiple lines i.e. for one long text it may have 2 lines and other may have 1 or 3 lines or etc.
    My trials :
    I used read_text() function mudule in a routine which is being called from the sap script to get the whole long text which has 5 lines and is stored in an internal table.
    Now is there a way to transfer the whole internal_table data as a whole into the script i.e. is there a way to transfer the table from the routine to the sapscript.
    Thanks in advance.
    kalikonda.

    Hi
    In addition of my include solution.
    you ofcourse can use a perform statement if you havea maximum of lines which is possible.
    like (if you have a maximum of 5 lines
    define &line_1& := ' '
    define &line_2& := ' '
    define &line_3& := ' '
    define &line_4& := ' '
    define &line_5& := ' '
    Perform getsomedate in program abcxyz
    using orderno
    using itemno
    changing &line_1&
    changing &line_2&
    changing &line_3&
    changing &line_4&
    changing &line_5&
    Endperform
    when printing the data
    /: if &line_1& NE ' '
    IL &line_1&
    /: endif
    /: if &line_2& NE ' '
    IL &line_2&
    /: endif
    /: if &line_3& NE ' '
    IL &line_3&
    /: endif
    /: if &line_4& NE ' '
    IL &line_4&
    /: endif
    /: if &line_5& NE ' '
    IL &line_5&
    /: endif
    Gr., Frank

  • Long text problem in sap script

    Hi Experts,
    I have craeted sap script for payment print progrem.. in my sap script one window is text window... client want more then 300 char for that window. for that i use read_text function module... its working fine... but problem is it retrive only one line from long text editor. only 70 char i got.
    below is my coding......
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = '0001'
        LANGUAGE                      = sy-langu
        NAME                          = NAME
        OBJECT                        = 'DOC_ITEM'
      TABLES
        LINES                         = LINES          .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT LINES.
      n = 0.
      l = 132.
      text+n(l) = lines-tdline.
      n = n + 132.
      l = l + 132.
    ENDLOOP.
    in sap script i have direct pass lines-tdline
    *&lines-tdline&
    Please suggest me which point i missing?
    Thanks
    Jigar

    Hi All,
    The standard text will be stored in Name = ORDCONF_TEXT_(sales org)_(distributionchannel)_(division)
    Text ID = ZSD
    Examples: ORDCONF_TEXT_4000_01_01 , ORDCONF_TEXT_4000_01_80 , ORDCONF_TEXT_1000_01_01.
    Requirement :
    The print program /form will need to pick up the appropriate standard text based on the Sales Area (combination of Sales Org / Distribution Center / Division) of the sales order [VBAK-VKORG / VTWEG / SPART], provided a standard text has been created for that Sales Area. Itu2019s not required that every sales area have a standard text, so if one is not found, this step should be skipped and the rest of the print program executed.
    The new text should print after 2 blank lines after the Printable Notes text (which is after the line items and the Total Net Price prints).
    The font should be the same size as the Printable Notes, but bolded rather than italicized.
    The text should print in the same columns as the Printable Notes currently print in (Material Description / Scheduled Ship Date / Quantity) .
    So the logic i have used is this below code:
    I used a subroutine in the layout of the main window becoz i need to print it in the main window below after 2 blank lines of line items.
    This is logic in the layout:
    /:PERFORM GET_OBJECT IN PROGRAM ZSDRP001_ORD_CONF_IRE
    /:USING &VBDKA-VBELN&
    /:CHANGING &ORDCONF_TEXT&
    /:ENDFORM
    /:INCLUDE &ORDCONF_TEXT& OBJECT TEXT ID ZSD PARAGRAPH A1
    I called this subroutine in the print program:
    Logic in the print program:
    FORM GET_OBJECT TABLES INPUT_TAB STRUCTURE ITCSY
                                                 OUTPUT_TAB STRUCTURE ITCSY.
    DATA : TMP_VBELN LIKE vbdka-VBELN,
                TMP_VKORG LIKE VBAK-VKORG,
                TMP_VTWEG LIKE VBAK-VTWEG,
               TMP_SPART LIKE VBAK-SPART,
               TMP_TXNAM1(40) TYPE C VALUE 'ORDCONF_TEXT',
               TMP_TXNAM2(100) TYPE C.
    DATA: v_text LIKE tline-tdline.
    DATA : P_V_TEXT LIKE tline-tdline.
    CLEAR : TMP_TXNAM1, TMP_TXNAM2, TMP_VBELN, TMP_VKORG, TMP_VTWEG, TMP_SPART.
    READ TABLE INPUT_TAB WITH KEY NAME = 'vbdka-VBELN'.
    IF SY-SUBRC = 0.
    tmp_vbeln = input_tab-value.
    ENDIF.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING INPUT = TMP_VBELN
    I
    MPORTING OUTPUT = TMP_VBELN .
    CLEAR VBAK.
    SELECT SINGLE VKORG VTWEG SPART INTO (TMP_VKORG, TMP_VTWEG, TMP_SPART)
                                            FROM VBAK WHERE VBELN EQ TMP_VBELN.
    IF NOT TMP_VKORG IS INITIAL
    AND NOT TMP_VTWEG IS INITIAL
    AND NOT TMP_SPART IS INITIAL.
    CONCATENATE TMP_TXNAM1 TMP_VKORG tmp_vtweg tmp_spart into TMP_TXNAM2 SEPARATED BY '_'.
    endif.
    CONDENSE TMP_TXNAM2 NO-GAPS.
    PERFORM read_order_text USING TMP_TXNAM2 CHANGING v_text.
    READ TABLE output_tab WITH KEY NAME = 'ORDCONF_TEXT'.
    IF SY-SUBRC = 0.
    output_tab-value = P_V_TEXT.
    MODIFY output_tab index sy-tabix.
    endif.
    endform.
    FORM READ_ORDER_TEXT USING P_TMP_TXNAM2 CHANGING P_V_TEXT LIKE tline-tdline.
    DATA: ztdid LIKE thead-tdid,
              zlang LIKE thead-tdspras,
              zobj LIKE thead-tdobject,
              zname LIKE thead-tdname.
    DATA: tlines TYPE STANDARD TABLE OF tline WITH HEADER LINE
              thead LIKE thead.
    CLEAR P_V_TEXT.
    ztdid = 'ZSD'.
    zlang = 'E'.
    zobj = 'TEXT'.
    zname = P_TMP_TXNAM2.
    CLEAR tlines.
    REFRESH tlines.
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    object = zobj
    name = zname
    id = ztdid
    language = zlang
    IMPORTING
    header = thead
    TABLES
    lines = tlines
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found = 4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    LOOP AT tlines WHERE NOT tdline IS INITIAL.
    MOVE tlines-tdline TO P_V_TEXT.
    ENDLOOP.
    ENDFORM.
    But still its not getting printed .Plz tell me where i am going wrong.
    Thanks,
    Suman

  • How to retrieve long text data

    Dear all,
    How can i retrieve the long text for document line item
    Gone thru this in forum..but unable to get the correct one
    some say to use READ_TEXT FM
    Pls advise steps
    Rgds
    Naresh

    Hi,
    Please find here with link for bringing the long text.
    http://scn.sap.com/thread/497205
    Regards,
    Ramana

  • Problem in downloading long text

    Hi Experts,
    I am facing problem  while downloading long text.
    previously it was working 5ne. now it is giving the error meaasge
    ID ST Language En not found
    is there any settings to do.
    Thanks & Regards
    Sangareddy

    In a SAPscript you do not need to use ABAP code to retrieve long text - Just use the INCLUDE command in SAPSCRIPT - see help for details
    /: INCLUDE name [OBJECT o] [ID i] [LANGUAGE l] [PARAGRAPH p]
    this puts the complete long text in and formats it for the window
    Long text problem in sap script
    Reward points..

  • Excel file to be added to Maintenance Item long text

    Hello,
    Do you know by any chance whether excel file can be pasted to Maintenance item long text?
    I'm not talking here about adding attachment to maintenance plan itself...
    Thanks for your clues
    Grzegorz

    Grzegorz,
      You should be able to paste the same , as long as you are not concerned about the formatting. If formatting is of importance,you will have to manually format the contents as only limited formatting is supported by long text editor in SAP.
    Regards
    Narasimhan

  • Copy Long text of a notification to its Follow-up Notification

    Hi,
    Need clarification on
    Copying of PM-Notification Long text to the Long text of its Follow-up Notifcations.
    Regards,
    LSK.

    Hi lalitha
    Pl go through the below link for details regarding copy of long text
    http://help.sap.com/saphelp_47x200/helpdata/en/af/cb5447461411d189f20000e81ddfac/frameset.htm
    Regards
    Suhas

  • How to display long text in SAP Query ALV layout? It only show 129 char now

    I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
    Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
    thanks very much in addvance.

    Hi,
    ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
    Regards,

  • Problem in long text in SAP script editor

    Hi ,
    i am maintaining long text in SAP script editor , when i am trying to change the long text in SAP script that changes are not reflected in print preview ,for example when i am giving tabs in the script then in print preview of the PO these tabs are displayed as , , ( comma) , and underlines are not appearing in print preview.please help me on this.
    Thanks and regards.
    Rajeshwar.

    hi
    you have to install the correct printer which supports the displaying the drawings and objects/

  • PO for item of service Level short and long text using sap script

    Please let me know how to do the PO for item of service Level short and long text using sap script.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on May 5, 2009 10:25 AM

    Hi ,
          In the transaction related to PO select the path goto->header texts and then details of the texts like ID,objectname,language,name.Pass all theses details to 'READ_TEXT '   FM. Then you will get text lines described for a perticular Po ,similarly for item also.
    Thanks,
    Suma.

  • SAP Long Text hyperlinking

    Hello All,
    I am trying to find out if it is possible in include hyperlinks in SAP Long Text fields.
    Thank you,
    Alex

    Hi,
      if you mean long text created e.g. via function module SAVE_TEXT try to use character format DS (Hypertextlink (SO70)).
    I guess the only possible setting is via character formats.
    To get it try to use any object where you can create long text in dialog mode (e.g. IW32, IW22, ...) and try to create it there throw any other character format...
    Regards,
      Karol

  • Reg sap script long text

    Hi experts,
    I have one problemin bseg-sgtxt field. i develop sap script for payment print prog, In my script my field is bseg-sgtxt(item text). and this field lenght is 50 char. i want more then 50 char through this field in my script. for that i use long text button... this long text stored in EENO_DYNP and field name is ZEILE , but it is a structure...so my question is
    1) How can i retrive this long text field in my script
    2) Can u give me example with this coding..
    3) How can i concate bseg-sgtxt with EENO_DYNP-ZEILE
    I need code example for that....
    Pl help me its urgent
    zeni

    hi,
    the long text of a document are stored into the standard text table and u can read it with the function READ_TEXT.
    call this function in this way
    >CONCATENATE bseg-bukrs bseg-belnr bseg-buzei INTO name.
    >CALL FUNCTION 'READ_TEXT'
    >  EXPORTING
    >    id                      = '0001'
    >    language                = sy-langu
    >    name                    = name
    >    object                  = 'DOC_ITEM'  " identified FI document
    >  TABLES
    >    lines                   = t_line
    >  EXCEPTIONS
    >    id                      = 1
    >    language                = 2
    >    name                    = 3
    >    not_found               = 4
    >    object                  = 5
    >    reference_check         = 6
    >    wrong_access_to_archive = 7
    >    OTHERS                  = 8.
    the id of the text you can find in SPRO transaction under
    Financial accounting->Financial accounting Global Settings ->Document->line Item-> Define Text Identifications for Line Items
    here you can find all ID of the standard text that are configurated in your system.
    now you can concatenate BSEG-SGTXT with the standard text of the document item .
    bye
    Marco

  • How to Add Long Text from CA10 on SAP Script

    Hi Friends,
    I got a requirement to add a long text from CA10 on to the SAP Script.
    How to do this ?
    Is it using INCLUDE ?
    Please give me some solution
    Thanks in Adv.

    Hi Bhupal,
    Could you tell me how did u add the long text from CA10.  I have the same requirement.
    Thanks in advance.
    Manisha

  • Issue while saving long text through MS Word Editor in SAP

    Hi All,
    I am facing some issue while saving text through Word editor in SAP(like Notes in Installation or Long Text in device location).
    After entering the text, when I am pressing the Back button, it says text transferred successfully, but when I try to see the text again, its not in the proper format.
    Every time I go to the word editor, some text is deleted.
    Thanks in advance for your help.
    Manoj Vatwani

    Hi Manoj,
    Can you share some screenshot for the formatting issue that you are facing.
    Thanks,
    Amlan

Maybe you are looking for

  • Invoice correction request price problem

    User would like to create Invoice Correction Order  from Invoice. Problem is, the original order is from Schedule Agreement in which customer buy in big quantity in order to get cheaper price (scale price is applied). If you can see the original invo

  • Cisco AIR-LAP 1131 reboot in loop

    Hi Everyone I recently had to deploy about 4 cisco 1131 AP's to one of our branch location. When configuring them on the controller, i needed to put them in HREAP mode. As soon as i do that and the AP needs to reboot, it will continue to reboot in a

  • S.M.A.R.T. FW400 bridge boards vs FW800 bridge boards

    I am building a 4 bay case with ATA drives for storage. It will be connected via with FW400 or FW800. I see the FW400 bridgeboards are available as S.M.A.R.T., just like the drive in my computr. I do not see any FW800 S.M.A.R.T. available. How inport

  • Can't Print to Trial Acrobat Professional

    I downloaded and installed an Acrobat Professional 30-day Trial version. It starts up but when I try to print to it, either from Word or using the startup icon, I get a message that I must activate it to print to it. But it appears activation require

  • Programs won't open, uninstalled, reinstalled, can't activate again???

    Original problem:  I have been using my programs with no problem on my primary laptop for over 2 years. Last month, my laptop needed to be repaired, so we did not have it for 1 month. During that time, I needed to finish a project for a wedding, so I