Modification of values of variant through program for tcode CJB1

hi,
How can we modify variant values for the variant created in TCODE CJB1 and also how to get the variant name saved for tcode CJB1 ? is there any FM available or any sample code for getting/changing the above senario.
many thanks in advance
bobby

check these fm's
RS_ALL_VARIANTS_4_1_REPORT     All Variants for a Report
RS_CHANGE_CREATED_VARIANT
RS_CREATE_VARIANT              Creating a variant (not using a selection screen)
RS_GET_SCREENS_4_1_VARIANT     All screens assigned to a variant
RS_RWSET_CREATE_VARIANT
RS_RWSET_SAVE_VARIANT
RS_VARIANT_ADD
RS_VARIANT_ADMIN_DATA
RS_VARIANT_ATTR_SAVE
RS_VARIANT_CATALOG             Returns variant directory for a report in an internal table
RS_VARIANT_CAT_PRINT
RS_VARIANT_CHANGE              Change Variant
RS_VARIANT_CHECK_TSTC          Checks entries in report transaction maintenance
RS_VARIANT_CLIENTCOPY          Function Module for Client Copy
RS_VARIANT_CONTENTS
RS_VARIANT_CONVERT_TO_DYNAMIC
RS_VARIANT_COPY                Copy variant
RS_VARIANT_DELETE              Delete Variant (In Current Client or All Clients)
RS_VARIANT_DEL_ALL_CLIENTS
RS_VARIANT_DISPLAY
RS_VARIANT_DISPLAY_FROM_SELSCR
RS_VARIANT_DISPLAY_SUBSCREENS
RS_VARIANT_EXISTS              Checks whether variant exists
RS_VARIANT_FETCH

