Regarding using ranges for parameters

Hi all,
          I have a requirement where i have to get the below using ranges.
Can anyone help me what shuld be done.
•     For existing program Z_AVAILABILITY, create parameter selection to run by travel dates. Must have ability to run nightly (travel date range: tomorrow’s date to 60 days later) and weekly (travel date range: 61days after of tomorrow to 6 month after of today’s date). 
eventual i have to use this in select statement.
Frnds plzz help me its urgent.
regards,
satish

Hi,,
first declare ranges like this
ranges:
  r_tdlnr for lfa1-lifnr,              " Forwarding agent number
  r_scacd for lfa1-scacd.              " Standard carrier access code.
after that assisgn values into it like this 
move: 'I'  to r_tdlnr-sign,
        'EQ' to r_tdlnr-option,
        t_lfa1-lifnr to r_tdlnr-low.
and finally write select statement like this..
select vttk~tknum                    " Shipment number
         vttk~tpbez                    " Transport description
         vttk~tdlnr                    " Forwarding agent number
         vttp~tpnum                    " Shipment line item
         vttp~vbeln                    " Delivery number
        vttp~zseq_num                 " Delivery stage sequence number
    into table t_vttk_vttp
    from vttk inner join vttp
      on vttptknum eq vttktknum
     for all entries in t_lips_vbak    " for all deliveries
   where vttk~tdlnr in r_tdlnr         " with valid forwarding agents
plzz reward if it is usefull to u...

