Reading Item texts of a document (PO) while it is not yet saved

Hi Team ABAP,
i´m a little confused about those item texts.
I was searching the Forum on this and found thread
according to this i adopted my Coding, but still it wont, work. Maybe one of you guys has an Idea where i go wrong?
FORM get_article_basic_text
  USING           ebeln           TYPE ebeln
                  ebelp           TYPE ebelp
                  matnr           TYPE matnr.
  DATA:           ls_header       TYPE thead,
                  lt_lines        TYPE TABLE OF tline,
                  ls_lines        TYPE tline,
                  lv_swap         TYPE c LENGTH 3,
                  lv_line         TYPE char20.
  FIELD-SYMBOLS: <line>           TYPE tline.
  DO 30 TIMES.
    WRITE sy-index TO lv_swap.
    CONDENSE lv_swap.
    CONCATENATE 'W_LONG_TXT' lv_swap INTO lv_line.
    ASSIGN (lv_line) TO <line>.
    IF <line> IS ASSIGNED.
      CLEAR <line>.
    ENDIF.
  ENDDO.
  IF ebeln IS INITIAL.
    ebeln = 'XXXXXXXXXX'.
  ENDIF.
  CONCATENATE ebeln ebelp
  INTO        ls_header-tdname.
  ls_header-tdid      = 'F03'.
  ls_header-tdobject  = 'EKPO'.
  ls_header-tdspras   = nast-spras.
  g_tdname = ls_header-tdname.
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id                      = ls_header-tdid
      language                = ls_header-tdspras
      name                    = ls_header-tdname
      object                  = ls_header-tdobject
    TABLES
      lines                   = lt_lines
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
I created a new PO using ME21N, added the F03 Text on item level for item 10. Then i pushed print preview and debugged right into my coding.
Values for LS_HEADER were:
ls_header-tdname = XXXXXXXXXX00010
ls_header-tdid = F03
ls_header-tdspras = D
ls_header-tdobject = EKPO
and still i got sy-subrc = 4 and no result.
Edited by: Florian Kemmer on Jun 9, 2011 9:36 AM

Florian,  Have you checked the possibility  of using the BADI "ME_PROCESS_PO_CUST" to achieve this ? Most of the methods in this badi uses the parameters of type IF_PURCHASE_ORDER_MM. May be you can use the methods IF_LONGTEXTS_MMGET_TEXTOBJECT,  IF_LONGTEXTS_MMGET_TYPES, IF_LONGTEXTS_MM~GET_TEXT of the interface IF_PURCHASE_ORDER_MM. 
I didn't tried this with PO, but simliar kind of BADI worked properly with Purchase requisition.  Wiki post  [Purchase Requisition Header Long Text using Badi - ME_PROCESS_REQ_CUST|http://wiki.sdn.sap.com/wiki/display/ABAP/PurchaseReq.HeaderLongTextusingBadi-ME_PROCESS_REQ_CUST] may be helpful.
Regards, Vinod

