RFC and read table in another destination

HI
I search a complete code to read a table using the function 'RFC_GET_TABLE_ENTRIES '
I can acess to another server using RFC without problem.
I need to read table 'tmsbuftxt ' and data ' TRKORR '.
my program looks like
TABLES:
       tmsbuftxt.
     DATA:
       i_tab512 TYPE tab512 OCCURS 0 WITH HEADER LINE,
       i_tmsbuftxt TYPE table of  tmsbuftxt,
       st_tmsbuftxt type tmsbuftxt.
     PARAMETERS p_dest LIKE rfcdes-rfcdest OBLIGATORY.
     START-OF-SELECTION.
       CLEAR i_tab512. REFRESH i_tab512.
       CALL FUNCTION 'RFC_GET_TABLE_ENTRIES'
         DESTINATION
           p_dest
         EXPORTING
    "     BYPASS_BUFFER           = ' '
     "     FROM_KEY                = ' '
     "     GEN_KEY                 = ' '
     "     MAX_ENTRIES             = 0
           table_name              = 'tmsbuftxt'
     "     TO_KEY                  = ' '
     "   IMPORTING
     "*     NUMBER_OF_ENTRIES       =
         TABLES
           entries                 = i_tab512
         EXCEPTIONS
           OTHERS                  = 1.
       i_tmsbuftxt[] = i_tab512[].
         LOOP AT i_tmsbuftxt INTO st_tmsbuftxt.
             Write : st_tmsbuftxt-TRKORR.
         ENDLOOP.
The problem is I dont know how to use the function correctly , I can choose the RFC I want but  my programm return nothing.
Anyone can corect this?
I just start develop abap since 1 month.
I just want write  st_tmsbuftxt-TRKORR. who is in another environnement using RFC.

Hello Guillaume,
welcome in this forum.
I try RFC_GET_TABLE_ENTRIES, but I think it is better to use RFC_READ_TABLE. Try this to get the numbers of the transports from another system:
"-Begin-----------------------------------------------------------------
  Program Z_TEST.
    Data Fields Type Standard Table Of RFC_DB_FLD.
    Data Field Type RFC_DB_FLD.
    Data Data Type Standard Table Of TAB512.
    Data Line Type TAB512.
    Field-FIELDNAME = 'TRKORR'.
    Append Field To Fields.
    Call Function 'RFC_READ_TABLE' Destination 'NONE'
      Exporting
        QUERY_TABLE = 'TMSBUFTXT'
      Tables
        FIELDS = Fields
        DATA = Data
      Exceptions
        TABLE_NOT_AVAILABLE = 1
        TABLE_WITHOUT_DATA = 2
        OPTION_NOT_VALID = 3
        FIELD_NOT_VALID = 4
        NOT_AUTHORIZED = 5
        DATA_BUFFER_EXCEEDED = 6
        Others = 7.
    If sy-subrc <> 0.
    Else.
      Loop At Data Into Line.
        Write: / Line.
      EndLoop.
    EndIf.
"-End-------------------------------------------------------------------
Let us know your results.
Cheers
Stefan

