Code to get friend list using PHP

Hi all ,
I need to know how to bring the friendlist of a particullar user from it's email-id as user id in an application.
Thanks and regards,
Deekay.

Hi all ,
I need to know how to bring the friendlist of a particullar user from it's email-id as user id in an application.
Thanks and regards,
Deekay.

Similar Messages

  • Get field position using PHP or JavaSript

    Hello guys! How can I get current position of some fields in Pdf form. For example, I have Pdf form with signature field. I need to get current page number and x, y position of this field. Can you give me some code example on PHP or JavaScript.
    Thanks.

    There's a big difference between doing it with JS and with PHP... Doing it with JS inside a PDF is very easy. The code will look something like this:
    var f = this.getField("FieldName");
    app.alert("Field page: " + f.page):
    app.alert("Field location: " + f.rect);
    Here I'm just outputting it to an alert window... You can do something else with it, of course.

  • Styling last link in list using php

    I'm using a "border right" to separate my horizontal navigation links but I would like to eliminate the border from the last link. I know how to do this in HTML but I'm trying to figure out if there's a php code I can use. Is it possible?

    Hi Stiankd,
    As croute1 suggested, check if the account used to create the item is a system account or not.
    It is by design that system account cannot start workflow automatically in SharePoint.
    If it's not the case, please check ULS logs to see if anything unexpected occurred.
    For SharePoint 2010, by default, ULS log is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS.
    Thanks,
    Victoria
    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]

  • Getting approvers List using request ID

    Hi All,
    Is there any API in OIM 11g to get the approvers list based on request ID. I have a requirement to get the request current status based on requestID and if the request is pending at one level, I need to get the corresponding approver information also by using 11g API's.
    Thanks,
    Rajesh

    The approver details are in SOA and not in OIM anymore. You need to use worklist API to get that information.
    Worklist App
    -Bikash

  • ERROR while getting BAPI list using JCo Action

    Hi,
    We are using MII 14. I have created JCo connection and also configured connection alias.
    I am using this two in JCo interface action just to test whether the connection is working fine.
    But I am getting "No RFC authorization for function module RFC_GET_FUNCTION_INTERFACE" when i search for BAPI_*.
    Can you please guide on , what priviliges user which we will use to connect ERP from MII , should have ?
    Thanks

    I do not know the specific Role or Permission required.  It might be in the help documentation,b ut the security folks should be able to figure it out from the error message.  Someone else may know the exact Role or Roles needed.
    The ID you are using does not have external access to the RFC pool, but you should also provide which RFCs you are planning to use as some have additional permissions required.
    Regards, Mike
    SAP Customer Experience Group - CEG

  • Getting a list of windows processes

    Hi, in my java application I need to get a list of processes that Windows XP is running. I am currently using this code to get the list:
    p = Runtime.getRuntime().exec("tasklist");
    BufferedReader procInput = new BufferedReader(InputStreamReader(p.getInputStream()));The problem is that the tasklist command only seems to work in Windows XP professional edition, and not in the 'Home' or 'Media Center' editions. While most people are running pro, in the interest of compatibility I would like it to work with all versions of windows. I've rooted around in the API, but I can't find another way to get a list of running processes. Any ideas? Thank you

    Hello,
    Maybe Michal Gajda's
    Windows Update PowerShell Module can do this. I have not installed it, but now that I have found it, I plan to. Read more about it on the Hey, Scripting Guy! Blog:
    http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/08/use-a-powershell-module-to-run-windows-update.aspx
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})
    hi Karl
    Great, that's exactly what i needed.
    really thanks
    regards

  • Getting raise_application_error code using  php

    I have a trigger that catches an action and returns a raise_application_error. I am having a hard time finding out how to retrieve the error code (I defined it) using php code.
    here is an example of the php/oracle error message that I get:
    Warning: OCIStmtExecute: ORA-21000: error number
    argument to raise_application_error of -2006 is
    out of range ORA-06512
    I can retrieve the oracle predefined error code (21000) using
    $oci_error = OCIError($statement);
    $oci_error["code"];
    but do not know how to get the (-2006) except maybe parseing the $oci_error["message'].

    nevermind, figured it out. my raise_application_error was out of range (like the error message said O=) )
    changing it to -20006 (instead of -2006) works.
    karn

  • Email flex list contents using php

    I have dragged 5 items from a datagrid to a drop-enabled list component. Now I want the user to be able to email himself the list. I am using PHP and have an HTTP service request and PHP mailer code but I do not know how to get the data that is in the list into variables that I can use with my php code.
    <mx:HBox>
    <mx:VBox>
         <mx:DataGrid dataProvider="{restaurantsAC}" dragEnabled="true" height="300" width="600" id="restaurantsDG">
              <mx:columns>
              <mx:DataGridColumn dataField="restaurantName" />
              <mx:DataGridColumn dataField="restaurantAddress" />
              <mx:DataGridColumn dataField="restaurantCuisine" />
              <mx:DataGridColumn dataField="restaurantPrice" />
              </mx:columns>
            mx:DataGrid>
         <mx:LinkButton label="Show my Favorites List" click="showFavoritesList()"/>
    </mx:VBox>
    <mx:Canvas id="favoritesListContainer" height="100%" includeInLayout="false" visible="false">
    <mx:SWFLoader source="assets/myFavorites.swf" x="10" y="10"/>
    <mx:List id="favoritesList" x="10" y="40" dropEnabled="true"  labelField="restaurantName" />
    </mx:Canvas>
    </mx:HBox>
    <mx:Button click="sendFavorites()" />    
    public function sendFavorites():void {
                    var h:HTTPService=new HTTPService();
                    h.url="http://wmywebsite.com/mail.php";
                    h.request=??????????????;
                    h.method="POST";
                    h.send();
    Thanks for any assistance!

    you fetch your datagrid items from PHP itself right????
    then, while sending mail in php, generate same set of data and mail it.. dont bother about the datagrid items.
    if you use filter/sorting in FLEX, then you can apply similar rules in php too before sending the email.
    or, if you manipulate the collection in front end ( by drag/drop ), then just concatenate the ids of items, and send to php, in php you can use EXPLODE to get individual items to mail.

  • Trying to use Web LCID property to get the List name in client object Model

    Hi ,
    I am trying to change the "Personal Documents" list NoCrawl property under MySite using SharePoint Client Object Model. As we use  web.Lists.GetByTitle("Personal
    Documents"); method to get the list,but here problem is :for different language List name is in their language.So I tried to use LCID property of the WEB and
    have taken key-value pair (PersonalSiteOnet_List_PersonalDocuments) from the resource file for that language from 14 hive.
    Example:I have selected Spanish language .there are so many LCID for Spanish language but Microsoft has given only one language pack for Spanish.
    Then,My Question is that
    "All LCID for Spanish language are using same Spanish language pack dictionary file OR something else"
     

    Hi,
    According to your post, my understanding is that your requirement is getting list in different language.
    Here are two ways for your reference:
    1. We can use getById method instead, so that we can avoid the language issue.
    2. We can use an array to store the different list name in different language in you JavaScript code, then use the code snippet below to get the list:
    var userLcid =_spPageContextInfo.currentLanguage;
    var localizedStrings = {
    ListName: {
    _1033: "EnglishName",
    _3082: "SpanishName"
    var listName=localizedStrings.ListName["_" + userLcid];
    var list=web.Lists.getByTitle(listName);
    More information:
    http://msdn.microsoft.com/en-us/library/hh670609.aspx
    http://wellytonian.com/2012/11/language-packs-sharepoint-2010/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Can I get a List of all the running processes in the system using java ?

    I want a complete list of all the Running processes currently in the system.
    List of running processes is like, in MS Window environment while we presses ctrl + alt + del and we get a small window containing a list of all the running processes currently in system.
    I hope somebody have done the same and will help me.
    thanx.

    Here is the sample code to get All running process in your system .
    Its in C++.And you have use JNI to use this code.
    For complete project goto
    http://www.mindcracker.com/mindcracker/c_cafe/winapi/protracker.asp
    typedef BOOL (WINAPI * PFNENUMPROCESSES)(
    DWORD * lpidProcess,
    DWORD cb,
    DWORD * cbNeeded
    typedef BOOL (WINAPI * PFNENUMPROCESSMODULES)(
    HANDLE hProcess,
    HMODULE *lphModule,
    DWORD cb,
    LPDWORD lpcbNeeded
    typedef DWORD (WINAPI * PFNGETMODULEFILENAMEEXA)(
    HANDLE hProcess,
    HMODULE hModule,
    LPSTR lpFilename,
    DWORD nSize
    //unsigned int i;
    static HMODULE hModPSAPI = 0;
    static PFNENUMPROCESSES EnumProcesses = 0;
    static PFNENUMPROCESSMODULES EnumProcessModules = 0;
    static PFNGETMODULEFILENAMEEXA GetModuleFileNameExA = 0;
    if ( !hModPSAPI )
    hModPSAPI = LoadLibrary( "PSAPI.DLL" );
    if ( !hModPSAPI )
    return FALSE ;
    EnumProcesses = (PFNENUMPROCESSES)
    GetProcAddress( hModPSAPI,"EnumProcesses" );
    EnumProcessModules = (PFNENUMPROCESSMODULES)
    GetProcAddress( hModPSAPI, "EnumProcessModules" );
    GetModuleFileNameExA = (PFNGETMODULEFILENAMEEXA)
    GetProcAddress( hModPSAPI, "GetModuleFileNameExA" );
    if ( !EnumProcesses
    || !EnumProcessModules
    || !GetModuleFileNameExA )
    return FALSE;
    LV_ITEM lvi;
    CString str, str1;
    if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
    return FALSE;
    cProcesses = cbNeeded / sizeof(DWORD);
    char szProcessName[MAX_PATH] = "unknown";
    for ( int i = 0; i < cProcesses; i++ )
    HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
    PROCESS_VM_READ, FALSE, aProcesses);
    if ( hProcess )
    HMODULE hMod;
    DWORD cbNeeded;
    if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) )
    GetModuleFileNameExA( hProcess, hMod, szProcessName,
    sizeof(szProcessName) );
    str = szProcessName ;
    str1.Format(": %d ", hProcess );
    str += str1 ;
    m_list.AddString ( str );
    UpdateData(TRUE );
    CloseHandle( hProcess );

  • ALV issue: when save list using Local File command will get run time error!

    help!!!!
    report list using ALV method when to save this list using Local File.
    i will get GETWA_NOT_ASSIGNED run time error information.
    how resolve it?
    source code :
    REPORT   ZIFT0103.
    TABLES :  MARA,MARC,CDHDR,CDPOS,MAKT.
    ******DEVK909212****************
    ****&#21033;&#29992;&#24037;&#21378;&#26469;&#21306;&#20998;&#19981;&#21516;&#30340;SERVER&#30340;FTP ADDRESS ,user ,PASSWORD
    DATA: FTP_WERKS LIKE MARC-WERKS.
    ********&#23450;&#20041;&#19968;&#20010;RANGE&#29992;&#26469;&#25235;&#21462;MARC&#30340;&#20449;&#24687;
    RANGES:R_MATNR FOR MARA-MATNR OCCURS 0.
    ********&#23450;&#20041;&#19968;&#20010;INTERNAL TABLE &#26469;&#25235;&#21462;MARC &#30340;&#20449;&#24687;
    DATA:BEGIN OF IT_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         FLAG_UI TYPE C,
         END OF IT_MARC.
    *******&#23450;&#20041;&#23384;&#25918;&#21271;&#20140;&#30340;&#25968;&#25454;&#30340;&#21464;&#37327;
    DATA : BEGIN OF FTP_BEIJING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_BEIJING .
    ******&#23450;&#20041;&#31119;&#28165;&#30340;&#25968;&#25454;&#21464;&#37327;
    DATA : BEGIN OF FTP_FUQING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_FUQING .
    *******DEVK909212*****************
    DATA : BEGIN OF FTP_ITEMDOC1 OCCURS 0 ,
                  MATNR(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC1 .
    DATA : BEGIN OF FTP_ITEMDOC OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC .
    DATA: WA_ZMSGTA TYPE ZMSGTA ,
          l_ersda  like MARA-ERSDA .
    ***********DEVK909553********************
    ****&#29992;&#26469;&#20915;&#23450;&#25191;&#34892;FTP&#36824;&#26159;&#26174;&#31034;LIST**********
    DATA:g_tcode_flag.
    ***********DEVK909553********************
    Error message process ******************************
    DEFINE EXPLAIN_MSG.
       break soe_richard.
      CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
        EXPORTING
          ID                = &1   "SY-MSGID
          NUMBER            = &2   "SY-MSGNO
          LANGUAGE          = SY-LANGU
          TEXTFORMAT        = &3
          LINKPATTERN       =
          MESSAGE_V1        = &4                                "SY-MSGV1
          MESSAGE_V2        = &5                                "SY-MSGV2
          MESSAGE_V3        = &6                                "SY-MSGV3
          MESSAGE_V4        = &7                                "SY-MSGV4
        IMPORTING
          MESSAGE           = &8   "WA_ZMSGTA-MSE1
          RETURN            =
        TABLES
          TEXT              =
    END-OF-DEFINITION.
    DEFINE ERROR_MSG_UPDATA.
      CALL FUNCTION 'ZINSERT_MSG'  "IN UPDATE TASK
        EXPORTING
          XZMSGTA      = &1    "WA_ZMSGTA
        EXCEPTIONS
          UPDATE_ERROR = 1
          OTHERS       = 2.
    END-OF-DEFINITION.
    IF SY-TCODE = 'ZIFT103' .
      g_tcode_flag = 'L'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          PERCENTAGE = 0
          TEXT       = '&#35831;&#32784;&#24515;&#31561;&#20505;,&#31995;&#32479;&#27491;&#22312;&#25235;&#25968;&#25454;'.
    ENDIF.
    l_ersda = sy-datum - 1 .  "&#21462;&#21069;&#19968;&#22825;&#20135;&#29983;&#30340;&#29289;&#26009;&#21495;&#30721;&#12290;
    DATA:BEGIN OF it_change OCCURS 0,
         OBJECTID TYPE CDHDR-OBJECTID,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         TABKEY   TYPE CDPOS-TABKEY,
         END OF it_change.
    DATA:BEGIN OF it_cDhdr OCCURS 0,
         OBJECTID type CDHDR-OBJECTID,
         CHANGENR TYPE CDHDR-CHANGENR,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         END OF it_cdhdr.
    DATA:search_len TYPE I.
    DATA:BEGIN of it_insert OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         END OF it_insert.
    DATA:BEGIN OF it_MAKT OCCURS 0,
         MATNR TYPE MAKT-MATNR,
         MAKTX TYPE MAKT-MAKTX,
         END OF it_makt.
    DATA IT_MARA TYPE TABLE OF MARA WITH HEADER LINE.
    DATA:BEGIN OF IT_OUT OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         MTART TYPE MARA-MTART,
         MEINS TYPE MARA-MEINS,
         MATKL TYPE MARA-MATKL,
         MAKTX TYPE MAKT-MAKTX,
         PSTAT TYPE MARA-PSTAT,
         BRGEW TYPE MARA-BRGEW,
         NTGEW TYPE MARA-NTGEW,
         GEWEI TYPE MARA-GEWEI,
         FERTH TYPE MARA-FERTH,
         KZUMW TYPE MARA-KZUMW,
         ERNAM TYPE MARA-ERNAM,
         ERSDA TYPE MARA-ERSDA,
         END OF IT_OUT.
    *-- DECLARE DATA FOR ALV
    TYPE-POOLS: slis.
    DATA  : g_variant LIKE disvariant,
            g_save(1) TYPE c,
            g_exit(1) TYPE c,
            gx_variant LIKE disvariant.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE, "
          gt_events   TYPE slis_t_event,
          gt_list_top_of_page TYPE slis_t_listheader,
          gs_print TYPE slis_print_alv,
          gs_layout         TYPE slis_layout_alv .
    ******&#21482;&#33021;&#25235;&#20986;&#31995;&#32479;&#26377;&#20570;&#26356;&#25913;&#30340;&#25968;&#25454;***************
    ******&#32780;&#31532;&#19968;&#27425;INSERT MARA&#30340;&#25968;&#25454;&#25235;&#19981;&#20986;&#26469;********
    START-OF-SELECTION.
    SELECT AOBJECTID AUSERNAME AUDATE BTABKEY
    INTO TABLE it_change
    FROM ( CDPOS AS B INNER JOIN CDHDR AS A ON
         AOBJECTCLAS = BOBJECTCLAS AND
         AOBJECTID   = BOBJECTID   AND
         ACHANGENR   = BCHANGENR )
    WHERE A~OBJECTCLAS = 'MATERIAL'
    AND   A~UDATE = l_ersda
    AND   B~TABNAME = 'MARC'
    AND   B~CHNGIND = 'I'.
    LOOP AT it_change.
       search_len = STRLEN( it_change-TABKEY ).
       search_len = search_len - 4.
       IF search_len > 0.
         IT_MARC-WERKS = it_change-TABKEY+search_len(4).
       ENDIF.
       IT_MARC-MATNR = it_change-objectid+0(18).
       IT_MARC-USERNAME = it_change-username.
       IT_MARC-UDATE    = It_change-udate.
       IT_MARC-FLAG_UI  = 'U'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    ****CDPOS is Cluster TABLE &#25152;&#20197;&#27809;&#26377;&#21150;&#27861;&#29992;INNER JOIN******
      SELECT OBJECTID CHANGENR USERNAME UDATE
      INTO TABLE it_cdhdr
      FROM CDHDR
      WHERE OBJECTCLAS = 'MATERIAL'
      AND   UDATE = l_ersda.
    AND   TCODE = 'MM02'.
      LOOP AT IT_cdhdr.
        SELECT * FROM CDPOS
        WHERE OBJECTCLAS = 'MATERIAL'
        AND   OBJECTID  = IT_CDHDR-OBJECTID
        AND   CHANGENR  = IT_CDHDR-CHANGENR
        AND   TABNAME   = 'MARC'
        AND   CHNGIND = 'I'.
          search_len = STRLEN( CDPOS-TABKEY ).
          search_len = search_len - 4.
          IF search_len > 0.
            IT_MARC-WERKS = CDPOS-TABKEY+search_len(4).
          ENDIF.
          IT_MARC-MATNR = IT_cdhdr-objectid+0(18).
          IT_MARC-USERNAME = IT_cdhdr-username.
          IT_MARC-UDATE    = IT_cdhdr-udate.
          IT_MARC-FLAG_UI  = 'U'.
          APPEND IT_MARC.
         CLEAR IT_MARC.
          CLEAR R_MATNR.
          R_MATNR-SIGN = 'I'.
          R_MATNR-OPTION = 'EQ'.
          R_MATNR-LOW = IT_MARC-MATNR.
          APPEND R_MATNR.
          CLEAR IT_MARC.
        ENDSELECT.
      ENDLOOP.
      IF g_tcode_flag = 'L'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 20
            TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;CHANGE&#30340;&#25968;&#25454;'.
      ENDIF.
    *******&#25235;&#24403;&#22825;&#20570;&#20102;INSERT&#30340;&#25968;&#25454;*************
    *******&#19981;&#38656;&#35201;***********************
    SELECT BMATNR BWERKS INTO TABLE IT_INSERT
    FROM MARC AS B JOIN MARA AS A
    ON   AMATNR = BMATNR
    WHERE A~ERSDA = l_ersda.
    LOOP AT IT_INSERT.
       IT_MARC-MATNR = IT_INSERT-MATNR.
       IT_MARC-WERKS = IT_INSERT-WERKS.
       IT_MARC-FLAG_UI = 'I'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    IF g_tcode_flag = 'L'.
       CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
           PERCENTAGE = 40
           TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;INSERT&#30340;&#25968;&#25454;'.
    ENDIF.
      IF g_tcode_flag = 'L'.
        PERFORM get_MAKTX.
        PERFORM get_mara.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 100
            TEXT       = '&#22788;&#29702;&#22909;&#25968;&#25454;,&#24182;&#24320;&#22987;&#26174;&#31034;&#25968;&#25454;'.
        PERFORM do_data.
        PERFORM display_alv.
      ELSE.
        PERFORM get_MAKTX.
        PERFORM do_ftp.
      ENDIF.
    *&      Form  get_marktx
          text
    FORM get_maktx.
      SELECT MATNR MAKTX INTO TABLE IT_MAKT FROM MAKT
      WHERE MATNR IN R_MATNR AND SPRAS = '1'.
    ENDFORM.                    "get_marktx
    *&      Form  get_mara
          text
    FORM get_mara.
      SELECT * INTO TABLE it_mara FROM MARA
      WHERE MATNR IN R_MATNR.
    ENDFORM.                    "get_mara
    *&      Form  do_data
          text
    FORM do_data.
      SORT IT_MARC BY MATNR WERKS.
      DELETE ADJACENT DUPLICATES FROM IT_MARC COMPARING MATNR WERKS.
      LOOP AT IT_MARC.
        CLEAR IT_MAKT.
        CLEAR IT_MARA.
        READ TABLE IT_MAKT WITH KEY MATNR = IT_MARC-MATNR.
        READ TABLE IT_MARA WITH KEY MATNR = IT_MARC-MATNR.
        MOVE-CORRESPONDING IT_MARA TO IT_OUT.
        IT_OUT-MAKTX = IT_MAKT-MAKTX.
        IT_OUT-WERKS = IT_MARC-WERKS.
        IF IT_MARC-FLAG_UI = 'U'.
          IT_OUT-ERNAM = IT_MARC-USERNAME.
        ENDIF.
        APPEND IT_OUT.
        CLEAR IT_OUT.
      ENDLOOP.
    ENDFORM.                    "do_data
    *SELECT AMATNR BMAKTX INTO CORRESPONDING
    *FIELDS OF FTP_ITEMDOC1 FROM MARA AS A JOIN MAKT AS B
    *ON AMATNR = BMATNR WHERE A~ERSDA = l_ersda
    *AND B~SPRAS = '1' . "&#20195;&#34920;&#20026;&#20013;&#25991;&#35828;&#26126;&#12290;
    APPEND FTP_ITEMDOC1.
    *******DEVK909212****************
    *******&#28155;&#21152;RANGE*****************
    CLEAR R_MATNR.
    R_MATNR-SIGN = 'I'.
    R_MATNR-OPTION = 'EQ'.
    R_MATNR-LOW = FTP_ITEMDOC1-MATNR.
    APPEND R_MATNR.
    CLEAR  FTP_ITEMDOC1.
    *******DEVK909212****************
    *ENDSELECT.
    *******DEVK909212****************
    ****get WERKS information from MARC*******
    *SELECT MATNR WERKS INTO TABLE IT_MARC
    *FROM MARC
    *WHERE MATNR IN R_MATNR.
    *******DEVK909212****************
    ******DEVK909212****************
    **MARK**************************
    *LOOP AT FTP_ITEMDOC1 .
    MOVE : FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_ITEMDOC-MAKTX.
    APPEND FTP_ITEMDOC.
    CLEAR FTP_ITEMDOC.
    *ENDLOOP.
    ******DEVK909212****************
    ******DEVK909212***********************************
    **&#26681;&#25454;IT_MARC&#20013;&#20449;&#24687;&#65292;&#24448;&#21271;&#20140;&#21644;&#31119;&#28165;&#30340;TABLE&#20889;&#25968;&#25454;*****
    FORM do_ftp.
      LOOP AT IT_MARC.
    ***&#31119;&#28165;&#30340;
        IF IT_MARC-WERKS = '1010' OR IT_MARC-WERKS = '1020'
           OR IT_MARC-WERKS = '1023' .
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_FUQING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_FUQING-MATNR,
             IT_MARC-MATNR TO FTP_FUQING-MATNR1,
             IT_MAKT-MAKTX TO FTP_FUQING-MAKTX.
          APPEND FTP_FUQING.
          CLEAR FTP_FUQING.
        ENDIF.
    ***&#21271;&#20140;&#30340;
        IF IT_MARC-WERKS = '1041' OR IT_MARC-WERKS = '1042'.
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_BEIJING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_BEIJING-MATNR,
                 IT_MARC-MATNR TO FTP_BEIJING-MATNR1,
                 IT_MAKT-MAKTX TO FTP_BEIJING-MAKTX.
          APPEND FTP_BEIJING.
          CLEAR FTP_BEIJING.
        ENDIF.
      ENDLOOP.
    ****&#28165;&#26970;&#37325;&#22797;&#30340;&#25968;&#25454;**********
      SORT FTP_FUQING.
      DELETE ADJACENT DUPLICATES FROM FTP_FUQING.
      SORT FTP_BEIJING.
      DELETE ADJACENT DUPLICATES FROM FTP_BEIJING.
    ***&#20256;&#36865;&#25968;&#25454;********
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_FUQING[].
      FTP_WERKS = '1010'.
      PERFORM ftp_work.
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_BEIJING[].
      FTP_WERKS = '1041'.
      PERFORM ftp_work.
    ******DEVK909212***********************************
    ENDFORM.                    "do_ftp
    *&      Form  ftp_work
         &#25226;&#20197;&#21069;FTP&#30340;&#24037;&#20316;&#20570;&#19968;&#20010;FORM
    *******DEVK909212**************************
    FORM ftp_work.
    *******DEVK909212**************************
      CHECK FTP_ITEMDOC[] IS NOT INITIAL.
    FTP function *****************************************************
      DATA : HDL TYPE I,
             L_SLEN TYPE I ,
             ERROR,
             KEY TYPE I VALUE 26101957,
             DEST TYPE RFCDES-RFCDEST VALUE 'SAPFTPA'.
      DATA: FTP_RESULT TYPE TABLE OF TEXT.
      DATA: P_FILE TYPE RLGRAP-FILENAME.
      DATA: L_USER(16) TYPE C VALUE 'SFIS',
            L_PWD(16) TYPE C VALUE 'SFIS',
            L_HOST(16) TYPE C VALUE '172.16.31.17'.
    *******DEVK909212**************************
    *****&#26681;&#25454;&#19981;&#21516;&#30340;&#24037;&#21378;&#26469;&#25235;FTP&#30340;&#20449;&#24687;
      CALL FUNCTION 'Z_FTP_SFIS'
        EXPORTING
          BLART = 'S'
          WERKS = FTP_WERKS
        IMPORTING
          HOST  = L_HOST
          USER1 = L_USER
          PASS1 = L_PWD.
    *******DEVK909212**************************
      CONCATENATE l_ersda '.KP' INTO P_FILE.
      SET EXTENDED CHECK OFF.
      ERROR = 0.
      CHECK HDL IS INITIAL.
    Connect to server
      L_SLEN = STRLEN( L_PWD ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = L_PWD
          SOURCELEN   = L_SLEN
          KEY         = KEY
        IMPORTING
          DESTINATION = L_PWD.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
         TEXT = 'Connect to FTP Server'.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = L_USER
          PASSWORD        = L_PWD
          HOST            = L_HOST
          RFC_DESTINATION = DEST
        IMPORTING
          HANDLE          = HDL
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = HDL
          COMMAND       = 'ascii'
        TABLES
          DATA          = FTP_RESULT
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = P_FILE
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = FTP_ITEMDOC
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
    *******DEVK909212**************************
    *******CLOSE FTP******************
      CHECK NOT HDL IS INITIAL.
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = HDL.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
        EXPORTING
          DESTINATION = DEST
        EXCEPTIONS
          OTHERS      = 1.
      CLEAR HDL.
    ENDFORM.                    "ftp_work
    *******DEVK909212**************************
    FORM DISPLAY_ALV .
    *-- PREPARE ALV DATA
      PERFORM EVENTTAB_BUILD USING GT_EVENTS[].
      PERFORM COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
    *-- LAYOUT SETTING
      PERFORM PREPARE_ALV_FIELD USING GT_FIELDCAT[].
    *-- ALV DISPLAY
      PERFORM CALL_REUSE_ALV_GRID_DISPLAY.
    ENDFORM.                    " display_alv
    *&      Form  eventtab_build
          text
         -->P_GT_EVENTS[]  text
    FORM EVENTTAB_BUILD USING PT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = PT_EVENTS.
      READ TABLE PT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        LS_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY PT_EVENTS FROM LS_EVENT INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      Form  comment_build
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM COMMENT_BUILD  USING PT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER,
            L_DATE(30),
            l_v_BWKEY like T001W-BWKEY,  "Valuation area
            l_v_BUKRS like T001K-BUKRS.  "Firm/Company
    Listen&#57692;erschrift: Typ H
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  not used for this type
    select single BWKEY
       into l_v_BWKEY
       from t001w
       where WERKS IN s_WERKS.
    select single BUKRS
       into l_v_BUKRS
       from t001k
       where BWKEY = l_v_BWKEY.
    SELECT SINGLE butxt INTO LS_LINE-INFO
        FROM t001
       WHERE bukrs = l_v_BUKRS.
    APPEND LS_LINE TO PT_TOP_OF_PAGE.
    Kopfinfo: Typ S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25253;&#34920;&#21517;&#31216;&#65306;'.
      LS_LINE-INFO = SY-TITLE.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26085;&#26399;&#65306;'.
      WRITE SY-DATUM TO LS_LINE-INFO.
    ls_line-info = sy-datum.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26178;&#38291;&#65306;'.
      WRITE SY-UZEIT TO LS_LINE-INFO.
    ls_line-info = sy-uzeit.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#20351;&#29992;&#32773;&#65306;'.
      LS_LINE-INFO = SY-UNAME.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
    ENDFORM.                    " comment_build
    *&      Form  prepare_alv_field
          text
         -->P_GT_FIELDCAT[]  text
    FORM PREPARE_ALV_FIELD USING P_FIELDCAT TYPE  SLIS_T_FIELDCAT_ALV.
      DATA: LS_LINE TYPE  SLIS_FIELDCAT_ALV.
    *-- DEFINE MARCO
      DEFINE APPEND_ALV_FIELD.
        CLEAR LS_LINE.
        LS_LINE-FIELDNAME = &1.
        LS_LINE-TABNAME = &2.
        LS_LINE-REPTEXT_DDIC = &3.
        LS_LINE-SELTEXT_L = &3.
        LS_LINE-SELTEXT_M = &3.
        LS_LINE-SELTEXT_S = &3.
        LS_LINE-QFIELDNAME = &4.
        LS_LINE-QTABNAME = &5.
        LS_LINE-NO_OUT    = &6.
        LS_LINE-NO_ZERO   = &7.
        LS_LINE-OUTPUTLEN = &8.
        APPEND LS_LINE TO P_FIELDCAT.
      END-OF-DEFINITION.
      APPEND_ALV_FIELD: 'MATNR' 'IT_OUT' '&#26009;&#21495;'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'WERKS' 'IT_OUT' '&#24037;&#21378;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MTART' 'IT_OUT' 'MTyp'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MEINS' 'IT_OUT' 'BUn'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKL' 'IT_OUT' '&#29289;&#26009;&#32452;\&#20998;&#32676;&#30721;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKX' 'IT_OUT' '&#29289;&#26009;&#25551;&#36848;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'PSTAT' 'IT_OUT' '&#32500;&#25252;&#29366;&#24577;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'BRGEW' 'IT_OUT' '&#27611;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'NTGEW' 'IT_OUT' '&#20928;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'GEWEI' 'IT_OUT' 'WUn'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'FERTH' 'IT_OUT' '&#23545;&#22806;&#26426;&#31181;&#21517;'
                     'O' 'X' ''.
      APPEND_ALV_FIELD: 'KZUMW' 'IT_OUT' '&#39640;&#20851;&#31246;&#26631;&#35782;'
                   'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERNAM' 'IT_OUT' '&#21019;&#24314;&#32773;'
                 'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERSDA' 'IT_OUT' '&#21019;&#24314;&#26085;&#26399;'
              'O' 'X' ''.
    ENDFORM.                    " prepare_alv_field
    *&      Form  call_reuse_alv_grid_display
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_REUSE_ALV_GRID_DISPLAY .
      gs_layout-f2code              = 'DISPLAY'.
      gs_print-no_print_listinfos   = 'X'.
      gs_layout-colwidth_optimize   = 'X'.       "&#21015;&#23485;&#24230;&#33258;&#21160;&#26681;&#25454;&#20869;&#23481;&#20248;&#21270;
    gs_layout-f2code              = '&ETA'.    "double check&#24377;&#20986;&#35814;&#32454;&#20449;&#24687;
      gs_layout-zebra               = 'X'.       "&#28165;&#21333;&#26465;&#32441;&#26174;&#31034;
      gs_layout-no_vline            = ''.        "&#26159;&#21542;&#26174;&#31034;&#21015;&#38388;&#38548;&#32447;
      gs_layout-box_fieldname       = ''.        "&#26159;&#21542;&#26174;&#31034;checkbox
      gs_layout-confirmation_prompt = ''.        "&#25512;&#20986;&#28165;&#21333;&#26159;&#21542;&#25552;&#31034;
      gs_layout-detail_titlebar     = '&#35814;&#32454;&#20449;&#24687;'."&#35814;&#32454;&#28165;&#21333;&#30340;&#26631;&#39064;
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM                = SY-CPROG
          I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
         I_CALLBACK_PF_STATUS_SET          = 'ALV_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'ALV_USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = GT_LIST_TOP_OF_PAGE[]
          IT_FIELDCAT                       = GT_FIELDCAT[]
          IT_EVENTS                         = GT_EVENTS[]
          I_STRUCTURE_NAME                  = 'IT_OUT'
          I_SAVE                            = 'A'
          IS_LAYOUT                         = GS_LAYOUT
          IS_PRINT                          = GS_PRINT
        TABLES
          T_OUTTAB                          = IT_OUT
        EXCEPTIONS
          PROGRAM_ERROR                     = 1
          OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " call_reuse_alv_grid_display
    *&      Form  PREPARE_ALV_FIELD
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    "TOP_OF_PAGE

    Hi,
    Please check your field catalog and refer field names once again.
    Check spelling, or Check strucutre properly.
    There are something wrong in your catalog definition
    aRs.

  • Get file list from directory(t.code: AL11).

    Hi Frnds,
    i need to get the list of file for particular directory from t.code AL11,
    is there any Function Module to display the list of File from  the directory in executable program,
    i have directory like '/home/im3/hrintf/processed/..... ' and now i need to get the list of file from that directory,
    the list is available in t.code AL11( standard program :RSWATCH0 ).
    pls suggest me with relevant FM or relevant logic.
    Thank you.
    Regards
    Ramesh M

    Hi 
       use this code i have checked its working fine
    Data:
          w_itab type table of  EPSFILI,
          w_dirnam type  EPSF-EPSDIRNAM.
          w_dirnam = 'C:\usr\sap\E6S\DVEBMGS00\work'.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
      EXPORTING
        dir_name                     = w_dirnam
    *   FILE_MASK                    = ' '
    * IMPORTING
    *   DIR_NAME                     =
    *   FILE_COUNTER                 =
    *   ERROR_COUNTER                =
      tables
        dir_list                     = w_itab
    * EXCEPTIONS
    *   INVALID_EPS_SUBDIR           = 1
    *   SAPGPARAM_FAILED             = 2
    *   BUILD_DIRECTORY_FAILED       = 3
    *   NO_AUTHORIZATION             = 4
    *   READ_DIRECTORY_FAILED        = 5
    *   TOO_MANY_READ_ERRORS         = 6
    *   EMPTY_DIRECTORY_LIST         = 7
    *   OTHERS                       = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write: 'test'.
    Thanks
    Viquar Iqbal

  • How to get listitems from different lists using Js

    Hi,
    I want to search my web for all the lists that contains a certain checkbox column (get it by name).
    Once I have this list, I want to iterate through all of them and get the list items with this column checked.
    I got the lists, but when I tried to get the fields - I got an error - the system doesn't recognizes the fields.
    To be more specific - in the code I've posted below in method onGetFieldsSuccess I'm getting an error in the first line, as I can't retrieve the enumerator.
    In the MSDN I saw how to retrieve list's fields, but there it was a specific list. Is there a way to get the lists who have a specific field?
    Any help will be appreciated
    <script> 
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    var ctx;
    var lists;
    function showFavorites()
         ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         ctx.load(web);
         lists = ctx.get_site().openWeb("/legal").get_lists();
         ctx.load(lists);
         ctx.executeQueryAsync(Function.createDelegate(this, this.onGetListSuccess), Function.createDelegate(this, this.onFail));
    var list;
    var fields;
    function onGetListSuccess(sender, args) {
              var listEnumerator = lists.getEnumerator();
              while (listEnumerator.moveNext()) {
                   list = listEnumerator.get_current();
                   ctx.load(list);
                   fields = list.get_fields();
                    ctx.load(fields , 'Include(Title)');
                   ctx.executeQueryAsync(Function.createDelegate(this, this.onGetFieldsSuccess), Function.createDelegate(this, this.onFail));
    function onGetFieldsSuccess(sender, args)
          var fieldEnumerator = fields.getEnumerator();
        while (fieldEnumerator.moveNext()) {
            var field = fieldEnumerator.get_current();
            var name = field.get_staticName();
            if (name == "MyFavorite") {
                alert(list.get_title()); 
                break;
    function onFail(sender, args) {
        console.log(args.get_message());
    </script>​​​​​​​​​​​​​​​​​​​​​​​​​

    Thanks a lot Thriggle,
    I've used your advise, and other then some syntax problems (as you predicted :) everything worked just fine!
    (I had to add another executeQueryAsync to get the listItems files - but that wasn't a problem).
    The only issue that I have is that it takes FOREVER to load, and once it does load - it returns duplicates of the same results (sometimes 3, sometime up to 10).
    I only have 13 tables with about 50 list items in each table, and from that only 6 tables have the specified field - so it shouldn't have taken THAT long (sometimes I see the results after 45 seconds after the page finished loading).
    should I have used a new client context for each query? or is there a place where I'm getting unnecessary loops (I've made sure that I have only 1 list item that matches the 
    I'm resending the complete code. maybe there's something I've missed here.
    <cfheader name="X-XSS-Protection" value="0"></cfheader>​​​​​ ​​​<script>
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    function showFavorites()
         var displayTable = document.getElementById("myFavoritesTable");
         for(var i = displayTable.rows.length - 1; i > 0; i--)
                displayTable.deleteRow(i);
       var fieldToLookFor = "MyFavorite";
         var ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         var lists = web.get_lists();
         ctx.load(web);
         ctx.load(lists, 'Include(Title,Fields)');
         ctx.executeQueryAsync(Function.createDelegate(this, function(){
         var matchingLists = [];
         var listEnum = lists.getEnumerator();
         while(listEnum.moveNext()){
              var currList = listEnum.get_current();
              var containsField = false;
              var fields = currList.get_fields();
              var fieldEnum = fields.getEnumerator();
              while(fieldEnum.moveNext()){
                   if(fieldEnum.get_current().get_staticName() == fieldToLookFor){ containsField = true; break;}
              if(containsField){
                  matchingLists.push(currList.get_title());            
         //alert(matchingLists);
         var i = 0;
         while(i < matchingLists.length){
              var list = lists.getByTitle(matchingLists[i]);
              i++;
              var camlQuery = new SP.CamlQuery();
              var camlString = '<View><Query><FieldRef Name=\'' + fieldToLookFor + '\' /><Value Type=\'Integer\'>1</Value></Query></View>';
              camlQuery.set_viewXml(camlString);
              var items = list.getItems(camlQuery);
              ctx.load(items);
              ctx.executeQueryAsync(Function.createDelegate(this,function(){
                   var itemEnum = items.getEnumerator();
                   while(itemEnum.moveNext()){
                        var item = itemEnum.get_current();
                        var file = item.get_file();
                        ctx.load(file);
                        ctx.executeQueryAsync(Function.createDelegate(this,function(){
                        var table = document.getElementById("myFavoritesTable");
    // Create an empty <tr> element and add it to the 1st position of the table:
    var row = table.insertRow(-1);
    // Insert new cells (<td> elements) at the 1st and 2nd position of the "new" <tr> element:
    var cell1 = row.insertCell(0);
    var cell2 = row.insertCell(1);
    var cell3 = row.insertCell(2);
    var cell4 = row.insertCell(3);
    cell1.innerHTML = "XX";
    cell2.innerHTML = item.get_id();
    cell3.innerHTML = "<a href='" + item.get_file().get_serverRelativeUrl() + "' alt=''>" + item.get_file().get_name() + "</a>" ;
    cell4.innerHTML = "";
                     }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
              }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
    }), Function.createDelegate(this, function(sender, args){ 
         alert(args.get_message()); 
    </script>​​​​​ 
    <table id="myFavoritesTable">
       <tbody> 
          <tr valign="top" class="ms-viewheadertr"> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">שם טבלה 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">ID 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">כותרת 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">מסמך ​ 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> ​​​​​​​</td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
          </tr>
       </tbody> 
    </table>​ 
    <p>​​​​​​​​​</p>

  • How can i get the list of all tcode used by user of particular module

    Hi,
    How can i get the list of all tcode used by user of particular module (e.g FI , MM ,PP) within year .
    Regards
    Vikram

    Login to your SAP System
    Run TCode SE16
    Type Table Name : TSTCT
    Press F7 Key (Table Contents )
    Go to Settings in menu bar
    Select User Parameters
    Under Keyword select Field Label and press green check mark
    Select your criteria in Data Browser and execute
    You will see all t codes in there
    Regards,
    Yogesh

  • Get SPO Tenant Site Collection Administrators list using CSOM.

    Hi All,
    I'm trying to get the list of all SCA's for a site collection created in SPO tenant.
    using following code, i could able to view few properties of Site Collection but not the SCA's for that site collection.
    spp = tenant.GetSiteProperties(startIndex, true);
    Any other possibility to get the list of SCA's for a Site Collection created on SPO Tenant.
    Thanks,
    P

    Your can easily adjust the time out limit of the underlying HttpRequest by setting the property ClientRuntimeContext.RequestTimeout (Details: http://msdn.microsoft.com/EN-US/library/office/ee541007(v=office.15).aspx).
    I use this method for multiple Sharepoint Online apps and it works well. But be warned, sometimes I get no repsond for requests and so the ExecuteQuery() blocks until the time out occurs. This happend for me regualry while sending simple GetListByTitle()
    requests. So set a sane value (e.g. several minutes for long running requests like feature activations) and handle a time out in catch blocks.

Maybe you are looking for