WD -SALV- setting initial view

Hi everyone,
I saw some forums in SDN about setting the initial View in a SALV.
Someone suggested to use R_COMPONENT of type IF_SALV_WD_COMP_TABLE_PERS in order to call the method SET_STANDARD_VIEW.
But noone was able to indicate how r_component could be properly referenced. (Such Forums are anyhow marked as closed but unanswered).
I would be very pleased to know if someone managed to do it, and how.
Thank you so much.
Best Regards,
Christian

Hi,
Please refer to this code and make changes accordingly as per the conditions -
METHOD wddoinit.
  DATA:
    lo_nd_mara                 TYPE REF TO if_wd_context_node,
    lt_mara                    TYPE        wd_this->elements_mara,
    lo_cmp_usage               TYPE REF TO if_wd_component_usage,
    lo_interfacecontroller     TYPE REF TO iwci_salv_wd_table ,
    lo_api_interfacecontroller TYPE REF TO if_wd_controller,
    lo_pers                    TYPE REF TO if_wd_personalization,
    lv_value                   TYPE REF TO cl_salv_wd_config_table,
    lt_var                     TYPE        wdr_pers_variants,
    wa_var                     TYPE        wdr_pers_variant,
    ls_config_key              TYPE        wdy_config_key.
* navigate from <CONTEXT> to <MARA> via lead selection
  lo_nd_mara = wd_context->get_child_node( name = wd_this->wdctx_mara ).
* Get material master data
  SELECT * FROM mara INTO TABLE lt_mara UP TO 10 ROWS.
* @TODO handle non existant child
  IF lo_nd_mara IS NOT INITIAL.
    lo_nd_mara->bind_table( new_items = lt_mara set_initial_elements = abap_false ).
  ENDIF.
