Very Urgent!...regarding selection criterion in Info Packages

Hi all,
     This is very urgent requirement for the project now. Is there any way to indicate a field in selection criterion of a IP as blank.
Like if I want to select all the records which have a field 0WBS_element as blank from one ODS into another ODS. How do I indicate it in the IP( any solution apart from writing a routine!)
cheers
Sudhir

Hi Sudhir,
  Pls. refer to the earlier posted forums :
Rotuine in Infopackage for Data Selection---- Urgent
Thanks,
Raj

Similar Messages

  • Selection option in info package

    Hello Friends,
    While loading data in BW system (3.5 Version).
    I would like to use selection option in info package for one particular field.
    I can see only range options (Selection From and Selection To) which does not satisfy my requriement.
    I need to select nearly 5000records which are in one specific number range, so, how can i select these records in infopackage.
    Thanks
    Tony

    Did you think of InfoPackage routine?
    Try to write a routine under data Selection tab based on your data selection scenarios. I think you can achieve your goal.
    1) Data selection tab - Type column, choose ABAP routine.
    Whendo we use this?
    when we cannot extract data selectively by giving direct conditions in selection tab, eg: "list all the employees who joined on the current date". here current date value changes every day when we run the query. In such cases we cannot give direct condition, we need to write routine to get the current date
    Check this if it helps to proceed:
    ABAP ROUTINE AT INFOPACKAGE FOR DATE RANGE
    InfoPackage Routine

  • Very urgent regarding ALV

    Hi all,
    I have displayed data in alv.and the error condition is that if for a material if it has more than one S as ok_status records then it should throw an error. This logic is working fine.
    Now suppose at first time user had entered S through keyboard which fails the condition so it throws an error first time.
    Now user can change the ok  status back to I or O from S (through keyboard although f4 help is available) which satisfies the conditon so that record should be saved. but when user presses save button then in the ALV display the changed status I or O for that record again converted back to status S automatically. and again gives an error.
    if we try third time then it allows to save with record other than s ok status i.e. I or O.
    this problem is comming only when we change the value through keyboard. If we select value using f4 help then whole logic is working fine, no problem at all.
    Can you please help me out in this regard
    Its very urgent.
    Thanks & Regards
    Ashutosh.

    Hi,
    to exclude toolbar buttons..
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
    DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO LT_EXCLUDE.
    CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
    <b>      IT_TOOLBAR_EXCLUDING = LT_EXCLUDE</b>
          IS_LAYOUT            = GS_LAYOUT
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = IT_FINAL[].
    and you told you are using REUSE_ALV_GRID_DISPLAY_LVC
    then in the user_command do this....
    then your problem will be solved.
    in the top you declare this..
      DATA: REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
    FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.
    *then insert the following code in your USER_COMMAND routine...
      IF REF_GRID IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            E_GRID = REF_GRID.
      ENDIF.
      IF NOT REF_GRID IS INITIAL.
        CALL METHOD REF_GRID->CHECK_CHANGED_DATA
      ENDIF.
    ENDFORM.
    Regards
    vijay

  • Maximum number of selections in an info package

    Hi friends,
    i want to load an ODS with data from MSEG. Due to the great number of records I've to select by
    0ATERIAL. Selection criteria are provided by a routine I'll write for this selection, reading a different
    ODS. Estimated number of records for selection is about 80,000.
    My question:
    Is there any restriction regarding the number of selection criteria of an Infoobject in info packages?
    Will a selection work with 80,000 criteria?
    Any input is highly appreciated.
    Thanks in advance and regards
    Joe

    Hello,
    If I understood correctly...you will compare the values from a DSO and then pass these values in the infopackage selections..
    but how are you planning to do it...will it be interval or single value??
    Also I think you can assign only one value or range in the infopackage at a time for selection through routine...
    More the number of selections more the number of AND in the where clause.
    I am not sure if there is any limitations on where clause but after 100 selection the select queries become complex and overflow the memory...so thats the limitation.
    Thanks
    Ajeet

  • Data selection options in info package

    hi,
    I am using filter for current month while loading data into info provider (let us say 0calmonth). I am using below code in info-package after selecting type '6'  (ABAP editor),
    data: l_s_range type rssdlrange,
    l_date type d.
    l_date = sy-datum.
    l_year = l_date+0(4).
    l_mth = l_date+4(2).
    concatenate l_year l_mth into l_month_high.
    concatenate l_year '01' into l_month_low.
    loop at l_t_range into l_s_range where fieldname = 'CALMONTH'.
    if dy-subrc = 0.
    l_s_range-low = l_month_low.
    l_s_range-low = l_month_high.
    modify l_t_range from l_s_range.
    endif.
    endloop.
    But now I would like to use created date as filter instead of calmonth/year (yyyymm). please note that calmonth has only one value but calendar day will have both from and to values. Please give me code to use created date (mm/dd/yyyy).
    please help me with your code.
    thanks,

    I have got the solution by myself (trial and error method). Solutions: there is a SAP delivered variable to calculate current month (Variable name is 0CMONTH).
    Is there any variable to calculate both previous month and current month as filter value? pls reply.

  • Adding a field in data selection tab of Info Package

    Hello,
    how can I add a field for selection in the data selection tab of the info-package in BW 3.5.
    Thanks,
    SD

    Hi,
    You need check Selection in RSO2 in ECC then that field is available for Selectgion in InfoPackage.
    Here I'm giving 0CUST_SALES_ATTR DataSource Example for Selection Change, so see the logic and accordingly you can change your DataSource Selections.
    See the properties of that field in RSA2 in ECC and you can also make it for selection, use the following program and see it.
    In ROOSFIELD table give the datasource 0CUST_SALES_ATTR and see , select only Active version Fields.
    For the following fields you can find FIELD = X, it indecates that it is abailable for selections, so in this way you try to do it by using following program and check.
    KUNNR
    SPART
    VKORG
    VTWEG
    REPORT ZBI_ROOSFIELD NO STANDARD PAGE HEADING .
    tables ROOSFIELD.
    Update ROOSFIELD set SELECTION = 'X' where
    OLTPSOURCE = '0CUST_SALES_ATTR' and
    FIELD = 'FAKSD '.
    Also see SAP Note : 1033847
    Re: Field Selection in Datasource 0CUST_SALES_ATTR
    Thanks
    Reddy

  • Selection Conditions on Info Package

    Hi Experts
      Please advise me on how to proceed
    My requirment is to include selection condition in INFOPACKAGE as the total data that data source is extracting is nearly 200 million records to minimize the extraction of data to be loaded to DSo...my requirment is include selection conditions at infopackage level
    Condition 1: On Fiscal Year/Period
    To load data from  2005 to current....
    Condition 2: to exclude particula Cost Center
    and data source is delta capable
    Please update me how to include these selection conditions do i need to write any ABAP Code and
    Do i need to include selection conditions on INIT & DELTA info package as well
    I need to load data from FY 2005 to........
    Thanks in advance

    Hi Siegfried Szame
    Thanks for the update...apologies for multiple posts
    One question as you said Parallel Inits
    If i created about 9 different INIT info packages  ( My requirment is to initilize data from FY 2006)
    IP1: 001.2006 to 004.2006
    IP2: 005.2006 to 009.2006
    IP3: 010.2006 to 001.2007
    IP4: 002.2007 to 005.2007
    IP5: 006.2007 to 009.2007
    IP6: 010.2007 to 001.2008
    IP7: 002.2008 to 005.2008
    IP8: 006.2008 to 010.2008
    IP9: 011.2008 to 002.2009
    How about delta....what are the selection conditions i need to use
    and
    Can i execute the above packages one after another...that is after completion of IP1 then IP2..then IP3
    Please update
    Thanks in advance

  • Very Urgent COOIS Selection Profiles

    Dear All
    I need a urgent help !!!! Please Kindly Help me into this
    My client have a scenario where he wants to extract the Production order's only "REL" status with combination of Work-center
    When we have choose the condition selecting the option of selection profiles and i have taken( SAP001 & SAP0011 )
    And my doubt is when i am using SAP001 i am getting orders "REL" status but only i am able to display some orders one order
    And When i am using SAP011 i am getting two orders and date range is same
    How to achieve this i want to extract orders with "REL" status with combination of Work center
    And i am using sys status CTRD Exclude enable & execute it will display only order release  but its throwing an error in sys status is not unique
    What is SAP001 is Dispatched means what?
    Is there any BUG in the COOIS or need any sap notes
    Please help me i am in great need
    With Regards
    Vasudeva

    Go to BS42 and configure your own Z profile if the standard profile didn't meet your requirement.
    The reason SAP011 is displaying two orders may be because one of the two order is not dispatched.
    SAP011 display orders with operations =REL & ≠LKD.
    SAP001 displays orders with operations = DSPT

  • Very urgent: regarding  problem in  display of output

    hi,
    i am modifying a report in which i have to display the stock date wise, i.e. it will display that the at this date this amount of stock is there.
    currently the code is able to display the according to this criteria that if date is <= 15 then it will display the stock of previous month and if it is >= 16 then it will display the stcok of last date of current month.
    but i  want to display the data in way that it will read the rest of the records from the other itab ITMSEG.
    should i display the code of it? that it will display more clear picture.
    Edited by: ric .s on Mar 31, 2008 8:23 AM

    hi,
    dis is d 1st part which do the segregation of date:-
    parameters: p_date LIKE ZSTOCKSUM-STLDATE default sy-datum.
    data: num type i,
         w_date type d.
    aa = p_date.
    num = p_date+6(2).
    if num <= 15.
    p_date+6(2) = 01.
    w_date = p_date - 1.
    elseif num => 16.
    p_date = p_date + 30.
    p_date+6(2) = 01.
    w_date = p_date - 1.
    endif.
    And it the part where it have to fetch the records:-
    SELECT ASTLDATE AMATNR AWERKS ALGORT ASTDEBIT ASTCREDIT
      BMEINS  BMTART BMATKL BNTGEW B~GEWEI
      FROM ZSTOCKSUM AS A
      INNER JOIN MARA AS B ON AMATNR = BMATNR
      INTO TABLE STIT
      WHERE AWERKS = P_WERKS AND MTART IN MAT_TYPE AND AMATNR IN P_MATNR AND STLDATE <= P_DATE
      AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
      AND A~LGORT IN P_STLOC.
    SELECT BBUDAT AMATNR AWERKS ALGORT AMENGE AMENGE
      CMEINS CMTART CMATKL CNTGEW C~GEWEI
      FROM MSEG AS A INNER JOIN MKPF AS B ON AMBLNR = BMBLNR AND AMJAHR = BMJAHR
      INNER JOIN MARA AS C ON  AMATNR = CMATNR
      INTO TABLE ITMSEG  WHERE AWERKS = P_WERKS AND MTART IN MAT_TYPE AND AMATNR IN P_MATNR AND BUDAT <= P_DATE AND BUDAT => aa
      AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
      AND A~LGORT IN P_STLOC.
    SORT ITMSEG BY MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI.
    DELETE ADJACENT DUPLICATES FROM ITMSEG COMPARING MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI NTGEW.
      INSERT LINES OF ITMSEG INTO TABLE STIT.
        ITAB[] = STIT[].
        SORT ITAB BY MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI NTGEW.
        DELETE ADJACENT DUPLICATES FROM ITAB COMPARING  MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI NTGEW.
      SORT STIT BY MATNR LGORT.
      SORT ITAB BY MATNR LGORT.
      LOOP AT ITAB.
        V_QTY = 0.
    LOOP AT STIT WHERE MATNR = ITAB-MATNR AND LGORT = ITAB-LGORT.
    if num <= 15.
        V_QTY = V_QTY + STIT-STDEBIT - STIT-STCREDIT + ITMSEG-MENGE.
    *IF AA >= 16.
    else.
        V_QTY = V_QTY + STIT-STDEBIT - STIT-STCREDIT - ITMSEG-MENGE.
    endif.
    ENDLOOP.
    this is the code where i think the problem is as it is able to display the data in debug mode but when it comes to actual report execution it is not displaying it i.e. if the stcok of material is changed on today's date it is showing but when i want to see the stock of previous date it is still showing the same. plzz help me out it is really urgent.
    Edited by: ric .s on Mar 31, 2008 11:06 AM

  • Urgent regarding select option

    Hi All,
    Hi All,
    i have lfart(delivery type) field on selction screen defiend as select-option.whenever i click on the multiple selection arrow button besides the lfart field then i n that i have selected "=" as values for opyion field of select-option table(sign,option,low,high).then an icon of "=" is displayed behind the lfart field.
    then i have wriiten a qery like this
    SELECT lfart,lfdat,.....
    INTO TABLE tb_likp
    FROM likp
    FOR ALL ENTRIES IN tb_get_del1
    WHERE vbeln = tb_get_del1-vbeln
    AND lfart IN s2_lfart
    AND lfdat IN s_lfdat,......
    but it is failing(bczo s2_lfart is not initial).then how to write the correct query .
    Thanks&Regards,
    Padma.

    Hi Padma,
    remove the = because of this the Select-option is working as parameter and your select-query is looking for the lfart  = SAPCE in the DB, which it can't found so it is failing.
    Hope it is clear.
    Reward points if useful.
    Regards,
    Atish

  • Very urgent - Regarding variables on Multicube.

    Hi Experts
    I created a multicube using two basic cubes(one for R/3 data and another one for CRM Data).
    In my reports i want to put 2 variables for CRM(Debit memo date) and R/3 (Billing Date).
    when i execute the report without entering any values for both the dates i am getting the values from both the cubes.
    If i enter the dates in selection condition for both the variables i am not getting the values.
    If I enter one variable value and viceversa i am getting the values from the respective cube.
    so why i am not getting the valuse by entering values for both the varibales in selection.
    Thanks
    Shiva

    Hi,
    Both dates are based on 0CALDAY. Looks like you give different selections for 0CALDAY and the system doesn't understand which one to use. Try to give the same dates for both variables. Will it bring any data?
    Which selections have you tried already?
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • Selection routine in info package

    Hi gurus,
    I need to load last month's data in to BW if I am executing the IP in this month.
    that is if Iam executing in Feb 2009 then it should load Jan 2009,
    and if Iam executing on JAn 2009 then it should pick data for Dec 2008,
    For this logic I had written like,
    data: TEMP_DATE TYPE DATE,
          TEMP_MONTH TYPE CHAR(6).
    TEMP_DATE = SY-DATUM.
    TEMP_MONTH = sydatum+2(6).
    L_T_RANGE-IOBJNM = 0CALMONTH.
    L_T_RANGE-SIGN = 'I'.
    L_T_RANGE-OPTION = 'EQ'.
    L_T_RANGE-LOW = TEMP_MONTH - 1.
    L_T_RANGE-HIGH = TEMP_MONTH.
    APPEND L_T_RANGE.
    Is this OK or I need to change,
    Thanks,
    Pavan

    Hi Pavan,
    This is an example How to ... Write Infopackage selection Routine
    1.Create an Infopackage
    2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen.
    4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    Regards
    Sudheer

  • VERY URGENT:REGARDING ALV REPORT

    HI,
    I am making Interactive alv report in which i have to display 3 views in a single report i.e.
    1.) I  have to display :-
    RAW MATERIAL      DAYS
    BOP                        DAYS
    Here days are the difference b/w the Material Doc. Date and Requsition Approval date.
    (which  i have already calculated.)
    2.) When i double click the raw material or bop option then material no and days are to be dislplayed.
    3.)  After double clicking the material then the its migo status and requsition status to be dislplayed .(this thing i had performed )
    My main problem is dat i have to write it all in a single ALV but its little confusing to me as i am doing this kind of report for first time.
    If anybody provide me useful or solved awnser ,he or she will be definately rewarded.
    Message was edited by:
            ric .s

    hi ric.s
    check this prog
    *& Report  ZSAMP_INTERCTIVE                                            *
    REPORT  zsamp_interctive                        .
    TABLES: mara,vbap.
    DATA : BEGIN OF itab OCCURS 0,
           matnr LIKE mara-matnr,
           ernam LIKE mara-ernam,
           END OF itab.
    DATA :  BEGIN OF itab1 OCCURS 0,
            matnr LIKE vbap-matnr,
            vbeln LIKE vbap-vbeln,
            END OF itab1.
    DATA: fld(20) TYPE c,val LIKE mara-matnr .
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: m FOR mara-matnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    *AT SELECTION-SCREEN ON m.
    SELECT SINGLE matnr FROM mara INTO mara-matnr WHERE matnr = m.
    IF sy-subrc NE 0.
       MESSAGE e000(zz) WITH 'invalid ' mara-matnr 'in your ' 'selection'.
    ENDIF.
    START-OF-SELECTION.
      SELECT matnr ernam INTO TABLE itab FROM mara WHERE matnr IN m.
      SELECT matnr vbeln INTO TABLE itab1 FROM vbap FOR ALL ENTRIES IN itab
      WHERE matnr = itab-matnr.
    END-OF-SELECTION.
      LOOP AT itab.
        WRITE:/20 itab-matnr,40 itab-ernam.
       hide itab-matnr.
        CLEAR itab-matnr.
      ENDLOOP.
    AT LINE-SELECTION.
      GET CURSOR FIELD fld  VALUE val.
      CASE fld.
        WHEN 'ITAB-MATNR'.
          WRITE:/ val.
      ENDCASE.
      CASE sy-lsind.
        WHEN '1'.
          SET PF-STATUS 'XX2'.
          SET TITLEBAR 'XX2'.
          IF itab1[] IS INITIAL.
            WRITE:/ 'no data found for itab1 in first secondary list'.
          ENDIF.
          LOOP AT itab1.
            WRITE:/30 itab1-matnr,60 itab1-vbeln.
           hide itab1-matnr.
          ENDLOOP.
        WHEN '2'.
          SET PF-STATUS 'XX2'.
          SET TITLEBAR 'XX2'.
          LOOP AT itab.
            WRITE:/30 itab-matnr,60 itab-ernam.
          ENDLOOP.
      ENDCASE.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'SET'.
          IF sy-lsind = 1.
            WINDOW STARTING AT 5 3 ENDING AT 40 10.
            WRITE 'Select line for a second window'.
          ELSEIF sy-lsind = 2.
            WINDOW STARTING AT 45 10 ENDING AT 60 12.
            WRITE 'Last window'.
          ENDIF.
        WHEN 'BACK'.
        sy-lsind = sy-lsind - 1.
        WHEN 'ABC'.
          WRITE:/ 'iam great'.
       WHEN 'DOWNLOAD'.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
            BIN_FILESIZE                    =
              filename                        = 'c:\temp.txt'
              filetype                        = 'DAT'
            TABLES
              data_tab                        = itab
           FIELDNAMES                      =
           EXCEPTIONS
             file_write_error                = 1
             no_batch                        = 2
             gui_refuse_filetransfer         = 3
             invalid_type                    = 4
             no_authority                    = 5
             unknown_error                   = 6
             header_not_allowed              = 7
             separator_not_allowed           = 8
             filesize_not_allowed            = 9
             header_too_long                 = 10
             dp_error_create                 = 11
             dp_error_send                   = 12
             dp_error_write                  = 13
             unknown_dp_error                = 14
             access_denied                   = 15
             dp_out_of_memory                = 16
             disk_full                       = 17
             dp_timeout                      = 18
             file_not_found                  = 19
             dataprovider_exception          = 20
             control_flush_error             = 21
             OTHERS                          = 22.
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
      ENDCASE.
    TOP-OF-PAGE DURING  LINE-SELECTION.
      CASE sy-lsind.
        WHEN '1'.
          WRITE:/ 'this is secondary list'.
      ENDCASE.

  • Very urgent: regarding display of parent material

    hi,
    i had been working on dis report and i hae to display the parent material on top and sub material in dis BOM structure report.
    plzz help me out  as i have to submimit dis report with 1 hour as help will be definately rewarded.
    TABLES: MBEW,           "Material Valuation
            MSLB,           "Special stocks with vendor
            MARA,           "Material Master
            MAKT,           "Material Descriptions
            MARD,           "Material Master: Storage Location/Batch Segment
            MAST,           "BOM Header
            STKO,           "BOM Detail
            STPO,           "Bom Components
            STAS.           "BOM Alternative
    Text Elements
    Plant
    SELECT-OPTIONS: S_WERKS FOR MAST-WERKS,
    DEFAULT 'CA',
    Material
                    S_MATNR FOR MAST-MATNR,
    Material Type
                    S_MTART FOR MARA-MTART.
    Base Quantity
    PARAMETERS: S_BASE TYPE I DEFAULT '1'.
    Display up to Level
    PARAMETERS: S_LVL  TYPE I DEFAULT '99'.
    PARAMETERS: stlal  type mast-stlal default '01'.
    SELECTION-SCREEN SKIP.
    Include Vendor Stock
    PARAMETERS: X_MSLB  AS CHECKBOX.
    DATA: W_MATNR LIKE MAPL-MATNR.
    DATA: PARENT_MATNR LIKE MAST-MATNR,
          CHILD_MATNR LIKE STPO-IDNRK,
          CHILD_WERKS LIKE MAST-WERKS,
          CHILD_STLAL LIKE MAST-STLAL,
          W_MAKTX LIKE MAKT-MAKTX,
          W_STD TYPE P DECIMALS 5,
          W_MAV TYPE P DECIMALS 5,
          W_MENGE TYPE P DECIMALS 3,
          W_LEVEL TYPE I,
          W_DOT(1),
          W_LVL(12),
          W_LVL1(12),
          W_LVL2(2),
          W_COL TYPE I,
          W_LFLAG,
          W_TTL LIKE MARD-LABST.
    DATA: SPART LIKE MARA-SPART.
    DATA: BEGIN OF INT1 OCCURS 50,
           LGORT(6),
            LABST LIKE MARD-LABST,
          END OF INT1.
    IF S_BASE EQ 0.
      S_BASE = 1.
    ENDIF.
    append multi level routing
    SELECT * FROM MAST WHERE WERKS IN S_WERKS AND
         MATNR IN S_MATNR and stlal = stlal.
      SELECT SINGLE SPART FROM MARA INTO SPART WHERE MATNR = MAST-MATNR AND  MTART IN S_MTART.
        write: 'aaaaa', sy-dbcnt.
    SELECT SINGLE * FROM MARA WHERE MATNR = MAST-MATNR AND
          MTART IN S_MTART.
      IF SY-SUBRC NE 0.
        CONTINUE.
      ENDIF.
      IF MARA-LVORM <> 'X'.
        PARENT_MATNR = MAST-MATNR.
        CHILD_MATNR  = MAST-MATNR.
        CHILD_WERKS  = MAST-WERKS.
        CHILD_STLAL  = MAST-STLAL.
        SELECT SINGLE * FROM MAKT WHERE MATNR = MAST-MATNR AND
             SPRAS = 'E'.
        W_MAKTX = MAKT-MAKTX.
        REFRESH INT1.
        SELECT * FROM MARD WHERE MATNR = MAST-MATNR AND
             WERKS = MAST-WERKS AND
             LABST NE 0.
          MOVE MARD-LGORT TO INT1-LGORT.
          MOVE MARD-LABST TO INT1-LABST.
          APPEND INT1.
        ENDSELECT.
        IF X_MSLB EQ 'X'.
          SELECT * FROM MSLB WHERE MATNR EQ MAST-MATNR AND
               WERKS EQ MAST-WERKS AND
               LBLAB NE 0.
            MOVE MSLB-LIFNR TO INT1-LGORT.
            MOVE MSLB-LBLAB TO INT1-LABST.
            APPEND INT1.
          ENDSELECT.
        ENDIF.
        W_LEVEL = 1.
       NEW-PAGE.
        PERFORM GETCHILD.
      ENDIF.
    ENDSELECT.
    get child parts
    FORM GETCHILD.
      SELECT * FROM STPO WHERE STLNR = MAST-STLNR
            ORDER BY POSNR.
        SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR
              AND STLAL = MAST-STLAL.
        SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
              STLKN = STPO-STLKN AND
              STLAL = MAST-STLAL.
        IF SY-SUBRC EQ 0.
          CLEAR: W_DOT, W_LVL, W_LVL1.
          PERFORM WRT_DTL.
          CHILD_MATNR = STPO-IDNRK.
          W_LEVEL = W_LEVEL + 1.
          IF W_LEVEL <= S_LVL.
            PERFORM SUBCHILD.
          ENDIF.
          W_LEVEL = W_LEVEL - 1.
        ENDIF.
      ENDSELECT.
    ENDFORM.
    get grand children parts
    FORM SUBCHILD.
      SELECT SINGLE * FROM MAST WHERE MATNR = CHILD_MATNR
         AND WERKS = CHILD_WERKS.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
      SELECT * FROM STPO WHERE STLNR = MAST-STLNR.
        SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR AND
          STLAL = MAST-STLAL.
        SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
            STLKN = STPO-STLKN AND
            STLAL = STKO-STLAL.
          IF SY-SUBRC EQ 0.
            W_DOT = '.'.
            PERFORM WRT_DTL.
            CHILD_MATNR = STPO-IDNRK.
            W_LEVEL = W_LEVEL + 1.
            IF W_LEVEL <= S_LVL.
              PERFORM SUBCHILD.
            ENDIF.
            W_LEVEL = W_LEVEL - 1.
            SHIFT W_LVL.
          ENDIF.
        ENDSELECT.
    ENDFORM.
    TOP-OF-PAGE.
    WRITE:/ SY-DATUM,SY-UZEIT,
           85 'ABC PTE LTD',
          182 'Page', SY-PAGNO.
    WRITE: / SY-REPID,
             75 'BOM STRUCTURE  (WITH LOCATION BALANCES)',
             182 SY-UNAME.
    SKIP.
    CLEAR W_LFLAG.
    *WRITE:/ 'Material No.:', PARENT_MATNR,
           'Division No.:', SPART,
           60 'Plant    :', MAST-WERKS.
    W_COL = 90.
    CLEAR W_TTL.
    **LOOP AT INT1.
    IF W_COL > 195.
       IF W_LFLAG IS INITIAL.
         WRITE:/ 'Description :', W_MAKTX,
              60 'Base Qty :', S_BASE LEFT-JUSTIFIED.
         W_LFLAG = 'X'.
         W_COL = 90.
       ELSE.
         W_COL = 90.
         SKIP.
       ENDIF.
    ENDIF.
    WRITE AT W_COL 'Loc :'.
    W_COL = W_COL + 6.
    WRITE AT W_COL INT1-LGORT.
    W_COL = W_COL + 7.
    WRITE AT W_COL(12) INT1-LABST LEFT-JUSTIFIED.
    W_COL = W_COL + 16.
    W_TTL = W_TTL + INT1-LABST.
    **ENDLOOP.
    **IF W_LFLAG IS INITIAL.
    WRITE:/ 'Description :', W_MAKTX,
          60 'Base Qty :', S_BASE LEFT-JUSTIFIED,
          90 'Total :', W_TTL LEFT-JUSTIFIED.
    **ELSE.
    WRITE AT W_COL 'Total :'.
    W_COL = W_COL + 8.
    WRITE AT W_COL W_TTL LEFT-JUSTIFIED.
    **ENDIF.
    **SKIP.
    **ULINE.
    'Level',
    WRITE: /001 'Material No',
            011 'Item',
            017 'Component',
            037 'Description',
            079 '    Per',
            089 'UOM',
            094 ' Std Price',
            106 'Moving Avg',
            119 'Location',
            128 ' Balance',
            139 'Location',
            148 ' Balance',
            159 'Location',
            168 ' Balance',
            179 'Total Quantity'.
    ULINE.
    FORM WRT_DTL.
      CLEAR: MAKT-MAKTX, W_MAV, W_STD.
      SELECT SINGLE * FROM MAKT WHERE MATNR = STPO-IDNRK AND
           SPRAS = 'E'.
    SELECT SINGLE * FROM MBEW WHERE MATNR = STPO-IDNRK AND
          BWKEY = MAST-WERKS.
    IF SY-SUBRC = 0.
       W_MAV = MBEW-VERPR / MBEW-PEINH.
       W_STD = MBEW-STPRS / MBEW-PEINH.
    ENDIF.
    W_MENGE = ( STPO-MENGE / STKO-BMENG ) * S_BASE.
    W_LVL2 = W_LEVEL.
      CONCATENATE W_DOT W_LVL INTO W_LVL.
      CONCATENATE W_LVL W_LVL2 INTO W_LVL1.
    *001 PARENT_MATNR
      WRITE: /001 PARENT_MATNR,
             /011 STPO-POSNR,
              017 STPO-IDNRK,
              037 MAKT-MAKTX,
              079 SPART.
             079(8) W_MENGE,
             089 STPO-MEINS,
             094(10) W_STD,
             106(10) W_MAV.
    W_COL = 119.
    CLEAR W_TTL.
    SELECT * FROM MARD WHERE MATNR = STPO-IDNRK AND
          WERKS = MAST-WERKS AND
          LABST NE 0.
       IF W_COL > 166.
         W_COL = 119.
         WRITE AT /W_COL ' '.
       ENDIF.
       WRITE AT W_COL MARD-LGORT.
       W_COL = W_COL + 5.
       WRITE AT W_COL(13) MARD-LABST.
       W_COL = W_COL + 15.
       W_TTL = W_TTL + MARD-LABST.
    ENDSELECT.
    IF X_MSLB EQ 'X'.
       SELECT * FROM MSLB WHERE MATNR = STPO-IDNRK AND
            WERKS = MAST-WERKS AND
            LBLAB NE 0.
         IF W_COL > 166.
           W_COL = 119.
           WRITE AT /W_COL ' '.
         ENDIF.
         WRITE AT W_COL(6) MSLB-LIFNR.
         W_COL = W_COL + 6.
         WRITE AT W_COL(12) MSLB-LBLAB.
         W_COL = W_COL + 14.
         W_TTL = W_TTL + MSLB-LBLAB.
       ENDSELECT.
    ENDIF.
    WRITE AT 179(15) W_TTL.
    ENDFORM.
    Edited by: ric .s on Jan 21, 2008 10:19 AM

    Hi,
    Use these two function modules to explore the BOM.
    CSAP_MAT_BOM_READ or
    CS_BOM_EXPL_MAT_V2
    The second one is more appropriate.
    You dont have to write much code in your case.
    Pass appropriate data into the FM and get the BOm exploded and you can just loop the interbal table and display it accordingly.
    Reward points if useful.
    Thanks,
    Arul.

  • Data selection tab from Info package.

    dear all,
    I'm using BI7 for my project. I have 1 simple question, how do you un-select a data target from the data selection tab?
    e.g.
    in the data selection i have 2 DSO
    0DSP_1 and ZDSP_1... how do i remove DSO 0DSP_1 from the selection tab?

    If you are using an infopackage...
    under Data Target tab you are seeing 2 DSO.
    in order to select only one: select the option "Select Data targets"
    and then select the DSO which you want to load.
    If you compeltly doesn't want to use the 2nd DSo then delete the update rules between the infosource and DSO.

