Runtime Error when generating Backend Adapter

Hi All,
I have a problem when im trying to generate a backend adapter for a data object with two nodes. it is just a simple data object with a root node and a child node having sales order header data & item data.
when im trying to activate i get a runtime error which is listed below.
Runtime Errors         DBIF_RSQL_SQL_ERROR
Except.                CX_SY_OPEN_SQL_DB
What happened?
    An exceptional situation has occurred in the ORACLE software,
    possibly due to an error.
    This is not an error in an application program.
actual source code trigger location: modify seocompodf from table modify_seocompodf.
Please help me with this if possible.
Thanks & Regards,
Malinda

Hi Malinda,
Below link would be usefull:
http://sap.ittoolbox.com/groups/technical-functional/sap-basis/runtime-error-dbif_rsql_sql_error-2649777
Above link mention why problem is coming
Runtime Errors DBIF_RSQL_SQL_ERROR & Exception: CX_SY_OPEN_SQL_DB
According to above link, its problem with database and your Basis team to set up the database according to the note 1005758. It will definitely solve your problem.
Regards,
Abhishek Joshi

Similar Messages

  • Runtime error when trying to open photoshop elements

    I need help getting into my photoshop elements. Purchased several weeks ago. Worked fine, then all of a sudden I'm getting "runtime error" when I try to open. Any thoughts?

    Try re-generating the media database by renaming MediaDatabase.db3
    See this link for further information:
    http://helpx.adobe.com/photoshop-elements/kb/microsoft-c-runtime-error-launcing.html

  • Portal Runtime Error when operating "Portal Content"

    Hi there,
    these days, I installed a NW710 in our team server, and try to configure its UWL to one backend system. Therefore I need to create a new system entry from "System Administration->System Configuration->Portal Content->New->System(from template)".
    After a few test, I found I can't do these operations: "add folder", "open properties", "open permissions", "new system", I got following runtime error when I clicked them:
    If anybody encounter the similar issue? great appreciate your clues!
    <b>Portal Runtime Error</b>
    An exception occurred while processing a request for :
    iView : N/A
    Component Name : N/A
    The object found is not an IView: pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.content_administration/com.sap.portal.content_admin_ws/com.sap.portal.wd_portal_content/com.sap.portal.admin.studio.configuration/actions/new/com.sap.portal.action.newFolder/com.sap.portal.WDfolderWizard.
    Exception id: 02:22_30/05/07_0030_708183150
    See the details for the exception ID in the log file
    <b>Detail Trace:</b>
    Exception ID:01:32_30/05/07_0014_708183150
    [EXCEPTION]
    com.sapportals.portal.prt.runtime.PortalRuntimeException: The object found is not an IView: pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.system_administration/com.sap.portal.system_admin_ws/com.sap.portal.system_configuration/com.sap.portal.admin_studio_system_landscape/com.sap.portal.admin.studio.configuration/actions/new/com.sap.portal.action.newFolder/com.sap.portal.WDfolderWizard
    at com.sap.portal.prt.core.PortalJNDIHelper.getPropertyContentProvider(PortalJNDIHelper.java:101)
    at com.sap.portal.prt.component.PortalComponentContextFactory.createPortalComponentContext(PortalComponentContextFactory.java:159)
    at com.sap.portal.prt.component.PortalComponentContextFactory.getPortalComponentContext(PortalComponentContextFactory.java:82)
    at com.sap.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:513)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:194)
    at com.sap.portal.prt.dispatcher.DispatcherServlet.service(DispatcherServlet.java:122)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:59)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:31)
    at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:145)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.runServlet(FilterChainImpl.java:163)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:82)
    at com.sap.portal.http.EnrichNavRequestFilter.doFilter(EnrichNavRequestFilter.java:49)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:74)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:417)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:280)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:393)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:382)
    at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:85)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:160)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:66)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
    at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:304)
    at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.run(Processor.java:215)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:137)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:229)

    Hi,
       Were u able to do the operations before the UWL configuration? There is possibility that it would have been caused because of improper configurations also.
    Regards,
    Vijai

  • Error when Generating the Program

    Recently there was an SP upgrade and my Planning Book started giving me this error message (SCM version =5.0 and SP = 7)
    "Error when generating the program" Message no. /SAPAPO/TSM141
    Diagnosis: Generated programs are programs that are generated based on individual data objects, such as planning object structure, planning areas and Infocubes. These programs are then executed in the transaction. An error occured during the generation of such a program
    Possible causes:
    1. The template has been corrupted
    2. The object that the template uses to generate the program contains inconsistencies; for instance an Infocube has not been activated
    This error occurs when I try to open the my planning book/creating the selection profile. I've re-activated the Infocube and later deactivate and active my POS and tried to do the same for the Planning Area....but the error still persists. I tried to create a new planning area and tried it again but the error still persists. I've tried to fix any inconsistencies in the planning area time series objects by running the consistency check....however the same error pops up during the consistency check....
    Anyone encountered this error message and any possible solutions to this issue.
    Thanks
    Surender

    I did find an ABAP Dump when looking at ST22.  The short message is as follows:
    Runtime Errors         GEN_BRANCHOFFSET_LIMIT_REACHED
    Date and Time          05/14/2007 19:33:54
    Short text
         Jump distance is too large and cannot be generated.
    What happened?
         A jump distance is too large and cannot be generated.
         A control structure or a routine with "CHECK" or "EXIT" contains
         too many ABAP statements.
         Error in the ABAP Application Program
         The current ABAP program "GP_MET_PSTRU_BASIC_FORMS" had to be terminate
          because it has
         come across a statement that unfortunately cannot be executed.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         During the generation of program "GP_MET_PSTRU_BASIC_FORMS", the system
          determined that
         within an ABAP event a control structure (for example, IF..ENDIF
         or LOOP..ENDLOOP) or a routine (for example, FORM routine) has
         become too large. The resulting jump distance is too large so that
        it could no longer be generated.
        With the internal load format, the jump distance must not be
        greater than 32768 (this is the size of approximately 10.000
        ABAP statements).
        The jump distance that is to be generated, however, is 50885.
    How to correct the error
       The ABAP application program must be changed.

  • ESS Leave Request - Portal Runtime Error when the "Cancel" button is hit

    We have configured the Leave Request application, created a custom workflow, created security roles, and we are now testing in our quality environment. 
    We are encountering a very strange "Portal runtime error" which we cannot resolve - When you come into the Leave Request application, and then, without completing the request, just hit the "Cancel" button, the runtime error is generated.
    We have run a trace of authorizations and everything has come up clean.  Everything is configured, and there are no problems actually creating, approving and posting requests. 
    Any ideas?

    Hi,
    please check whether the user is authorized to cancel the request.
    and take a look at this WS12300111
    Regards
    Manohar

  • RUNTIME ERROR IN GENERATED PROGRAM. Overflow converting ''

    Hi,
    While executing the below code i am getting the error
    " RUNTIME ERROR IN GENERATED PROGRAM. Overflow converting ' ' am new to ABAP , can anyone kindly help me where i have went wrong ? .
    IF ( V_DO_CDS_NAME_MAIN <> '' ).
        ABAP.
            DATA: ref_it_tab TYPE REF TO data,
                  ref_wa TYPE REF TO data.
            FIELD-SYMBOLS: <fs_itab> TYPE ANY TABLE.
            FIELD-SYMBOLS: <fs_wa> TYPE ANY.
            FIELD-SYMBOLS: <fs_field> TYPE ANY.
            CREATE DATA ref_it_tab TYPE STANDARD TABLE OF (V_DO_CDS_NAME_MAIN) WITH NON-UNIQUE DEFAULT KEY.
            ASSIGN ref_it_tab->* TO <fs_itab>.
            SELECT * FROM (V_DO_CDS_NAME_MAIN) INTO TABLE <fs_itab> where C1 = V_WORK_ITEM_ID_MAIN.
            CREATE DATA ref_wa LIKE LINE OF <fs_itab>.
            ASSIGN ref_wa->* TO <fs_wa>.
            loop at <fs_itab> assigning <fs_wa>.
                assign component 'CLIENT' of structure <fs_wa> to <fs_field>.
                V_CLIENT = <fs_field>.
                assign component 'C0' of structure <fs_wa> to <fs_field>.
                V_C0 = <fs_field>.
                assign component 'C1' of structure <fs_wa> to <fs_field>.
                V_C1 = <fs_field>.
                assign component 'C2' of structure <fs_wa> to <fs_field>.
                V_C2 = <fs_field>.
                assign component 'C3' of structure <fs_wa> to <fs_field>.
                V_C3 = <fs_field>.
                assign component 'C4' of structure <fs_wa> to <fs_field>.
                V_C4 = <fs_field>.
                assign component 'C5' of structure <fs_wa> to <fs_field>.
                V_C5 = <fs_field>.
                assign component 'C6' of structure <fs_wa> to <fs_field>.
                V_C6 = <fs_field>.
                assign component 'C7' of structure <fs_wa> to <fs_field>.
                V_C7 = <fs_field>.
                assign component 'C8' of structure <fs_wa> to <fs_field>.
                V_C8 = <fs_field>.
                assign component 'MESSAGE_ID' of structure <fs_wa> to <fs_field>.
                V_MESSAGE_ID = <fs_field>.
                assign component 'TIMESTAMP' of structure <fs_wa> to <fs_field>.
                V_TIMESTAMP = <fs_field>.
                assign component 'EXTRACTKEY' of structure <fs_wa> to <fs_field>.
                V_EXTRACTKEY = <fs_field>.
                assign component 'STATEID' of structure <fs_wa> to <fs_field>.
                V_STATEID = <fs_field>.
                assign component 'DEVICE_ID' of structure <fs_wa> to <fs_field>.
                V_DEVICE_ID = <fs_field>.
            ENDLOOP.
        ENDABAP.
    ENDIF.

    Hi Mubeen,
    While Copying the cotes have come closer otherwise its working fine , i was able to find the error .
    There are ten predefined ABAP data types. There are 100 possible type combinations between these elementary data types. ABAP supports automatic type conversion and length adjustment for all of them except type D (date) and type T (time) fields which cannot be converted into each other.
    I commented the TimeStamp part where i had given the ABAP Type as D and it started working .
    But now i want to display the content of  "TimeStamp"  field but i am not able to do so .
    This is the format in which it has to be displayed 2009.011.915.3353.
    Which ABAPTYPE i need to use ?.
    i am able to display in this format 20090119153353
    regards
    Harsha

  • Runtime Error when starting Lightroom

    I'm currently on day 12 or so of my trial with Lightroom. I've spent quite a few hours getting to know LR by retouching and cataloging over 8 years of photos. So far, aside from a few in-program bugs that I found a way to work around, I've been super-happy with it (especially the powerful keywording/metatagging system: amazing!) and have been really seriously coughing up the huge wad of $$ when the trial's done. But....
    For no reason, LR started giving me a Runtime Error when I tried to start it. Something along the lines of "This application requested Runtime to terminate it unusually."
    So off to Google I went, where I knew I could probably search that error and fix it like I've done with countless other programs. Unfortunately nothing is working.
    Here are the facts:
    --I'm running a fully patched Vista machine.
    --LR worked fine earlier this morning. I had 1.4 and didn't perform any upgrades or maintenance to it (that I know of) when it just gave me the error out of the blue today when I tried to start it.
    --I tried holding CTRL when I start it, and it still gives the error.
    --I tried deleting a .lock file (which did exist) but it still wouldn't start.
    --I tried running the "repair" tool in the install...no good.
    --I uninstalled LR, d/led it again, and re-installed it. IT WORKED!....one time. I was able to run it, checked to make sure my cataloging was still intact (it was - phew!) and even deleted a folder I didn't want in it. Then I closed it. I tried re-opening it a few hours later and I got the SAME ERROR!
    I sure hope someone can help because I'm at my wit's end.

    This is disgusting. I've pounded away for over 4 hours and I finally found a workaround. Here's the original post that had my answer:
    http://www.adobeforums.com/webx/.3c05ac2f
    The short of the story: if I put lightroom.exe into Windows XP compatibility mode" it will work. (To do that, for anyone else who comes across this, you just right-click your lightroom icon, click PROPERTIES, and go to the Compatibility tab and check the box next to "Run this program in compatibility mode for:" and select "Windows XP (Service Pack 2)")
    I've loaded it up half a dozen times and it's still working perfectly as far as I can tell. Hopefully it won't hurt anything keeping it in that mode.
    I'm glad this happened early enough into my trial that I'll have ample opportunity to see if it repeats itself. I'm not keen on sinking $300 into software that will give me ulcers as I troubleshoot problems like this.

  • Error when generating the report in Production Server

    Hi,
    I have created one infoset query in Development server of my client. It is working fine there. I had transported the request containg this query to Production server. But whenever I am trying to generate report using this query in Production server it is giving an error message
    "Error when generating the report".
    I am not getting what 's problem.
    Samriddhi

    Samriddhi,
    Genarally its not suggested to transport Queries. Should be able to create Queries directly Production. There might be diferences between your Development and Production versions.
    Thanks.

  • Error When generating  dataprovider

    HI ,
    i get an error message while executing a query in rsrt.
    "Error When generating  dataprovider
    Notification Number BRAIN 282 "
    require help in this regard,
    Rakesh.

    By best approach in that case is trial and error.
    Copy that query to a new one and change it step by step (creating it simpler, by removing key figures and characteristics) executing it in each step until you don't find the error. There you can see what is causing that error.
    Diogo.

  • Portal runtime error when trying to create new Iviews in EP

    Hi
    Require an Urgent help
    getting portal runtime error when trying to create a new iView in portal. I am unable to create a single iView  in portal.
    It was working before please see this error message
      Portal Runtime Error
    An exception occurred while processing a request for :
    iView : com.sap.portal.appintegrator.sap.WebDynproPageBuilder
    Component Name : com.sap.portal.appintegrator.sap.WebDynproPageBuilder
    Error occurs during the rendering of jsp component.
    Exception id: 05:20_12/01/08_0004_17115850
    See the details for the exception ID in the log file
    AM Iworking on NW2004s sp11. I was able to create iViews on this system before
    let me know where to check the log file also. Points will be awarded
    Thank you
    Krishna Kanth
    Edited by: siddi siddi on Jan 13, 2008 12:05 AM

    Krishna Kanth,
    logs can be read from nwa, if you hv the relevant access or get portal admin to pass the defaulttrace file to you. Login to nwa, navigate to Monitoring-Logs and traces and select (either default trace or last 24hrs) to view the logs. hope this helps
    prachi

  • Runtime Error when creating a new group

    I'm getting a runtime error when creating a new group on a site collection? 
    Thanks in advance

    The most possible reason is if your site collection is reached the maximum site quota limit,then there is chance to get the run time error while creating a new group.
    In this case,you will get the error while creating/updating the group or while adding the new user/uploading any content.
    Also Ensure the group name is not having any special/unsupported characters.
    Feel free to share the error screenshot/entry in the ULS logs.
    Please remember to click 'Mark as Answer' on the answer if it helps you
    Best Regards,
    Pavan Kumar Sapara
    s p kumar

  • Runtime error when adding a role to a webpage in WPC

    Dear Portal KMC WPC experts,
    After upgrading to KMC WEB PAGE COMPOSER 7.01 SP005  in the SAP Netweaver Portal we encountered a runtime error when we add a role to a webpage or website in Web Page Composer. This was not the case before the upgrade.
    This is the error we get:
    Runtime Error
    An exception occured while processing the request.
    Additional information: null
    Exception ID = 8049882b-36e3-2c10-56bd-ef82084cf508
    How can we correct this?
    Thanks in advance,
    Peter

    Kenny K wrote:
    Ok, I figured out my issue.
    It seems that you have to graph the data, before you can change any graph attributes, even though I have done that before.
    Once I put the axis, title, etc after the graphing, then it worked.  Well, I also had specified my range wrong, so that errored out too.
    Thank you for the help.
    Also, how to you get a reference to the Chart Wizard through the excel activex?
    I posted a snippet. You can take it from there. I do not remember how I got it before. I have not had to change it in six to seven years. I remember going through the MSDN and found the function. I think I made it from scratch to match the MSDN..
    Tim
    Johnson Controls
    Holland Michigan

  • Error when generating the report (see long text), Message no. AQ_AD_HOC221

    Hi All,
    I am facing a peculiar problem while executing an infoset query.I have created 2 customized fields Compa-ratio and PIR in infotype 0008 in an infoset.I have coded in these additional fields.
    When I execute a query using 1 of these customized fields the report is generated correctly.But when I put both the fields in the output the report shows an error "Error when generating the report (see long text)". The message# associated with this errAQ_AD_HOC221.
    I have also checked the data types and the references. Nothing seems to be wrong here.
    Does anybody has any clue about this ?
    Kajal

    Hi Bernd,
    I had a look at those notes. But the information provided did'nt prove to be helpful. I found out the problem. I was using the same local variable for both the fields in their code. This generated the error. This error is a very generic one and does'nt help in finding out what exactly is the problem.
    I changed the other local variable and it started working. When I was using the same variable that time I did'nt forget to clear the values but the query still generated the error.
    Anyways thanks a lot for the reply.
    Kajal

  • Runtime error when executing ME2B/ME3B if condition recs 160

    Dear all,
    I have created a vendor rebate agreement and entered condition records for a vendor/material combination.
    Since for this vendor there are 170 materials for which he provides rebate I have created 170 condition records.
    When I am trying to change or display the rebate agreement by executing transaction codes ME2B and ME3B respectively the following run time error occurs (Runtime error when executing transaction codes ME2B/ME3B for condition recrds >160):
    Runtime Errors: DBIF_RSQL_INVALID_RSQL
    Except. CX_SY_OPEN_SQL_DB
    The error is in function module SELECT_TEXT at line 120 "select * from stxh client specified into table stxh_buffer".
    When I debug or test/execute the function module SELECT_TEXT, I find that there are no relevant entries in table STXH for the vendor rebate agreements.
    Please note that if the condition records of the rebate agreement are 160 and less then there is no problem.
    I would appreciate if I could have your expert oppinion on what is causing this runtime error and if it is possible on how to resolve it.
    Thanks in advance.
    Regards,
    Mimis
    Edited by: Mimis1973 on Jan 26, 2011 11:18 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:20 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:23 AM

    There's something similar in OSS note 1002788. Is it relevant to your system?

  • Runtime Error when Posting Invoice with text added (MIRO)

    Hi Gurus,
    We are getting a shortdump (runtime error) when we post certain invoices in MIRO. This happens when we input some text in the text field or add some text to the NOTE tab.
    We are having exception ERROR_DP raised in the program c_textedit_control.
    If the text field is blank and nothing is writing in the NOTE tab, the invoice gets posted with no problem.
    Has anyone come accross this issue before and how did you solve it please.
    Thanks.

    are u processing thru BADI, then it is very easy there are interfaces and methods for handling texts. u sud not get any error and plz never write commit work in BADI.
    May be i cud provide more help if u share more details but let me tell more but let me share one recent development that i did.
    In ME59n when we do PR TO PO then texdts sud be copied to header text in PO and get reflected in PO. the coding is like below may be can give some clues wid ur MIRO stuff.
    METHOD if_ex_me_process_po_cust~process_header.
    *  Author        : Prasenjit Bist                                          *
    *  ID            : PRBIST                                                  *
    *  Date          : 04.08.2011                                              *
    *  Changes       : New Devlopment                                          *
    *  Change Request:                                                         *
    *  Description: To copy LSP information in PO                               *
    TYPES:
            BEGIN OF ty_text,
              auto_pr_po TYPE zman_auto_pr_po,
              plant TYPE zman_plant,
              vendor TYPE zman_vendor,
              lsp_vendor TYPE zman_lsp_name,
              contract_no_text TYPE zman_contract_no_text,
            END OF ty_text.
      TYPES:
           BEGIN OF ty_address,
             ort01      TYPE ort01_gp,  " city
             ort02      TYPE ort02_gp,  " district
             pfach      TYPE pfach,     " PO Box
             pstlz      TYPE pstlz,     " Postal code
             region     TYPE regio,     "Region (State, Province, County)
             telf1      TYPE telf1,     "1st telephone number
             telf2      TYPE telf2,     "2nd telephone number
             telfx      TYPE telfx,     "Fax number
             land1      TYPE land1,
           END OF ty_address.
      DATA:
       get the header level details
            ls_mepoheader TYPE mepoheader,
            lt_purchase_order_items TYPE purchase_order_items,
            ls_purchase_order_items LIKE LINE OF lt_purchase_order_items,
       get the line item details
            lt_mepoitem TYPE STANDARD TABLE OF mepoitem,
            ls_mepoitem TYPE mepoitem,
            lt_textlines TYPE mmpur_t_textlines,
            ls_textlines LIKE LINE OF lt_textlines,
    TEXT TYPES
            lt_texttypes TYPE mmpur_t_texttypes,
            ls_texttypes LIKE LINE OF lt_texttypes.
      DATA: l_name TYPE thead-tdname,
            ls_header TYPE thead,
            lt_lines TYPE STANDARD TABLE OF tline,
            ls_lines TYPE tline,
            l_tdobject TYPE thead-tdobject,
            l_metafield TYPE mmpur_metafield.
      DATA: ls_text TYPE ty_text,
            l_text(50).
      DATA: l_continue(1).
      DATA: l_pass_vendor TYPE lifnr,
            l_pass_plant TYPE werks,
            l_name1(35).
    fetch the address
      DATA: ls_address TYPE ty_address,
            l_landx    TYPE landx.
      CONSTANTS: lc_id TYPE thead-tdid     VALUE 'F01',
                 lc_langu TYPE thead-tdspras  VALUE 'E',
                 lc_object TYPE thead-tdobject VALUE 'EKKO'.
      CONSTANTS: lc_set(1) VALUE 'X',
                 lc_vendor(11) VALUE 'Vendor:    ',
                 lc_lsp_vendor(11) VALUE 'LSP Vendor:',
                 lc_contract_no_text(14) VALUE 'Contract Text:'.
      CLEAR: l_continue.
      IF sy-uname EQ 'PRBIST'.
    Read the header data
        ls_mepoheader = im_header->get_data( ).
    read teh item level data.
       break prbist.
        lt_purchase_order_items = im_header->get_items( ).
        LOOP AT lt_purchase_order_items INTO ls_purchase_order_items.
    The item attribute of the structure is reference to line item
          ls_mepoitem = ls_purchase_order_items-item->get_data( ).
          APPEND ls_mepoitem TO lt_mepoitem.
        ENDLOOP.
    CHECK VENDOR IS THE ONE WE WANT.
        SELECT SINGLE name1 FROM lfa1 INTO l_name1 WHERE lifnr = ls_mepoheader-lifnr.
    First read the vebdor name based on LIFNR.
        TRANSLATE l_name1 TO UPPER CASE.
        IF ( l_name1 EQ 'LSP1' ) OR ( l_name1 EQ 'LSP2' ).
          LOOP AT lt_mepoitem INTO ls_mepoitem.
            TRANSLATE ls_mepoitem-werks TO UPPER CASE.
            IF ls_mepoitem-werks EQ 'FI01'.
              l_continue = lc_set.
              l_pass_vendor = ls_mepoheader-lifnr.
              l_pass_plant = ls_mepoitem-werks.
              EXIT.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF l_continue EQ lc_set AND sy-tcode EQ 'ME21N'.
    Call the POP UP screen to display LPS information.
          CALL FUNCTION 'ZMAN_LSP_POP_UP'
            EXPORTING
              im_vendor = l_pass_vendor
              im_plant  = l_pass_plant
            IMPORTING
              ex_text   = l_text.
    GET Text Object (TTXOB)
          im_header->if_longtexts_mm~get_textobject(
                        IMPORTING ex_tdobject = l_tdobject
                                  ex_metafield = l_metafield ).
    GET TEXT IDS
          im_header->if_longtexts_mm~get_types(
                        IMPORTING ex_texttypes = lt_texttypes ).
    CHECK TEXT TYPE 'F01' EXISTS.
          READ TABLE lt_texttypes INTO ls_texttypes WITH  KEY tdid = lc_id.
          IF sy-subrc EQ 0.
    UPDATING ITEM TEXT.
            MOVE: l_tdobject TO ls_textlines-tdobject,
                  ls_texttypes-tdid TO ls_textlines-tdid,
                  '*' TO ls_textlines-tdformat.
         break prbist.
            ls_text = l_text.
         CONCATENATE l_text ls_texttypes-tdtext INTO ls_textlines-tdline.
           CONCATENATE ls_text-vendor
                       ls_text-plant
                       ls_text-lsp_vendor
                       ls_text-contract_no_text
                                               INTO ls_textlines-tdline SEPARATED BY space.
           APPEND ls_textlines TO lt_textlines.
          INSERT VENDOR
           CLEAR ls_textlines-tdline.
           CONCATENATE lc_vendor ls_text-vendor INTO ls_textlines-tdline SEPARATED BY space.
           APPEND ls_textlines TO lt_textlines.
          INSERT LSP VENDOR
            CLEAR ls_textlines-tdline.
            CONCATENATE lc_lsp_vendor ls_text-lsp_vendor INTO ls_textlines-tdline SEPARATED BY space.
            APPEND ls_textlines TO lt_textlines.
          INSERT CONTRACT TEXT.
            CLEAR ls_textlines-tdline.
            CONCATENATE lc_contract_no_text ls_text-contract_no_text INTO ls_textlines-tdline SEPARATED BY space.
            APPEND ls_textlines TO lt_textlines.
         INSERT A BLANK LINE.
            CLEAR ls_textlines-tdline.
            APPEND ls_textlines TO lt_textlines.
    INSERT addreSS CAPTION.
            CLEAR ls_textlines-tdline.
            MOVE 'Address:' TO ls_textlines-tdline.
            APPEND ls_textlines TO lt_textlines.
            break prbist.
    READ THE ADDRESS
            SELECT SINGLE   ort01      " city
                            ort02      " district
                            pfach      " PO Box
                            pstlz      " Postal code
                            regio      "Region (State, Province, County)
                            telf1      "1st telephone number
                            telf2      "2nd telephone number
                            telfx      "Fax number
                            land1      "COUNTRY
            FROM lfa1 INTO ls_address WHERE lifnr = ls_mepoheader-lifnr.
    GET COUNTRY
            SELECT SINGLE landx FROM t005t INTO l_landx WHERE spras = 'E' AND land1 = ls_address-land1.
    INSERT ADDRESS DETAILS.
            CLEAR ls_textlines-tdline.
            CONCATENATE ls_address-ort01 ls_address-ort01 INTO ls_textlines-tdline SEPARATED BY space.
            APPEND ls_textlines TO lt_textlines.
    INSERT COUNTRY.
            CLEAR ls_textlines-tdline.
            MOVE l_landx TO ls_textlines-tdline.
            APPEND ls_textlines TO lt_textlines.
    TELEPHONE DETAILS
            CLEAR ls_textlines-tdline.
            CONCATENATE 'Tel:' ls_address-telf1 '/' ls_address-telf2 INTO ls_textlines-tdline.
            APPEND ls_textlines TO lt_textlines.
    FAX DETAILS.
            CLEAR ls_textlines-tdline.
            CONCATENATE 'Fax:' ls_address-telfx INTO ls_textlines-tdline.
            APPEND ls_textlines TO lt_textlines.
          SAVE THE HEADER LONG TEXT.
            im_header->if_longtexts_mm~set_text(
                          EXPORTING im_tdid = ls_texttypes-tdid
                                    im_textlines = lt_textlines ).
          ENDIF.
        ELSEIF l_continue EQ lc_set AND sy-tcode EQ 'ME59N'.
    No need to display POPUP simply read the values and show.
    if not
        ENDIF. "(l_continue = 'X' and transaction code is ME21N or ME59N)
        CLEAR l_continue.
      ENDIF. "(sy-uname)
    ENDMETHOD.
    Edited by: Prasenjit Singh Bist on Aug 14, 2011 10:15 AM
    Edited by: Prasenjit Singh Bist on Aug 14, 2011 10:21 AM

Maybe you are looking for