Creating a number of Link to Actions based on the Output of an ALV

Hello Experts,
I have an ALV table as an output in WDA in which the number of records are unknown.
I want to limit the number of records to 500 at a point of time.
Below the table i need to have link to actions placed like 1-500 501-1000 10001-1500 and so on.
As the number of records are unknown i need to have these link to actions divided among total records.
And if the table shows 1-500 records the Link to Action 1-500 should become text so that the user will not be able to click on it.
So my requirement is
1.How to limit the number of records to 500.
2.How to place the link to actions dynamically based on the number of output records.
3.How to change the Link to Action to Text.
Please help me in this.
Thanks in Advance,
Shravan

Hello Shravan,
If you know the total number of records at runtime then its simple. Otherwise you need to write some complex logic. I assume that at runtime while launching the application you will know the total number records .
1.How to limit the number of records to 500.
As Srinivas mentioned call the set_visible_row_count method by passing 500
2.How to place the link to actions dynamically based on the number of output records.
Logic for the same.
data i_total type i value 1250. "say total number of records
data i_max type i value 500. "your max records to be displayed in aLV at anypoint of time
data i_num type i.
data i_rem type i.
i_num = i_total div i_max.
i_rem = i_total mod i_max.
data lv_end_text type string.
data lv_start_text type string.
data lv_final_text type string.
data i_start type i.
data i_end type i.
do i_num times.
  i_start = ( i_max * ( sy-index - 1 ) + 1 ).
  lv_start_text = i_start.
  i_end = i_max * sy-index.
  lv_end_text = i_end.
  concatenate lv_start_text ' - ' lv_end_text into lv_final_text RESPECTING BLANKS.
   "Write the logic to create the Link to Action - as suggested by Srinivas
enddo.
if i_rem > 0.
  i_start  = i_max * i_num + 1.
  lv_start_text = i_start.
  i_end = i_max * i_num + i_rem.
  lv_end_text = i_end.
  concatenate lv_start_text ' - ' lv_end_text into lv_final_text RESPECTING BLANKS.
" Write the logic to add the last linkToAction
endif.
3.How to change the Link to Action to Text.
If you set the enable property of the LinkToAction to abap_false then it will be disabled and displayed as text.
Hope this helps.
BR, Saravanan

