I need use conditions in the select fields of a query.

Hello,
Is possible, that I can have conditions in the select fields of a query? In a invoice when the type is cancellation I want to put *-1 to price and if is other type the price is normally.
If VBRK.FKART = 'S1' THEN KWERT*-1 else KWERT .
Thank you very much.

you can do two things:
1. select the data into internal table and loop through the internal table and do the necessary changes
SELECT fkart kwert
FROM vbrk
INTO TABLE itab
WHERE ...
LOOP AT itab.
IF itab-fkart EQ 'S1'.
itab-kwert = itab-kwert * -1 .
MODIFY itab.
ENDIF.
ENDLOOP.
2. use select-endselect and change the data acc. to your needs inbetween and append the internal table.
SELECT fkart kwert
FROM vbrk
INTO wa
WHERE ...
IF wa-fkart EQ 'S1'.
wa-kwert = wa-kwert * -1 .
ENDIF.
APPEND wa TO itab.
ENDSELECT.
(The first approach is probably faster.)

Similar Messages

  • Order of the selection fields in SAP QUERY

    Hello All,
    How can we set the order of the selection fields in SAP QUERY!
    Regards!
    Ashish

    Hi,
    You can go into infoset and change the order.
    Or you can select 1 by 1 in the same order, you want to display.
    Below is the link which might help you:
    help.sap.com/printdocu/core/Print46c/EN/data/.../BCSRVQUE.pdf
    Please revert, if needed more clarifications
    Regards,
    Yashwin

  • Need some help with the Select query.

    Need some help with the Select query.
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    select single vkorg abgru from ZADS into it_rej.
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
            VKORG TYPE VBAK-VKORG,
            ABGRU TYPE VBAP-ABGRU,
           END OF IT_REJ.
    This is causing performance issue. They are asking me to include the where condition for this select query.
    What should be my select query here?
    Please suggest....
    Any suggestion will be apprecaiated!
    Regards,
    Developer

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

  • I need a report with the following fields

    Hi All,
    I need a report with the following fields & G/L "Expenses" only.
    1)G/L Code.
    2) G/L Name.
    3) G/L Balance
    & Selection Criteria From Date, To Date , & Location(for me locations is PROFITCENTRE).
    Please some body suggest me an SQL Querry to fetch this result.
    Thanks in Advance,
    S. Mobin

    Hi!
    Individual G/L means i didn't understand
    check this for only Expence Acc
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Location nvarchar(20)
    set @FromDate = (Select min(S0.RefDate) from jdt1 s0 where s0.Refdate >='[%0]')
    set @ToDate = (Select max(S1.RefDate) from jdt1 s1 where s1.Refdate >='[%1]')
    set @Location = (Select max(s2.ProfitCode) from jdt1 s2 where s2.ProfitCode  = '[%2]')
    select
    J1.Account,
    max(A0.AcctName) as Name,
    j1.ProfitCode as Location,
    sum(J1.debit-j1.credit) as Balance
    From
    JDT1 J1,OACT A0
    Where
    J1.Account=A0.AcctCode and
    J1.RefDate >=@FromDate and
    J1.RefDate<= @ToDate and
    j1.ProfitCode=@Location and
    A0.GroupMask = 5
    Group By
    J1.Account,j1.ProfitCode

  • In a query, for the selection field 'KNB1-ZWELS' a match-code isn't availab

    Hi All,
    Creating a query, for the selection field 'KNB1-ZWELS' a match-code isn't available.
    Could anyone tell me the reason?
    Thanks
    Gandalf

    Hi,
    Match Code Object is not available for the field ZWELS. If required, You need to contact a Developer for creating one .

  • Code order in sq02, Problem in the selection fields in sq01

    Hi all,
    I'm writing a query with sq01 and sq02.
    In sq02 I have some joined tables, and 2 extras fields named: "TIME" and "LEFT_ER".
    in this fields I wrote a code to calculate something from fields in the tables.
    The problem is:
    1. When I write the code in the coding section "Additional field/structure" for each field, If I want to use this fields in the selection fields (in sq01) the query can't find any record.
    But if I run this query without any selection in this fields, I get all the records, with my calculated fields.
    2. I tried to write this code in the coding section "Record processing", and it seems that I can use this fields in the selection fields (in sq01), and get all the records I wanted.
    But in the sq02 I get a Warning messages:
    "Access error in code for additional field *GET******
    *GET****** has sequence number 00
    Access to LEFT_ER with sequence number 00"
    In this case my field LEFT_ER has no code.
    And when I change the order of the sequence number, I didn't get the Warning message, but I could not use my fields in the selection fields (in sq01), like at the beginning.
    HELP ME PLEASE.
    Itzhak.
    Message was edited by: Itzhak Tanami

    Hi,
    i've an idea .
    pls define your help-fields :
    1) as sel-option : s_f1 for bseg-dmbtr
    and
    2) as calculate-field  : c_f1 for bseg-dmbtr
    so for event e.g. GET BSEG .
    you <b>1st</b> calculate your field .
    e.g.
    if bseg-shkzg = 'H'.
       c_f1 = Bseg-wrbtr * -1.
      else.
       c_f1 = Bseg-wrbtr.
    endif.
    and 2nd  your restriction from sel-screen:
    <b>check c_f1 in s_f1.</b>
    good luck
    Andreas

  • Foreign key cannot be created for the selected field A907-MWSKZ

    Dear Guru's,
    I am having the requirement for creation of access sequence having country/Plant/vendor/tax code but during creation of condition table i am getting the error as
    Foreign key cannot be created for the selected field A907-MWSKZ.
    Anything i am missing please let me know.
    Regards,
    Umesh

    Hi Umesh,
    Actually i am also facing exactly the same problem as mentioned by you that is "Foreign key cannot be created for the selected field A769-MWSKZ ".
    I think you found some solution regarding this..can you please help me to solve it.
    Looking forward for your prompt reply..
    Thanks & Regards,
    Sandeep Sharma

  • SAP Query; change the name of the selection fields

    Hi,
    I created a SAP query using SQ01. When I execute the report, the selection field are the names of the table fields. As an example, I would like to change the selection field name «Customer number 1» for «Customer number». How can I change this selection field name in a SAP Query?
    Thanks,
    Julien

    Check Page Number 8 of this below mentioned document
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c

  • Hiding the Selected field in the Crystal reports 2011

    Hi Experts,
              I am new to the Crystal reports. How to hide the Selected Field in the Crystal report 2011.
    Thanks,
    Kavya.C

    Hi Kavya,
    You can right click on the field, go to Format Field -> Common Tab. Select/Check the option "Suppress". Or if you want to hide/ Suppress the entire section in a Crystal Report, for e.g. Detail section, right click on Details Section and select Section expert. You can select Hide/Supress accordinly.
    That should hide the filed/Section when you run the report.
    - Kuldeep

  • Selection field in Infoset Query

    Hi All,
    I have an Infoset which is based on Logical database PNP &  it has few additional fields. Now the requirement is to add one of the additional field to the selection screen of "Infoset Query". But in the Infoset query the 'Selection' checkbox for all the additional fields is graded out, & only the 'Output' Checkbox is enabled for all the Additional fields.
    I added a new additional field in Infoset and even that is not available for selection in the Infoset query.
    Kindly let me know if you have any info regarding this....
    Please note that i have this problem in 'Infoset Query' only.
    Thanks in advance.
    Regards,
    Karthick.

    Navin,
    Try with this link,everything in detail is explained about Infoset queries..
    http://shafiq.us/sap/index.php?view=article&id=54%3Aadhoc-query&option=com_content&Itemid=61
    hope..this will help you!
    Cheers,
    KK

  • Need help with correcting the select statement

    I have two tables mkt & error.
    The fields of mkt are
    app_id (xxx)
    c_mkt_id
    app_mkt_id
    The fields of error table are
    mkt_id
    intr_id (its in format xxx.yyy or xxx)
    xyz
    abc
    pqr
    I have to select * fields from error table such that
    ->mkt.app_id = error.intr_id (here i am using combination of sbstr & instr to get the part before "." if present)
    ->mkt.c_mkt_id=error.mkt_id
    Where ever the above two conditions match i have to replace the mkt_id field in my select * from error table query with the
    app_mkt_id field from mkt table. If the above two condtions dont match my select * from error table should return the original mkt_id present in the error table.
    I have presently developed a query(*) which selects the app_mkt_id from mkt table where ever the two conditions match.
    How should i go about using this to get my actual requirement.
    (*)=select app_mkt_id from mkt where app_id in (select case when case_when=1 then substr(intr_id, 1, instr(intr_id,'.')-1) else substr(intr_id, 1) end from (select intr_id, case when instr(intr_id,'.',1)=0 then 0 else 1 end case_when from error)) and
    c_mkt_id in (select mkt_id from error)

    you wrote:
    (*)=select app_mkt_id from mkt where ....What is this?
    If you are writing PL/SQL the syntax is:
    SELECT ....
    INTO ....
    FROM ....
    WHERE ....This seems to be school work and thus you really need to puzzle this out for yourself.

  • Crystal Reports XI:  Using Wilcards with the Select Expert

    I have a field with 10 numbers.  There are several of them that start with three numbers and end in all zeros.  I want to make sure these are not in my report.  I have been successfully able to do this using the select expert, but it requires a lot of manual entry:
    {@Phone Number} <> "4090000000" and
    {@Phone Number} <> "2810000000" and
    {@Phone Number} <> "8320000000" and
    {@Phone Number} <> "5120000000" and
    {@Phone Number} <> "9999999999" and
    {@Phone Number} <> "9760000000" and
    {@Phone Number} <> "9360000000" and
    {@Phone Number} <> "6010000000" and
    {@Phone Number} <> "8150000000" and
    {@Phone Number} <> "7130000000"
    I need to find a way to do this without having to enter each code by itself.  I tried using a wilcard, but it appears that I am not using it correctly.
    {@Phone Number} <> "***0000000"
    Please help.  Thanks!

    Nevermind   Just needed a simple: 
    not ({@Phone Number} like "*0000000")

  • Using @Prompt in the SELECT clause (?)

    Post Author: faltinowski
    CA Forum: Semantic Layer and Data Connectivity
    Product:  Business Objects
    Version:  6.5 SP3 
    Patches Applied:  MHF11 and CHF48
    Operating System(s):  Windows
    Database(s):  Oracle
    Error Messages:  "Parse failed: Exception: DBD, ORA-00903 invalid table name  State N/A"
    Hi!  I'm bewildered -- we have an object that parses but when I try to reproduce this object, it does not.
    We have a universe that's been in production for several years using an object developed by another designer who's no longer with the company.  This object is a dimension, datatype is character, and there's no LOV associated.  The SELECT statement in this object is
    decode(@Prompt('Select Snapshot Month','A','Object Definitions\CY Month Snapshot',MONO,CONSTRAINED),'00-Previous Month',to_number(to_char(add_months(sysdate,-1),'MM')),'01-Current Month',to_number(to_char(add_months(sysdate,0),'MM')),'01-January','1','02-February','2','03-March','3','04-April','4','05-May','5','06-June','6','07-July','7','08-August','8','09-September','9','10-October','10','11-November','11','12-December','12')
    This object parses. The client uses the object in the select clause to capture the "month of interest" for the report.  So the report may be for the entire year's data which is graphed to show trends, but there's a table below the graph which is filtered to show just the month of interest.  Typically they use the value "00-Previous Month" so they can schedule the report and it will always show the last month's data.
    Problem
    The original object parses.
    If I copy the object within the same universe, it parses.
    If I copy the code into a new object in the same universe, it doesn't parse
    If I copy the code into a new object in a different universe, it doesn't parse
    If I copy the object to a different universe, then edit the LOV reference, it doesn't parse
    If I create any new object having @Prompt in the SELECT statement, it doesn't parse.
    If another designer tries - they get the same thing.
    What am I missing?  Obviously someone was able to create this successfully.
    On the brighter side
    The object I created in a new universe (which doesn't parse in the universe) seems to work fine in the report.

    Seems that, the prompt syntax is correct.
    But the condition is not correct.
    You are taking the prompt value and not doing anything. That could be one issue for this error.
    I believe that, you just want to capture the prompt value use it in report level and do not want to apply as a filter.
    So, use the condition as follows.
    @Prompt('Select Grouping','A',{'A','B','C'},mono,constrained) = @Prompt('Select Grouping','A',{'A','B','C'},mono,constrained)
    Hope this helps!

  • 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

  • How to change the value of the Selection field in the ROOSFIELD table for o

    Hi there
    I have a standard data source 0CRM_SALES_ACT_1 for which one of the standard field has the status A(Hidden).
    In the field selection filed of the table ROOSFIELD and I want to change it to P(Visible)  for  one of the field in the Data source.
    How it can be done. Any suggestion will be greatly appreciated.
    kind regards
    Sarah

    Hi,
    Keerthi
    Good Question..Even am also new to this issue.
    But let me try to find the solution.
    Before lookinto this issue. i need clarification on this.
    1. You want to see the value in the text box as a color one or you want to change the disable from true to false?
    If that is the case, then following one is my suggestion.
    In proceesRequest method
    1. get the handle for the messageTextInput Bean and based on that set the disable property to false
    for example:
    OAMessageTextInputBean t1 = (OAMessageTextInputBean )webBean.findChildRecurrsive("ItemId");
    t1.setDiabled(false);
    In ProcessFormRequest method
    1. get the handle for the messageTextInput Bean and based on that set the style class or css property to "OraFieldText"
    for example:
    OAMessageTextInputBean t1 = (OAMessageTextInputBean )webBean.findChildRecurrsive("ItemId");
    t1.setCss(OraFieldText);
    (Or)
    If it will not work then directly set the cssClass Property to OraFieldText.
    I hope it will work....am not sure about this.
    Regards
    Santhosh kumar.k

Maybe you are looking for

  • NODE GETTING EVICTED ?

    Hello All, We have a Two node production setup for RAC 11gR2 on VM. We are facing issue of frequent Node eviction. Node gets evicted atleast once a day, We have tried switching to Single node and stopped all the services on the another node. However,

  • Map XML content to RFC Input parameters

    Hello I have a MII Transaction that opens a xml file from a legacy system, this transaction have to handle the content of that XML file and fill out the BAPI_PRODORDCONF_CREATE_TT parameters. My transaction is already reading the XML using Reference

  • Replay error with new iTunes

    I just downloaded version 7.0.2.16 and I've connected my Nano to my laptop to play music directly from the ipod through my satellite speakers while I charge my nano. The problem I'm having is that iTunes will play one song, and then the next, and the

  • Can anyone confirm this getPathInfo()= null problem???

    Hey everyone,           I am still awaiting word from WEBSupport, but I am curious if anyone else           can confirm this behaviour... I have created a very simple little           TestServlet class...once it is compiled you simply need to place i

  • After upgrading to Snow Leopard, free disk space calculation seems off.

    So, I have a MacBook Pro 13". I bought it in June, so it came with Leopard. I ordered it with a 500GB hard drive, which actually came out to 465GB (as expected). However, since upgrading to Snow Leopard, the maximum disk space now reads 500.11GB, as