Similar Messages

  • Performance syntax loop at  and read table

    in the routine , for reading one line in a internal table  , the syntaxe
      loop at  xxx where   and read tabl exxx   with key     XXXX
    has a great difference on performance or not?

    Loop at statement is used only for processing multiple records.Read table is used for reading a particluar record of an internal table.If you just need to check whether record exists in internal table, use can sort and use binary search with TRANSPORTING NO FIELDS addition. Also, try to use field symbols so that performance is increased.

  • Sy-tabix in relation to LOOP AT and READ TABLE

    Hi All,
    As per SAP documentation,
    1) While looping through an internal table (LOOP AT), sy-tabix contains the index number of current row(for standard and sorted tables)
    2)When successfully reading from an internal table(READ TABLE), sy-tabix is set to the index of the result row.
    But what happens when READ TABLE is used while looping through another internal table?
    i.e. Loop at TAB1...
    write sy-tabix.
    READ TABLE TAB2...
    write sy-tabix.
    endloop.
    If we are looping through 1st row of TAB1 and the result of read statement is found in 3rd row of TAB2, I expected that sy-tabix before READ would be 1 and after the READ be 3.
    But, I found that sy-tabix remains unchanged at 1. Can someone expalin why?
    Thanks,
    Jagan

    Hi
    If after reading the table TAB2 the system variable SY-TABIX has still the previous value, that menas the READ TABLE fails or it was read the first record of TAB2.
    After READ TABLE TAB2 try to check the SY-SUBRC:
    LOOP AT TAB1.
       WRITE: / 'TAB1 index:', SY-TABIX.
       READ TABLE TAB2 .........
       IF SY-SUBRC = 0.
         WRITE: 'TAB2 index:', SY-TABIX.
    Try this:
    DATA: BEGIN OF ITAB OCCURS 0,
            FIELD1,
          END   OF ITAB.
    DATA: BEGIN OF ITAB2 OCCURS 0,
            FIELD1,
          END   OF ITAB2.
    DATA: INDEX TYPE I.
    DO 10 TIMES.
      APPEND ITAB.
    ENDDO.
    DO 10 TIMES.
      APPEND ITAB2.
    ENDDO.
    LOOP AT ITAB.
      WRITE: / 'ITAB:', SY-TABIX.
      INDEX = SY-TABIX + 2.
      READ TABLE ITAB2 INDEX INDEX.
      IF SY-SUBRC = 0.
        WRITE:  'ITAB2:', SY-TABIX.
      ENDIF.
    ENDLOOP.
    Max

  • Field symbols and READ TABLE with system code 4

    Hi,
    I have a hashed table and I am using field symbols to point to it to retrieve the field content. I then use it in the READ TABLE statement in the following way:
    Loop at x_data assign <fs>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c1>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c2>.
    READ TABLE ZZZZ assign <fs> with table key a1 = <c1>
                                               a2 = <c2>.
    If sy-subrc = 0.
    endif.
    I ran the debugger and I keep getting a 4. I am not able to get the value from a1 and a2 to see what it is and why it is causing a 4 sy-subrc. I know the value from the hashed table and the values c1 and c2 are the same, so the sy-subrc should be 0.
    How would I read a hashed table using field symbols? I know that usig a standard table, I have to sort the table on the key fields() before I actually can do the READ TABLE using the binary search.
    Please advise. Thanks
    RT

    Hai Rob
    Go  through the following Code
    Field-Symbols are place holders for existing fields.
    A Field-Symbol does not physically reserve space for a field but points to a field, which is not known until run time of the program.
    Field-Symbols are like Pointers in Programming language ‘ C ‘.
    Syntax check is not effective.
    Syntax :
    Data : v1(4) value ‘abcd’.
    Field-symbols <fs>.
    Assign v1 to <fs>.
    Write:/ <fs>.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
    APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
    WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
    WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
    1 1
    2 100
    4 16
    Thanks & regards
    Sreenivasulu P

  • Problem with RFC and empty table

    Hi,
    I have a problem using and RFC function module. The problem is that the RFC returns a table type, but even though the table is emtpy the tag is returned. I have this target structure who has a required subsstructure:
    Input:
    <RFC_function_module>
    <customers>
      <customer1>   
        <table1>  (0..1)
          <item>  (0..Unbounded)
           <salesorder>
      <customer2>   
        <table1>
          <item>
             <salesorder>
        <table2>     
           <item>        
              <accountdoc>
    result:
    <customers>
      <list1> (0..1)
        <table1> (1..Unbounded)
      <list2> (0..1)
        <table2> (1..Unbounded)
    The problem is that if i just do at simpel mapping the mapping returns error because the missing table2 in the result. Then i have tried with an Exists function but it seems like the mapping program searches the hole file for just one occurences. Not record by record.
    Do anyone understand my problem an has a solution?
    /Jakob

    OK - what do you mean by to level of mapping? Mapping to an "internal" structure first and then for the final output?
    The reason i do not whant to change the External defintions is because of changes. If the ones who have designet the external defintions ie.  adds a field or something like that, we should remember to change this kind of thing before updating.
    Jakob

  • How to export and Import table of another user from user system using expdp

    Hi All,
    How to export a table 'scott.emp' from system user.
    expdp system/password directory=expdp dumpfile=scott_emp.dmp ???? ?? tables=emp ??????????????????????????
    thank you
    ---------------------------------------------------------- Posting solution here to make needed users not to scroll down ------------------------------------------------------
    Finally I got it right!!!
    Task :- Export table_1 of schema_a from database db1 and Import it to schema_b of database db2 as user other than schema owner
    Solution :-
    expdp system/pwd directory=expdp tables=schema_a.table_1 dumpfile=schema_a.table_1.dmp logfile=expdp_schema_a.table_1.log
    impdp system/pwd directory=expdp tables=schema_a.table_1 dumpfile=schema_a.table_1.dmp logfile=impdp_schema_a.table_1.log remap_schema=schema_a:schema_b remap_tablespace=table_1_tablespace:schema_b_tablespace
    Thank You All
    Edited by: Ven on Mar 9, 2011 7:52 AM

    Just a example
    SQL> $expdp system/sys directory=data_pump_dir dumpfile=tests.dmp tables=scott.emp
    Export: Release 11.2.0.1.0 - Production on Tue Mar 8 10:39:57 2011
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** directory=data_pump_dir dumpfile=tests.dmp tables=scott.emp
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 64 KB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "SCOTT"."EMP" 8.570 KB 14 rows
    Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
    Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
    C:\APP\MAZAR\ADMIN\ACEME\DPDUMP\TESTS.DMP
    Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at 10:40:01
    SQL>

  • What is the difference between READ TABLE ITAB WITH KEY  and  TABLE KEY

    Hi Experts,
    what is the difference between
    READ TABLE <ITAB> WITH KEY <K1> = <C1>
                                                    <Kn> = <Cn> .
    and 
    READ TABLE <ITAB> WITH TABLE KEY <K1> = <C1>
                                                              <Kn> = <Cn> .
    Thanks
    Akash.

    Hi akashdeep,
    Nice question. I also tried to find out, but no much success. My opinion is that for practical purposes there is no difference.
    It may have difference in case of searching, especially sorted tables. (binary search or normal linear search).
    Case1: If our table is sorted table with defined key fields, and we give WITH TABLE KEY, then faster binary search is used.
    Case2 : If our table is sorted table with defined key fields, and we give WITH  KEY, (and no field contained in the keys), then normal linear search is used.
    regards,
    amit m.

  • Generat two signals at the same time and reading voltage

    Hii
    i have try to generate two signals at the same time and read voltage from another port on the board(not have to be at the same time), i have not alot of expriens in labview
    and i based my code of example(http://zone.ni.com/devzone/cda/epd/p/id/5197) from yours site and try to suit to my needs
    now my problem is when i generat the 2 signals(that work perfect) i canot read voltage from another port on my CB-68LP
    i can not find the problem  and make it over i hope there is away to figer out and fix it.
    i have two cards 6229, and two CB-68LP board.
    labview 8.5.
    my code is look like this - http://img142.imageshack.us/my.php?image=scrennshot2no2.png
    (this works perfect).
    and this is my code after suit to my need - http://img183.imageshack.us/my.php?image=scrennshotfl5.png,there is  error exception at  the right side.
    the exception-
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: RefClk.Src
    Source Device: Dev1
    Source Terminal: 10MHzRefClock
    Required Resources in Use by
    Task Name: _unnamedTask<0>
    Source Device: Dev1
    Source Terminal: None
    Destination Device: Dev1
    Destination Terminal: RefClock
    Task Name: _unnamedTask<1>
    eyal

    sorry...
    The AO tasks is very important they will be synchronize ,it is very importent the two tasks will start at the same time
    and after it run at synchronize mode i will need to make reading of voltage
    i gust try to make simulation of machin (i give that machin AO and reading from it voltage that all)
    first of all i make the two signals(synchronize signals).
    and after it i will need to reading voltage.
    i can make two signals synchronize together.
    i can make reading voltage
    but i can't make two signals synchronize together with reading voltage
    it throw to me this error message.
    i am looking for away to figer this out.
    thank's for any help 
    eyal
    Attachments:
    test11.vi ‏130 KB

  • FBL5N t code and BSEG table is showing wrong contract number

    Hi,
    The proces flow is contract number>sales order>DMR-->Invoice
    Now when I am checking the VBFA table it's showing correct contract number against invoices but FBL5N t code and BSEG table are showing wrong contract numbers.
    Why FBL5N and BSEG table is showing wrong contract number?
    Currently we are using one enhancement and user exit is used to incorporate one customized field as identifier for bill type.
    1. During the billing document release to accounting VFX3, The user exit triggering and it is update the customized fields and Net settlement indicator.
    2. Using the Invoice number, get the fields VGBEL(Document number of the reference document) and VGPOS (Item number of the reference item) from VBRP and read table VBAP with VBELN and POSNR, to get DMR number (Sales Document) that created for the Invoice.
    3. Use fields VGBEL and VGPOS on table VBAP to get the sale order number.
    4. By using the Sales order number, get the Distribution channel to update Net indicator field
    In accounting table BSEG-UZAWE = JF must be updated on the customer line.
    5. Retrieve the sale order number and item level to get customized field from table VBAP
    Any pointers.
    Thanks
    Ashu

    Hi Reazuddin,
    Thanks for your reply,
    I am concercerned about BSEG table and using user exit EXIT_SAPLV60B_008 to post the document in FI.
    Now in we have enhanced this user exit  for contracts and included in this way.
      SELECT SINGLE ZZ_CONTRACT FROM VBAK INTO (LC_CONTRACT) WHERE VBELN EQ cvbrp-vgbel.
    Endloop.
    *Moving the values to final accounting table
    loop at xaccit.
    xaccit-vertn = lc_contract.
    xaccit-VBEL2 = xaccit-AUBEL.
    xaccit-xref3 = lc_vbel2.
    MODIFY xaccit .
    ENDLOOP.
    Clear: lc_contract,lc_vgbel,lc_vgpos,lc_vbel2.
    But I am getting correct data when checked other clients( development and quality), this problem I am getting in production.
    Do I need to ask the ABAP'er to debug this enhancement in production?
    Thanks
    Ashutosh

  • I am having issues suddenly exporting files. It reads error exporting 25 files, As I attempt to choose another destination folder the folders show a black square where the folder sign previously was. I am in my busy season and this has created a huge dela

    I am having issues suddenly exporting files. It reads error exporting 25 files, As I attempt to choose another destination folder the folders show a black square where the folder sign previously was. I am in my busy season and this has created a huge delay!!! HELP!!!!

    oh and if you use a creative cloud version of Lightroom it could also be that the logon to the cloud is messed up. Logging out and logging back in from preferences in the creative cloud app will fix that. Due to the release of Lightroom CC it appears that adobe's servers have been overwhelmed a bit And many people have strange problems that are solved by logging out and back in.

  • Can you read Reports and Tables through RFCs and BAPIS?

    Is there any way to read established reports and tables through RFC or BAPI function calls?  We have a middleware that can execute various BAPIs and RFCs.  I see a few promising ones: RFC_READ_REPORT, but no examples anywhere what the parameters needed are for the inputs. 

    Hello Scott,
    Check below FMs for reading tables and programs.
    Tables : RFC_READ_TABLE
    Program : RFC_READ_DEVELOPMENT_OBJECT
    Please note that for reading program using RFC_READ_DEVELOPMENT_OBJECT , lines in program should not exceed 72 chars else FM will throw dump(READ_REPORT_LINE_TOO_LONG).
    Program code will appear in table QTAB which is 72 chars wide.

  • I need to loop through 1 table and read another until a value changes

    i need to read a table and sum the quantity field until a reason code changes.  how do I go about doing this?

    sort itab by reasoncode.
    Loop at itab.
    quantiy = quanity  + itab-quantity.
    at end of reasoncode.
    jtab-reasoncode = itab-reasoncodee.
    jtab-sum = quantity.
    append jtab.
    clear quantity.
    endat
    endloop.
    or
    sort itab  by reasoncode.
    loop at itab.
    at end of reasoncode.
    sum.
    jtab = itab.
    append jtab.
    endat.
    endloop.
    or
    let us say itab and jtab are two tables and you want to loop through itab and read jtab for reasoncodes.
    if jtab has only one entry for each entry in itab then use read else use loop.
    loop at itab.
    loop at jtab where reasoncode = itab-reasoncode.
    quantiy = quantiy + jtab-quanity.
    endloop.
    endloop.
    or
    loop at itab.
    read table jtab with key reasoncode = itab-reasoncode.
    if sy-subrc eq 0.
    endif
    endloop.

  • RFC-Error while reading table TFMCA003

    Hello,
    we have a running system with campus management an I'm doing the customizing for a separate system SLCM with EHP3. I created a RFC-Connection as in the Base IMG Configuration Settings for Pre-Configured SAP Student Lifecycle Management (ERP 6 - EHP 3) 31 October 2007 page 8+9 described.
    On the old system it works without problems but on EHP3 I get the following error displayed while creating new students: Error - check RFC-Destination RFC_FICA_ACCT_CREATE
    Looking into the rfc trace I read the following entry:
    Trace file opened at 20090407 135656 W. Europe Daylight Time, SAP-REL 700,0,185 RFC-VER nU 3 1025200 MT-SL
    ======> Fehler beim Lesen in der Tabelle TFMCA003
    ABAP Programm: SAPLHRPIQ00STUDENT_ACCOUNT (Transaction: PIQSTC)
    Called function module: HRIQ_STUDENT_ACCTDATA_UPD_INT
    User: RSEIDLER (Client: 100)
    Destination: RFC_FICA_CREATE_100 (handle: 6, 10238413, {306B23DE-EF74-F186-BAA8-0022640496A6})
    Error RFCIO_ERROR_MESSAGE in abrfcio.c : 1833
    So there is an error reading table TFMCA003, but this one is empty, in both systems!
    Although the error message is displayed I can not see any limitation working with the created student. So it seems everything is working normal. But the message is unacceptable in a live system, of course.
    Any ideas?
    Robert

    Hi Nivdedita,
    Check the rule which you have defined in the workflow.
    Regards,
    Sravanthi

  • Reading VBAK, VBAP and VBFA table during a process

    Hi friends,
    I have an execution DUMP in a Z report, so I would be very thankful if you can give me your expert opinion.
    I have a Z report which collects some information into an internal table. After that, I need to go over each record and read VABK, VBAP and VBFA tables and compute some quantities. It is not possible to do this in another way because I need to get some information first.
    Of course, each table is being read in the corresponding sequence (1st VBAK, then VBAP and then VBFA and at the end LIPS table) using the key or part of it. The problem is that if the user wants to execute the report online, it will be finish in a dump at this routine.
    My question is if it is possible to skip the dump getting VBAK and VBAP tables in memory and instead of reading directly, read them from memory. Notice that if I do this I need to put almost the entire table into memory. So, do you think that I will earn time or it will be the same or worse?
    Thanks in advance & kind regards,
    MMP.

    Hi everybody!
    We applied the note but it doesn't help. We realized that we have a problem with records quantity, so the key user is going to analyze which other parameter could be helpful.
    Thank everybody very much!
    Kind regards.

  • Read data from MDM For Lookup and Flat table using MDM ABAP API

    Hi,
    I have requriment to read data from MDM from FLAT and Lookup table using MDM ABAP API. My design  is like this ,
    I have one ITEMS (Main table in MDM) and inside that i have one Lookup flat table ITEM_TYPE , my requriment is to read Item number and its related Item type.
    From ABAP.
    Please help if any body has any idea.
    Regards,
    Shyam

    HI Guys,
    I found my solution by myself. Below is the solution , hope this will help others:-
    Retrieve data from MDM  using MDM ABAP API.
    Step- 1. Create structure in SAP with the same name as that of MDM field code for MDM Main table.
    Step-2. Create another structure in SAP having all  lookup fields of MDM , fieldname in ECC must be same as that of MDM field
    code.
    Step-3.Create structure in SAP for  individual lookup field(Single Field only)   with the same name as MDM Field code.
    Step-4.
    DATA: IT_QUERY            TYPE STANDARD TABLE OF MDM_QUERY,  "MDM_QUERY_TABLE,
          WA_QUERY            TYPE  MDM_QUERY,
          WA_CDT_TEXT         TYPE  MDM_CDT_TEXT,
          IT_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT_TABLE,
          WA_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT,
          WA_STRING           TYPE  STRING.
    DATA:<Internal table> TYPE STANDARD TABLE OF <SAP Str Having all LOOKup Fields>    
    DATA: :<Internal table>TYPE STANDARD TABLE OF <SAP Str one LOOKup field>,
         <Workarea> LIKE LINE OF :<Internal table>.
    *PASS LOGICAL OBJECT NAME.
    V_LOG_OBJECT_NAME = 'Logical object name defined in Customization'.
    Define logon language, country & region for server
    WA_LANGUAGE-LANGUAGE = 'eng'.
    WA_LANGUAGE-COUNTRY = 'US'.
    WA_LANGUAGE-REGION = 'USA'.
    TRY.
        CREATE OBJECT LR_API
          EXPORTING
            IV_LOG_OBJECT_NAME = V_LOG_OBJECT_NAME.
    ENDTRY.
    CONNECT to repository. Apply particular logon language info
    CALL METHOD LR_API->MO_ACCESSOR->CONNECT
      EXPORTING
        IS_REPOSITORY_LANGUAGE = WA_LANGUAGE.
    *NOW PASS ITEM NO AND GET KEY FROM MDM.
    CLEAR WA_QUERY.
    WA_QUERY-PARAMETER_CODE  = <MDM FIELD CODE>. "Field code
    WA_QUERY-OPERATOR        = 'EQ'. "Contains
    WA_QUERY-DIMENSION_TYPE  = 1. "Field search
    WA_QUERY-CONSTRAINT_TYPE = 8. "Text search
    WA_STRING                = <Field Value>.
    GET REFERENCE OF WA_STRING INTO WA_QUERY-VALUE_LOW.
    APPEND WA_QUERY TO IT_QUERY.
    CLEAR WA_QUERY.
    *PASS ITEM NUMBER AND GET RELATED KEY FROM MDM.
    TRY.
        CALL METHOD LR_API->MO_CORE_SERVICE->QUERY
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Main Table>
            IT_QUERY            = IT_QUERY
          IMPORTING
            ET_RESULT_SET       = IT_RESULT_SET_KEY.
      CATCH CX_MDM_COMMUNICATION_FAILURE .
      CATCH CX_MDM_KERNEL .
      CATCH CX_MDM_NOT_SUPPORTED .
      CATCH CX_MDM_USAGE_ERROR .
      CATCH CX_MDM_PROVIDER .
      CATCH CX_MDM_SERVER_RC_CODE .
    ENDTRY.
    Pass record id into keys.
    LOOP AT IT_RESULT_SET_KEY INTO WA_RESULT_SET_KEY.
      WA_KEYS = WA_RESULT_SET_KEY-RECORD_IDS.
    ENDLOOP.
    WA_RESULT_SET_DEFINITION-FIELD_NAME = <Look field name>.
    APPEND WA_RESULT_SET_DEFINITION TO IT_RESULT_SET_DEFINITION.
    CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE
      EXPORTING
        IV_OBJECT_TYPE_CODE      = <MDM Main Table>
        IT_RESULT_SET_DEFINITION = IT_RESULT_SET_DEFINITION
        IT_KEYS                  = WA_KEYS
      IMPORTING
        ET_RESULT_SET            = IT_RESULT_SET.
    LOOP AT IT_RESULT_SET INTO
            WA_RESULT_SET.
    *PASS KEYS INTO MAIN TABLE TO GET Structure for FALT or Look up Table
      TRY.
          CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
            EXPORTING
              IV_OBJECT_TYPE_CODE = <MDM Main Table>
              IT_KEYS             = WA_KEYS
            IMPORTING
              ET_DDIC_STRUCTURE =<SAP Strct having all Look up fileds of MDM>         
      ENDTRY.
      LOOP AT <SAP Strct having all Look up fileds of MDM> INTO <Work area>.
        CLEAR WA_KEYS.
        APPEND <Work area>-field name TO WA_KEYS.
        CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Lookup table name>
            IT_KEYS             = WA_KEYS
          IMPORTING
            ET_DDIC_STRUCTURE   = <Single Structure in SAP For Lookup field>.
        READ TABLE <Single Structure in SAP For Lookup field>. INTO <Work Area> INDEX 1.
    Here you can get the value of realted lookup fields associated with main table data.
      ENDLOOP.
    ENDLOOP.
    LR_API->MO_ACCESSOR->DISCONNECT( ).
    Edited by: Shyam Babu Sah on Nov 24, 2009 4:52 AM

Maybe you are looking for

  • Safari keeps crashing and wont reset or clear history.

    Safari keeps crashing and a Netflix pop up opens everytime I open Safari. The same window and tabs keep reloading every time I open Safari. I have tried clearing the history and resetting Safari, but nothing is working. Below is the error report I am

  • My MacBook Pro does not recognize my iPhone 4 when I connect with USB

    As the subject line says, when I connect my iPhone 4 to my MacBook Pro via the USB cable, it normaaaally opens iTunes and iPhoto automatically and syncs and imports photos from the phone. But, for some reason, that doesn't happen anymore... Now when

  • Adobe Acrobat 9 Pro - Creating PDF from explorer (Right-Click) problem

    Hello, I am new here. I've searched the forums here and maybe I've missed finding the solution.  We recently updated from Acrobat 6 Pro to Acrobat 9 Pro, and I can no longer get a PDF to be created in the same folder the Word, Excel or other file is

  • File Server Permission Woes

    Ok, I have a pretty simple setup. I have a single 200gb drive formatted to ext3 and mounted at /mnt/media: fstab wrote:/dev/sdb1 /mnt/media ext3 defaults,users,acl 0 1 I have the group sticky bit set and all newly created files are automatically owne

  • TS2771 white screen wont restart

    hi my son has 4th gen ipod touch that has a white screen, tried to reboot but wont turn off also it isn recogonised on itunes libuary. thanks cheryl