Similar Messages

  • So Can I determine the business partners linked to user based on the assigned role and org. structure?

    Hello, I am working on a SAP CRM 7 Sales implementation and we are implementing leads and opportunity scenarios. The current business organization model is that there multiple vertical and horizontal departments. This is typical matrix structure. This organization has done the segregation of its clients based on the verticals so every clients belongs to at least one or more Vertical department but Horizontal departments can contact all the clients. In the same way sales executives are also either belonging to one or more Verticals or Horizontal departments? Horizontal sales executive can create leads for any clients available in the system but a Vertical sales executive can only create lead only for the client belongs to his vertical and assigned to him. This can be achieved by creating organization structure and business partner relationship.
    Now the problem statement is that few sales executives need work for both some Verticals and Horizontals at the same time. But requirement is that they should be able to do the both roles with single user id but multiple roles. So when sales executive is creating leads his vertical department, he should only be able to select clients assigned to his Vertical only but when he is creating lead for Horizontal department, he should be able to select any clients.
    So Can I determine the business partners linked to user based on the assigned role and org. structure?
    Please let me know if this is not clear also  note we are only using CRM WebUI no SAP ePortal.
    Thanks a lot your help in advance.
    Regards
    Sudesh Sharma

    Thanks, Tahir
    my problem has solved
    Kind Regards,
    Faisal

  • DIO Pass or Fail Tests: LabVIEW would have to determine the expected result or results (1 or 2 of a possible 25) based on the output pattern send out (1 of 65K).

    I am trying to come up with a plan to write a LabVIEW VI to do the following test. Can you give me a few ideas how to do this in LabVIEW. I am a new to LabView. I think I how to read and write I/O ports and do comparisons. I need a little guidance on the error checking. In simple terms the test will go like this:
    I have 16 digital inputs and 16 outputs.
    The 16 outputs are turned on in a specific pattern (i.e. 1001000101011101) and then the 16 inputs (i.e. 1000101111111111) are read in after a time delay. The inputs are checked to see if they match the expected results. If they do it's a pass if not it's a f
    ailure. This seems pretty straightforward. And I think I have an idea how to do it. Here's the problem. The inputs are changed sequentially so that all possible combinations are tried. The test needs to determine if the resulting input pattern is correct based on the outputs that were sent out. 16 outputs give 65K possible tests. For each tests there would be 1 or 2 possible results with a total of 25 results for the entire 65K possible tests. LabVIEW would have to determine the expected result or results (1 or 2 of the 25) based on the output pattern send out (1 of 65K). Then it would have to compare the actual input pattern received to see if it's a pass or fail?
    Any ideas how I can approach this?

    The 16 outputs are simulating inputs to the device under test, (simulating remote switches and contacts). The object of the test is to test every possible combination to ensure that nothing unexpected happens at the output. The device under test is a logic motor control system and we want to make sure (among other things) that we don’t start or stop the motor when its not suppose to. How can only two tests do that?
    I think you are describing how to create an array with the results. But I still don’t know how to determine what the result should be and if it is correct.
    I’ve identified 25 possible valid states the motor controller can be in.
    I’ve also identified the correct outputs that determine each of the 25 states.
    I’ve also
    identified the possible valid states you can go to from each (previous) state, You can only get to a valid new state from a previous state if the right combination of inputs is applied (we hope).
    If you know what state you are in when start and you know the valid states you can go to and the inputs required to get there, you should be able test the system against that. You verify this by checking the outputs against what they should be. With 65K possible inputs combination, checking them all manually would be quite is a task. Putting this into LabView is my task.

  • IDOC Number based on the output type

    Hi,
    I have a special requirement where in I need to find the IDOC number generated from the output type .
    I have the NAST details and the Invoice number and need to find the IDOC generated for the particular NAST entry.
    Is there any table or FM which gives this information in SAP.
    Please let me know.
    Regards
    Praneeth

    All,
    Solved myself.
    Used FM WFMC_PROTOCOL_GET to get the IDOC number based on the NAST value.
    Regards
    Praneeth

  • Create a drop down list that populates based on the selection form another drop down list.

    I need to set up a drop down list that is popualated (i.e. displays a certain list of selctions in the drop down list) based on the choise the form user selects in an adjacent List
    For example
    There are two drop down list field sitting side by side in the form
    1. Select State          2. Select Course
    What I want to do is have a list of states in the first drop down list (1.Select State) and depending on which state the form user selects , the second drop down list (2.Select Course) will populate with a selction of courses available in that selected state only (i.e. it will on;y show course available in QLD if QLD is selcted).
    Is this hard to do?

    Hi,
    I would recommend some posts from Stefan Cameron's blog:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
    Hope that helps,
    Niall

  • Filter a Query Based on the Output of Another Query

    Is it possible to run a query based on the put put of another query? I have two queries. One query is based on GL Line items and shows the account assignemnt of postings where a customer has had a debt raised and it been credited to an account assignment e.g. Order, Cost Centre or Profit Centre. The other query is on an AR cube and that shows payment made. I want to bring these together to show the owners of the various account assignments to what extent customers have actually paid the debts that have been raised and credited to them. This I do as the source document of the CO doscument matches the allocation of the ar document. So I have a query that shows the CO journal and another query that shows payments. But I only want to show the payments in the second query for documents displayed in the first query (which can be restricted by period and fiscal year and the particular account assignment).

    Hi,
    This can be acheived by usign a replacement path variable.
    Create replacement pathe variables for those the filter values in the second report nneds tobe restricted from the first.
    Then in the properties of the varioable say replce by query result and input the first query name in it.
    Use these variables in teh filter section of the second report.
    Make sure the characteristics for which you created the replacement path variables are in teh row section of the first Query.
    Now on executing the second query you will have it filtered based on teh values of the first Query.
    Hope this helps.
    Regards.
    Shafi.

  • How to subdivide 1 large TABLE based on the output of a VIEW

    I am searching for a decent method / example code to subdivide a large table (into a global temp table (GTT) for further processing) based on a list of numeric/alphanumeric which is the resultset from a view.
    I am groping with the following strategy in PL/SQL:
    1 -- set up cursor, execute the view (so I have the list of identifiers)
    2 -- create a second cursor (or loop?) which:
    accepts each of the identifiers in turn
    executes a query (EXECUTE IMMEDIATE?) on the larger table
    INSERTs (or appends?) each resultset into the GTT
    3 -- Then the GTT contains just the requires subset of the larger table for further processing and eventual import into iReport for reporting.
    Can anyone point me to code that would "spoon feed" me on this? Or suggest the best / better way to go about it?
    The scale of the issue here -- GTT is defined and ready to go, the larger table contains approx 40,000 rows and I need to extract a dozen subsets or so which add up to approx 1000 rows.
    Thanks,
    Rob

    Welcome to the forum!
    >
    I am searching for a decent method / example code to subdivide a large table (into a global temp table (GTT) for further processing) based on a list of numeric/alphanumeric which is the resultset from a view.
    Can anyone point me to code that would "spoon feed" me on this? Or suggest the best / better way to go about it?
    The scale of the issue here -- GTT is defined and ready to go, the larger table contains approx 40,000 rows and I need to extract a dozen subsets or so which add up to approx 1000 rows.
    >
    No - there is no code to point you to.
    As many of the previous responses indicate part of the concern is that you seem to have already chosen and partially implemented a solution but the information you provided makes us question whether you have adequately analyzed and defined the actual problem and processing that needs to happen. Here's why I have questions about your approach
    1. GTT - a red flag issue - these tables are generally not needed in Oracle. So when you, or anyone says they plan to use one it raises a red flag. People want to be sure you really need one rather than not using a table at all, or just using a regular table instead of a GTT.
    2. Double nested CURSOR loops - a DOUBLE red flag issue - this is almost always SLOW-BY-SLOW (row-by-row) processing at its worst. It is seldom needed, doesn't perform well and won't scale. People are going to question this choice and rightfully so.
    3. EXECUTE IMMEDIATE - a red flag issue or at least a yellow/warning flag. This is definitely a legitimate methodology when it is needed but may times developers resort to it when it isn't needed because it seems easier than doing the hard work of actually defining ALL of the requirements. It seems easier because it appears that it will allow and work for those 'unexpected' things that seem to come up in new development.
    Unfortunately most of those unexpected things come up because the developer did not adequately define all of the requirements. The code may execute when those things arise but it likely won't do the right thing.
    Seeing all three of those red flag issues in the same question is like waving a red flag at a charging bull. The responses you get are all likely to be of the 'DO NOT DO THAT' variety.
    You are correct that a work table is appropriate when there is business logic to be applied to a set of data that cannot be applied using SQL alone. Use a regular table unless
    1. you plan to have multiple sessions working with the table simutaneously,
    2. each session needs to work with ONLY their own data in that table and not data from other sessions
    3. the data does NOT need to be available after the session ends
    4. you actually need a GTT to take advantage of the automatic data preservation (ON COMMIT PRESERVE/DELETE) functionality
    Remember - when a session ends the data in the GTT is gone. That can makek it very difficult to troubleshoot data related problems since a different session can't see what data is in the table. Even if a GTT is needed for the final product it is very useful to use a regular table so that the data can be examined after test runs to help find and fix problems. Then after development is complete and initial testing is done a GTT would be substituted and final testing performed.
    So the main remaining question is why you need to perform multiple dynamic queries to get the data populated into the work table? Especially why is a nested cursor loop needed? My suspicion is that you have the queries stored in a query table and one of your loops extracts the query and executes it dynamically.
    How many queries are we talking about? Do these queries change from run to run? Please provide more detail of the process and an example query for the selection filtering as well as a typical dynamic query you plan to use.

  • How to create a table using blob datatype and then selecting the output???

    I have created table
    create table imgloader(img_l blob);
    now i want to insert the image i.e. '/u1/archie.jpg' to this table
    what steps to be follwed to insert the image into table..and how to see the stored image??

    Is GOOGLE & SEARCH broken for you?
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:392618837633

  • How to bind value to lov based on the output from other lov

    HI all, i have 2 message choice Lov, i am selected a value from the 1st lov based on this value i am a executing a query, i want to display one of the attribute value from the query result in the second LOV. i am getting the attribute value correctly but i dont know how to bind that(display) in the 2nd LOV(at runtime).

    Read the dev guide LOV section, it should give you details about this implementation.

  • Link to action in editable ALV

    Hi experts,
    I have an editable alv with a column where I implemented the UI Element "Linktoaction" for the cells of this column. I implemented it in the WddoInit-Method in my view with the alv:
    lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'LINK' ).
      CREATE OBJECT lr_linktoaction.
      lr_linktoaction->set_text( value = 'Go to Detail' ).
    If I have an normal InputField I need:
    lr_column->set_cell_editor( lr_input_field ).
    What have I to do for getting an action for clicking on the Link? The link with the text "Go to Detail" is displayed in the editable alv. But how can I navigate to another view by clicking?
    Thanls a lot for your help!!
    Best Regards
    Ingmar

    Hi Ingmar,
    Implement 'ON_CLICK_EVENT' in the same view where u have ALV. Clicking on the link in the cell using link to action gives you the following information which u can use (pass to other view etc..) -
    COLUMN_ID
    INDEX
    ATTRIBUTE
    VALUE
    You can read these values and store them in a node.
    Create one node in the view by name 'EVENT_PROPERTIES' with attributes 'NAME' and 'VALUE' of type string both and use the below code in on_click_event. Here I am navigating to the next view after clicking the link, you can do whatever u want depending on ur requirement.
      DATA: lr_node TYPE REF TO if_wd_context_node,
            lt_event_properties TYPE if_models_list_view=>elements_event_properties,
            ls_event_properties TYPE if_models_list_view=>element_event_properties.
      FIELD-SYMBOLS: <l_value> TYPE ANY.
    fill internal table
      ls_event_properties-name = 'COLUMN_ID'.
      ls_event_properties-value = r_param->column.
      APPEND ls_event_properties TO lt_event_properties.
      ls_event_properties-name = 'INDEX'.
      ls_event_properties-value = r_param->index.
      APPEND ls_event_properties TO lt_event_properties.
      ls_event_properties-name = 'ATTRIBUTE'.
      ls_event_properties-value = r_param->attribute.
      APPEND ls_event_properties TO lt_event_properties.
      ASSIGN r_param->value->* TO <l_value>.
      ls_event_properties-name = 'VALUE'.
      ls_event_properties-value = <l_value>.
      APPEND ls_event_properties TO lt_event_properties.
    navigate to context node EVENT_PROPERTIES
      lr_node = wd_context->get_child_node( 'EVENT_PROPERTIES' ).
    bind internal table to context node
      lr_node->bind_table( lt_event_properties ).
      wd_this->fire_to_pi_main_view_plg( ).
    Regards,
    Gaurav

  • Define Corrective Actions based on URL

    Hello,
    I'm new to using 10gR3 Grid control -
    Is there a way of defining a corrective action based on the success of a URL - so if a URL fails with say a 404 error or times out, an OS script can be run.
    I can only find ways of assigning corrective actions with pre-defined alert metrics.
    Thanks for any help

    At the risk of repeat-posting, I'll clarify. Say I create a file named routing.xml which defines some routes like this:
    <routing-config>
      <route>
        <name>Standard rule</name>
        <description>
          This route maps the first two parts in the path with the module and action
        </description>
        <url-pattern>/:module/:action.do</url-pattern>
      </route>
      <route>
        <name>Default Index</name>
        <description>
          Allows the module to be specified without the action for "Index" actions.
        </description>
        <url-pattern>/:module.do</url-pattern>
        <request-parameters>
          <parameter key="action" value="Index" />
        </request-parameters>
      </route>
      <route>
        <name>Homepage</name>
        <description>
          Loads the Home page
        </description>
        <url-pattern>/</url-pattern>
        <request-parameters>
          <parameter key="module" value="Home" />
          <parameter key="action" value="Index" />
        </request-parameters>
      </route>
    </routing-config>The bits like ":module" which be represented by the actual name of the module in the URL. Does anyone know if something like this already exists? :)
    I wrote this exact same thing in PHP5 just a few weeks ago but I really don't have the motivation to write it all over again in Java :P On a side-note, things like this usually come with helpers for turning unclean URIs into clean URIs.

  • Table Cell Editor - Link To Action UI

    Hi,
    I have a Table UI element in the first view and i need that the first column should have Link To Action UI as the cell editor.
    For this the requirment is that Context Attribute Type should be Boolean. please let me know why this is so.
    Also i want that Link To Action UI should have the text property set to a values from another context attribute. How will this be possible. Please provide some suggestion on this.
    Regards
    Sidharth

    Hi,
    Do you use the table binding wizard? There the first option for the binding property of a Link to action is "enabled" as far as I can remember... And <b>this</b> of course has to be boolean.
    If you want to bind the text property to a Context element you can do it by choosing text as binding property.
    You may also bind the text property to a Context element after completing the wizard.
    Does this answer your question?
    Rgds
    Daniel

  • Also Question about create Random number

    What's the best way to create random number in main method, which will allow the number (random) to be stored into content of queue. I was thinking somewhere along the road, is this the appropriate way to handle this?
    import java.util.*;
    public static void main(String[] args)
            Queue q=new Queue();
    Random random = new Random ();
            for(int i=0;i<12;i++)
               q.add(random);
              

    Close, but not quite. That will add the same random number number generator (no random numbers) to the queue 20 times.
    Look at the methods in the Random class to find the one that suits your needs for using the generator (the Random) to generate a random number.
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Random.html

  • Custom Data Link is Lost on Saving the InCopy Document

    Hi,
    I am creating a custom data link in InCopy CS3 for the story.  I am able to successfully create the custom data link in InCopy.
    But when I save the InCopy document and re-open it then custom data link is gone and I have the normal data link.
    InCopy default behaviour is that when we save the InCopy document then it creates a normal data link.
    Does anybody have an idea what should be done to retain the custom data link and normal data link is not created.
    Thanks in Advance.
    Regards,
    Eric Won

    Thanks Dirk.
    Yes, I saw that there was some problem with the Script Provider.
    I created a new sample project in InCopy and created the custom data links. The custom data link got persisted in incx file which can be viewed by opening it in text editor. I am creating custom data link for stories.
    But when I open the InCopy document then my Script Provider gets the call back for creating the links. I created the links as shown in Custom Data Links sample but it doesn't create the link. Instead when I open the document normal data link exists for the story in InCopy.
    It seems to be that incx file is getting created correctly becuase when I try to import the incx file in InDesign then it is able to successfully create the custom data links.
    Am I missing something or doing something wrong ? any ideas ?
    I once gain thank you dirk for helping me out.
    Regards,
    Eric Won

  • Create Accounting when completed in warning the output is coming in XML

    Hello to all,
    I am having APPS version 12.1.3 OS version OEL 5.5
    my problem is that when i am running Create Accounting concurrent request if it completes in warning the output (view output) is coming in XML in browser where as if its completing normal then the output appears correctly as expected, the output type for create accounting concurrent program is XML.
    Please advise / guide me
    thanks

    Please find below log file details
    ==============================================================================================
    Start of log messages from FND_FILE
    06-OCT-2011 10:36:08 - Beginning of the Report
    06-OCT-2011 10:36:08 - Starting of the Parent Thread
    Starting main program for the source application = 200
    06-OCT-2011 10:36:08 - Dynamic conditions built
    06-OCT-2011 10:36:08 - Event Applications Determined
    06-OCT-2011 10:36:08 - Security Context Set
    06-OCT-2011 10:36:08 - Session Identifier Set
    06-OCT-2011 10:36:08 - Setup for the ledger and Event applications Read
    06-OCT-2011 10:36:08 - executing preaccounting hook
    event key = 10-426334
    06-OCT-2011 10:36:08 - preaccounting hook executed successfully
    06-OCT-2011 10:36:08 - Pre-Accounting steps performed
    06-OCT-2011 10:36:08 - Queue Created = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:36:08 - Queue Created = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:36:08 - Queue Started = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:36:08 - Queue Started = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:36:08 - Global Context Initialized
    06-OCT-2011 10:36:08 - Calling sequencing batch_init
    06-OCT-2011 10:36:08 - Returned from sequencing batch_init
    06-OCT-2011 10:36:08 - Begin enqueue
    06-OCT-2011 10:36:08 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:08 - Spawning unit processors
    06-OCT-2011 10:36:08 - Unit processors spawned
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Enqueueing completed
    06-OCT-2011 10:36:36 - Waiting for Unit Processor requests to complete
    06-OCT-2011 10:37:06 - Child Threads completed
    06-OCT-2011 10:37:06 - Global Context cleared
    06-OCT-2011 10:37:06 - Queue stopped = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:37:06 - Queue stopped = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:37:06 - Queue dropped = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:37:06 - Queue dropped = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:37:06 - Calling sequencing batch_exit
    06-OCT-2011 10:37:06 - Returned from sequencing batch_exit
    06-OCT-2011 10:37:06 - Executed post-accounting routine
    06-OCT-2011 10:37:06 - Accounting Program completed successfully
    06-OCT-2011 10:37:06 - executing postaccounting hook
    event key = 10-426334
    06-OCT-2011 10:37:06 - postaccounting hook executed successfully
    - Accounting Time = 58.73 secs
    - Transfer Time = 0 secs
    06-OCT-2011 10:37:06 - End of the Report
    End of log messages from FND_FILE
    Executing request completion options...
    Output file size:
    1920
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 426334 on node M at 06-OCT-2011 10:37:06.
    Post-processing of request 426334 failed at 06-OCT-2011 10:39:06 with the error message:
    The Output Post-processor is running but has not picked up this request.
    No further attempts will be made to post-process this request, and the request will be marked
    with Warning status.
    Setting the profile option Concurrent: OPP Response Timeout to a higher value may be necessary.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 06-OCT-2011 10:39:06
    Edited by: hassanksa on Oct 8, 2011 8:15 AM
    Edited by: hassanksa on Oct 8, 2011 8:16 AM

Maybe you are looking for