Similar Messages

  • How do i use ranges and parameters together?

    Plz help me...
    I have a selection screen with about 8 parameters out of which two are mandatory, i.e. a flag and the date of creation. What I need to do is delete certain entries from a database table based on the parameters input by the user. Now the problem is when i am using the delete statement using where statement..
    delete from zinbd_delv where vbeln     = vbeln    and             
                                 posnr     = posnr    and
                                 lfimg     = lfimg    and
                                 lfdat     = lfdat    and
                                 created  = created and
                                 status   = status.
    But suppose the user enters data in only the two mandatory fields and say status = 'X' and created = 'XX/XX/XXXX'. In that case it should delete all the entries from the table where status = X and creation date as specified but since it will find the other parameters as blank it will fail. Can we use range table for this...plz tell me how to do it.

    i think if you are using parameters then you have to enter the value in that.
    or
    select-options : sop for mara-matnr no intervals no-extension.
    for single entry.
    data : itab like zinbd_delv occurs 0 with header line.
    select * from zinbd_delv ito table itab where vbeln in vbeln and
    posnr in posnr and
    lfimg in lfimg and
    lfdat in lfdat and
    created in created and
    status in status.
    delete zinbd_delv from table itab.
    commit work.
    regards
    shiba dutta

  • How to use range for a field that is not in select options

    Dear All,
    I have a requirement to show Long Text of a G/L account , where G/L account is between a given range. But this field is not in select options. I have to show Long Text of this Account, if the field is in a given range. I have tried to use RANGE , but RANGE is not working here. Please help with some sample codes.
    Note: The range is too high so I cant use IN operator.
    Thanks ,
    Rosaline.

    Hi,
       Declare a range as :
    ranges : r_hkont for bseg-hkont.
    fill in the values
    r_hkont-sign = 'I'.
    r_hkont-option = 'BT'.
    r_hkont-low = '26000000'.
    r_hkont--high = '2999999'.
    append r_hkont.
    Select sgtxt from bseg into text
    where bseg-hkont in r_hkont.
    Regards,
    Srini.

  • Using null for parameterized "newInstance(Object [])" method in Object[].

    I have a really serious problem. I am creating instances of specific classes by using reflection techniques. I am reading a flat file, finding class from its name and creating it by using its parameterized constructor. Example:
    line 1: Dummy("A",Dummy2("B"),12,,"C");
    I create an instance of Dummy with parameters "A", an instance of Dummy2 object with value "B", 12 (I use here Integer as wrapper), null (There is no wrapper for null :( ) and "C".
    I find constructor by using findConstructors() and looking their parameter counts, creating an object array with given values and calling:
    constructorIFoundBefore.newInstance(objectArrayIPrepared);
    But!!!
    Because I use null directly, I got this message:
    java.lang.IllegalArgumentException: argument type mismatch
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at reader.parser.ObjectCreator.createObjectFromObjectItem(ObjectCreator.java:192)
         at reader.parser.ObjectCreator.createObjectFromParseItem(ObjectCreator.java:112)
         at reader.parser.ObjectCreator.createObject(ObjectCreator.java:78)
         at reader.analyzer.FileAnalyzer.analyzeAndCreateObjects(FileAnalyzer.java:95)
         at reader.ReverseReader.main(ReverseReader.java:43)
    I will be very glad if you help me.
    Thanks a lot!
    Gokcer

    I said something wrong. Sorry. While invoking a method (or a constructor) we need an object array which are equivalent to parameters. For example to call a method or constructor for class A;
    class A {
    int age;
    String name;
    public A(int age, String name){
    this.age = age;
    this.name = name;
    public set(int age, String name){
    this.age = age;
    this.name = name;
    we use in any place
    A a1 = new A(12,"Gokcer");
    A a2 = new A(15,null);
    To achieve this by using reflection techniques, we must find constructor with two parameters of class A. At this point "BetterMethodFinder" will give great help.
    After finding right constructor, we must create an object array to tell the constructor parameters (age and name). At this point we need an object array which stores our parameters. Code must be like this.
    Object []params = new Object[2]; // we have two parameters.
    params[0] = new Integer(12); // we can't use params[0]=12
    // because 12 is not an object. (It is a
    // primitive type)
    params[1] = "Gokcer";
    Now create the new object.
    A a1;
    a1 = constructorWeFound.newInstance(params);
    While creating param[], we could also use:
    Object []params = new Object[2] {new Integer(12),"Gokcer"};
    While creating a2, we can use "null" directly for second parameter.
    params = new Object[2] = {new Integer(15), null};
    or
    Object []params = new Object[2];
    params[0] = new Integer(15);params[1] = null;
    Thanks again everyone who replied me.
    My sincerely...

  • How to use %  Symbol for parameters in conditions in Discoverer

    Hi All,
    Actually I should add four parameters in that
    two param's should be given %(means to select all) as default value.
    ie as we use LIKE '%' in Query.
    the problem is when I enter a value for a parameter, it should result me for that particular value,
    and if I need all, I should enter % symbol,
    so for this Iam confused How to use this,
    even I tried with some options, it is not getting satisfactory results.
    will any one please help me in reaching this.
    Thank's in Advance
    Edited by: user10271105 on Sep 17, 2008 3:37 AM

    Hi,
    You can create a parameter and give % as the default value. If you set the condition to use LIKE then when the default value is used for the parameter then the query contains LIKE '%' and everything is selected.
    If you are using a List of Values with your parameter then you must add the '%' to your list of values so that the user can select this value.
    However, this method will not work if some of the values in your database contain percent characters, because the condition LIKE 'ABC%DEF' will return ABCXYZDEF as well as ABC%DEF.
    Unfortunately the like escape syntax is not available in Discoverer so you have to invent an value that the user can enter for all, e.g. ALL and set this as the default for the parameter.
    Then use a condition similar to:
    item LIKE :param OR item = DECODE(:param,'*ALL*', item)
    Rod West

  • Help for views regarding using Liferay for an already developed project.

    Hi all,
    I don't know if I am posting this question in the right place. If I am then extremely sorry. Guide me to post in right place. I have already posted in Liferay forum but still no reply!
    First of all, let me tell you what I am or my company is intended to do. We have already developed a project using Java, JSP and Servlet. We want it to integrate with Liferay so that we can change logo, css, images, themes or any other UI related component at run time using Liferay admin panel. But backend should be what we have developed. In short, UI of our project is controlled by Liferay but control of data displayed on UI or submitted from UI should be from our developed backend code.
    Now I have a few questions regarding above said approach of fulfilling the requirement:-
    1) What we are trying to do is possible?
    2) Is this approach recommendable for what we intended to do?
    3) Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
    4) What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
    Liferay is a very new for us. We have checked the documentation section of Liferay but still few things like above said requirements and its implementation is not clear. Also, we would like to know in what scenarios/requirements Liferay is useful.
    Eagerly waiting for your views. Any help will be very much appreciated.
    Thanks

    Hi all,
    I don't know if I am posting this question in the right place. If I am then extremely sorry. Guide me to post in right place. I have already posted in Liferay forum but still no reply!
    First of all, let me tell you what I am or my company is intended to do. We have already developed a project using Java, JSP and Servlet. We want it to integrate with Liferay so that we can change logo, css, images, themes or any other UI related component at run time using Liferay admin panel. But backend should be what we have developed. In short, UI of our project is controlled by Liferay but control of data displayed on UI or submitted from UI should be from our developed backend code.
    Now I have a few questions regarding above said approach of fulfilling the requirement:-
    1) What we are trying to do is possible?
    2) Is this approach recommendable for what we intended to do?
    3) Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
    4) What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
    Liferay is a very new for us. We have checked the documentation section of Liferay but still few things like above said requirements and its implementation is not clear. Also, we would like to know in what scenarios/requirements Liferay is useful.
    Eagerly waiting for your views. Any help will be very much appreciated.
    Thanks

  • Regarding number ranges for sales documents.

    Dear Guru's,
    There are 2 number range fields in defining a sales document(i.e Int. &  Ext.).
    Actually we specify either internal or external ,but if we specify both what will happen.
    Thanks in advance,
    Cherukuri

    Hi,
    The number ranges can be either external or internal. If it is external internal you need to mark it in the VN01 and at the same time delete the internal assignment number in the VOV8. If the internal assignment field in VOV8 is not blank the system will keep generating internal numbers.
    If it is external no. range the current no. that is being used cannot be seen on the VN01 screen. And while creating the sales order itself the sytem will prompt you to enter a number between the available range. If you dont enter the same system will not allow you to proceed further.
    Kind Regards
    Chakradhar

  • Regarding push button for parameters

    initially there are two push buttons and the parameters should not be displayed.
    when any one push button is clicked on one parameter should be displayed.
    i had written the following code but is not working
    please help me
    with regards
    bob
    TABLES : SSCRFIELDS.
    PARAMETERS : P LIKE MARA-MATNR MODIF ID ABC.
    PARAMETERS : P1 LIKE MARC-WERKS MODIF ID ABC.
    SELECTION-SCREEN : begin of line,
    PUSHBUTTON 2(10) PB1 USER-COMMAND A,
    PUSHBUTTON 20(10) PB2 USER-COMMAND B,
    end of line.
    AT SELECTION-SCREEN ." OUTPUT.
    CASE SSCRFIELDS-UCOMM.
    WHEN 'A'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P'.
    SCREEN-INPUT = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    endcase.

    Hi Gangadhar,
    Try the following code. Its working on my side.
    TABLES : SSCRFIELDS.
    PARAMETERS : P LIKE MARA-MATNR MODIF ID ABC.
    PARAMETERS : P1 LIKE MARC-WERKS MODIF ID ABC.
    SELECTION-SCREEN : begin of line,
    PUSHBUTTON 2(10) PB1 USER-COMMAND A,
    PUSHBUTTON 20(10) PB2 USER-COMMAND B,
    end of line.
    DATA : FLAG TYPE C.
    AT SELECTION-SCREEN OUTPUT.
      IF FLAG IS INITIAL..
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P'.
            SCREEN-ACTIVE = '1'.
            SCREEN-INPUT = '0'.
            SCREEN-OUTPUT = '1'.
            SCREEN-INVISIBLE = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN .
      CASE SSCRFIELDS-UCOMM.
        WHEN 'A'.
        FLAG = '1'.
          LOOP AT SCREEN.
            IF SCREEN-NAME = 'P'.
              SCREEN-ACTIVE = '1'.
              SCREEN-INPUT = '1'.
              SCREEN-OUTPUT = '1'.
              SCREEN-INVISIBLE = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
      Endcase.
    Hope this helps,
    Pragya

  • Define Cost Elements Range for Internal Activity Allocation

    Dear All,
    I have the following scenario, for SAP standard they have defined the Secondary Cost Elemenets 641000 - 641999 as the Internal Activity Allocation.  I would like to ask where in SPRO configuration can I change this range with my own custom Secondary Cost Elements 400000 - 499999.
    Thanks

    I have not come across any SAP standard number range. They are client specific.
    Also your question regarding number range for Secondary cost elements is not clear. For creation of same you dont require any number range I suppose.
    Number range in SPRO can be maintained in KANK
    Regards,
    Divraj

  • Dump while selecting data using ranges

    Hi everybody,
    I am using ranges to select data from BSEG table.
    In a particular case the ranges table contains around 7000 entries, hence it leads to a short dump. Is there any limitation associated with ranges? with fewer number of entries it works fine. The code is already optimized properly for performance tuning purposes. There are no duplicate entries in ranges table i.e. all 7000 entries are unique and all are with sign as 'I' and option as 'EQ' , so all entries are unique single values.
    Apart from this I have another query also. While selecting data from BSEG / CATSEKKO  table if I use for all entries, then complete data is not fetched, However when I use ranges for same set of values, the missing records are also fetched. Any ideas for this behavior ? Is this related to cluster / pooled / transparent table types?
    Thanks,
    Harmeet Singh.

    Hello,
    I am using ranges to select data from BSEG table.
    In a particular case the ranges table contains around 7000 entries, hence it leads to a short dump. Is there any limitation associated with ranges? with fewer number of entries it works fine. The code is already optimized properly for performance tuning purposes. There are no duplicate entries in ranges table i.e. all 7000 entries are unique and all are with sign as 'I' and option as 'EQ' , so all entries are unique single values.
    i have already encoutered problem using range in SELECT statement. TO avoid the SELECT statement to dump, i have changed my SELECT statement : FOR ALL ENTRIES instead using range.
    +Apart from this I have another query also. While selecting data from BSEG / CATSEKKO table if I use for all entries, then complete data is not fetched, However when I use ranges for same set of values, the missing records are also fetched. Any ideas for this behavior ? Is this related to cluster / pooled / transparent table types?+
    Could you show us the SELECT statement ?
    Cordialement,
    Chaouki AKIR.

  • How to populate the ranges using FM for the SELECTs

    Hi,
    I am still working on the FM to create a generic extractor. I went through the debugger but I am still unable to determine how the ranges are populated. RSA3 always gives me zero values for the results.
    There is a RANGE statement in the sample FM and the following statements for SELECTs
      RANGES: L_R_CARRID  FOR SFLIGHT-CARRID,
              L_R_CONNID  FOR SFLIGHT-CONNID.
    and...
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
            APPEND L_R_CARRID.
          ENDLOOP.
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
            APPEND L_R_CONNID.
          ENDLOOP.
    My question is how is L_R_CONNID and L_R_CARRID populated with low and high values for the SELECT statements? I tried to find the DS 0SAPI_SFLIGHT_SIMPLE to run and see how it is set up but there is no such DS.
    Would someone take the time to say something about this in  several sentences? I have my own code and it seems that it is not populating the values for the SELECTs when I debug from RSA3 when I provide the low and high values.
    Would I normally populate the low and high values from the InfoPackage 'Data Selection' tab once I have implemented in BW or ready to test in BW? That would mean I have to choose those fields as selections from RSO2. Anyway, I think I have asked about this but I am hoping to get an answer to get this going...
    Appreciate any replies.

    Hi
    Here is an example of an extractor that uses
    both method's, if the InfoPackage selection exist's
    it overrides the TVARV selection (which is the default).
    FUNCTION ZBW_TC_FORECAST_SO_EXTRACTOR.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SBIWA_S_INTERFACE-REQUNR
    *"     VALUE(I_DSOURCE) TYPE  SBIWA_S_INTERFACE-ISOURCE OPTIONAL
    *"     VALUE(I_CHABASNM) TYPE  SBIWA_S_INTERFACE-CHABASNM OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SBIWA_S_INTERFACE-INITFLAG OPTIONAL
    *"     VALUE(I_UPDMODE) TYPE  SBIWA_S_INTERFACE-UPDMODE OPTIONAL
    *"     VALUE(I_DATAPAKID) TYPE  SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
    *"     VALUE(I_PRIVATE_MODE) OPTIONAL
    *"     VALUE(I_CALLMODE) TYPE  ROARCHD200-CALLMODE OPTIONAL
    *"  TABLES
    *"      I_T_SELECT TYPE  SBIWA_T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SBIWA_T_FIELDS OPTIONAL
    *"      E_T_DATA STRUCTURE  ZBW_TC_FORECASTING_EXT_STR OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    *"      HIERARCHY_NOT_FOUND
    Change History                                                      *
    Mod. #  |  Date    |  Developer     |  Description                  *
    *RD3K915762|06/21/2005| SRangaraj      | Change selection of open SO   *
             |          |                | data to include deleted matls *
             |          |                | and obsolete items too        *
    RD3K915888|06/29/2005| SRANGARAJ      | Add ext matl grp and lab offce
             |          |                | filters for data-selection    *
    The input parameter I_DATAPAKID is not supported yet !
    Auxiliary Selection criteria structure
      DATA: L_S_SELECT TYPE SBIWA_S_SELECT.
    Maximum number of lines for DB table
      STATICS L_MAXSIZE TYPE SBIWA_S_INTERFACE-MAXSIZE.
    Parameter I_PRIVATE_MODE:
    Some applications might want to use this function module for other
    purposes as well (e.g. data supply for OLTP reporting tools). If the
    processing logic has to be different in this case, use the optional
    parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
    between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
    (I_PRIVATE_MODE = X).
    If the message handling has to be different as well, define Your own
    messaging macro which interprets parameter I_PRIVATE_MODE. When
    called by BIW, it should use the LOG_WRITE macro, otherwise do what
    You want.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    The input parameter I_DATAPAKID is not supported yet !
    Invalid second initialization call -> error exit
        IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
          IF 1 = 2. MESSAGE E008(R3). ENDIF.
          LOG_WRITE 'E'                    "message type
                    'R3'                   "message class
                    '008'                  "message number
                    ' '                    "message variable 1
                    ' '.                   "message variable 2
          RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDIF.
    Check InfoSource validity
        CASE I_DSOURCE.
          WHEN 'ZBW_TC_SO_EXTRACT'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE E009(R3). ENDIF.
            LOG_WRITE 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                      I_DSOURCE            "message variable 1
                      ' '.                 "message variable 2
            RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDCASE.
    Check for supported update mode
       CASE I_UPDMODE.
         WHEN 'F'.
         WHEN OTHERS.
           IF 1 = 2. MESSAGE E011(R3). ENDIF.
           LOG_WRITE 'E'                  "message type
                     'R3'                 "message class
                     '011'                "message number
                     I_UPDMODE            "message variable 1
                     ' '.                 "message variable 2
           RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDCASE.
    Check for obligatory selection criteria
       READ TABLE I_T_SELECT INTO L_S_SELECT WITH KEY FIELDNM = 'PGMID'.
       IF SY-SUBRC <> 0.
         IF 1 = 2. MESSAGE E010(R3). ENDIF.
         LOG_WRITE 'E'                    "message type
                   'R3'                   "message class
                   '010'                  "message number
                   'PGMID'                "message variable 1
                   ' '.                   "message variable 2
         RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDIF.
        APPEND LINES OF I_T_SELECT TO G_T_SELECT.
    Fill parameter buffer for data extraction calls
        G_S_INTERFACE-REQUNR    = I_REQUNR.
        G_S_INTERFACE-ISOURCE   = I_DSOURCE.
        G_S_INTERFACE-MAXSIZE   = I_MAXSIZE.
        G_S_INTERFACE-INITFLAG  = I_INITFLAG.
        G_S_INTERFACE-UPDMODE   = I_UPDMODE.
        G_S_INTERFACE-DATAPAKID = I_DATAPAKID.
        G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
        APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
    Fill range tables for fixed InfoSources. In the case of generated
    InfoSources, the usage of a dynamical SELECT statement might be
    more reasonable. BIW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
        LOOP AT G_T_SELECT INTO L_S_SELECT.
          CASE L_S_SELECT-FIELDNM.
            WHEN 'PRDHA'.
              WGF_PRDHA_LENGTH = STRLEN( L_S_SELECT-LOW ).
              IF WGF_PRDHA_LENGTH = 6.  "PARTIAL PRDHA
                 WGF_PRDHA = L_S_SELECT-LOW.
                 CONCATENATE WGF_PRDHA '%' INTO WGF_PRDHA.
              ELSEIF WGF_PRDHA_LENGTH = 12.  "FULL PRDHA
              MOVE-CORRESPONDING L_S_SELECT TO L_R_PRDHA.
              APPEND L_R_PRDHA.
              ENDIF.
            WHEN 'MATKL'.
              MOVE-CORRESPONDING L_S_SELECT TO L_R_MATKL.
              APPEND L_R_MATKL.
          ENDCASE.
        ENDLOOP.
    reset the index of where we are in the gt_header table
      g_tabix = 0.
      perform populate_default_variables.
      perform get_data.
      perform build_detail.
        EXIT.
      ENDIF.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
       IF G_COUNTER_DATAPAKID = 0.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between InfoSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
      DESCRIBE TABLE LT_DATA LINES l_count.
      IF g_tabix GE l_count.
        RAISE no_more_data.
      ENDIF.
    *CLEAN UP THE OUTPUT TABLE
      refresh E_T_DATA.
      LOOP AT LT_DATA FROM G_TABIX INTO LS_DATA.
        APPEND LS_DATA TO E_T_DATA.
    Set global counter
        g_tabix = g_tabix + 1.
      ENDLOOP.
       G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
    ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    Forms
    ***INCLUDE LZBW_TC_FORECAST_SO_EXTF01 .
    *&      Form  populate_default_variables
          text
    -->  p1        text
    <--  p2        text
    FORM populate_default_variables.
      data: wlf_name like tvarv-name.
      clear: R_prdh3[], wlf_name.
    *get the exclusion range from tvarv for the product hierarchy in
    *question
      concatenate 'ZBW_EXL_' WGF_PRDHA(6) INTO WLF_NAME.
    SELECT LOW FROM TVARV INTO R_prdh3-low WHERE
                                 NAME = WLF_NAME.
      move:  'I'    to R_prdh3-sign,
             'EQ'   to R_prdh3-option.
      append R_prdh3.
      clear R_prdh3.
    ENDSELECT.
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
    CLEAR L_R_LABOR[].
    SELECT LOW FROM TVARV INTO L_R_LABOR-Low WHERE
                                 NAME = 'ZBW_TC_FORECAST_LAB_OFF'.
      move:  'I'    to L_R_LABOR-sign,
             'EQ'   to L_R_LABOR-option.
      append L_R_LABOR.
      clear L_R_LABOR.
    ENDSELECT.
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    ENDFORM.                    " populate_default_variables
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      data: wlf_lmeng like vbep-lmeng.
    *get all deliveries for date range for either a range of product hrchy
    *or a like value
      refresh int_records1.
      if wgf_prdha ne space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha like wgf_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
      elseif not l_r_prdha[] is initial and wgf_prdha = space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha in l_r_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    endif.
        sort int_records1 by vbeln posnr.
        delete adjacent duplicates from int_records1 comparing
        vbeln posnr.
    *remove unnecessary records
        if not r_prdh3[] is initial.
        DELETE INT_RECORDS1 WHERE PRDHA+6(3) IN r_prdh3.
        endif.
    *get the schedule lines for all of the above records and
    *get the lowest schedule line date per so line item
         if not int_records1[] is initial.
         refresh int_records3.
         select vbeln posnr etenr mbdat into table int_records3
         from vbep for all entries in int_records1
                           where vbeln = int_records1-vbeln and
                                 posnr = int_records1-posnr and
                                 lmeng > 0.
         sort int_records3 by vbeln posnr etenr mbdat ascending.
         loop at int_Records1.
           loop at int_records3 where vbeln = int_records1-vbeln
                                  and posnr = int_records1-posnr.
             int_records1-mbdat = int_records3-mbdat.
             modify int_records1.
             exit.
            endloop.
         endloop.
         refresh int_records3. free int_records3.
         refresh int_records2.
    *get the deliveries and calculate the open quantities
        select vbelv posnv vbeln posnn rfmng plmin
                    from vbfa into table int_records2
                                  for all entries in int_Records1
                                  where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr
                                    and VBTYP_N = 'J'. "Dels
    *calculate open quantities next
         loop at int_records1.
           clear wlf_lmeng.
           clear int_records2.
           loop at int_records2 where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr.
           case int_records2-plmin.
             when '-'.
              wlf_lmeng = wlf_lmeng - int_records2-rfmng.
             when others.  "just add
              wlf_lmeng = wlf_lmeng + int_records2-rfmng.
            endcase.
           endloop.
           int_records1-klmeng = int_records1-klmeng - wlf_lmeng.
           int_records1-vbeln_dl = int_records2-vbeln.
           int_records1-posnr_dl = int_records2-posnn.
           modify int_records1.
        endloop.
        endif.
        delete int_records1 where klmeng le 0.
        refresh int_records2. free int_Records2.
    ENDFORM.                    " get_data
    *&      Form  build_detail
          text
    -->  p1        text
    <--  p2        text
    FORM build_detail.
        LOOP AT int_records1.
    *DO INDIVIDUAL MOVES - ITS FASTER THAN MOVE-CORRESPONDING
        move: int_records1-vkorg    to LS_DATA-VKORG,
              int_records1-werks    to LS_DATA-WERKS,
              int_records1-matnr    to LS_DATA-MATNR,
              int_records1-klmeng   to LS_DATA-KLMENG,
              int_records1-mbdat(6) to LS_DATA-YEARMONTH,
              int_records1-meins    TO LS_DATA-MEINS,
              int_records1-vbeln    TO LS_DATA-VGBEL,
              int_records1-posnr    TO LS_DATA-VGPOS,
              int_records1-vbeln_dl TO LS_DATA-VBELN,
              int_records1-posnr_dl TO LS_DATA-POSNR,
              int_records1-mbdat    to LS_DATA-WADAT_IST,
              int_records1-PRDHA    to LS_DATA-PRDHA,
              int_records1-matkl    to LS_DATA-MATKL.
        APPEND LS_DATA TO LT_DATA.
        clear: LS_DATA.
        ENDLOOP.
    ENDFORM.                    " build_detail

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_0

    How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_001 using Functional Module NUMBER_GET_NEXT explain me ?

    Hi,
    First go thourh the FM import export parameters list.
    Try to create an internal table of type INRI-NRRANGENR for number ranges.
    We can provide the lower and higher values for this table so that what ever PO is created will be with that range.
    Try to create the ncessary ones using this FM.
    In the Exit, EXIT_SAPMM06E_001,
    the Export parameters are-
    EKKO-EBELN- the PO ios created with in that specified range
    Range as INRI-NRRANGENR - Here try to assign the Internal table that was populated in the FM.
    Try to code this in the Include provded and keep Breakpint and check the PO number generated.
    Reply if u need more help on this.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • How to use parameter range for subreports?

    On the main report, I have two parameters for starting customer order number and ending customer order number.   I created the same parameters on the sub-report.  When I run the report, I use the 2 parameters with the starting customer order
    as 139818 and the ending customer order 139824.   The main report which is the customer order information prints correctly.   However, instead of getting one sub-report based on the first order which is 139818,  I get
    a sub report for every order in the range.   Then, the main report prints order 139819, and then repeats the sub-report loop for every order.  So, each time the main report prints, I get 7 sub-reports.   How do I link the
    main report to the sub-report so there is a one to one match so only one sub-report is generated per customer order?    
    The design requirement is for the user to be able to enter a range of customer orders and then there is one main report and one sub-report per customer order.
    I appreciate your response for answering this question.
    Jeff

    Sounds like you are passing the same two parameter values that the main report uses to the subreport and the subreport is set to display a range of results, just like the main report.
    The subreport needs only one parameter... customer order. Assuming that the main report displays its information in a tablix that is grouped on customer order and the subreport is embedded in that group, you would simply set the subreport parameter (@CustomerOrder)
    to the value for customer order from the dataset (Fields!CustomerOrderNum.Value). That will pass a single order number to the subreport.
    Using the current setup, whatever it is, you should be able to achieve the same results by passing Fields!CustomerOrderNum.Value (or whatever you dataset column name is) for both parameters. That way the range of customer order numbers is the single order
    you wish to display.
    Performance should be better if you fix the subreport so it takes and displays a single order number. You should be able to simplify the underlying dataset query and thereby gain efficiency.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How to use Generate Synchronization Parameters for PSK modulation and demodulation

    Hi I am trying to use Generate Synchronization Parameters.vi to sync the recovered stream after demodulation and my input stream to modualtion block but I don't know how to work with this block to sync input stream with output stream. Also would you please let me know what are the ways to sync input bits and demodulation  bit stream.I really appreciated your help
    Thanks
    Solved!
    Go to Solution.

    Hi en99,
    In order to use "MT Generate Synchronization Parameters.vi" you must wire in the following on your block diagram:
    The system parameters created in "MT Generate System Parameters.vi" needs to be wired directly to the sync vi.
    The synchronization parameters need to be wired direct to "MT Demodulate.vi"
    The synchronization bits can be wired into the sync vi direct from "MT Generate Bits.vi"
    What I have done is taken your 11.vi that you uploaded in your previous post and altered it to contain the sync vi. I have saved it as a 2010 version.
    I hope this information helps!
    Kind Regards,
    Laurence C.
    Senior Test Development Engineer
    Dyson Ltd
    Attachments:
    11sync2010.vi ‏18 KB