* Instantiate ALV
  lo_cmp_usage =   wd_this->wd_cpuse_alv_materials( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
* Get the interface controller of the component usage
  lo_interfacecontroller =   wd_this->wd_cpifc_alv_materials( ).
* Get the model object of ALV
  IF lo_interfacecontroller IS NOT INITIAL.
    lv_value = lo_interfacecontroller->get_model(
* Get the API reference
    lo_api_interfacecontroller = lo_interfacecontroller->wd_get_api( ).
  ENDIF.
* Get personalization obect
  IF lo_api_interfacecontroller IS NOT INITIAL.
    CALL METHOD lo_api_interfacecontroller->get_personalization_manager
      RECEIVING
        pers_manager = lo_pers.
  ENDIF.
* Get variants
  IF lo_pers IS NOT INITIAL.
    CALL METHOD lo_pers->get_variants
      RECEIVING
        variants = lt_var.
  ENDIF.
* Set the default variant
* Required variant is read
* READ statement can be modified as per the requirement.
* As this application holds only one user variant, first record is read.
##read the respective records based on your condition
  IF lt_var IS NOT INITIAL.
    READ TABLE lt_var INTO wa_var INDEX 1.
    IF sy-subrc EQ 0.
      ls_config_key-config_id    = wa_var-config_id .
      ls_config_key-config_type  = wa_var-config_type.
      ls_config_key-config_var   = wa_var-config_var.
    ENDIF.
    TRY.
        CALL METHOD lo_pers->set_default_variant
          EXPORTING
            config_key = ls_config_key
            set        = abap_true.
      CATCH cx_wd_personalization .
    ENDTRY.
* Get the variant information based on variant id
* Load the variant/ Set the default variant
    CALL METHOD lo_pers->load_config_by_key
      EXPORTING
        config_key            = ls_config_key
        fetch_default_variant = abap_true.
  ENDIF.
ENDMETHOD.
Regards,
Lekha.

Similar Messages

  • WD- SALV- Setting initial View dynamically

    Hi everyone,
    I'd like to have 2 different ALV initial views, depending on certain conditions in my program (two buttons, each of them calling the same ALV, but with different initial View)
    I'm settung at runtime the config_key when I initialize the ALV component, as Regina Breuer explained in the following forum
    Re: WDA ALV initial view
    After I run the program and I click on one of the buttons it works fine. But the initial view doesn't change even if I click on the other button, although in debugging mode I can see that the correct configuration key is being set.
    For any suggestions I woud be very pleased!
    Best Regards,
    Christian

    Hi Baldari,
    Please check this also..
    WD -SALV- setting initial view
    Cheers,
    Kris.

  • Batch create multiple pdf's while using epilogue.ps for setting initial view and opening bookmarks

    Hi,
    I'm trying to batch create multiple pdf's from word files, and use the epilogue.ps file for setting the initial view and opening the bookmarks panel, but i keep getting no satisfying result.. i'm probably missing something fundamental.
    I've read some forum posts and adobe help posts explaining this, so i'm pretty sure this would be possible?
    Reference:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7f0f.w .html  see advanced panel options
    http://help.adobe.com/en_US/acrobat/using/WS58a04a822e3e50102bd615109794195ff-7f14.w.html
    System: Windows 7
    Acrobat: Acrobat X professional
    i've searched for and found a way to overwite the epilogue.ps file and have inserted the following:
    %  Insert your custom PostScript here...
    [ /PageMode /UseThumbs
    /Page 1 /View [/Fit ]
    /DOCVIEW pdfmark
    After that i checked my Adobe Acrobat preferences, and in the categorie 'Convert to Pdf' i selected 'Microsoft office word' in the select area 'Converting to pdf'.
    Clicked 'Edit settings' to allow creating a joboptions file (field: 'adobe pdf settings') which has the option 'Use epiloque.ps and prologue.ps' checked in the advanced section.
    So now i thought i would have everyting setup to create my pdf's, however, my view isn't changed to fit, nor are there any bookmarks or in this case thumbs (i used /useThumbs) visible.
    Did i miss something obvious? Is there a better way to test this? Any help would be appreciated!

    i like it about that ok in how to open my site

  • PDF through VBA: How to set Initial View?

    - Adobe Acrobat 6.0 (sorry we're a bit out of date)
    - MS Office 2003
    - MS Windows XP Professional SP2
    I am trying to automate the creation of PDFs from MS Word. I have succeeded. My VBA code works fine (have pasted it below). I can create a PDF, and give it a title and author.
    The problem I am having is with the Initial View settings, i.e. how the document opens. I want to hardcode:
    1. Show to "Page Only"
    2. Page Layout to "Continuous"
    3. Magnification to "Fit Width"
    The first I have done, using AcroExch.PDDoc's SetPageMode() function (although it seems to default to that even without doing this). I cannot, for the life of me, find any reference to the second and third, though. This must be doable, right? Be kind of weird not to have access to this in the API.
    Hours of Googling has thrown up three ideas I've discarded.
    1. AcroExch.App's SetPreference() function. This would presumably change preferences on the machine making the PDF, not reading it. I don't want to fiddle with other people's preferences anyway.
    2. AcroExch.AVPageView's ZoomTo() function. Ditto. I am not creating an app to view PDFs, just trying to configure the default for opening one I've created.
    3. An "undocumented" SetOpenInfo() in AcroExch.PDDoc. This looked the most promising for Magnification, but nobody seems to be able to get it to work, and it does nothing for me either. Someone somewhere even suggested it had been deprecated in later versions of Acrobat.
    So... what do I do?
    Thanks in advance for any pointers.
    jON
    ===============================================
    Sub MakePDF(strFilename As String, strTitle As String, strAuthor As String)
    Dim pdfD As PdfDistiller
    Dim strPDFName As String
    Dim strPSName As String
    strPSName = strFilename & ".ps"
    strPDFName = strFilename & ".pdf"
    '... make PS
    Application.ActivePrinter = myPDFPrinter
    Application.PrintOut Filename:="", _
    Range:=wdPrintAllDocument, _
    Item:=wdPrintDocumentContent, _
    Copies:=1, _
    Pages:="", _
    PageType:=wdPrintAllPages, _
    ManualDuplexPrint:=False, _
    Collate:=True, _
    Background:=False, _
    PrintToFile:=True, _
    PrintZoomColumn:=0, _
    PrintZoomRow:=0, _
    PrintZoomPaperWidth:=0, _
    PrintZoomPaperHeight:=0, _
    OutputFileName:=strPSName, _
    Append:=False
    '... make PDF
    Set pdfD = New PdfDistiller
    pdfD.FileToPDF strPSName, strPDFName, ""
    '... tag PDF
    Set qq = CreateObject("AcroExch.PDDoc")
    b = qq.Open(strPDFName)
    b = qq.SetInfo("Title", strProperties_Title)
    b = qq.SetInfo("Author", strProperties_Author)
    b = qq.SetPageMode(1) '... 1 = PDUseNone
    b = qq.Save(33, strPDFName) '... 33 = PDSaveFull (1) OR PDSaveCollectGarbage (32)
    b = qq.Close
    End Sub

    I have the same problem. I need to change Initial View Settings configuring the following settings
    2. Page Layout to "Single Page"
    3. Magnification to "Fit Width"
    My software configuration is as follows:
    - Adobe Acrobat 7.9
    - Microsoft Windows XP SP2
    - Visual Basic 6
    Has anyone worked with this attributes of Acrobat?

  • Setting Initial View of .PDF when exporting from ID

    Hi,
    I use 5.0.1 and upgrading is not an option due to the IT department - don't get me started!
    I have created a document in ID with Bookmarks to aid navigation when its converted to a PDF.
    In Acrobat 8.0 there is a feature to set the initial view to open the pdf with the bookmarks tab showing - Document Settings > Initial View > Layout & Magnification > Bookmarks Panel & Page.
    Is it possible to set this attribute in ID without having to use Acrobat after creating the pdf? i.e when I export the ID file to pdf it is effectivly fire and forget.
    Thanks in advance all...

    No need to apologize - I'm a rookie when it comes to IS detail.
    I use Acrobat Standard 8.1 when setting the initial view and IE 7. There are no security settings set.
    I'm posting the documents on a web site and others that open to view are most likely using Acrobat Reader.
    Not certain what I should try next. I appreciate your help.

  • Need to set "initial view" to two up and fit page

    Newbie here, I apologize for such a basic question:
    It's easy to set an open document view to "two up" and "fit page":
    this.zoomType = zoomtype.fitP;
    this.layout = "TwoColumnLeft";
    However, I cannot seem to find the properties to set the "initial view" to the same view.
    "initial.zoomType" and "initial.layout" do not work.
    Any ideas?  Thanks, JB

    "initial.zoomType" and "initial.layout" do not work.
    This properties doesn't exist. Did you read the documentation?

  • Setting Initial View Folder for All Users at Once and Forever. How???

    <p>Is there any way to make the initial view of all users to be a specific folder? What I want to acomplish it to show my public folders expanded and always showing a specific folder. I can do it for myselft but what about a global setting?</p>

    I tried the following code and it does not appear to work.  Why?
    Our goal is to take the destop preferences of a selected user and apply those preferences to all other users.  How can that be done?  Note:  We need to apply those preferences whether they have already set their preferences or not.
         Dim oSourceUser As InfoObject
                Dim oTargetUsers As InfoObjects
                bErrorOccurred = False
                oSourceUser = oInfoStore.NewInfoObjectCollection().InfoStore.Query("SELECT SI_NAME, SI_DATA FROM CI_SYSTEMOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.User' And SI_Name = '" & vstrSourceUserID & "'").Item(1)
                If vstrTargetUserID.Length > 0 Then
                    oTargetUsers = oInfoStore.NewInfoObjectCollection().InfoStore.Query("SELECT SI_NAME, SI_DATA FROM CI_SYSTEMOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.User' And SI_Name = '" & vstrTargetUserID & "'")
                Else
                    oTargetUsers = oInfoStore.NewInfoObjectCollection().InfoStore.Query("SELECT SI_NAME, SI_DATA FROM CI_SYSTEMOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.User' And SI_Name != '" & vstrSourceUserID & "'")
                End If
                For Each oUser As InfoObject In oTargetUsers
                    Try
                        oUser.Properties.Add("SI_DATA", oSourceUser.Properties("SI_DATA").Properties)
                    Catch ex As Exception
                        bErrorOccurred = True
                        If ex.Message.Length = 0 Then
                            strLastError = "Unknown Error Occurred"
                        Else
                            strLastError = ex.Message
                        End If
                        Exit For
                    End Try
                Next
                If bErrorOccurred = False Then oInfoStore.Commit(oTargetUsers)

  • Setting Initial View to include Previous View and Next View buttons

    I am trying to set up a PDF so that when others open it, the Previous View and Next View buttons appear on the tool bar. Is there away to do this? Or do I need to create my own buttons?
    I am using Adobe Acrobat 9 Pro Extended version 9.4.4

    You'll have to create your own in the document.

  • Initial View set with epilogue.ps when exporting pdf from Indesign

    Hi all. After years of Quarking, Freehanding, Pagemakering and my favourite, Indesigning, i finally got down to investigating a one step solution to setting the initial view in pdfs.
    When distributing pdf 'layouts' and 'proofs' to clients i always set the pdf's initial view to fit page before emailing. It is simply the pro thing to do, and allows for a client to view the 'big picture' without having to first see a close-up of the top of a layout or design.
    In the same breath i would set a business card layout to open at 125% or 150% so they get a feel for the actual size of finished product.
    Well all these years of pdf proofing i have been hitting the old ⌘-D in Acrobat and manually setting initial view to fit page. Then ⌘-S and "bobs your uncle".
    Ready to email.
    Huge deadlines aside, this morning i woke up early, and decided to have a good look online as to what one can do to automate this small, but oh so repetitive task. Well reading about the prologue.ps and epilogue.ps, got me really excited, especially when i implemented a little postscript tweak to the epilogue.ps, and distiller saw it through beautifully.
    Alas my elation was short lived as it seems Indesign uses it's own 'distiller' so to speak and does not see the epilogue.ps.
    And i am definitely not going to start printing ps files to a 'watched folder'. I spent years distilling manually, and since Indesign and it's superb built in pdf-ing, i have never looked back.
    So looks like we are all gonna have to continue ⌘-D ing, till adobe picks this up and changes the build to accomodate.
    Just wanted to put this out there, and see perhaps if anybody has another take on this one. Am i missing something. If i am please let us all know.
    Many thanks,
    Rupert Pluck

    If you upgrade to InDesign CS5, there are two ways to export a PDF file: (1) For Print. This this does not include the option to set Initial View (2) For Interactive. For Interactive PDF's you can set the Initial View in InDesign.

  • Acrobat 9 Ingores Document Initial View Settings

    I've created a PDF from InDesign. I set Initial View Settings for the document in Acrobat 9. When I open the document in A9, the Initial View Settings are ignored. I then open the same document in A8 and it opens fine. I'm guessing there is a global setting in the A9 preferences, but I can't seem to find one that works. Please help.

    I apply the Initial View settings as I first create the PDF.
    I use File... Properties... Initial View.
    Depending on the length of the document, I make the first setting Page Only, Pages Panel and Page (most often), or Bookmarks and Page (if it is a long report and I am making bookmarks).
    I make Page Layout be Single Page.
    And I check Hide Tool Bars in the last group. (All commands are still available with menus, with much less real estate taken up by tall toolbars.)
    Then I save and close the document. Then I re-open it to make sure it looks as I intended.
    On my old computer, that always worked great and made a professional looking PDF.
    But when I downloaded the same product onto my new computer, this no longer works.
    I am using a workaround and hoping that when I upgrade on the new computer that the later version will work.

  • Interaction Between Initial View Magnification & Bookmark Destination

    I'm using Adobe Acrobat X.
    I understand that setting the destination of a bookmark also establishes the view magnification. Apparently, this is always the case, and that doesn't seem right to me.
    Suppose all I want is for each bookmark to take the reader to a particular page, and I don't want the view magnification to be any different from the magnification that the reader is currently using. For example, suppose I've set Initial View, Magnification to Default when creating the PDF. How do I make sure the reader isn't going to get confronted with a different view magnification upon clicking on a bookmark and being taken to the page?

    Here are four screenshots showing what Bookmark Properties shows:

  • Is there a way to set the default Initial View to Bookmarks Panel and Page on word documents that I save as PDF?

    When I save my word 2013 documents as Adobe PDF I have to open the PDF up, go to File>Properties>Initial View>Navigation Tab and then set the initial view as Bookmark Panel and Page; it gets pretty tedious.
    I use Save as Adobe PDF rather than Print to Adobe PDF Printer because I like being able to have the security settings automatically set.
    I just want to be able to save my word document as Adobe PDF with the initial view already set as Bookmark Panel and Page, and with security, so I can send it out immediately.
    Is this possible?
    Thank you.

    Use the Firefox Android Addon - Phony
    *https://addons.mozilla.org/en-US/android/addon/phony
    for more
    *https://addons.mozilla.org/en-US/android/

  • Initial View set in PDF Document not working.

    I have a PDF document w/Initial View in the Document Properties set to Navigation tab: 'Bookmarks panel and Page', and Open to page '1''.  However, when I send this document out, the Initial View settings do not happen (The PDF opens to the page last accessed before the document was sent and the navigation pane does not display).  Help - what am I missing or doing wrong when trying to distribute PDF?
    I am using Acrobat X Pro.

    It might be the settings in Acrobat that is causing the problem. Edit – Preferences…, under Categories select Documents. Uncheck Restore last view settings when reopening documents.

  • Set PDF Document Properties Initial View by Acrobat SDK with C#

    Hi,
    Here am trying to set the PDF document initial view by the Acrobat SDK with C#.
    Here I am show my screen shot which properties I want to set.
    For this process I am referred Acrobat SDK and also following Adobe forums they also asked similar question.
    http://forums.adobe.com/message/3866361
    http://forums.adobe.com/message/4803264
    http://livedocs.adobe.com/acrobat_sdk
    And also I am used following C# code
          Acrobat.AcroPDDocClass doc = new Acrobat.AcroPDDocClass();
          doc.Open(@"D:\..\sap.pdf");
    doc.SetOpenInfo(1,1,"Fit Width");
          doc.SetPageMode(3);
          doc.Save(1, @"D:\..\sap.pdf");
          doc.Close();
    From the above code {doc.SetPageMode(3);} is working for set the page mode.
    But I am having problem in following code {doc.SetOpenInfo(1,1,"Fit Width");}
    Because it won’t work I do’t known, and there is no clear samples in the SDK reference document.
    So please give advice and clear sample code/syntax to meet above needs which are marked in red box.
    Document Properties - > Intial View
    Document Option
         Show: Bookmarks Panel and Page
         Page Layout: Continuous
         Magnification: Fit Width
    Window Options
         Show : Document Title
    Regards,
    Thirusanguraja Venkatesan

    ok thank you Test Screen
    I will try and let you know if i am done by automation .
    Regard,
    Thirusanguraja Venkatesan

  • In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?

    Adobe Acrobat 9 Pro V9.4.0
    Win7 Pro x64
    Problem: In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?
    Every time Acrobat scans a document, I have to go to Initial View to set Navigation tab, Page layout, and Magnification. It does not remember the settings I last used.
    Thanks in advance.

    See my response to this post

Maybe you are looking for

  • Problem in Creation of business partner

    i create business partner with the help of BAPI_ISUPARTNER_CREATE_FROM_DATA i want to add mobile number but there is no any field such like mobile number in address data table. But there is separate table of telephone data. When i use this table to s

  • Replacing old hard drive with a new one. HP ENVY DV7 7230us laptop

    I am trying to replace my old hard drive with a new one. For some reason it won't do it. I want to perform a clean install with the recovery disks. It seems the only way I can do this is to clone the old one with the new. I have attempted several tim

  • Multiple instances of the same entity bean out of sync

    Env: NT4.0SP6/jdk build 1.3.1-b24/oc4j 1.0.2.2.1 Scenario: A) Session Bean(SB) 1 loads Entity Bean (EB) 1. B) Another Session Bean, SB2, loads the same EB1 (same pk). (It turns out that oc4j loads 2 instances of the same EB1.) C) SB1 changes data of

  • Stocks app changed in iOS-8 - language

    Hi, just updated to iOS-8 and found one thing very annoying and it also does´t make sense to me: I have lots of stocks in my stocks app - like Apple at NASDAQ (AAPL) and Apple at FRA (APC.F) or Adobe NASDAQ (ADBE) and Adobe FRA (ADB.F)....... So - qu

  • Owb error(please pass a parent frame)

    Hi all, While synchronizing mapping in a process flow i am getting "this message is not modal pass a parent frame" error.My mapping has operating mode of "set based fail over to row based".Any idea why i am getting the error?