Similar Messages

  • How can I findout the coulm value contains 0 through 9 for the table

    could u plz suggest me how can I findout the coulm value contains <> 0 through 9 for the table...

    Well I am going to give it a shot, because I believe I am looking for the same thing.
    I have a value that is of type varchar2. How can I determine if it has special characters or alpha characters in it? In other words, I only want the value to consist of numbers. (Initially it had been thought that Letters would be used as well, but now they just want numbers and the datatype of the column cannot be altered since there is data in it.)
    I have gotten this far, but I do not know what else I can use besides '[:alpha:]'? I cannot seem to find this documented anywhere...I can find the regexp package reference, but not the character classes...
    select regexp_instr('1a23456', '[[:alpha:]]',1,1,1, 'i') x
    from dual
    This works fine = returns 3, so I know there is an alpha character.
    select regexp_instr('1$23456', '[[:alpha:]]',1,1,1, 'i') x
    from dual
    This returns 0 - what do I need to change so that it detects the '$' and returns 3?
    Thanks!!
    Janel

  • Managing Program Variants through program

    Hi,
    I used the function modules RS_VARIANT_CONTENTS to load the program variants and RS_CHANGE_CREATED_VARIANT to change the variants. The program is working fine but I have a problem with the length of the field. The VARI_CONTENTS table for the function modules has the fields LOW (CHAR 45) and HIGH(CHAR 45) which hold the values for the fields(parameter or select-options). But the value of the field being more than 45 chars is being truncated while saving the variants through these function modules.
    But when I change directly through GOTO->VARIANTS and then save the value, Its accepting the field value with more than 45 chars. Please do the needful at the earliest possible.
    Thanks in Advance.
    Regards,
    Raj.

    Hi,
    I used the function modules RS_VARIANT_CONTENTS to load the program variants and RS_CHANGE_CREATED_VARIANT to change the variants. The program is working fine but I have a problem with the length of the field. The VARI_CONTENTS table for the function modules has the fields LOW (CHAR 45) and HIGH(CHAR 45) which hold the values for the fields(parameter or select-options). But the value of the field being more than 45 chars is being truncated while saving the variants through these function modules.
    But when I change directly through GOTO->VARIANTS and then save the value, Its accepting the field value with more than 45 chars. Please do the needful at the earliest possible.
    Thanks in Advance.
    Regards,
    Raj.

  • Custom program for Tcode MIR6

    Hello All,
    I have created a Zprogram for the Tcode MIR6. Activated sucessfully. But when executed getting dump.
    Please suggest me to correct this issue.
    Runtime Errors         SUBMIT_WRONG_TYPE
    Short text                 Incorrect program type with SUBMIT.
    Tried to correct the issue below but unfortunately unsucessful.
    You attempted to start the ABAP/4 program "YSAPMM08N" with SUBMIT, but the
    attributes specify this program as type "M" instead of "1". You can
    only start programs of type 1 with SUBMIT.
    Best Regards,
    Jai
    Moderator message: very descriptive error message, please do some own research before posting, read SAP documentation for SUBMIT statement and program attributes.
    Edited by: Thomas Zloch on Jan 19, 2012

    1. PSAVE-FIELDNAME will use the old values in the FIELD. It will be used in cases when we have to do plausibility checks on the basis of new as well as old value, eg, we want to use dynamic action for employees whose status changes from 'inactive' to 'active'
    2. Sequence no represents sequence no. If for a particular Infotype and FCode, we have to specify which step has to be performed first. Sequence no tells the system exactly this thing.
    Regards
    Lincoln

  • Controls access through program not proper

    VIs developed in LabVIEW 6i has button controls whose T/F boolean values are controlled through program and the control is used as a button as well. When the same VI is run after installing DSC this button control values cannot be changed through the program.

    Hi,
    Can you please attach a sample VI which exhibits this problem?
    Thanks,
    Khalid

  • Change a query variant using a program for APD

    Hello everyone,
    Some background:
    We have a complex reporting based on calculated key figures (CKF). However, the business rules do change over time, and the formulas for CKF get outdated. So the business meaning of CKF remains the same, but the way it gets calculated - changes.
    Yesterday CKF "A" = B + C
    Today CKF "A" = B + D - F
    Since the customer requires reporting for the former periods, maintaining several CKF of the same business meaning but calculated differently for each period becomes a problem.
    Instead of having several versions of CKF "A", we decided to use APD, to periodically run the query with valid CKF, save the query results to transactional ods, then move it to another infocube. Now we will have the infocube with figures and dates, and the customer needs to maintain just one CKF "A".
    After trying this out we've encountered following issue:
    Since the query will run periodically we must use a time period filter (in fact - variable on a time characteristic - APD is not working with filter) to select CKF valid for this month for example.
    The query in APD can work with variables only via query variants.
    Now, the question is how to change the query variant automatically?
    We can not force the customer to create new query variants each month for dozens of reports.
    We plan to integrate APD in the process chain (although we haven't check how it works), where the query variant will be changed using a program.
    so please advice:
    1) is there any function module to change query variants in the background
    2) which tables contain the query variant, so we can change it using abap
    3) may be you can suggest other options to make it work
    thank you
    Message was edited by:
            Northern

    Hi,
    here it is.
    write this code in SE38.
    REPORT  ZDATE_CAL..
    DATA: itab_tvarvc like tvarvc,
          l_date like sy-datum,
          l_monthyear_low type /BI0/OICALMONTH,
          l_monthyear_high type /BI0/OICALMONTH,
          l_day(2) type c,
          l_month(2) type c,
          l_year(4) type c,
          l_mandt(3) TYPE c VALUE '010',
          l_type(1) type c VALUE 'S',
          l_numb(4) type N value '0000'.
          l_day = sy-datum+6(2).
          l_month = sy-datum+4(2).
          l_year = sy-datum+0(4).
          concatenate l_day l_month l_year into l_date.
          concatenate '01' l_year into l_monthyear_low.
          concatenate l_month l_year into l_monthyear_high.
    variable for current month interval
    itab_tvarvc-mandt = l_mandt.
    itab_tvarvc-name  = 'ZDATE_INV'.
    itab_tvarvc-type  = l_type.
    itab_tvarvc-numb  = l_numb.
    itab_tvarvc-sign  = 'I'.
    itab_tvarvc-opti  = 'BT'.
    itab_tvarvc-low   = l_monthyear_low.
    itab_tvarvc-high  = l_monthyear_high.
    update TVARVC from itab_tvarvc.
    This code will always maintain the entry for the variable 'ZDATE_INV' as range from the start of month till current month.
    you can modify it store anything yuou want.
    Now when creating the variant by clicking the create variant option when running the query.
    you have the option in the "selection variable" column here you will find only TVARVC table as option select it and then in "name of variable" use the Z variable you have just created.
    This will automatically pick the current value for the variant for that variable.
    So anytime the variant is used in any of the scheduling it will pick the inout from here.
    make sure that the variable for time interval is of same type as that of the entry in the TVARVC table.
    That if it is of type calmonth then TVARVC table should have variable entry of type calmonth.
    thanks

  • ABAP program for wage type variant report

    Hi experts,
    plz any one sen me the ABAP program for to create wage type variant report plz.
    Thanks
    Rajesh.

    Requesting for code is against forum rules. Please read the rules of the forum before posting.

  • Will somebody provide me with a QBASIC 4.5 PROGRAM for Interfacing with a Anritsu make(model-MS710) Rf spectrum analyser through GPIB ( NI-488.2 ) in DOS environment? I would like to aquire from the instrument and save the data in PC.the data

    Will somebody provide me with a QBASIC 4.5 PROGRAM for Interfacing with an Anritsu make(model-MS710) RFspectrum analyser through GPIB ( NI-488.2 ) in DOS environment? I would like to aquire data from the instrument and save it in PC for printing purpose.

    Hello,
    Unfortunately I was unable to find a driver for this instrument. This leaves you with one of a couple options. First, I would like you to submit a request for this driver at:
    http://www.ni.com/devzone/idnet/other.htm
    We develop drivers in CVI and LabVIEW based on demand and popularity so the more requests we have for it, the greater the possibility that we will develop one. While this would not provide you with a QBASIC program, you may be able to create a DLL that you could call from QBASIC.
    If you would like to try developing your own instrument driver (or modify the existing one), we have documentation, model instrument drivers, and driver templates to help at :
    http://www.ni.com/devzone/idnet/development.htm
    We also have a syndica
    te of third party vendors that specialize in National Instruments' products and services. Some of the vendors specialize in driver development. I would suggest contacting one of the Alliance members at:
    http://www.ni.com/alliance
    Good Luck,
    Kim L.
    Applications Engineer
    National Instruments

  • Transaction  for triggering  of  form through print program for FI

    Hi,
    I went in table T001F. Now I see couple of programs and forms asscoaited with it.
    Now lets say program RFKQST20 and associated form is F_RFKQST20_CO_02. Now how do I know what transaction I can test the triggering i.e printing of this form thorugh its print program  ?

    Mostly in FI the print programs themself are driver programs for printing outputs. You can directly execute print programs such as RFKQST20 to issue outputs. If you want to find out trnsaction associated, do a where used for trnsactions and find out.
    Thanks,
    Shashi Reddy

  • Variable values in Variant

    Hi Gurus,
    I want to create one variant for transaction 'FPB3' so that i can pass different 'Identification' and 'filename' each time under the same variant to a background job.
    Is there any possible way to pass the variable values of fields in an variant of FPB3 transaction.
    Your help is appreciated.
    Thanks 'n Regards,
    Ashwani

    Ashwani,
    You can create an entry TVARV table with that variant   When u create a variant variable(in the tcode STVARV) of type select option and chose different selections(Include single values, Include range, exclude single values, exclude range) through multiple selections button, then a separate entry will be created in the database table TVARVC(with a different NUMB value) for each selection made in multiple selections dialog box .You can access this table in your program while executing the in background.
    Hope this helps
    Veera

  • Job scheduling(passing the values to the child program)

    when i'm trying to schedule a background job(using job_open job_submit and job_close) i'm passing the values of the selection screen(parent program) to my child program using set parameter id. And trying to get the values using get parameter id in the cild program.
    But the values of the parent program are not being passed to the child program what may be the cause for it?

    rathan,
    Why con't you use
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    When you start an executable program, the standard selection screen normally appears, containing the selection criteria and parameters of both the logical database connected to the program and of the program itself (see Direct Execution - Reports). When you start an executable program using SUBMIT, there are various additions that you can use to fill the input fields on the selection screen:
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    These options have the following effects:
    VIA SELECTION-SCREEN
    The selection screen of the called executable program (report) appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values. By default, the system does not display a selection screen after SUBMIT.
    USING SELECTION-SET <var>
    This option tells the system to start the called program with the variant <var>.
    WITH <sel> <criterion>
    Use this option to fill individual elements <sel> of the selection screen (selection tables and parameters). Use one of the elements <criterion>:
    <op> <f> [SIGN <s>], for single value selection
    If <sel> is a selection criterion, use <op> to fill the OPTION field, <f> to fill the LOW field, and <s> to fill the SIGN field of the selection table <sel> in the called program.
    If <sel> is a parameter, you can use any operator for <op>. The parameter <sel> is always filled with <f>.
    [NOT] BETWEEN <f1> AND <f2> [SIGN <s>], for interval selection
    <f1> is transferred into the LOW field, <f2> into the HIGH field, and <s> into the SIGN field of the selection table <sel> in the called program. If you omit the NOT option, the system places the value BT into the OPTION field; if you use NOT, the system fills OPTION with NB.
    IN <seltab>, transferring a selection table
    This addition fills the selection table <sel> in the called program with the values of the table <seltab> in the calling program. Table <seltab> must have the structure of a selection table. Use the RANGES statement to create selection tables.
    WITH FREE SELECTION <freesel>, user dialog for dynamic selections
    To use this option, the called program must be connected to a logical database that supports dynamic selections. In the calling program, use the function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. They allow the user to enter dynamic selections on a selection screen. One export parameter of these function modules has structure RSDS_TEXPR from the RSDS type group. Transfer the values of this export parameter by means of the internal table <freesel> of the same structure to the called report.
    WITH SELECTION-TABLE <rspar>, dynamic transfer of values
    You need an internal table <rspar> with the Dictionary structure RSPARAMS. The table then consists of the following six fields:
    SELNAME (type C, length 8) for the name of the selection criterion or parameter
    KIND (type C, length 1) for the selection type (S for selection criterion, P for parameter)
    SIGN, OPTION, LOW, HIGH as in a normal selection table, except that LOW and HIGH both have type C and length 45.
    This table can be filled dynamically in the calling program with all of the required values for the selection screen of the called program. If the name of a selection criterion appears more than once, the system creates a multiple-line selection table for that criterion in the called program. If the name of a parameter appears more than once, the system uses the last value. Note that LOW and HIGH have type C, so that the system executes type conversions to the criteria of the called program. This is important for date fields, for example. Before your program is used in a live context, you should check it using the VIA SELECTION-SCREEN addition.
    Except for WITH SELECTION-TABLE, you can use any of the above options several times and in any combination within a SUBMIT statement. In particular, you can use the WITH <sel> option several times for one single criterion <sel>. In the called program, the system appends the corresponding lines to the selection tables used. For parameters, it uses the last value specified. The only combination possible for the WITH SELECTION-TABLE option is USING SELECTION-SET.
    If the input fields on the selection screen are linked to SPA/GPA parameters, you can also use this technique to pass values to the selection screen (see Passing Data Between Programs).
    The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:
    REPORT  demo_program_submit_rep1.
    DATA number TYPE i.
    PARAMETERS      paramet(14) TYPE c.
    SELECT-OPTIONS  selecto FOR number.
    The program DEMO_PROGRAM_SUBMIT_REP1 is called by the following program using various parameters:
    REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
    DATA: int TYPE i,
          rspar TYPE TABLE OF rsparams,
          wa_rspar LIKE LINE OF rspar.
    RANGES seltab FOR int.
    WRITE: 'Select a Selection!',
    SKIP.
    FORMAT HOTSPOT COLOR 5 INVERSE ON.
    WRITE: 'Selection 1',
         / 'Selection 2'.
    AT LINE-SELECTION.
      CASE sy-lilli.
        WHEN 4.
          seltab-sign = 'I'. seltab-option = 'BT'.
          seltab-low  = 1.   seltab-high   = 5.
          APPEND seltab.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH paramet eq 'Selection 1'
                          WITH selecto IN seltab
                          WITH selecto ne 3
                          AND RETURN.
        WHEN 5.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
          wa_rspar-low  = 14.  wa_rspar-high = 17.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
          wa_rspar-low  = 'Selection 2'.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
          wa_rspar-low  = 10.
          APPEND wa_rspar TO rspar.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          AND RETURN.
      ENDCASE.
    Pls. reward if useful...

  • How to suppress "enter parameter values" screen in crystal reports for Visu

    Hi,
        I am passing parameters to the report through program.  But still the "Enter Parameter Values" Dialog is shown every time I run the application.  Code used to pass parameters is given below:
                    rptCBBookRpt objRptCBBook = new rptCBBookRpt();
                    objRptCBBook.SetParameterValue("@Branch", strBranch);
                    objRptCBBook.SetParameterValue("@CoName", mdlFinIF.objCommon.CoName);
                    objRptCBBook.SetParameterValue("@Heading", strHeading);
                    objRptCBBook.SetParameterValue("@UserInfo", mdlFinIF.objCommon.ReportInfo());
    How can I suppress the "Enter Parameter Values" dialog.  Please help.
    Cris Evan

    Well, no. But this being a community, not technical support, you may get a response, perhaps even an actual answer, or you may not...
    If you are not getting a response or an answer, you may want to consider obtaining a dedicated support here:
    http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyVkAAAAR&rests=1282226845369
    Look at samples here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Check out the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23] - it will apply to your version of CR...
    And of course, developer help files.
    - Ludek

  • XL reporter error-requried COM add-in program for XL reporter has not ben l

    Dear All,
    I am getting this error could anyone please let me know the solution:
    "A requried COM add-in program for XL reporter has not been Loded and prohibuit Microsoft Excel from running.

    Hi,
    try to use the solution from the SAP note 893307:
    XLR - Activation of Other Microsoft Excel Add-Ins
    Symptom
    When Microsoft Excel is launched from within the XL Reporter application, other add-ins selected in Microsoft Excel's Add-Ins window are not automatically loaded into Microsoft Excel upon start.
    Other terms
    XLR, Business One, Addins, deactivated
    Reason and Prerequisites
    When Microsoft Excel is started through Automation (COM), Add-ins are not loaded by default. This is by design and XL Reporter follows this behaviour.
    The following is a workaround solution that is avalible in SAP Add-On XL Reporter 2004 SP02 patch 2 and SAP Add-On XL Reporter 2005 SP00 patch 1 and subsequent releases.
    Solution
    If you need to have other add-ins automatically loaded upon start, a workaround solution is now possible:
    In the Microsoft Registry Editor on your client machine, change the following settings in your system registry: in the registry tree underHKEY_CURRENT_USER/Software/iLytix/XLReporter/Settings/SBOOEM, add a key with the following name: StartExcelAddins. The key can have two values: the value, 1, which activates other add-ins upon start, and the default value, 0, which leaves the other add-ins inactivated.
    Incorrectly editing the registry may damage your system. System registry changes should therefore only be performed by an advanced user who is prepared to both edit and restore the registry. For details about the system registry, please refer to Microsoft Registry Editors help system
    if not solve yet, just let me know
    JimM

  • Variant transaction ZMM42 for one view: Logistics: Distribution Center

    Hi All!
    I have to create for tCode MM42 a variant (ZMM42) and authorize some users only for ZMM42 (in order to modify only Storage data).
    I read about the solution of Ralf Nellesen in thread How create a custom profile on SU02, with only one view? .
    But I can't create an entry for my transaction in OMT3E in order that the new screen sequence will be called for transaction ZMM42. I can't create this entry because I don't know how to create a new Transaction screen reference (table T130M). If I use tCode SM30 for table VCM_T130M I can only modify the entries and I can't add a new entry for:
    ZMM42     Change Material &    04
    (04 is a new transaction screen reference)
    Can anybody help me? I'm getting stuck...
    Regards.
    Florina

    Hi,
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    Regards,
    Ram

  • PROGRAM FOR INTERACTIVE ALV REPORT

    Hi frens,
      this is my 3rd query to this forum. the response of this forum is excellent.now my question is :
    whats the source code(or program) for Interactive ABAP List Viewer(ALV)  reports connecting KNA1 as basic list and VBAK, VBAP as the seconday lists...having the relation between KNA1 and VBAK with KUNNR and VBAK and VBAP with VBELN as key fields.

    Hi Prasad
    <u><b>For More alv report examples check these Tcodes <i>LIBS, BIBS</i> Here u can find more number of examples on alv reports of different kinds
    check this sample code for intercative alv report</b></u>
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    * declaration for events table where user comand or set PF status will
    * be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    * declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    * declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
    *       Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
    *   we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    *  EXCEPTIONS
    *    LIST_TYPE_WRONG       = 1
    *    OTHERS                = 2
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
    *      Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
    *   retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
    *       text
    *      -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
    *       text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
    *   I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         = ALV_LAYOUT
         IT_FIELDCAT                       = I_FIELDCAT[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *     i_default                         = 'ZLAY1'
         I_SAVE                            = 'A'
    *     is_variant                        = i_variant
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "display_alv_report
    *&      Form  TOP_OF_PAGE
    *       text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
    *    i_logo                   =
    *    I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM    text
    *      -->,          text
    *      -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
    *       text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
    *   we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    * EXCEPTIONS
    *   LIST_TYPE_WRONG       = 1
    *   OTHERS                = 2
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
    *        Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
    *       text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
    *    i_logo                   =
    *    I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM    text
    *      -->,          text
    *      -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKPO
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         =
       IT_FIELDCAT                       = I_FIELDCAT[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         =
       I_SAVE                            = 'A'
    *   IS_VARIANT                        =
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_EKPO
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Reward all helpfull answers
    Regards
    Pavan

Maybe you are looking for