Maybe you are looking for

  • Re: [SunONE-JATO] Re: How to use a tiled view without a model

    I'm not sure what is different for you now. You still parse the string and put it into a data structure. Before the data structure was a vector, in JATO its just a model with a "hidden" data structure (a hash map). MVC only really comes into play whe

  • Background IMG won't show up in browser IEXPLORE

    I have a div tag called "banner" in which I have used our company logo as a background image. I can't figure out why it's not showing up when I preview the page in Internet Explorer. It is showing up in the design page just fine. Below is my code: <!

  • Purchase Order Customer Fields

    Hi Experts, I have enhanced purchase order screen at header level with customer data tab.This tab contains text fields where user can enter details regarding import purchase orders. I have also activated release strategy on Purchase Orders.Now the re

  • Modules fail to load

    Hi there I've been away for some time and for some reason i can't get the installation to work . When arch boots i get the message that modules fail to load , and afterwards when i try to startx , i get a black screen and nothing happens. Also i reme

  • Cisco VPN Client wont install Error 1406

    Hello I am installing Cisco VPN Client on my Windows 7 32-bit  laptop but it doesn't work. I have downloaded VPN Client ver "vpnclient-win-msi-5.0.07.0410-k9" which is supposed to be assigned for Win 32 bit but i get a lot of error like his: "Error 1