Getting a runtime error in reading long text from production order

Hi all,
I am trying to read production order long text and the code is not showing any syntax error but if i execute it i am getting a runtime error as "Text object aufk is not available".
But i did check for the text object , text id enties in TTXOB and TTXID tables. Also i am able to see the relevant text in tables STXH and STXL, dont know why i am getting this runtime error and unable to debug.
I tried a lot searching in forums, but they all ask me to write the code in the way i did, so dont know what is the problem.
Data Declarations
data: xaufk  type aufk.
data: l_name type thead-tdname.
data: ilines type table of tline with header line.
Parameters
parameters: p_aufnr type aufk-aufnr.
concatenate sy-mandt p_aufnr into l_name.
condense l_name no-gaps.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
             CLIENT                         = SY-MANDT
              ID                                =  'kopf'
              LANGUAGE                 =  sy-langu
              NAME                          = l_name
              OBJECT                       = 'aufk'
            TABLES
              LINES                         =  ilines
          write : ilines.
Regards
Jessica

Hey Vijay,
Thanks for you reply, It worked, i am not getting the runtime error, but also not getting the output.
am i missing anywrite statements?
Please check the code and suggest changes if required. i want to see the long text in the production order in the output. should i say write: ilines.?
Data Declarations
data: xaufk  type aufk.
data: l_name type thead-tdname.
data: ilines type table of tline with header line.
Parameters
parameters: p_aufnr type aufk-aufnr.
concatenate sy-mandt p_aufnr into l_name.
condense l_name no-gaps.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
             CLIENT                         = SY-MANDT
              ID                            = 'KOPF'
              LANGUAGE                      =  sy-langu
              NAME                          = l_name
              OBJECT                        = 'AUFK'
            TABLES
              LINES                         =  ilines
             write : ilines.
Regards,
Jessica.

