Long Text problem in a BADI

Hi Everyone,
I am implementing BADI "WORKORDER_UPDATE". The requirement is there should be no changes made on the IW32 transaction. I have successfully implemented the BADI and it is now giving an error when we try to change anything on the order in IW32.
The problem is with the longtext. There is a field TXCHG which I used to see if there are any changes being made to the long text. When someone changes the lontext and tries to save it, it gives an error but still retains the changed longtext. The code works fine with all other changes(I mean it gives an error when they try to change anything in IW32 and will not retain the changes). But this does not happen in the case of long text. It gives an error but still has the changed long text as part of the order.
Any suggestions on how to proceeed? I am using instance  Before_Update in this BADI.
Thanks
Kumar.

Do u mean after giving the Error message, even if u come out without saving it is keeping the changes?
If the answer to the above question is no then try the following procedure:
Read the long text using READ_TEXT (function module) by passing the TDID, TDOBJECT, TDSPRAS, TDNAME (u can get these details by going through the menu edit-> go to header). 
Store that in an internal table and then append all the lines of this internal table into a string Variable and assign this variable's text to the field in which long text is being displayed.
This should work bcoz , in the database only the original Long text is stored and we are retrieving it and displaying back in the relevant field.
Please reply if it works.....

Similar Messages

  • Long text problem while uploading Inspection plan through BDC.

    Hi,
    I am facing some problem while uploading the inspection plan. There are few MICs for which we are having long text, while uploading the inspection plan through BDC - some other long text is getting copied into the MIC's long text. After checking I came to know that in function module, read_text - some text which is stored in ABAP memory is getting copied into the inspection plan.
    I am working in SAP release 4.7. I have checked with SAP notes: 97419, but it is also not satisfying.
    Waiting for quick solution.
    Thanks in advance.
    Fahié

    Hi a®s,
    Thanks a lot for your kind reply.
    My requirement is I want to maintain long text for few MICs (which are not having long texts at MIC level) in inspection plan (QP01).
    When I am trying to manually assign the MIC's to inspection plan (QP01), long text is copied whereas I am not clicking the long text icon in (QP01). Long text is not maintained in MIC level, still some long text is copied to this MIC. This was also happening while uploading the inspection plan thro' BDC.
    I believe what you have mentioned about function module SAVE_TEXT cannot be used here since long text is already copied before we pass the long text. Also if we pass some long text, still apart from the long text what we have passed there is some other long text copied (extra long text).
    Waiting for quick solution.
    Thanks in advance.
    Fahié

  • ECC5.0 Long text Problem in QM02

    Hi friends,
    when i am create Item long text in Qm01 when i am reading the text in from FM read_text in tlines my structure is
    tdofrmat ,tdline
             text1(72)
    =          text1(72)
             text2(59)
    after saving the long text and when i am trying to read in QM02 mode ,with same FM i am getting as.
    tdofrmat ,tdline
    X>         * text1(72)
    X>         * text1(72)
    X>         * text2(59)
    Hope u under stand my problem.
    How to Indentify which line is continous to which one,where the word was splitted.i searched FM's but i didn't get.i tried with "Newline" by refering Class No result.Gurus kindly Provide the solution......
    In Advance Thanks...

    Hi,
    Did you try this:
    text1(72)
      text1+72(72)
    text2(59)
    Regards.

  • IA05-Long text problem

    Hi ,
    I have to do a data upload for IA05 transaction.
    I have done the recording for BDC.
    But i am facing problem in Long text upload (SAVE_TEXT), because the TEXT NAME logic requires Group number. This group number is created when the transaction is executed.
    Do by any means i can get the group number at runtime because will executing the transaction i can see the group number which is created.
    Else does anybody have some other way to do this. Please suggest.
    Thanks & Regards
    Kapil

    Hi,
    <b>This is the only way you can do this.</b>
    And you are not hardcoding anything. If BDC is successful and you get the 'Group numer" just create a text using SAVE_TEXT FM.
    Let me know if you have something else on your mind.
    Regards,
    RS

  • 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

  • PRT long text problem

    Hi,
    I have assigned long text in ABC PRT.  After that I assigned this ABC prt to material (XYZ) routing to operation no 100. But surprisingly long text of ABC prt has not transferred to routing and I am unable to see it in XYZ routing 100 operation.
    Does anybody have any idea about this issue?
    Your valuble input is highly appericiated.
    Regards,
    Alex

    Hi,
    We should not get such type of error.
    Please check once.
    Select the operation no 100-> PRT Overview-> Select the PRT BAsic Data- > Long text.
    In case you didn't find it there please give some more details of the problem.
    Regards
    JB

  • Long Text problem in Process order header

    Hi All,
    I am using SAVE_TEXT FM to update the header long text in process order.
    Also, I am updating the field AUFK-LTEXT = 'E'.
    But when i display the order and click on long text, it does not display any thing as the text is not saved.
    When I update the text directly in the order using COR2, it gets saved.
    Does anyone know why the text is not being saved through FM SAVE_TEXT?
    Also tried COMMIT WORK but was not successful.
    The paramters I am passing to the FM are
    TDOBJECT = 'AUFK'
    TDID     = 'KOPF'
    TDSPRAS  = SY-LANGU
    TDNAME = sy-mandt+order number with leading zeros.
    and the text lines in internal table.
    Am I missing anything else here?
    Thanks,
    Sandeep

    Hi Sandeep,
    First check table STXH for the order which you saved manually, in order to verify that the values you are passing to the FM SAVE_TEXT are correct.
    Also check the documentation which is supplied with this function to determine the INSERT and SAVEMODE_DIRECT values.
    Also maybe check function COMMIT_TEXT and its documentation.
    Regards,
    Robert
    PS. also test the scenario in which text s/b added to already existing text. The SAVE_TEXT function wipes out everything and therefore you first should read the existing text (READ_TEXT) to retrieve the current text and save this together with the new text using SAVE_TEXT. (check function group STXD for possible related functions to use).
    PPS. Thinking about my comments under PS., I recall now that this was the symptom of the long text passed on through BAPI_SALESORDER_CHANGE and therefore maybe this is not the case for SAVE_TEXT.
    Edited by: RJ. Schamhart on Feb 3, 2011 4:53 PM

  • Saving long text - problem

    Hi,
    I am having a long text which has 10lines.. i need to save that long text from a file using migration.
    first i need to store that text in a field for of an internal table & then save it in a long text ..
    can any one help me out in providing the soln/alternatives to fix this..
    Pls. do the needful.
    thanks
    john

    Hi John,
    From what I know about long text in SAP is that they are stored based on ID, Object and Language. First you probabaly need to set them using tcode SE75(Change / Add New Object and ID)
    Then in your program you can use several FM that process long text.
    My favorite is
        CALL FUNCTION 'LANGTEXT_ONLY'
             EXPORTING
                  object           = *Object
                  object_nr      = *Object_no
                  spras           = *language
                  txtid              = *ID
                  x_xaktyp      = *aktyp
               save_mode   = 'X'
               text_history  = 'x'
               text_property = 'x'
             IMPORTING
                  ind_inv       = *line
                  inv_exist     = *exist
             TABLES
                  t_inlines     = t_linetab.
    This FM will call longtext editor and also set the mode
    aktyp = H => create new,
    aktyp = V => change
    aktyp = A => read only
    Another useful FM is READ_TEXT and SAVE_TEXT. Try to experiment with it and see any documentation for detail.
            CALL FUNCTION 'READ_TEXT'
              EXPORTING
                id              = *ID
                language  = *Language
                name        = *Name
                object        = *Object
              IMPORTING
                header    = t_headltx
              TABLES
                lines     = t_linetab
              EXCEPTIONS
                not_found = 1.
            CALL FUNCTION 'SAVE_TEXT'
              EXPORTING
                header          = t_headltx
                savemode_direct = 'X'
              TABLES
                lines           = t_linetab.
    Hope it helps
    Regards
    Hadi

  • Long text problem in BW query and Key figure name

    Hello
    We're using SAP BO 4.0 (IDT) and SAP BW as a datasource. Maybe someone knows:
    1. How to change the name of keyfigure, which now appears as Formula 1, Formula 2 etc. In BW every single key figure has it's own name Sales, Purchases etc. What I'm missing here?
    2.As you well might know every single char infoobject has it's own Long\Short\medium which now appears as an attribute. When I choose multiple Long definitions then the execution of a BEx query fails with 'Inconsistent answers'. In Universe Designer we can change the objects name, but how to proceed here. Do I need to change something on a Bex query level?
    I'm well familiar with SAP BO, but due to lack of experience in SAP I'' ve hit astumbling block with these 2 things> Any assistance would be more than welcome
    Thanks in advace

    Hi,
    for (1)  - that doesn't sound right...   i think your KF are calculated KF (CKF)  possibly with a formulae variable .. or something, which is supposed to populate the name, based on a user response ? 
    Or maybe you've got non-unique KF descriptions, and this is some system imposed nomenclature?
    for (2)  i'm not so sure, but you may have to change the infoobject text setting, globally, in RSA1.   webi won't like non-unique labels if the keys are different.. How does it look with the default 'key and text' (medium) setting?
    yes you can change the characteristic display properties in Bex query designer, but i have a funny feeling that it doesn't get consumed by webi over that API.  (it's native OLAP stuff for BEx really...)
    Good luck
    H

  • 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..

  • Problem with long text

    Hi folks,
    iam uploading longtext in transaction KP06 in bdc programing using create_text.
    now my problem is if i pass selection criteria
    case 1:
    Vertion : N0
    fiscal year : 2007
    planner profile: CCPLAN4
    then the budeget plan data uploading successfully along with long text.
    case2: Vertion : N1
    in this case also everthing wrking fine
    case3: Vertion : 001
    in this case budgetplan data uploading sucessfully but longtext is not uploading,
    i debbug the proragm , create_text also returning sy-subrc = 0. but if i check in KP06  the long text is not there.
    data declaration
    vertion : VERSN type C(3)
    can u tell me the problem is in logic or with FM ?
    note : i checked with save_text also.
    regards
    neeru

    HI Naimesh,
    the FM Create_text internally contains both FMs save_text and commit_text,
    even i debug the FM in case of vertion N1, N0 and 001,
    all the cases sy-subrc = 0.
    code:
    CLEAR G_OBJNR.
    LOOP AT RECORD.
    COST = RECORD-BDC01.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = COST
        IMPORTING
          output = COST.
        CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.
            SELECT SINGLE * FROM COSP WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
      IF SY-SUBRC = 0.
          LEDNR = COSP-LEDNR.
          OBJNR = COSP-OBJNR.
          GJAHR = COSP-GJAHR.
          WRTTP = COSP-WRTTP.
          VERSN = COSP-VERSN.
          KSTAR = COSP-KSTAR.
          HRKFT = COSP-HRKFT.
          VRGNG = COSP-VRGNG.
          VBUND = COSP-VBUND.
          PARGB = COSP-PARGB.
          BEKNZ = COSP-BEKNZ.
          TWAER = COSP-TWAER.
    CONCATENATE LEDNR OBJNR INTO OBJNR.
    CONCATENATE OBJNR GJAHR INTO TNAME1 separated BY SPACE10.
    CONCATENATE TNAME1 WRTTP VERSN INTO TNAME2.
    CONCATENATE TNAME2 KSTAR INTO TNAME3 separated BY SPACE.
    CONCATENATE TNAME3 VRGNG INTO TNAME4 separated BY SPACE4.
    CONCATENATE TNAME4 BEKNZ INTO TNAME5 separated BY SPACE10.
    CONCATENATE TNAME5 TWAER INTO TNAME.
    I_THEAD-TDOBJECT = 'CCSS'.
    I_THEAD-TDID = 'COSP'.
    I_THEAD-TDNAME = TNAME.
    I_THEAD-TDSPRAS = 'E'.
    APPEND I_THEAD.
    i_tline-tdformat = '*'.
    I_TLINE-TDLINE = RECORD-LONGTEXT.
    APPEND I_TLINE.
    loop at i_thead.
    CALL FUNCTION 'CREATE_TEXT'
      EXPORTING
        FID               = I_THEAD-TDID
        FLANGUAGE         = I_THEAD-TDSPRAS
        FNAME             = I_THEAD-TDNAME
        FOBJECT           = I_THEAD-TDOBJECT
      SAVE_DIRECT       = 'X'
      FFORMAT           = '*'
      TABLES
        FLINES            = i_tline
    EXCEPTIONS
      NO_INIT           = 1
      NO_SAVE           = 2
      OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CLEAR I_TLINE.
    REFRESH I_TLINE.
    CLEAR I_THEAD.
    REFRESH I_THEAD.
      SELECT SINGLE * from cokp into itab WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
    if sy-subrc = 0.
       itab-TXFLG = 'X'.
       append itab.
       write:/ 'Text saved for', record-bdc00 , record-bdc01.
       else.
          write:/ 'Text saved for', record-bdc00 , record-bdc01.
          ENDIF.
    ENDIF.
    my program wrking fine but the long text is not visible for vertion 001.
    regards
    niru

  • How to update long text in symptoms/problems ?

    Hi All,
    Can anybody help me regarding how to update the long text of a symptom/problem?
    Please help.
    Regards,
    Jeetu

    Hi Jeetu,
    Can you Please elaborate your query.
    Are you talking about Problem/solutions created using Tcode: IS01( used in service scenario)
    Or
    The Text Management i.e. Text Types
    Regards.
    Shalini Chauhan

  • Operation Long text creation problem in IW32

    Hi experts,
    I have a requirement of showing a checklist pop up for all the new external operations in creating a MPA work order(IW32). And when the user answers the questions on the checklist, I have to copy all the questions and answers into the long text of the corresponding operation.
    The problem here is,
    for a case when the long text is not yet created for a new line item, when the pop up is shown and answers are filled, I am creating a new standard text using SVE_TEXT(setting the insert paramter 'X'), but the standard text is getting created in the database i.e a record is getting created in STXH with the text id, text name, text object of the operation. But when I go to IW32 and see the operation line it shows the create long text icon which says that the text is not created at all.
    In a case where the long text is already created for the operation, and then the pop up is shown with the questions and answers are filled, the questions and answers are copied into the operation long text which is already created. So this works fine.
    If any pointers regarding this please let me know.
    Thanks and Regards,
    Asha

    Hi,
    Try passing SAVEMODE_DIRECT = 'X' and check..
    also check if the text exists using the function module READ_TEXT once you do the SAVE_TEXT..
    Thanks,
    Naren

  • Get the long text into BADI from text editor

    hi all,
    I implemented BADI ME_PROCESS_PO_CUST, before saving the purchase order i am calling the text editor where i am writng
    the long text . but when save the text from the text editor the long text in the editor is not updating to the BADI.
    Can anybody help how can i get the long text to the BADI.
    Regards,
    Madhavi

    Hi
    Have you tried with interface 'IF_PURCHASE_ORDER_MM' with these methods in the BADI?
    IF_LONGTEXTS_MM~GET_TEXTOBJECT
    IF_LONGTEXTS_MM~GET_TYPES
    IF_LONGTEXTS_MM~GET_TEXT
    IF_LONGTEXTS_MM~SET_TEXT
    IF_LONGTEXTS_MM~ADOPT_TEXT
    IF_LONGTEXTS_MM~DELETE_TEXT
    IF_LONGTEXTS_MM~EDIT_TEXT
    Regards
    Eduardo

  • Problem in Getting Long Text After uploading LT using CREATE_TEXT in CORS

    Hi Gurus,
    i am uploading long text for Reason for cancellation in CORS Transaction through CREATE_TEXT.
    after uploading this text by using this FM CREATE_TEXT i am seeing the long text what ever i uploaded through CREATE_TEXT , i am unable to see first 40 characters of that long text.
    if anybody faced this problem earlier please guide me to resolve this problem.
    Thanks & Regards
    Venkata Ramesh J

    Hi,
    can you please check this link
    Replacing the text created in create_text
    Thanks
    durga.K

Maybe you are looking for