Similar Messages

  • Document line item text in Clearing document

    Dear All,
    Document line item text
    My client want the vendor invoice line item text(BSIK-SGTXT) to be captured in the corresponding clearing document line item text field(BSAK-SGTXT).
    (i.e) The vendor invoice and its payment clearing document should have the same text in the document line item text filed.
    According to me i can use  a substition rule and a user exit to assign the values. but here comes a problem* i have one clearing document against 3 to 4 vendor invoice documents* so my programming logic has got stucked here? like which vendor invoice line item text the clearing document should pick up?
    is there any other enhancements possible or can some one help me with the programming logic to be applied here.
    Thank you
    Regards,
    Vasanth D

    like which vendor invoice line item text the clearing document should pick up?
    is there any other enhancements possible or can some one help me with the programming logic to be applied here
    Why don't you discuss the issue with your client?  As you said, if you pay 5 invoices in a single run, the payment document item text can't carry all of those texts unless you use the long text.  What is the reason for the requirement?  Perhaps there's another solution.

  • Getting error: The document [document title was here] could not be saved."

    I am getting this error when trying to save a Numbers spreadsheet:
    "The document (document title was here) could not be saved."
    I created this spreadsheet from scratch in the numbers format, and I have been using it for several weeks now.
    When I 'get info' on the file and look at the file permissions, I see that my user has read and write access to the file. It is in the /Users/Shared directory as I share it with others on this computer. No other users are logged in, therefore the file is only open by me.
    I have already tried restarting the computer, and that didn't work.
    Any help would be greatly appreciated with this! I think others on this forum may have had a similar problem but they were blaming it on opening the file over a network. In my case as you can see, it is all local to my computer.

    Thanks for the suggestions. I tried all three and unfortunately the problems just got worse until the file would not open at all
    I had to restore from time machine from yesterday, then save as a different file. This allows me to edit the copy, but as soon as I try to edit it as a different use I go back to the same old problems again, even if the user has read & write permissions on the file and the directory the file is in.

  • Reading item text of sales order using READ_TEXT but getting error

    Hi Experts,
    I want to read the Billing item text which is processed through from delivery.
    For that I am using FM  READ_TEXT, but getting error.
    Text 0090014392 ID 0001 language EN not found
    I am providing data in FM...
    ID : 0001
    LANGUAGE : E
    NAME : 0090014392 (Billing Document Number)
    OBJECT : VBBP
    but still I am getting the error...
    Can anyone provide solution?
    Regards,
    SURYA
    Edited by: suryabasu on Mar 10, 2011 5:49 AM

    hii
    try with this,
    select single tdtxtlines
                   from stxh
                   into v_textline
                   where tdid = '0001'
                   and   tdname = wa_tname-name
                   and   tdobject = 'VBBP'.
    if v_textline ne 0.
    call function 'READ_TEXT'
       exporting
         id                            = '0001'
         language                      = sy-langu
         name                          = wa_tname-name
         object                        = 'VBBP'
       tables
         lines                         = it_tline
      exceptions
        id                            = 1
        language                      = 2
        name                          = 3
        not_found                     = 4
        object                        = 5
        reference_check               = 6
        wrong_access_to_archive       = 7
        others                        = 8.
    endif.
    read table it_tline into wa_tline index 1.
    regards,
    Sri.

  • Item Text in FI Document

    Hi,
    For FI documents generated from GR (MIGO) and IV (MIRO), can we update the text field with certain values from the material documents?
    In fact, we would like to always populate the text field of FI documents from sub modules.
    What would be the best method?
    I found this thread: Item Text in FBL3N copied automatically from MIRO line item
    Can the method be used for all types of documents? It seem quite tedious?
    Thanks.
    Regards.

    Hi,
    The above given thread is the perfect solution for your requirement.
    Defaulting some data in the text field means, either you can use the the Substitution / BTE.
    Using the substitution, system not allows you to change the text field in case of any modification you want. But with the BTE you can specify only at the time of the document posting.
    BTE is the best option in this case.
    VVR

  • Can't modify line item text in financial document

    Dear all,
    In some cases I'm not able to modify line item text field in financial documents, and I don't know why.
    I've checked customizing and BSEG-SGTXT appears as modificable field in any case.
    As far as i know text field is not a relevant field, so the system should let me modify it if the customizing is right.
    Does anyone know if there could be any other customizing that affects this transaction (FB02)?
    Thanks

    Hi
    Since you indicated the entry is from goods receipt, I understand that you are trying to change the line item text in a GL line item.
    If so, please ensure the following:
    1. in OB32, for Account type S and Field name BSEG-SGTXT, the trasaction type is blank, "Field can be changed" is ticked and "Posting period not closed" and "Line item not cleared" are not ticked. 
    2. In OB32, for Account type S and field name BSEG-SGTXT, no other entry is there along with company code which has a different rule.
    3. You can enough authorization to change the document.
    4. If you can change the text, but cannot save it, then please check whether any validation/BTE is in place which is not allowing to do so.
    Regards

  • Upload item text for FI document using BAPI_ACC_DOCUMENT_POST

    Hi,
    I need to upload FI document posting using BAPI_ACC_DOCUMENT_POST.  However item text that I received is too long and need to store at item long text.  So can we use BAPI_ACC_DOCUMENT_POST to upload long text for item text? If this possible, may I know how to do this.
    Thanks.
    Regards,
    ain

    Hi,
    You cannot pass item long text using this BAPI,  Call the function module SAVE_TEXT after successfull call of BAPI
    Call Save_Text with following parameters.
    Text_ID : 0001 (Notes)
    Text_object : DOC_ITEM (Line Item Text)
    Language : EN
    Text Name : Company code +Document NO + Fiscal Year + Line item ID
    Regards
    Vinod

  • Transfer  item text invoice in Document FI

    Hi developers,
    I wish transfer the item text of the invoice SD in field of Account Document FI  (BSEG-SGTXT ).
    Have you some ideas for help me!!!!!!!!
    Thanks in advance
    Domenico

    use enhancement SDVFX008 to feed the XACCIT-SGTXT field.
    You ca retreive the text using the FM READ_TEXT, normally in the invoice the header text is a VBBK object.
    Roberto

  • Item Text of PO needs to be populated before it is saved

    Hi All,
    I have to write Item text of PO to Application server along with other PO details.
    So using ME21n I am trying to do this using a BTE, but when BTE is triggered by  that time item text is not saved to PO so I am unable to capture it.
    Please suggest the approach or solution for this issue.
    Thanks in advance.

    hi,
    u will not be able to fetch the latest value untill commit take place for me21n..
    So u need to get that value at runtime, so u need to debug and find out, I think u will get some method which will give u that current text...
    And write enhancement(may be implicit) and write ur data to App. server.

  • Compliance Policy Center - Document Deletion Policies option is not yet enabled

    Hello,
    I have configured Compliance Policy Center for my Online tenant. Created a policy and assigned it to a Site Collection.
    I am trying to view policy assigned to Site Collection from Site Settings > Document Deletion Policies (as mentioned in
    https://technet.microsoft.com/en-us/library/dn790608.aspx   ) however this setting is not yet displayed. technet article says, it takes 24 hours once you assign a policy, but its almost
    a week have been spent. Still not yet displayed.
    Kindly assist me to get it done.
    Thanks,
    Mayank Nigam

    Hi Mayank,
    As a common practice, it is recommended to dig into the ULS logs cause it will give us more details about this issue. However, as it is an online environment hosted in the cloud by Microsoft, there is
    no method to get the log files from client side.
    Since this is an issue more relate to Office 365 SharePoint Online, I suggest you open a thread in Office 365 forum, you will get more help and confirmed answers there:
    http://community.office365.com/en-us/forums/default.aspx
    Or you can contact Office 365 Support, it may involve the backend support engineer and provide more professional support on SharePoint Online issue:
    https://support.office.com/en-us/article/Contact-Office-365-for-business-support-32a17ca7-6fa0-4870-8a8d-e25ba4ccfd4b
    Thanks         
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Retrieve item text in SO document

    Hi Experts,
    How can i retrieve text stored at item level in a Sales Order Document.
    Iam able to retreive header text through by table STXH.
    But this tables does not show item level text.
    Pls suggest?
    Thanx in advance.
    Rajiv Ranjan

    Hi,
    You can retrive this using the Fun Module;
    READ_TEXT
    have to pass 4 paramters for this:
    go to the text, double click on it, takes to text editor
    from there GOTO -> header
    will give the OBJECT, ID, OBJECTNAME(mostly the SO doc no and Item No has to be concatenated and to be passed), and lang.
    reward if useful
    regards,
    Anji

  • Reading item text of Sales order

    Can i use the text entered in Sales order-line to identify sales order-line item ?
    ex in Sales line 1 --> text entered is COLUMN 3
       In sales line 2 --> text entered is column 4.
    how will i come to know COLUMN 3 belongs to Sales line 1 ?

    Hi rag,
    sorry for the insufficient explanation.
    I don't know your smartforms detail.
    I think you defined a table node for the item output. In the DATA tab, you will have the LOOP defined for an internal table INTO a header line or ASSIGNING a field-symbol. If the  internal table structure is like VBAP, it has the field UEPOS.
    Then, the filter will be defined for the node where you create the output line. In the node, you have a TAB called conditions. Here you can define the condition as <itabs headerline> = space.
    If you do not get the item data UEPOS value in the smartforms interface, you may change the calling program and the interface or you can create a code node in the loop and get the value from database. The result can be used in the condition.
    Regards,
    Clemens

  • Reading Characteristics of a DMS Document if the one does not exist yet

    Hi,
    Whenever a document is created with classification from transaction CV01N, an entries is being made into the tables of DB for the entered classification of the document. In this case I can get the characteristic values of document classification from within the BAdI method (for example DOCUMENT_MAIN01~BEFORE_SAVE) by selecting from DB table.
    Is there any way for read the document classification from within method DOCUMENT_MAIN01~BEFORE_SAVE before the actual save of document (corresponding entries does not exist in DB table)?

    Nemesis wrote:
    The original table t_data contains data which is normally deleted after 45 days, but it also stores data which is used for demonstration purposes by consultants, and which should not be deleted with the rest.
    Truncating would delete all the data in the table t_data, but the problem is that a subset of the data must be retained in the table. This means that either I adapt the purge code on this table not to delete the required data, or I displace the data that must be saved until the purge is done and then reinsert it into t_data...Choice 1:
    Use partitioned tables. Store the "temporary" data in partitions that can be deleted and the consultants demo data in another partition that doesn't get truncated.
    Choice 2:
    Have two similarly structured tables that store the two types of data so that one table can be truncated as required and the other maintains the data. Use a view on top of the tables to union the data to appear as one "table" for use in the application.
    As already mentioned by others, creating tables at run time is just wrong. It's poor design, it's not scalable and it leads to dynamically generated queries which can inherently have bugs that will not be apparent until run-time and sometimes only under certain conditions, thus leaving your code very liable to break and very difficult to debug.
    Global Temporary tables are what are generally used for temporary storage of data within a transaction or a session if they suit, but it sounds as if you need the data retention across sessions with truncate option available as required on partial data. That is one of the purposes of partitions on tables... or of course go for the two table and view option if you haven't paid for partitioning in your licence.
    Edited by: BluShadow on Dec 22, 2009 8:33 AM
    LOL! Billy posted whilst I was typing. p.s. Glad to see you got your Ace badge Billy. Well deserved.

  • The document "spirit hawk.pages" could not be saved as "spirit hawk grape vine.pages". Read-only file system

    In recent days my Pages 09 has decided not save files and make them 'read only'
    Does anyone have any ideas on why this is so - any help would be appreciated.
    Many thanks,
    Gerry

    Isn't it just after the 10.7.3 update ?
    If it's that, download the free maintenance tool named Onyx
    http://www.titanium.free.fr/download.php
    and run it with these settings :
    I'm accustomed to urge users to apply MAINTENANCE bu Onyx was updated yesterdays so it may be matching more closely the system features.
    Yvan KOENIG (VALLAURIS, France) lundi 13 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

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

Maybe you are looking for