Maybe you are looking for

  • Dimension member values not showing (just empty cells)

    Hi, I have an organization dimension (Business > Business Unit> Department > Account) and a single fact (Dollars) on my test repository. When I add my fact and any dimension level to an answers report I can see for example two empty cells for each me

  • Access Control not working as expected after upgrade to 7.5.2

    I have a Time Capsule set up with mac address access control on the main network plus a guest network. After the upgrade to 7.5.2, it seems that the access control is applying to my guest network and the main network is allowing all devices on it. Ha

  • Sound in video not in sync

    I just recently purchased Lenogo DVD to Ipod coversion software, and it converted the videos BUT the sound is faster than the movie. IS there any way to fix this problem? Also, sometimes the video jumps and a little choppy. Any suggestions? Thanks

  • I am unable to access my RBS digital banking site - the help message from the bank suggests it could be a Firefox add-on problem

    Just changed from Internet Explorer to Firefox - could initially access digital banking but now unable to log in. Bank suggests the problem is due to Firefox add-ons & to start Firefox in safe mode. How do I do this?

  • Google Chrome and instability

    About two weeks ago I decided to switch from using Firefox (because it was much too piggish with resources) to Chrome.  At first, this was wonderful -- Chrome was lightweight and speedy, but starting a few days later all sorts of bad things began hap