Select-option in ABAP objects

Hi Guys,
           I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very important

check this code
REPORT ZSELOPT_TO_CLASS .
TABLES: VBRK.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
DATA: IT_VBELN TYPE RSELOPTION.
DATA: X_VBELN TYPE RSDSSELOPT.
CLASS C1 DEFINITION.
PUBLIC SECTION.
DATA: IT_VBRP TYPE VBRP_TAB,
      X_VBRP LIKE LINE OF IT_VBRP.
METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
METHODS: DISP_DATA.
ENDCLASS.
CLASS C1 IMPLEMENTATION.
METHOD GET_DATA.
  *SELECT * FROM VBRP*
   INTO TABLE IT_VBRP
   WHERE VBELN IN S_VBELN.
ENDMETHOD.
METHOD DISP_DATA.
  LOOP AT IT_VBRP INTO X_VBRP.
    WRITE:/ X_VBRP-VBELN,
            X_VBRP-POSNR.
  ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA OBJ TYPE REF TO ZCL_SELOPT.
CREATE OBJECT OBJ.
LOOP AT S_VBELN.
  MOVE S_VBELN-LOW TO X_VBELN-LOW.
  MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
  MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
  MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
  APPEND X_VBELN TO IT_VBELN.
ENDLOOP.
CALL METHOD OBJ->GET_DATA
                    EXPORTING
                      S_VBELN = IT_VBELN.
CALL METHOD OBJ->DISP_DATA.
Edited by: moazam hai on May 17, 2008 6:17 AM
Edited by: moazam hai on May 17, 2008 6:19 AM

