Count based on the UDA's in ASO cube

In product dimension I have UDA's like MDW, NEW in all level 0 members. I would like to get the count of all MDW's and put that in an account A and count of all NEW's and put it in account B. Please help this MDX query.
I tried this ..but not sure how SKCOMPMCount will get reset every time. ALso I want to get it for all children
case when [Location].CurrentMember = [SKUCountComp] and IsLevel(Date.CurrentMember, 0) and IsLevel(Product.CurrentMember, 1)
then
IIF(IsUda(firstchild(Product.CurrentMember),"MDW"),SKCOMPMCount+1,SKCOMPMCount)
end
I am using Essbase 9.2.0 and this is a ASO cube
Edited by: user4498967 on Mar 27, 2009 10:06 AM
Edited by: user4498967 on Mar 27, 2009 10:09 AM

I have had one such requirment in past project and I made the changes in PCR X011. Actully I copied it into Z011 and then made the changes. You can also use the processing class 47. If you will take a look at this PCR you will understand how you can use it.
We dont have anything in the standard to fulfill this requirment.
I hope this helps.
Regards,
Ahsan Zaidi.

Similar Messages

  • Need to get the count based on the column availability

    You get a set of table names from a query, say
    select table_name from all_tab_columns where column_name like 'DC_I’;
    TABLE_NAME
    A
    B
    C
    Now, for the above set of tables (A,B and C), you need to get the count(*) for a single dc_i value (say XXX DC)
    In simple words, its like framing the following 4 separate queries into one single one:
    select table_name from all_tab_columns where column_name like 'DC_I’; (Based on this o/p, following 3 queries..)
    select count(*) from A where dc_i=XXX;
    select count(*) from B where dc_i=XXX;
    select count(*) from C where dc_i=XXX;
    Thanks

    Are you looking for this?
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:01.04
    satyaki>
    satyaki>
    satyaki>
    satyaki>SELECT table_name,
      2         DBMS_XMLGEN.getxmltype ('SELECT Count(*) c FROM ' || table_name||' where '||column_name|
    |' = 10').EXTRACT ('//text()').getnumberval() tot_rows
      3  FROM all_tab_cols
      4  WHERE table_name in ('EMP', 'DEPT')
      5  and   column_name = 'DEPTNO';
    TABLE_NAME                       TOT_ROWS
    EMP                                     4
    DEPT                                    1
    Elapsed: 00:00:01.00
    satyaki>
    satyaki>
    satyaki>
    satyaki>select count(*) from emp where deptno = 10;
      COUNT(*)
             4
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>select count(*) from dept where deptno = 10;
      COUNT(*)
             1
    Elapsed: 00:00:00.00
    satyaki>Regards.
    Satyaki De.

  • How to store multiple counts based on creation date

    Hi,
    I want to retrieve the count of number of risk  for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
    column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015  and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2  and
    then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
    date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
    Please help.
    Thanks in advance. 

    Hi,
    I want to retrieve the count of number of risk  for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
    column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015  and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2  and
    then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
    date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
    Please help.
    Thanks in advance. 

  • ASO Cube with attributes very slow in retrieval

    Hi,
    I have a ASO Cube with 5 base dimensions and 8-9 attributes on the entity dimension. I have only 5-6 measures, which do the averages and counts based on the 40 day period. Howere, the data is loaded at the 15 minute increment
    Entity
    Date - (date-time, lowest level being date)
    TIme - ( 15 minute time for the full 24 hour period, has a attribute assocuated with oit)
    LocationType
    Measures.
    The sample formula is
    IIF(Islevel([Locations].CurrentMember,0), Avg(CrossJoin({[Measure].[Sale]},{[DateDim].CurrentMember.lag(40):[DateDim].CurrentMember})),Missing)
    Is there a way, i can have this calculated as a part of the script? DO you suggest i create a BSO, to do these calculations and pass on the result.
    In OBIEE, the report is to display the followung based on the date input.
    Entity Gen7, Entity Gen 6..... Entity Gen 2, Attr1, Attr2, Attr3, Attr4, Attr5, Attr6, Attr7, Measures

    2 things I would look at
    1st - I don't know how much performance you would get out of this, but I'm not clear why you are using a crossjoin in your MDX, it seems unnecessary and may cause more overhead. The following should work, you could also try using IsLeaf instead and see if that is any faster
    IIF(Isleaf([Locations].CurrentMember),
    Avg({[DateDim].CurrentMember.lag(40):[DateDim].CurrentMember},
    [Measure].[Sale], INCLUDEEMPTY)
    2nd - your problem mostly revolves around the fact that you are running a 40 member sum/avg for every member you are querying. It also sounds like the average is at the Day level, which is not level 0. So for all forty days, ASO also has to calc the results of each of those days. Remember that aggregations only get you so far, you should really think of everything in ASO as dynamic and that is why you can see what you have set up is not going to work that well, it is too calc intensive.
    I don't know how practical this is, but to get this to work fast you would probably need to break out the 15 minute increments below the day level to another dimension so the day level becomes a stored level zero member. The 15 minute increment dimension should also be stored. If at all possible you would want to have an alternate stored hierarchy with the 40 days you want to base the average on. Enable alternate hierarchies in your aggregations, then change your MDX calc to be based on the parent of the 40 day hierarchy divided by 40. That would be fast.
    I suppose you could opt to not break out the 15 minute increments and just have the shared hierarchy made up of the 15 minute increments that are below the 40 days. That would still give you a good stored subtotal that with some query hints you could get optimized.

  • Outline Change ASO cube in Version 7

    Hi Guys,
    I am working on version 7 of EAS.
    I have to make a minor change(add a child) to the outline in the ASO cube. I am not able to see the option of retain data with restructure ( which is the case with higher versions).
    so how do i save the restructure and data in version 7 of Essbase.
    any inputs will be great
    Thanks
    Ram

    You don't Version 7 deletes data with most outline changes. (Simple changes like chaging a formula might not delete data). THe whole premise of ASO cubes was you would always have the source data to reload from. In System 9 it was improved to be able to retain data in most cases

  • Count the number of rows based on the values!!!

    Hi all,
    What I am using:
    I am working with a multidimensional database in Visual Studio 2010 using its Data source view and calculation member and dimension usage.
    What I want to do:
    I have a fact table that has five columns(leg(s),hand(s), Head and body,overall) that shows the category of how severe the injury is. Let say for the records all columns never have an empty value(no injury is stated with 'No injury' ) . These five columns
    are connected with a dimension that has all the available values (Category A-E of injury).The overall has the most severe from the other four columns. I want to create a bar chart with five different measure
    values, one for each column, and count the values in those columns. 
    For example : I have a slicer in the excel and a bar chart and the slicer has all the values of the Category of the injury ( Cat a,Cat B, Cat C, ... Cat E, No injury ) and when i select one of them, lets say
    Cat C,  the bar chart should update and show how many Cat C each measurement column has. 
    Example FACT table:
    ID      LEG      HAND    HEAD   BODY OVERALL
    1        No         A           No        No        A
    2        No        D            C          C         C
    3    E         C            D           A         A
    4         E          E           B            C         B
    So if i selected C the bar chart will count   (Leg = 0, Hand = 1, Head = 1, body = 2 and Overall = 1).
    Any ideas ?
    Thanks for the help and the time :) 

    Hi DBtheoN,
    According to your description, you want to create a chart on excel worksheet to count the rows based on the value, right? If in this case, I am afraid this issue is related to Office forum, I am not the expert of Office, you can post the issue on the corresponding
    forum.
    However, this requirement can be done easily on SQL Server Reporting Services. You can using the expression below to count the rows.
    =COUNT(IIF(Fields!LEG.Value=Parameters!TYPE.Value,1,NOTHING))
    Regards,
    Charlie Liao
    TechNet Community Support

  • Warranty id not getting determined based on the warranty counter

    Hi,
    We are trying to determine the warranty id from the counter reading.
    Scenario:
    We are confirming the vehicle and the business partner and create a service order . We are entering the reading in the service order and want to get the warranty product determined based on the counter reading.
    First free service at counter reading of 5000 kms
    Second free service at counter reading of 10,000 kms
    We have followed the following steps:
    1. Warranty product with Warranty basis as Counter dependant and Warranty counter data with the value.
    2. For the Vehicle object in relationships we have assigned a counter id.
    However we are unable to determine the warranty id
    Is there something that we are missing. Would really appreciate a solution.

    Hi Ayan,
    Firstly, whlich version of SAP CRM you are working on?
    If it is CRM 5.0
    Apply Note 1009244 - 'Counter attribute' field missing in CRM 5.0.
    This note will get the counter attribute field in the Counter creation screen.
    Check these steps again:
    1.  Create a counter warranty. Ensure nothing is excluded.
    2. Create a counter  and assign it prouct master or installed base component.
    3. If you have assigned it to a product master, in the service transaction enter the reference data as well.
        Ensure that warranty check profile has been assigned
    4. Once you enter a service product your warranty must get determined.
    5. If not, check the log in the warranty tab, it shall give u the details.
    Wish it helps.
    Regards,
    Shalini Chauhan

  • Steps to create the counter based Maintenance plan

    Hi!
    Can any body give "Steps to create the counter based Maintenance plan"
    (Mater Data,Transactional Data and Customizing Data creation)
    Regards,
    MDSFR

    hi
    please refer the following link
    http://help.sap.com/saphelp_46c/helpdata/en/fe/67ef189d6f11d189b60000e829fbbd/content.htm
    regards
    thyagarajan

  • What is the use of OR and AND functions in counter based maint plan

    Hi
    I want to create a counter based maintenance plan...
    I entered the measurement reading for the counter, reading is 4000 hrs
    IN IP43
    I created the counter plan with cycle as 6000 hrs. Once the document reaches 6000 order will be created. While creating the maintenance plan, in the maintenance schedule parameters, i check there is OR and AND functions avaliable...
    I know the basic use of both the functions..
    But what is the significance in the maintenance plan....
    Will it give any effect, between the schedule date and measurement docu entries...
    Since i need to maintain like... once the counter reaches 6000 hrs only order should be created.. it should not create once the date as been reached... since due to present condition, i am not running the DG....
    Give ur inputs
    - Pithan

    Hi
    Thank you for your reply
    As you said...
    If you want order to be created only after certain Hrs to be reached to cycle value then you may opt for single cycle or strategy cycle
    can u explain how to do it...
    In single cycle or stratergy... if u schedule the plan itself, the dates will be populated.. it will calculate with respect to the annual reading we have entered in the measurement document...
    My DG overhaul to be taken in every 6000 hrs... i create a plan... i have given the annual reading as 8000 hrs... if i schedule the plan for 5 yrs... wat will be the call objects...
    Then i am running the DG for 3 hours a day... my annual running hrs will be 1000 hours.. but my order will be released since it has crossed the dates...
    how to control... is it possible to do it in IP43 with multiple counter...
    How to do this ?
    Cna u explain
    - Pithan

  • How to release the IDOC based on the count

    Hi IDOC gurus,
    How to release IDOC's based on the count?
    Actually, my requirement is I have to release the IDOC's of count 50 for every 5 or 10 minutes. I tried by scheduling the background job for the program RSEOUT00, but unfortunately there was no option of selecting the IDOC's based on count for the given message type except IDOC range i.e FROM and TO select options in the selection screen.
    Are there any other alternative where I can release the IDOC's based on count for every periodic 5 or 10minutes?
    Also, can I know how can we configure the multiple QUEUES for the IDOC's?
    I highly appreciate who can help regarding this and points are awarded.
    Thanks,
    Sreevani.

    Hi Ferry,
    I tried with that option. Maximum number of IDocs parameter is the package size not the count of IDOC's.
    I have 100 IDOC's with status 30 and all IDOC's got released eventhough the value of  "Maximum number of IDocs" parameter is 50. I checked in the code it is an package size i.e., maxm IDOCs that it can be transferred from RFC outbound queue to a port at time and not maximum number that can be processed for the program execution.
    Thanks,
    Sreevani.

  • How to manage the same counter based on Order Number and Order Items

    Hi All,
       we need some help to build an infocube and a query as described in the following scenario.
    ODS 1 (Order Numbers aggregated at month level) defined as:
    - Order Month
    - Customer
    - Counter
    ODS 2 (Order Items aggregated at month level) defined as:
    - Order Month
    - Customer
    - Product
    - Counter
    We would like to build an InfoCube that allows us to create a query through which we are able to compare:
    -  ODS 1 - Counter, that means the number of orders without considering the product
    -  ODS 2 - Counter, that means the number of orders where a specific product is included
    For example:
    ODS 1:
    Order Month........Customer........Counter
    200701...............20001.............10
    200701...............20002.............5
    ODS 2:
    Order Month.............Customer...................Product..........Counter
    200701.....................20001.......................A....................1
    200701.....................20001.......................B....................10
    200701.....................20002.......................A....................4
    200701.....................20002.......................C....................5
    The desired query should show the following result
    Ord Month.Customer..Product.....Counter....Counter
    .................................................(ODS2).....(ODS1)
    200701......20001.......A..............1..............10
    200701......20001.......B..............10.............10
    200701......20002.......A..............4..............5
    200701......20002.......C..............5..............5
    Do you have any idea how to get this result?
    Thanks
    Kind Regards

    Hi Valeria,
        Have a look,
    <a href="http://sapbwneelam.blogspot.com/2007/08/sap-tables.html">How to... Count the occurrences of a characteristic</a>
    <a href="http://sapbwneelam.blogspot.com/">More Docs .....</a>
    Hope it Helps
    Srini

  • Count and limit the accesses to a browser based swf

    I have a swf file imbedded in a HTML. Acceess to the file are controlled by passwords, stored in a XML-file
    I want to limit the number of accesses for each visitor to let us say 10 visits. How do I count (and store) the number of logons for each visitor?
    SharedObject works only at clienside, but iI want i serverside. The "easy" way would be to save the number of accesses for each visitor in a text-file but Flash and save... I hvave tried ExternalInterface calls, PHP etc and etc, but cant find a way that works. This is the last obstacle in a huge project. Please help.

    If using a MySQL database is an option, here's a link to a tutorial that deals with all the various aspects of that.
    http://www.gotoandlearn.com/play?id=20

  • Creation of a Marketing Profile Set based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset thru the WebUI Segment Builder

    Objective: Creation of a Marketing Profile Set based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset thru the WebUI Segment Builder.
    Problems: Standard CRM_MKTTG_BP_BIRTHDATE Infoset DOES NEVER RETURN ANY RESULTS on the segmentation builder of the WebUI client (no matter the filter you specify).
    Other cases:  However if we create a new Data source with data "Extraction from Query" (transaction RS02) based on this standard CRM_MKTTG_BP_BIRTHDATE Infoset and we test the functionality using transaction RSA3, IT DOES RETURN RESULTS (using the same filters as in the segmentation builder)! Of course the segmentation builder works with other attribute lists.
    NEW: IF WE DON’T ESPECIFY ANY SEGMENTATION BASE IN THE PROFILE GROUP, IT DOES RETURN RESULTS!!! (GO TO THE END OF THE DOCUMENT FOR DETAILS)
    Steps followed:
    Review Standard Infoset CRM_MKTTG_BP_BIRTHDATE (Transaction SQ02).Review Data Reading Program code: do we have to change the standard code? We have only remove the "BREAK-POINT" statement.
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset (Transaction CRMD_MKTDS).
    Creation of an Attribute List based on that standard Data source and selection the Birth date as a filter in the Attribute list (Transaction CRMD_MKTDS).
    On the segment builder of the WebUI set any filter (Example: “TODAY”).
    Steps in detail:
    Review Standard Infoset CRM_MKTTG_BP_BIRTHDATE
    SQ02.
    (Image deleted)
    Review Data Reading Program code (Code attached)
    (Image deleted)
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset
    Data source: Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation - Maintain Data Sources and Attribute Lists: CRMD_MKTDS
    Create Data Source
    (Image deleted)
    Infoset: CRM_MKTTG_BP_BIRTHDATE.
    Business Partner Field: CRMT_MKTTG_IS_BIRTHDATE-PARTNER_GUID
    (Image deleted)
    Result:
    (Image deleted)
    Attribute List
    Creation of the Attribute List
    (Image deleted)
    Assign Data Source:
    (Image deleted)
    Selection of the Birth date as a filter in the Attribute list:
    (Image deleted)
    Result:
    (Image deleted)
    Segment builder of the WebUI:
    Access to WebUI with marketing role.
    Create Segment:
    Creation of Profile Set
    Graphical modeler
    Create Filter: We have already tried many different filters (we already seen notes referring to this matter).
    Example1: “today”
    Count target group. Here I would like to stand out that once you click on the “Count” option, immediately it shows 0 results. In other words, it doesn’t process any information. With other attribute lists it takes some time to process, no matter the filter or the attribute list you use. However if we create a new Data source with data "Extraction from Query" (transaction RS02) based on this standard CRM_MKTTG_BP_BIRTHDATE Infoset and we test the functionality using transaction RSA3, IT DOES RETURN RESULTS (with “today” filter and other)! So it seems that the problem has to do with the segment builder, not the Infoset.
    Result: it never return any results no matter the filter you specify.
    Other cases:
    Creation of a new Data source with data "Extraction from Query" where you enter the name of your new query
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset
    Standard Infoset CRM_MKTTG_BP_BIRTHDATE:
    We fill the form and select “Extraction from Query”:
    Press SAVE and define which fields will be available for selection and which of them will be visible.
    RSA3: Extractor checker in order to test the Data source:
    We specify the Data source:
    IT DOES RETURN RESULTS:
    ALV Grid:
    NEW: It seems that it has to do with the Segmentation Basis selected in the creation of a Profile Set, because if we do not select any, it does return results. But we need to create this Profile Set based on a particular Segmentation Basis called BS Usuarios Registrados.
    Segment builder – Profile Set of the WebUISegmentation Basis: we leave it in blanc.
    Graphical modeler
    Create Filter: We have already tried many different filters (we already seen notes referring to this matter).
    Example1: “today”
    Count target group.
    Result: IT DOES RETURN RESULTS!!! àConclusion: the problem is the Segmentation Basis
    Define Segmentation Basis:
    Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation – Classic Segmentation - Define Segmentation Basis.BS Usuarios Registrados:
    Define Reports for Creating Segmentation Bases
    Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation – Classic Segmentation - Define Reports for Creating Segmentation BasesZMK_UTL_MGR_SITES_UREG
    Define Usage for Segments:
    Transacción: SPRO – Customer Relationship Management - Marketing – Segmentation – General Settings - Define Usage for Segments.ZBS_UR à02 Segmentatión Basis
    Attribute List:Category:
    There is no Category 02 Segmentatión Basis!!! Why?? Why is not posible to select Category 02 Segmentation Basis in the creation of the Attribute List???
    Usage ID
    NEW: It seems that it has to do with the Segmentation Basis selected in the creation of a Profile Set, because if we do not select any, it does return results. But we need to create this Profile Set based on a particular Segmentation Basis called BS Usuarios Registrados. Why is not posible to select Category 02 Segmentation Basis in the creation of the Attribute List???

    It seems that the standard Infoset doesn’t work by itself with Segmentation Basis. Two SAP notes have been applied and a new Field Group has been added to the Infoset (in order to distint the Segmentation Base).
    CRMT_MKTTG_IS_BIRTHDATE-MGRGUID
    1966298: MGR_GUID is not populated correctly to infoset read program
    2007687:Segmentation InfoSet queries saved with incorrect Master Group
    For that reason we had to create a new Infoset based on the standard CRMT_MKTTG_IS_BIRTHDATE, but adding this new Field MGRGUID to the Group Fields.
    Issue solved

  • I have the exclamation point symbol next to podcasts that don't meet the criteria for said symbol based on the FAQ

    When I'm looking through and trying to manage my Podcast library within iTunes, I see the exclamation point symbol next to several. My first issue is the fact that there are many that have this symbol that I only wanted a few episodes and not a subscription. How can I fix this problem?
    My second issue is that for many of the podcasts with the exclamation point symbol, they don't fit the criteria based on what's in the Symbol FAQ, which states that there are too many unplayed episodes so new episodes won't download. For the podcasts in question, this is not the case, as all episodes have been listened to. What can be done to fix this problem?
    My third issue is the fact that when I DO play a podcast on my iPod Touch (4th Gen), I don't use the app (can't stand it), then go to sync it with the computer, these episodes are shown as having already been played PRIOR to the actual syncing happening. So, when I go to do the ACTUAL sync, the play count is off. Right now, I have to manually reset the play count so that the episodes that I listened to on my iPod Touch only show one play in the library count, not two or in some cases, three. How can I fix this problem?
    I have the most current version of iTunes and use Windows 7 64-bit.
    Thanks for ANY help!

    Try this Support Article  >  http://support.apple.com/kb/HT1808

  • I Need Interactive Report for displaying vendor information. Based on the s

    Interactive Report for displaying vendor information. Based on the selection made by the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along with the secondary list.

    hi
    Hi
    Use the Table LFA1 and LFB1 in the basic list
    and LFBK table details in the secondary list
    see the sample code related to customer Sales orders
    modify it with the Vendor tables
    REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
    HEADING.
    *TABLES DECLARATION
    TABLES : KNA1, VBAK, VBAP.
    *SELECT OPTIONS
    SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
    *INITIALIZATION
    INITIALIZATION.
    CUST_NO-LOW = '01'.
    CUST_NO-HIGH = '5000'.
    CUST_NO-SIGN = 'I'.
    CUST_NO-OPTION = 'BT'.
    APPEND CUST_NO.
    *SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN ON CUST_NO.
    LOOP AT SCREEN.
    IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
    MESSAGE E001(ZTJ1).
    ENDIF.
    ENDLOOP.
    *BASIC LIST SELECTION
    START-OF-SELECTION.
    SELECT KUNNR NAME1 ORT01 LAND1 INTO
    (KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
    FROM KNA1
    WHERE KUNNR IN CUST_NO.
    WRITE:/1 SY-VLINE,
    KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
    16 SY-VLINE,
    KNA1-NAME1 UNDER 'NAME',
    61 SY-VLINE,
    KNA1-ORT01 UNDER 'CITY',
    86 SY-VLINE,
    KNA1-LAND1 UNDER 'COUNTRY',
    103 SY-VLINE.
    HIDE: KNA1-KUNNR.
    ENDSELECT.
    ULINE.
    *SECONDARY LIST ACCESS
    AT user-command.
    IF SY-UCOMM = 'IONE'.
    PERFORM SALES_ORD.
    ENDIF.
    IF SY-UCOMM = 'ITWO'.
    PERFORM ITEM_DET.
    ENDIF.
    *TOP OF PAGE
    TOP-OF-PAGE.
    FORMAT COLOR 1.
    WRITE : 'CUSTOMER DETAILS'.
    FORMAT COLOR 1 OFF.
    ULINE.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'CUSTOMER NO.',
    16 SY-VLINE,
    18 'NAME',
    61 SY-VLINE,
    63 'CITY',
    86 SY-VLINE,
    88 'COUNTRY',
    103 SY-VLINE.
    ULINE.
    FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR SECONDARY LISTS
    TOP-OF-PAGE DURING LINE-SELECTION.
    *TOP OF PAGE FOR 1ST SECONDARY LIST
    IF SY-UCOMM = 'IONE'.
    ULINE.
    FORMAT COLOR 1.
    WRITE : 'SALES ORDER DETAILS'.
    ULINE.
    FORMAT COLOR 1 OFF.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'CUSTOMER NO.',
    16 SY-VLINE,
    18 'SALES ORDER NO.',
    40 SY-VLINE,
    42 'DATE',
    60 SY-VLINE,
    62 'CREATOR',
    85 SY-VLINE,
    87 'DOC DATE',
    103 SY-VLINE.
    ULINE.
    ENDIF.
    FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR 2ND SECONDARY LIST
    IF SY-UCOMM = 'ITWO'.
    ULINE.
    FORMAT COLOR 1.
    WRITE : 'ITEM DETAILS'.
    ULINE.
    FORMAT COLOR 1 OFF.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'SALES ORDER NO.',
    40 SY-VLINE,
    42 'SALES ITEM NO.',
    60 SY-VLINE,
    62 'ORDER QUANTITY',
    103 SY-VLINE.
    ULINE.
    ENDIF.
    FORMAT COLOR 3 OFF.
    *END OF PAGE
    END-OF-PAGE.
    ULINE.
    WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
    SY-PAGNO.
    SKIP.
    *& Form SALES_ORD
    *& FIRST SECONDARY LIST FORM
    FORM SALES_ORD .
    SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
    (VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
    FROM VBAK
    WHERE KUNNR = KNA1-KUNNR.
    WRITE:/1 SY-VLINE,
    VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
    16 SY-VLINE,
    VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
    40 SY-VLINE,
    VBAK-ERDAT UNDER 'DATE',
    60 SY-VLINE,
    VBAK-ERNAM UNDER 'CREATOR',
    85 SY-VLINE,
    VBAK-AUDAT UNDER 'DOC DATE',
    103 SY-VLINE.
    HIDE : VBAK-VBELN.
    ENDSELECT.
    ULINE.
    ENDFORM. " SALES_ORD
    *& Form ITEM_DET
    *& SECOND SECONDARY LIST FORM
    FORM ITEM_DET .
    SELECT VBELN POSNR KWMENG INTO
    (VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
    FROM VBAP
    WHERE VBELN = VBAK-VBELN.
    WRITE : /1 SY-VLINE,
    VBAP-VBELN UNDER 'SALES ORDER NO.',
    40 SY-VLINE,
    VBAP-POSNR UNDER 'SALES ITEM NO.',
    60 SY-VLINE,
    VBAP-KWMENG UNDER 'ORDER QUANTITY',
    103 SY-VLINE.
    ENDSELECT.
    ULINE.
    ENDFORM. " ITEM_DET
    REPORT demo_list_at_pf.
    START-OF-SELECTION.
    WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
    AT pf5.
    PERFORM out.
    AT pf6.
    PERFORM out.
    AT pf7.
    PERFORM out.
    AT pf8.
    PERFORM out.
    FORM out.
    WRITE: 'Secondary List by PF-Key Selection',
    / 'SY-LSIND =', sy-lsind,
    / 'SY-UCOMM =', sy-ucomm.
    ENDFORM.
    After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
    Secondary List by PF-Key Selection
    SY-LSIND = 14
    SY-UCOMM = PF06
    Example for AT USER-COMMAND.
    REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
    START-OF-SELECTION.
    WRITE: 'Basic List',
    / 'SY-LSIND:', sy-lsind.
    TOP-OF-PAGE.
    WRITE 'Top-of-Page'.
    ULINE.
    TOP-OF-PAGE DURING LINE-SELECTION.
    CASE sy-pfkey.
    WHEN 'TEST'.
    WRITE 'Self-defined GUI for Function Codes'.
    ULINE.
    ENDCASE.
    AT LINE-SELECTION.
    SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
    PERFORM out.
    sy-lsind = sy-lsind - 1.
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'FC1'.
    PERFORM out.
    WRITE / 'Button FUN 1 was pressed'.
    WHEN 'FC2'.
    PERFORM out.
    WRITE / 'Button FUN 2 was pressed'.
    WHEN 'FC3'.
    PERFORM out.
    WRITE / 'Button FUN 3 was pressed'.
    WHEN 'FC4'.
    PERFORM out.
    WRITE / 'Button FUN 4 was pressed'.
    WHEN 'FC5'.
    PERFORM out.
    WRITE / 'Button FUN 5 was pressed'.
    ENDCASE.
    sy-lsind = sy-lsind - 1.
    FORM out.
    WRITE: 'Secondary List',
    / 'SY-LSIND:', sy-lsind,
    / 'SY-PFKEY:', sy-pfkey.
    ENDFORM.
    <b>Vendor performance report</b>
    See this sample code
    *"Table declarations...................................................
    TABLES:
    EKKO, " Purchasing Document Header
    CDHDR, " Change document header
    SSCRFIELDS. " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
    S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
    S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
    S_EKGRP FOR EKKO-EKGRP, " Purchasing group
    S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
    S_UDATE FOR CDHDR-UDATE. " Creation date of the change
    " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number *
    DATA:
    BEGIN OF FS_EBELN,
    EBELN(90) TYPE C, " Purchase Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
    " the Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EBELN,
    Field String to hold Purchase Document Header *
    BEGIN OF FS_EKKO,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor *
    BEGIN OF FS_LFA1,
    LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
    NAME1 TYPE LFA1-NAME1, " Name1
    END OF FS_LFA1,
    Field String to hold Change date and the name of the user *
    BEGIN OF FS_CDHDR,
    OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
    OBJECTID TYPE CDHDR-OBJECTID, " Object value
    CHANGENR TYPE CDHDR-CHANGENR, " Document change number
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    END OF FS_CDHDR,
    Field String to hold Change document items *
    BEGIN OF FS_CDPOS,
    OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
    OBJECTID(10) TYPE C, " Object Value
    CHANGENR TYPE CDPOS-CHANGENR, " Document change number
    TABNAME TYPE CDPOS-TABNAME, " Table Name
    FNAME TYPE CDPOS-FNAME, " Field Name
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_CDPOS,
    Field String to hold Date Element Name *
    BEGIN OF FS_DATAELE,
    TABNAME TYPE DD03L-TABNAME, " Table Name
    FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
    ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
    END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element *
    BEGIN OF FS_TEXT,
    ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid *
    BEGIN OF FS_OUTTAB,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    WERKS TYPE LFA1-WERKS, " Plant
    NAME1 TYPE LFA1-NAME1, " Name1
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number *
    T_EBELN LIKE STANDARD TABLE
    OF FS_EBELN,
    Internal table to hold Purchase Document Header *
    T_EKKO LIKE STANDARD TABLE
    OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header *
    T_EKKO_TEMP LIKE STANDARD TABLE
    OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor *
    T_LFA1 LIKE STANDARD TABLE
    OF FS_LFA1,
    Internal Table to hold Change date and the name of the user *
    T_CDHDR LIKE STANDARD TABLE
    OF FS_CDHDR,
    Internal Table to hold Change document items *
    T_CDPOS LIKE STANDARD TABLE
    OF FS_CDPOS,
    Temp. Internal Table to hold Change document items *
    T_CDPOS_TEMP LIKE STANDARD TABLE
    OF FS_CDPOS,
    Internal Table to hold Data Element Name *
    T_DATAELE LIKE STANDARD TABLE
    OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name *
    T_DATAELE_TEMP LIKE STANDARD TABLE
    OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element *
    T_TEXT LIKE STANDARD TABLE
    OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid *
    T_OUTTAB LIKE STANDARD TABLE
    OF FS_OUTTAB.
    C L A S S D E F I N I T I O N *
    CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables *
    DATA:
    W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
    W_VALUE TYPE EKKO-EBELN, " Reflected Value
    W_SPACE VALUE ' ', " Space
    W_FLAG TYPE I, " Flag Variable
    W_VARIANT TYPE DISVARIANT, " Variant
    *--- ALV Grid
    W_GRID TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
    W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
    T_FIELDCAT TYPE LVC_T_FCAT.
    AT SELECTION-SCREEN EVENT *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
    PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
    PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
    PERFORM VALIDATE_PUR_GRP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
    PERFORM SELECT_PO.
    CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
    PERFORM SELECT_OBJ_ID.
    CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
    PERFORM SELECT_CHANGED_VALUE.
    CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
    PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
    PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
    PERFORM DESCRIPTION.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
    PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
    PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
    CALL SCREEN 100.
    ENDIF. " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
    PUBLIC SECTION .
    METHODS:
    HANDLE_HOTSPOT_CLICK
    FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
    IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
    METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
    PERFORM GET_CELL_INFO.
    SET PARAMETER ID 'BES' FIELD W_VALUE.
    CALL TRANSACTION 'ME23N'.
    ENDMETHOD. " HANDLE_HOTSPOT_CLICK
    ENDCLASS. " LCL_EVENT_HANDLER
    *& Module STATUS_0100 OUTPUT
    PBO Event
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'OOPS'.
    SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
    PERFORM FILL_VARIANT.
    IF W_GRID IS INITIAL.
    CREATE OBJECT W_GRID
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = CL_GUI_CONTAINER=>SCREEN0
    I_APPL_EVENTS =
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0
    CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT = W_VARIANT
    I_SAVE = 'A'
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    IT_OUTTAB = T_OUTTAB
    IT_FIELDCATALOG = T_FIELDCAT
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF W_GRID IS INITIAL
    CREATE OBJECT W_EVENT_CLICK.
    SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    PAI Event
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form PREPARE_FIELD_CATALOG
    Subroutine to build the Field catalog
    <--P_T_FIELDCAT Field Catalog Table
    FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
    DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
    LS_FCAT-FIELDNAME = 'EKGRP'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Number...
    LS_FCAT-FIELDNAME = 'EBELN'.
    LS_FCAT-REF_TABLE = 'EKKO' .
    LS_FCAT-EMPHASIZE = 'C411'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-HOTSPOT = 'X'.
    APPEND LS_FCAT TO PT_FIELDCAT .
    CLEAR LS_FCAT .
    Name of Person who Created the Object...
    LS_FCAT-FIELDNAME = 'ERNAM'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-OUTPUTLEN = '15' .
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Date...
    LS_FCAT-FIELDNAME = 'BEDAT'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Vendor's account number...
    LS_FCAT-FIELDNAME = 'LIFNR'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
    LS_FCAT-FIELDNAME = 'NAME1'.
    LS_FCAT-REF_TABLE = 'LFA1'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Vendor Name'(001).
    LS_FCAT-SELTEXT = 'Vendor Name'(001).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Creation date of the change document...
    LS_FCAT-FIELDNAME = 'UDATE'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Change Date'(002).
    LS_FCAT-SELTEXT = 'Change Date'(002).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    User name of the person responsible in change document...
    LS_FCAT-FIELDNAME = 'USERNAME'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Modified by'(003).
    LS_FCAT-SELTEXT = 'Modified by'(003).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
    LS_FCAT-FIELDNAME = 'DDTEXT'.
    LS_FCAT-REF_TABLE = 'DD04T'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '15'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Old contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_OLD'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    New contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_NEW'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    ENDFORM. " PREPARE_FIELD_CATALOG
    *& Form SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
    SELECT EBELN " Purchasing Document Number
    ERNAM " Name of Person who Created
    " the Object
    LIFNR " Vendor's account number
    EKGRP " Purchasing group
    BEDAT " Purchasing Document Date
    FROM EKKO
    PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
    WHERE EBELN IN S_EBELN
    AND BEDAT IN S_BEDAT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S401(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDFORM. " SELECT_PO
    *& Form SELECT_OBJ_ID
    Subroutine to select Object ID
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
    SELECT OBJECTCLAS " Object Class
    OBJECTID " Object value
    CHANGENR " Document change number
    USERNAME " User name
    UDATE " Creation date
    FROM CDHDR
    INTO TABLE T_CDHDR
    FOR ALL ENTRIES IN T_EBELN
    WHERE OBJECTID EQ T_EBELN-EBELN
    AND UDATE IN S_UDATE
    AND TCODE IN ('ME21N','ME22N','ME23N').
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Header Not Found'(031).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EBELN IS INITIAL
    ENDFORM. " SELECT_OBJ_ID
    *& Form SELECT_CHANGED_VALUE
    Subroutine to select Changed Values
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
    SELECT OBJECTCLAS " Object class
    OBJECTID " Object value
    CHANGENR " Document change number
    TABNAME " Table Name
    FNAME " Field Name
    VALUE_NEW " New contents of changed field
    VALUE_OLD " Old contents of changed field
    FROM CDPOS
    PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
    FOR ALL ENTRIES IN T_CDHDR
    WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
    AND OBJECTID EQ T_CDHDR-OBJECTID
    AND CHANGENR EQ T_CDHDR-CHANGENR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Item Not Found'(032).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_CDHDR IS INITIAL
    T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM. " SELECT_CHANGED_VALUE
    *& Form SELECT_PUR_DOC
    Subroutine to select Purchase Order Details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_EBELN BY EBELN.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
    FS_CDPOS-OBJECTID BINARY SEARCH.
    IF SY-SUBRC NE 0.
    DELETE TABLE T_EBELN FROM FS_EBELN.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDLOOP. " LOOP AT T_CDPOS...
    LOOP AT T_EBELN INTO FS_EBELN.
    MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
    MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
    MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
    MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
    MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
    APPEND FS_EKKO TO T_EKKO.
    ENDLOOP. " LOOP AT T_EBELN...
    T_EKKO_TEMP[] = T_EKKO[].
    ENDIF. " IF NOT T_CDPOS IS INITIAL
    ENDFORM. " SELECT_PUR_DOC
    *& Form SELECT_VENDOR
    Subroutine to select Vendor details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
    IF NOT T_EKKO IS INITIAL.
    SORT T_EKKO_TEMP BY LIFNR.
    DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
    SELECT LIFNR " Account Number of Vendor or
    " Creditor
    NAME1 " Name 1
    FROM LFA1
    INTO TABLE T_LFA1
    FOR ALL ENTRIES IN T_EKKO_TEMP
    WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
    IF SY-SUBRC NE 0.
    MESSAGE S002(M8) WITH 'Master Details'(033).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EKKO IS INITIAL
    ENDFORM. " SELECT_VENDOR
    *& Form DESCRIPTION
    Subroutine to get the description
    There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_CDPOS_TEMP BY TABNAME FNAME.
    DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
    SELECT TABNAME " Table Name
    FIELDNAME " Field Name
    ROLLNAME " Data element
    FROM DD03L
    INTO TABLE T_DATAELE
    FOR ALL ENTRIES IN T_CDPOS_TEMP
    WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
    AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
    IF NOT T_DATAELE IS INITIAL.
    T_DATAELE_TEMP[] = T_DATAELE[].
    SORT T_DATAELE_TEMP BY ROLLNAME.
    DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
    SELECT ROLLNAME " Data element
    DDTEXT " Short Text Describing R/3
    " Repository Objects
    FROM DD04T
    INTO TABLE T_TEXT
    FOR ALL ENTRIES IN T_DATAELE_TEMP
    WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
    AND DDLANGUAGE EQ SY-LANGU.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_DATAELE IS INITIAL.
    ENDIF. " IF NOT T_CDPOS IS INITIAL.
    ENDFORM. " DESCRIPTION
    *& Form FILL_OUTTAB
    Subroutine to populate the Outtab
    There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
    SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
    SORT T_EKKO BY EBELN.
    SORT T_LFA1 BY LIFNR.
    SORT T_DATAELE BY TABNAME FIELDNAME.
    SORT T_TEXT BY ROLLNAME.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
    OBJECTCLAS = FS_CDPOS-OBJECTCLAS
    OBJECTID = FS_CDPOS-OBJECTID
    CHANGENR = FS_CDPOS-CHANGENR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
    MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
    READ TABLE T_EKKO INTO FS_EKKO WITH KEY
    EBELN = FS_CDHDR-OBJECTID
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
    MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
    MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
    MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
    MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
    READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
    LIFNR = FS_EKKO-LIFNR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
    MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
    READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
    TABNAME = FS_CDPOS-TABNAME
    FIELDNAME = FS_CDPOS-FNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    READ TABLE T_TEXT INTO FS_TEXT WITH KEY
    ROLLNAME = FS_DATAELE-ROLLNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    APPEND FS_OUTTAB TO T_OUTTAB.
    CLEAR FS_OUTTAB.
    ENDLOOP.
    ENDFORM. " FILL_OUTTAB
    *& Form GET_CELL_INFO
    Subroutine to get the Cell Information
    --> W_VALUE Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
    CALL METHOD W_GRID->GET_CURRENT_CELL
    IMPORTING
    E_ROW =
    E_VALUE = W_VALUE
    E_COL =
    ES_ROW_ID =
    ES_COL_ID =
    ES_ROW_NO =
    ENDFORM. " GET_CELL_INFO
    *& Form VALIDATE_PD_NUM
    Subroutine to validate Purchase Document Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
    IF NOT S_EBELN[] IS INITIAL.
    SELECT EBELN " Purchase Document Number
    FROM EKKO
    INTO W_EBELN
    UP TO 1 ROWS
    WHERE EBELN IN S_EBELN.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E717(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EBELN[]...
    ENDFORM. " VALIDATE_PD_NUM
    *& Form VALIDATE_VEN_NUM
    Subroutine to validate Vendor Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
    IF NOT S_LIFNR[] IS INITIAL.
    SELECT LIFNR " Vendor Number
    FROM LFA1
    INTO W_LIFNR
    UP TO 1 ROWS
    WHERE LIFNR IN S_LIFNR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E002(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_LIFNR[]...
    ENDFORM. " VALIDATE_VEN_NUM
    *& Form VALIDATE_PUR_GRP
    Subroutine to validate the Purchase Group
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
    IF NOT S_EKGRP[] IS INITIAL.
    SELECT EKGRP " Purchase Group
    FROM T024
    INTO W_EKGRP
    UP TO 1 ROWS
    WHERE EKGRP IN S_EKGRP.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E622(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EKFRP[]...
    ENDFORM. " VALIDATE_PUR_GRP
    *& Form FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
    W_VARIANT-REPORT = SY-REPID.
    W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM. " FILL_VARIANT
    <b>Reward if usefull</b>

Maybe you are looking for

  • OS X 10.5 Leopard - Installation error message "No software to install"

    Hello, I am trying to upgrade my Intel iMac (Early 2006) from OS X 10.4.11 to Leopard OS X 10.5. I insert the Leopard DVD and installation begins after restarting. The DVD consistency check runs fine but as soon as installation commences a yellow exc

  • N8 Update Problem

    Hello, I have recently updated my N8 and since then i am having two problems,  1- The gallery is not showing me any new photos that i take, or videos that i record. 2- The top part of main screen gets stuck sometimes, like from the signal strength ba

  • Why is the music clip marked with a yellow warning sign?

    While browsing my project library today, I noticed that every music clip associated with a particular project is marked with a yellow "warning" triangle (with an exclamation point in the center). What's worse, the music won't play. I had previously u

  • How to keep JRE updated on clients

    I deal with multiple clients, and it's a real pain trying to keep Java updated. In particular the users don't have administrative access, so they can't update directly. Those I give administrative access to updatet will usually install the various to

  • Web upload and download

    Can Apple add support for upload and download function on iOS Safari? I know Apple will have restriced access to its storage, but upload/download from or to DropBox maybe be the best solution. When click the upload link, it can chose file from DropBo