Similar Messages

  • How to copy long text from production order to automatically created P.R

    Hello experts,
    I want to add some text to the long text , in the production order and save it.
    There is an external process in our routing, in which when the order is saved and released, there is a P.R created automatically.
    My requirement :-  The text in the long text tab of the Production order should flow to one of the text types {Item text} in the P.R item created.
    I checked in SPRO [ IMG-> MM->Purchasing -> P.R-Texts for PR-> define copying rules].
    For text type ,  'Item text' already has  the text linkages : Order/network, with source texts "component text' and 'transaction text'.
    However, the text being maintained in the order is not flowing on its own anywhere into the P.R created.
    Is there any other config that needs to be done to achieve this?
    Regards
    P.R

    Hi, A production order long text exists at a header level and a Purchase req gets triggered at an operation level of a production order during external processing.
      So if you expect a mapping of a header text to operation level text, it should not be definitely possible in the SAP standard. (May be an enhancement would still work but you need to decide on it).
    If you maintain a long text at the same operation where you trigger a pur.req (a text on your own or via a standard text key-CA10 tcode), you would see that populated, at the item-level text tab of the generated pur req automatically, as a standard behaviour.
    Hope you would go with the standard system behaviour.

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • How to add the long text in Production order through FM

    Hi,
    Iam having custom program which has BAPI (BAPI_PRODORD_CREATE) inside it and this program is used to create Production orders with the details of Sales order Number,Line item,Plant,Order type,Quantity and Start date. This program is scheduled in Background.
    Now client wants to add the Long text (seperate TAB in production order and they want to update the VC details of Sales order in the Long text area).
    One option is after creation of Production order, through BDC(calling CO02 and update the long text) we  can update the long text and client doesn't want this option.
    Another option is after creation of Production order, using Function module SAVE_TEXT, Update the Long text in Production Order and this is not working in Production order (already my ABAP consultant checked it ).
    If any one of you came across this requirement, pl share with me how you addressed it.
    Regards
    A.Sureshbabu

    Hi,
    The method is quite simple, i presume you're quite well versed with doing recording, so the key thing to keep in mind is how to prepare the input file.
    At my end i had about 5 lines of data which needed to be uploaded, hence i had a tab-delimited file with the order nos. in the first column & the five lines of text in five different columns (Refer format below)
    Order No.
    Line - 1
    Line - 2
    Line - 3
    Line - 4
    Line - 5
    12345
    txt - 1
    txt - 2
    txt - 3
    txt - 4
    txt - 5
    67890
    txt - a
    txt - b
    txt - c
    txt - d
    txt - e
    Now provide this input file for your lsmw or bdc program & it will work. You can work with your abaper if you're not so comfortable with LSMW or BDC programming he / she should be able to easily make it work for you.
    Regards,
    Vivek

  • Update Long Text of Production Order

    Hi ABAP Gurus,
    We want to update some information in long text automatically while releasing production order.
    We try PPCO0007
    We found that we must update AUFK-LTEXT as 'E' then we can see long text via CO02, CO03.
    Without updating AUFK-LTEXT, even if the long text value saved in SXTL, but it can not be displayed via CO02, CO03.
    After saving the text using 'SAVE_TEXT' function module and commiting it we update the 'ltext' field in AUFK table.
    SELECT SINGLE * INTO wa_aufk FROM aufk WHERE aufnr EQ '000012345678'.
    wa_aufk-ltext = 'D'.
    MODIFY aufk FROM wa_aufk.
    However, it only works when we go to CO02 and press 'Save' button without changing anything.
    If we press 'release' button, AUFK-LTEXT will be overwritten by system. >_<
    What we expect system to do is that when we release production order, AUFK-LTEXT can be changed to 'E', so that we can display long text via CO02, CO03.
    Please help.
    Cheers,
    Qiang

    There is no standard SAP enhancement we can use for this purpose.
    We have developed another program to maintian the long text in production order.
    This call can be closed.
    Cheers,
    Qiang

  • Printing Long Text of Production Order

    Dear all,
    Can we print the long text of Production Order using Co04N transaction? Please suggest.
    regards,
    Kumar

    Hi,
    Thanks for suggestion,,, awarded points.
    Thread closed
    regards,
    Kumar

  • Add new tab of long text to production order

    Hi all
    i need to add new tab of long text to production order, which will be blocked for changes.
    anyone can help with this?
    thanks.

    Yossi,
    The purpose of long text is so that business users can add additional information while processing the order so that everyone can check the text.
    Please tell us why do you want to block the production order text? Also why do you need a new tab for long text? and where do you want that information to be stored?
    -Swapnil

  • Reading Long Text from MM03

    I need to read a long text from MM03, view - Sales Text. I cannot use FM READ_TEXT as there is no header data available there.
    How do i do it?

    Amol,
    Sales Text CANNOT exist without the HEADER DATA.
    You have to use READ_TEXT with these paramters.
    Text Name       Material Number (NAME)
    Language        EN
    Text ID         0001 (ID)
    Text object     MVKE (OBJECT)
    regards,
    Ravi
    Note : Please close the thread if the issue is solved.
    Message was edited by: Ravikumar Allampallam

  • How to create long text in production order?

    Hi,
    i have found that i could only change long text in the
    production order by 'SAVE_TEXT'.
    but i want to create long text and any advice?

    DATA:TEXT_HEADER LIKE THEAD.
    DATA:TEXT_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE.
    data: t_ponum  like BAPI_ORDER_KEY-ORDER_NUMBER.
    t_ponum = '000040000068'.
    TEXT_HEADER-TDID ='KOPF'.
    TEXT_HEADER-TDOBJECT = 'AUFK'.
    TEXT_HEADER-TDSPRAS = sy-LANGU .
    CONCATENATE SY-MANDT t_ponum INTO TEXT_HEADER-TDNAME.
    clear text_lines.
    refresh text_lines.
    text_lines-TDFORMAT = '*'.
    text_lines-TDLINE = '12567'.
    append text_lines.
    text_lines-TDFORMAT = '*'.
    text_lines-TDLINE = 'lg'.
    append text_lines.
    text_lines-TDFORMAT = '*'.
    text_lines-TDLINE = 'prh'.
    append text_lines.
    text_lines-TDFORMAT = '*'.
    text_lines-TDLINE = 'ueue'.
    append text_lines.
    CALL FUNCTION 'CREATE_TEXT'
      EXPORTING
        FID               = TEXT_HEADER-TDID
        FLANGUAGE         = sy-LANGU
        FNAME             = TEXT_HEADER-TDNAME
        FOBJECT           = TEXT_HEADER-TDOBJECT
                     SAVE_DIRECT       = 'X'
                     FFORMAT           = '*'
      TABLES
        FLINES            = text_lines
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        CLIENT          = SY-MANDT
        HEADER          = TEXT_HEADER
        INSERT          = ' '
        SAVEMODE_DIRECT = 'X'
      TABLES
        LINES           = text_lines.
    CALL FUNCTION 'COMMIT_TEXT'
      EXPORTING
        OBJECT          = TEXT_HEADER-TDOBJECT
        NAME            = TEXT_HEADER-TDNAME
        ID              = TEXT_HEADER-TDID
        LANGUAGE        = sy-LANGU
        SAVEMODE_DIRECT = 'X'.

  • Long text in production order

    Hi All,
    I have enter some text in all my production order. Based on that txt can i pulled the orders in the report(in std report). Is there any report like this.
    Thanks and Regard,
    D.Dutta

    Hi,
    Check in COOIS report by adding executing at header level & adding the header text field.
    If this does not give you the desired result, then you can get the same from STXH table.
    pass the field value as below:
    TDOBJECT = AUFK
    TDID = KOPF
    TDSPRAS = EN
    TDNAME = (client nos + 12 digit order nos)
    The same can also be read from the FM - READ_TEXT.
    Hope the above answers your query.
    If helpful award points
    Regards,
    Vivek

  • Occurs error when create purchase req. from product order with 'PP02'

    hi,friends.
    when i add a route with 'co02', and select control key 'pp02',
    then it leave to the view of 'Ext. Processing',
    i input the values of 'Cost Element' 、'Purchasing Group' 、'Material Group'....
    and the value of 'Res./Purc. req.'  is  '3',
    but when i return,it shows the error:
    Error occurred during creation of purchase requisition for operation 0050
    Message no. C2325
    Diagnosis
    During automatic creation of the purchase requisition to operation 0050, an error (ME 673) occurred.
    System Response
    The system cannot create the corresponding purchase requisition.
    Procedure
    For further proceedings, read the long text of error message (ME 673) in transaction SE91. Check the operation affected and change or complete any missing data that led to the error message.
    double click the route,goto the view of 'Ext. Processing',
    and the value of 'Res./Purc. req.'  changed  to  '2',
    why?
    and the purchase request isn't be created.

    thanks for K.Madhu Kumar
    the value of Res./Purc. req. be changed to '2'
    so the purchase requisition con't be created.
    if i Release the production order,it will be created,
    and the item cat. is null, the acct assgt cat. is 'F'
    Edited by: tizo lee on Jul 20, 2010 5:11 AM

  • Printing long text from Routing instead of Production order for an order.

    Hi Gurus,
    When a production order prints it is printing  the long text from the routing master rather than the long text on the actual production order.
    This field is used to provide specific instructions in special circumstances in addition to the standard text.
    I need system to be changed so that printing takes long text from production order.
    Please help me.
    Naveen.A

    Hi,
    In the production order long text, the text we are maintaining is only for information. It can't be able to print. In Production order, copies all the masters and the texts which we are maintaining in the masters only will be able to print. Standard SAP will not print the production order long text.
    Regards,
    V. Suresh

  • WHILE DELETING A SALE ORDER GETTING A RUNTIME ERROR

    hi to all experts,
    whenever i try to delete a particular sale order im getting a runtime error
    stating that
    Short text
        Screen: Illegal message
    What happened?
        The current screen processing action was terminated since a situat
        occurred where the application could not continue.
        This is probably due to an error in the ABAP program or in the cur
        screen.
    Error analysis
        The program attempted to issue a " " message during "Exit Command" processing.
        This is an illegal operation.
        The program was terminated.
        Screen name.............. "SAPMV45A"
        Screen number............ 4001
    Trigger Location of Runtime Error
        Program                                 SAPMV45A
        Include                                 MV45AFZZ
        Row                                     370
        Module type                             (FORM)
        Module Name                             USEREXIT_SAVE_DOCUMENT
    SourceCde
                  message e001(zm) WITH text-335 ltab-kunnr text-334.
                else.
                  if ktab-jkunnr <> ltab-kunnr.
                    ktab-jkunnr = ltab-kunnr.
                    jobsitecode = ltab-kunnr.
                    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                    EXPORTING
                      input  = jobsitecode
                      IMPORTING
                      output = jobsitecode.
                    SELECT SINGLE * FROM kna1 WHERE kunnr = jobsitecode.
                    IF sy-subrc = 0.
                      ktab-jname1 = kna1-name1.
                      ktab-jstras = kna1-stras.
                    ENDIF.
                    chg_flg = 'X'.
                  endif.
                endif.
              else.
                message e001(zm) WITH text-336.
    * Validation for relationship between Sold-to Party and Ship-to Party
    *          if ktab-ckunnr+0(4) NE ktab-jkunnr+0(4).
    *            message e001(zm) WITH text-335 ktab-jkunnr text-337 ktab-ckunnr.
    *          endif.
              custcode1 = ktab-ckunnr.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = custcode1
                IMPORTING
                  output = custcode1.
              jobsitecode1 = ktab-jkunnr.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = jobsitecode1
                IMPORTING
                  output = jobsitecode1.
              SELECT SINGLE * FROM knvp
              WHERE kunnr = custcode1
                AND vkorg = vbak-vkorg
                AND vtweg = vbak-vtweg
                AND spart = vbak-spart
                AND parvw = 'WE'
    Error analysis
        The program attempted to issue a " " message during "Exit Command"
        This is an illegal operation.
        The program was terminated.
        Screen name.............. "SAPMV45A"
        Screen number............ 4001
    Trigger Location of Runtime Error
        Program                                 SAPMV45A
        Include                                 MV45AFZZ
        Row                                     370
        Module type                             (FORM)
        Module Name                             USEREXIT_SAVE_DOCUMENT

    Hi,
    Seems there is some problem with the user exit USEREXIT_SAVE_DOCUMENT..
    Put a breakpoint and see.
    Regards,
    Nagaraj

  • Update Time confirmation and Long text of Work Order in single FM or BAPI

    Hi,
    I would like to know, which standard FM or BAPI will update the longtext along with the confirmation text while doing the time confirmation of a work order.
    I have tried with standard BAPI BAPI_ALM_CONF_CREATE for updating the time confirmation. This is updating the time and confirmation text properly but not the long text. I would like to know how can I update the long text while doing the time confirmation. Is there any other standard FM/BAPI will update both?
    Thanks in Advance,
    Mohan.

    There is no standard SAP enhancement we can use for this purpose.
    We have developed another program to maintian the long text in production order.
    This call can be closed.
    Cheers,
    Qiang

  • Propagate long text from order to notification, notification to order

    Hi Experts!
    Like in subject I want to propagate long text from PM order to PM notification and the other way round. If text will be changed in one document it should be changed in second too.
    Have you any idea how to do that?
    Thank from advance
    Bartek
    Edited by: Julius Bussche on May 4, 2009 11:25 AM
    Subject formatting corrected.

    Hi,
    If these are two different fields having different data elements then I dont think its possible until and unless they both have the same data element...
    if they have the same data element I think you can keep the long text for the data element and it will reflect both the sides...
    Regards,
    Siddarth

Maybe you are looking for