Similar Messages

  • Re : select-options in abap-objects program

    Dear friends,
                      I want to give select-options in abap-objects program. How to give that.
                                 Thanking You
    with regards,
    Mani

    In the transaction SE24, enter your class name, click modify.
    in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
    " P_SAKNR FOR SKAT-SAKNR".
    you've got to declare two types in the class:
    a- TYPES:  begin of E_S_SAKNR,
                          sign(1),
                          option(2),
                          low(10),
                          high(10),
                      end of E_S_SAKNR.
    b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
    so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
    method TEST importing ET_SAKNR type E_T_SAKNR.
    now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example..

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • How to set default value in select option for ABAP query

    Hi experts,
    What is the way to set up default values for select-options in ABAP query.
    e.g.
    I have one field 'Year' in my ABAP query selection screen.
    I want value of current year to be appeared here whenever user execute report
    Thanks in Advance
    -Harkamal

    Hi Harkamal,
    execute your Query via SQ01. On Selection-Screen
    goto save Variant. Mark your field
    as selection variable an press Button election variable.
    Take variable from TVARV and use it.
    Than save the Variant.
    Look at TVARV if the 'Year' is updated to the actualYear!
    regards, Dieter

  • How to write text name of parameters / select options in  ABAP list??

    Hi gurus, i must read the text name of parameterd / select options in ABAP program and write it in a list of the same program for log.......how can i do it??
    Thanks in advance!
    Best regards!
    Ferdinando
    Message was edited by:
            Ferdinando Sellitto

    Hello Ferdinandino
    Useful function modules are:
    RS_PRINT_SELECTIONS
    RS_LIST_SELECTION_TABLE (Generates list according to values in selection table(RSPARAMS))
    RS_REFRESH_FROM_SELECTOPTIONS (Current contents of selection screen)
    Function module RS_REFRESH_FROM_SELECTOPTIONS can provide the input for function module RS_LIST_SELECTION_TABLE.
    Regards
      Uwe

  • Programming a select option in abap webdynpro

    Dear Gurus,
    I have used a select option in a specific webdynpro, but this select option does not
    enable the same functionalities as select option in SAP GUI.
    As an example, the possibility to upload a file or the clipboard in the multiple
    selection for individual value is not available.
    This is really a problem for my  customer.
    Any solution ?
    Thanks in advance.
    F.Alllut
    Moderator message : Post the question in Web Dynpro forum. Thread locked.
    Edited by: Vinod Kumar on Jul 11, 2011 7:00 PM

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • Parameters and Select Option in ABAP OO

    Hi all,
    it's possible to build an application starts with a method of a class thats declares parameters and select-option or I have to do it custom creating a dynpro and some input field as parameters?
    thanks
    enzo

    Just to add detail: the function module RS_REFRESH_FROM_SELECTOPTIONS returns a table of TYPE RSPARAMS_TT.
    The structure of this table is:
    SELNAME
    RSSCR_NAME
    KIND
    RSSCR_KIND
    SIGN
    TVARV_SIGN
    OPTION
    TVARV_OPTI
    LOW
    TVARV_VAL
    HIGH
    TVARV_VAL
    the first field is the name of the selection parameter, the others have the same structure obtained declaring a range with:
    TYPES|DATA <rangetab> TYPE RANGE OF <type>.
    see the help topic http://help.sap.com/saphelp_470/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm

  • Multiple Select options

    Hi,
    I have a requirement where i have to use to separate select options but the value of the 2nd Select option is dependant of the value chosen in the first select option.
    For eg:First Select option is for SWCV and 2nd option is for Data Object.
    If you choose S1 as SWCV in first select option then the values in select options for Data object should be populated for Data objects belonging to SWCV "S1" only an not for any other SWCV.
    PS:Points will be awarded

    Hi Sacha,
    Is there any other way in abap web dynpro where i can achieve the above mentioned requirement.The catch here is that the user can enter multiple values.
    Earlier user was allowed to have only one entry in inputfield so OVS used to solve my problem.But with multiple entries i can't do the same thing.

  • Select - Options in BSP

    Hi all,
    I am using F4 help for two input boxes, is it possible for these two input boxes to have the same functionality as that of Select-Options in ABAP/4, where in u can make multiple selections.
    Thanx in Advance.
    Regards,
    Neo.

    it wont work for multiple values, just for ranges.
    two inpufield a) from b)to
    in your application declare a range.
    ranges: user for sy-uname .
    now user will have the same format as select option.
    sign, option, low , high
    Regards
    Raja

  • Passing SELECT-OPTIONS value to Function Module

    Hi,
    I need to pass select-options value to a function module.
    Code is like the following:
    SELECT-OPTIONS seltab FOR object-type.
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    I have found a similar problem in the SDN forum: How to pass select-options parameter to FM?
    However, that could not help me much in solving my problem.
    So far I have tried to created a structure in DDIC with the following components for the select-options:
    SIGN - BAPISIGN
    OPTION - BAPIOPTION
    LOW - ZBWOBJECTTYPE (my type)
    HIGH - ZBWOBJECTTYPE (my type)
    and subsequently a table type for this structure which is specified in the "Import" tab of my function module.
    Unfortunately, when I ran the program a runtime exception occured (CALL_FUNCTION_CONFLICT_TYPE).
    Could anyone please help me on this issue?
    Thanks in advance.
    Regards,
    Joon Meng

    Hello Joon,
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    You have defined SELTAB as a SELECT-OPTION.
    So when you pass only SELTAB, the header line is transferred to the FM. When you pass SELTAB[] the whole table(range) is passed.
    It is similar to the concept of an internal table with header line.
    Hope i am clear.
    Anyways how have you defined result_tab and sel_tab ?
    BR,
    Suhas

  • Multiple Single Values with Select Options

    hi,
    I'm using the SELECT_OPTIONS to accept the multiple input values through CREATE_RANGE_TABLE and it is working well but
    1) i have requirement for some input fields that should accept multiple single values means without RANGES(From .. To).. Usually we achieve this by statement SELECT-OPTIONS in ABAP,  could you help me out how i can achieve same functionality in webdynpro application.
    2) i'm using dictionary search helps for WD4A, here i need to select multiple rows in the F4 results.
    kindly provide suggestion how to achieve above functionalities.
    thanks,
    gupta.

    Hi , make the ls_rsoptions-eq eq abap_true .. this disable the multiple value selection
    data: ls_complex_restrictions type if_wd_select_options=>t_complex_restrictions,
               ls_rsoptions                    type rsoptions.
      clear ls_rsoptions.
      ls_rsoptions-bt = abap_false.
      ls_rsoptions-cp = abap_false.
      *ls_rsoptions-eq = abap_true.   " for enable only single value* 
    ls_rsoptions-ge = abap_false.
      ls_rsoptions-gt = abap_false.
      ls_rsoptions-le = abap_false.
      ls_rsoptions-lt = abap_false.
      ls_rsoptions-nb = abap_false.
      ls_rsoptions-ne = abap_false.
      ls_rsoptions-np = abap_false.
      ls_complex_restrictions-m_exclude = ls_rsoptions.
      clear ls_rsoptions .
      ls_rsoptions-bt = abap_false.
      ls_rsoptions-cp = abap_false.
      *ls_rsoptions-eq = abap_true.   "  for enable only single value*
      ls_rsoptions-ge = abap_false.
      ls_rsoptions-gt = abap_false.
      ls_rsoptions-le = abap_false.
      ls_rsoptions-lt = abap_false.
      ls_rsoptions-nb = abap_false.
      ls_rsoptions-ne = abap_false.
      ls_rsoptions-np = abap_false.
      ls_complex_restrictions-m_include = ls_rsoptions.
    wd_this->m_handler->ADD_SELECTION_FIELD(
        I_ID                         =  typename
        I_DESCRIPTION                = 'N length 5'
        IT_RESULT                    = lt_range_table
        I_COMPLEX_RESTRICTIONS       = ls_complex_restrictions
        I_USE_COMPLEX_RESTRICTION    = ABAP_TRUE
        I_NO_EXTENSION               = ABAP_false
        I_NO_INTERVALS               = ABAP_TRUE ).
    for result see this screen shot from the below URL , hope this is your requirement
    [http://i35.tinypic.com/2u8ckno.jpg|http://i35.tinypic.com/2u8ckno.jpg]
    Regards
    Chinnaiya P

  • Set multi select-options

    Hi,
    Do you know how to set multi select-options in ABAP, i know i can use default to set single value. but is it possible set multi value for select-options. Thanks

    Hi ,
    Just like Rich Heilman said,
    with a litle modification:
    select-options: s_datum for sy-datum.
    initialization.
    s_datum-sign = 'I'.
    s_datum-option = 'BT'.
    s_datum-low = sy-datum.        s_datum-high = sy-datum+30.    append s_datum.
    s_datum-low = sy-datum + 1.  s_datum-high = sy-datum+31.    append s_datum.
    s_datum-low = sy-datum + 2.  s_datum-high = sy-datum+32.    append s_datum.
    s_datum-low = sy-datum + 3.  s_datum-high = sy-datum+33.    append s_datum.
    Regards,

  • Abap objects and selection screen

    Hello everybody,
    I am interested in your ways of implementing selection-screens in the style of ABAP Objects.
    In earlier times (when I used to implement ABAP objects in a procedural way) I just put the selection-screen commands in an include or a form routine of my ABAP report. So it was possible to run the report in background.
    Now I read something about selection-screens/dynpros and "separation of concerns" in the book "ABAP Objects" written by Keller. He advises using function groups to encapsulate presentation from logical matters. (Selection-screen commands are in an automatically generated include now). I implemented this way. (ABAP report with a local class, which has a main method, where function module of the function group is called). It works, but i see no chance to run my report in background now.. but I need to run the report in background.
    Does anybody know a solution without deleting function group?
    What do you think is the best way of using selection-screen-commands and ABAP Objects, especially regarding running in background?
    Thx for your advise in advance.
    Kind regards,
    Anne

    Hi Naimesh,
    thx for explanation. I am not sure, if I understood everything in the right way.
    Where do you write the code for building the selection-screen? (PARAMETERS, SELECT-OPTIONS etc.)
    If you write these commands in a class method, you will get a syntax error ( because it's forbidden per definition of ABAP objects). So, am I right assuming that you put the coding just at the beginning of the ABAP report ? And after START-OF-SELECTION-event you start the processing... ?
    Furthermore, I don't really understand why you create an separate class for ALV. I found your "SAP abap help"-blog, where you explained the concept of MVC ((By the way, well done!), but you didn't mention an "ALV class" there..
    Mh.. another question - have you ever combined MVC with object services?
    At the moment I'm working on a software project where I use object services. I created 2 persistent classes via SE24 and one local class in my ABAP Report.
    I don't really see possibility to implement MVC in this project without change very much of coding and class structure...
    In my opinion the M (data&business logic) are my existing global classes and my local class is kind of Controller class?!
    Thx in advance,
    Anne

  • Default Values for Select-options In Webdynpro-ABAP

    Hi Freinds,
    Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP.
    Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View.
    Regards,
    Xavier.P

    Xavier Reddy Penta sent me this question via email and I answered it directly yesterday. Here is the solution that I provided to him, so that it is stored with the original question:
    I believe your problem is that you are not setting the value into the range correctly.  You are setting it directly into the field symbol of the range like such:
    <FS> = L_STRING2.
    But ranges are deep objects. They have four fields: Sign, Option, High, and Low. This is from the online help:
    1.     sign of type c and length 1. The content of sign determines for every row whether the result of the condition formulated in the column is included or excluded in the entire resulting set for all rows. Evaluable values are "I" for include and "E" for exclude.
    2.     option of type c and length 2. option contains the selection option for the condition of the row in form of logical operators. Analyzable operators are "EQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP" if column high is initial, and "BT", "NB" if column high is not initial. With the options "CP" and "NP", the data type of the columns low and high must be of the data type c, and special rules apply for entries on the selection screen.
    3.     low of the data type defined after FOR. This column is designated for the comparison value or the lower interval limitation.
    4.     high of the data type defined after FOR. This column is designated for the upper interval limitation.
    So when you are moving the value into the field symbol you are setting it into the sign column.
    Here is an example of how you can access the components of the range:
    * create a range table that consists of this new data element
        lt_range_table =
          wd_this->lv_sel_handler->create_range_table(
               i_typename = l_typename ).
        IF l_fieldname = 'CARRID'.
          FIELD-SYMBOLS: <tab>         TYPE INDEX TABLE,
                             <struct>      TYPE ANY,
                             <wa>          TYPE ANY,
                             <option>      TYPE char2,
                             <sign>        TYPE char1,
                             <high>        TYPE ANY,
                             <low>         TYPE ANY,
                             <wa_values>   TYPE ANY.
          ASSIGN lt_range_table->* TO <tab>.
          APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
          <sign> = 'I'.
          <option> =  'EQ'.
          <low> = 'AA'.
        ENDIF.

  • Craete a simple abap object to select data from a table and display

    Hi,
    I know the concept of abap objects but i never worked on it,
    can any one give me simple example of how to create an abap object to display data from mara table.also please send me documents or info regd ABAP OBJECTS.
    I want to write a simple report in terms of abap object
    Regards,
    Sowjanya

    hi,
    Here is hte sample program in se38.
    REPORT ZFGLI00003
    *-- Include for data declarations and performs
    include ZFGLI00003_f01.
    *--Include for Classes and their Implementation
    include ZFGLI00003_cl.
    *                selection-screen                                      *
    *-- Selection Values : Block1
    selection-screen begin of block b1 with frame title text-001.
    *--         Ledger
    parameters: p_rldnr  like zzprodnt-rldnr default 'NP'.
    *--         Fiscal year
    parameters: p_ryear  like zzprodnt-ryear.
    *--         Period(month)
    parameters: p_rpmax  like zzprodnt-rpmax.
    selection-screen end of block b1.
    *-- Selection Values : Block2
    selection-screen begin of block b2 with frame title text-002.
    *--              Company ID's
    select-options : s_glcomp  for ZZPRODNT-ROBUKRS .
    *--              Profit Center
    select-options : s_prctr   for ZZPRODNT-RPRCTR .
    *--              Product Assignment
    select-options : s_prasn   for ZZPRODNT-RZZWWZ01 .
    *--              Corporate Brand
    select-options : s_crpbd   for ZZPRODNT-RZZWWZ05 .
    selection-screen end of block b2.
    *-- Selection Values : Block3  Download Options
    selection-screen begin of block b3 with frame title text-003.
    parameters : p_local radiobutton group 1,
                 p_unix  radiobutton group 1,
                 p_path  like rlgrap-filename obligatory
                         default 'C:P20Z_Formatted.txt'(009).
    selection-screen end of block b3.
    *            At Selection-Selection on value-request  for file path    *
    at selection-screen on value-request for p_path.
      if p_unix <> 'X'.
    *-- Getting F4 help for output file
        perform get_filename changing p_path.
      else.
        message i999(zi) with
              'Sorry !! Function not available for UNIX file.'(i01).
      endif.
    *-- At selection screen validations
    at selection-screen on p_path.
      if p_unix <> 'X'.
    *-- Validate local file
        if p_path+1(2) <> ':'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      else.
    *-- Validate unix file
        if p_path+0(1) <> '/'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      endif.
    *                   Initialization                                    *
    initialization.
    *-- Initialize the period
      perform init_period changing p_rpmax p_ryear.
    *                    start-of-selection                               *
    start-of-selection.
      data : o_tm1_intf type ref to lcl_tm1_intf.
      create object o_tm1_intf.
    *-- Extract the data from ZZPRODNT
      call method o_tm1_intf->get_data exporting e_rldnr  = p_rldnr
                                                 e_ryear  = p_ryear
                                                 e_rpmax  = p_rpmax
                                                 e_glcomp = s_glcomp[]
                                                 e_prctr  = s_prctr[]
                                                 e_prasn  = s_prasn[]
                                                 e_crpbd  = s_crpbd[]
                                       importing i_subrc  = v_subrc.
    *   INCLUDE ZFGLI00003_CL                                              *
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf definition.
      public section.
    *-- Data Declaration
        data  : lv_date     type sy-datum,       "Date
                lv_time     type sy-uzeit,       "Time
                lv_count    type i,              "Count for total records
                lv_acsline  type zfgl014-acsline,"ACS line code
                lv_amt_curr type zzprodnt-kslvt, "current month amount
                lv_amt_ytd  type zzprodnt-kslvt, "YTD Amount
                lv_check,                        "check if any record is
                                                 "downloaded
                lv_msg(100),                     "message
                lv_count_s(5)  ,                 "Count for total(char)
                lv_amt_curr_s(23),               "Current month amount(char)
                lv_amt_ytd_s(23),                "YTD Amount(char)
                lv_ksl_pd(17),                   "KSLxx
                lv_period(2) type n.             "month(period)
    *-- Types Declaration
        types : ty_rldnr type zzprodnt-rldnr,    "Type for Ledger
                ty_ryear type zzprodnt-ryear,    "Type for Fiscal Year
                ty_rpmax type zzprodnt-rpmax,    "Type for Period
                ty_glcomp type range of char4,   "Type for company selection
                ty_prctr type range of char10,   "Type for profit center sel
                ty_prasn type range of char6,    "Type for prod assignmt sel
                ty_crpbd type range of char4,    "Type for Corp Brand sel
                begin of ty_file,                "Type for File
                  line(150),
                end of ty_file,
                begin of ty_ZZPRODNT,            "Type-ledger summary table
                  company       type OBUKR,      "Company
                  gl_acct       type RACCT,      "GL Account
                  cst_ctr       type KOSTL,      "Cost Center
                  prt_ctr       type PRCTR,      "Profit Center
                  rfarea        type FKBER,      "Functional Area
                  wbs_ele       type PS_POSID,   "WBS Element
                  prd_***       type RKEG_WWZ01, "Product Assignment
                  corp_bd       type RKEG_WWZ05, "Corporate Brand
                  ksl01         type KSLXX9,     "Total of transactions - 01
                  ksl02         type KSLXX9,     "Total of transactions - 02
                  ksl03         type KSLXX9,     "Total of transactions - 03
                  ksl04         type KSLXX9,     "Total of transactions - 04
                  ksl05         type KSLXX9,     "Total of transactions - 05
                  ksl06         type KSLXX9,     "Total of transactions - 06
                  ksl07         type KSLXX9,     "Total of transactions - 07
                  ksl08         type KSLXX9,     "Total of transactions - 08
                  ksl09         type KSLXX9,     "Total of transactions - 09
                  ksl10         type KSLXX9,     "Total of transactions - 10
                  ksl11         type KSLXX9,     "Total of transactions - 11
                  ksl12         type KSLXX9,     "Total of transactions - 12
                  ksl13         type KSLXX9,     "Total of transactions - 13
                  ksl14         type KSLXX9,     "Total of transactions - 14
                  ksl15         type KSLXX9,     "Total of transactions - 15
                  ksl16         type KSLXX9,     "Total of transactions - 16
                end of ty_ZZPRODNT.
    *-- Structure Declaration
    *           Structure for final file
        data  : x_file         type ty_file,
    *           Structure for Product Ledger Summary table
                x_ZZPRODNT     type ty_ZZPRODNT,
    *           Structure for Functional Area to ACS line mapping
                x_zfgl014      type zfgl014.
    *-- Internal Table Declaration
    *           Table for records of Product Ledger Summary table
        data  : it_ZZPRODNT     type table of ty_ZZPRODNT,
    *           Table for final file
                it_file         type table of ty_file,
    *           Table for Functional Area to ACS line mapping
                it_zfgl014      type table of zfgl014.
    *-- Method Declaration.
        methods : get_data      importing e_rldnr  type ty_rldnr
                                          e_ryear  type ty_ryear
                                          e_rpmax  type ty_rpmax
                                          e_glcomp type ty_glcomp
                                          e_prctr  type ty_prctr
                                          e_prasn  type ty_prasn
                                          e_crpbd  type ty_crpbd
                                exporting i_subrc type sy-subrc.
    endclass.                    "lcl_tm1_intf DEFINITION
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf implementation.
    *-- Method get_data selects the North American Product Ledger Summary
    *   table data and then maps the Functional Area to ACS line to get
    *   the ACS line code
      method get_data.
    *-- Local Variable
        DATA: L_ZZPRODNT TYPE TY_ZZPRODNT.
    *-- Get the data from North American Product Ledger Summary table
        select robukrs
               racct
               rcntr
               rprctr
               rfarea
               rzzwbs_el
               rzzwwz01
               rzzwwz05
               ksl01
               ksl02
               ksl03
               ksl04
               ksl05
               ksl06
               ksl07
               ksl08
               ksl09
               ksl10
               ksl11
               ksl12
               ksl13
               ksl14
               ksl15
               ksl16
          from zzprodnt
          into table it_ZZPRODNT
         where rldnr    = e_rldnr
           and ryear    = e_ryear
           and rpmax    = e_rpmax
           and ROBUKRS  in e_glcomp
           and RPRCTR   in e_prctr
           and RZZWWZ01 in e_prasn
           and RZZWWZ05 in e_crpbd.
        if sy-subrc = 0.
          loop at it_ZZPRODNT into l_zzprodnt.
            condense l_ZZPRODNT-rfarea no-gaps.
            if l_ZZPRODNT-rfarea is initial.
              delete it_ZZPRODNT.
            endif.
          endloop.
    *-- Get the Functional Area to ACS line code mapping data
          select *
            from zfgl014
            into table it_zfgl014
             for all entries in it_ZZPRODNT
           where fkber = it_ZZPRODNT-rfarea .
          if sy-subrc = 0.
          endif.
        endif.
        i_subrc = sy-subrc.
      endmethod.                    "get_data
    endclass.                    "lcl_tm1_intf IMPLEMENTATION
    *   INCLUDE ZFGLI00003_F01                                             *
    *                             Table
    tables : zzprodnt.
    *                          Data Declaration
    data : v_subrc type sy-subrc.
    *&      Form  get_filename
    *  Description : This subroutine is used for F4 Prompting
    form get_filename changing p_path like rlgrap-filename.
    *-- Local variables
      data : lv_file  like ibipparms-path, "Local file for upload/download
             lv_repid like syst-cprog,     "ABAP program, caller in external
                                           "procedures
             lv_dynnr type syst-dynnr.     "Current screen No
      lv_repid = syst-cprog.
      lv_dynnr = syst-dynnr.
    *-- Function module used for F4 help
      call function 'F4_FILENAME'
           exporting
                program_name  = lv_repid
                dynpro_number = lv_dynnr
           importing
                file_name     = lv_file.
      move lv_file to p_path.
    endform.                    " get_filename
    *&      Form  init_period
    FORM init_period changing p_rpmax p_ryear.
      if sy-datum+4(2) = 01.
        p_rpmax = 12.
        p_ryear = sy-datum+0(4) - 1.
      else.
        p_rpmax = sy-datum+4(2) - 1.
        p_ryear = sy-datum+0(4).
      endif.
    ENDFORM.                    " init_period
    Hope this helps.
    Regards,
    Richa

Maybe you are looking for

  • How to delete a data element? - error message

    Error in the ABAP Application Program The current ABAP program "SAPLRSSG" had to be terminated because it has come across a statement that unfortunately cannot be executed. The following syntax error occurred in program "GP0GVENGV13S7QSCONTM4LCHNZG "

  • Better to use a printer's  WiFi or connect via TimeCapsule USB Printer.

    Just a generic question....Is it better/easier/faster to use a printer's built in WiFi versus connecting it via a USB connection to my Time Capsule. I'm installing an all in one, Epson 810. MBP, 10.5.8, Time Capsule. Would like to use all the functio

  • Adobe Forms for Material Pocurement

    Hi Experts, Pls provide some Samples of Adobe Forms for Material Pocurement Process. Thank U. Ravi

  • Design Studio and DSL Bridge for BW (Sizing)

    Hi, I'm doing a sizing exercise on a system where we are only going to use Design Studio, Analysis for Office and their mobile counterpart. Now, the "Resource Usage Estimator" does not provide options for these two tools, and as far as I can read the

  • Using Larger Fonts For Simple Sign

    I am creating a sign.  Using Photoshop CS2 I was very surprised when I tried to create a large character of font size 1500.  Error message noted the maximum was something like 1296. I did not think there was a limit. How do people make huge signs wit