Multiple entries alongwith one contra

Hi,
I have a detail block in which i have fields like this and user can enter amount data in both fields (debit, credit) ...but i want to restrict my user that he/she should only enter data either MULTIPLE DEBITS and only one(1) credit entry like the following.
Acc_code....Name.................Debit.........Credit...................
1                Bank A             5000
2                Bank B             500
3                Bank C             450
4                Bank D             100          
10              Cash                                   6050I dont want my user to do the following.
Acc_code....Name.................Debit.........Credit...................
1                Bank A              5000
2                Bank B                500
3                Bank C                450
4                Bank D                100          
10              Cash                                   5000
10              Cash                                   1000
10              Cash                                      50OR this is also not allowed
Acc_code....Name.................Debit.........Credit...................
1                Bank A                                7000
2                Bank B                                1000
3                Bank C                                  500
4                Bank D                                  100          
10              Cash                   5000
10              Cash                   1000
10              Cash                   2000
10              Cash                     100In Short....following are the rules
1. AGAINST MULTIPLE DEBITS only one CREDIT entry is allowed
2. AGAINST MULTIPLE CREDITS only one DEBIT entry is allowed
3. ONE DEBIT AGAINST ONE CREDIT OR ONE CREDIT AGAINST ONE
DEBIT is allowed
4. NO REPEATATION OF ACC_CODES IN DETAIL BLOCK AS WELL
Now How to do this in forms .thanks in advance :)

Table Level Trigger
==============
Pre Insert
=======
Select count(*)
into V_count
from -----
and vouhcerid = ---
and credit_amt >0
if nvl(v_count,0) > 0 then
if :credit_amt <> 0 then
message/ alert show "only one credit entry pass"
raise form_trigger_failure;
end if;
end if;

Similar Messages

  • Multiple entries in one database column

    Hello.
    I am a bit of a php/mysql newbie.  I'm trying to figure out how to select multiple data entries from one database column.
    For example, I have a column in one table called name_id.  I want to assign multiple names to a specific entry in this table.  Like, "1,4,12,18", for example.  Each of these numbers are the primary keys for my name table.  So, I'm trying to assign 4 people to one set of data in this example.
    I have seen this done before, I just don't know how to select this data once it is in there.  I think it may have something to do with arrays, but I'm not sure.
    I hope this makes sense, any help would be much appreciated.

    That's a poor design plan as it violates the basic rules of normalization and will cause  problems in the end. Just create another table to link to and store the one value in each row. If you need more details, then tell us exactly what you are trying to do.

  • HELP: Customizing ESS Leave Request for multiple entries in one submission

    Hi experts,
    I appreciate help on this urgent problem. We're on ECC6 with EP7. My customization requirements are below:
    1) Allow multiple leave entries to be submitted at one go. Standard ESS only allows one date range entry per submission. We've customized the Webdynpro Leave request form to allow multiple entries in table form.
    Assuming there's 3 requests:
    R1 ~ 01-Oct-2007
    R2 ~ 03-Oct-2007
    R3 ~ 05-Oct-2007
    Whenever user clicks 'New Entry' button, Webdynpro will call bapi PT_ARQ_REQUEST_PREPARE to generate a new request ID.
    When user clicks on 'Review' button, I will loop at the requests internal table and check each of the entries, which is an individual request, via BAPI PT_ARQ_REQUEST_CHECK. Am I doing correctly so far?
    The checks return no error. Next comes the problem. When I click the 'Send' button, I will loop at the request IDs (in ascending order) into BAPI PT_ARQ_REQUEST_EXECUTE. I will get a dump, saying that the object cannot be found. Debugging shows that it cannot find the first request ID (R1) in the memory. I found that if I sort the request IDs in descending order, it will be able to find the last request (R3) and could process it. However, when it comes to the 2nd last request (R2), it will give me the same dump saying that object can't not found. Both R1 and R2 cannot be found whereas only R3 can be found.
    In overview, the logic we adopted is like this:
    1) PT_ARQ_REQUEST_PREPARE-CREATE (R1)
    2) PT_ARQ_REQUEST_CHECK (R1) upon clicking 'New Entry' Button
    3) PT_ARQ_REQUEST_PREPARE-CREATE (R2)
    4) PT_ARQ_REQUEST_CHECK (R2) upon clicking 'New Entry' Button
    5) PT_ARQ_REQUEST_PREPARE-CREATE (R3)
    6) PT_ARQ_REQUEST_CHECK (R1, R2, R3) upon clicking 'Review' Button
    7) Loop PT_ARQ_REQUEST_EXECUTE ( R3 - Returns OK, R2 - Returns object not found and terminates, R1 - not processed because execution terminated by R2).
    Can anyone please advise me how I should go about changing the BAPIs? Or are the CLASSes/BADIs to be changed?
    <b>Points will be rewarded for helping with this urgent requirement.</b> Thank you.
    Regards,
    Damien

    Hi Kiran,
    Thanks for replying. My guess initially was also that the requests are overwritten.
    I heard of another company's implementation who did the same concept and was able to do it. Unfortunately, I'm unable to get any information from them.
    Initially, my frontend programmer and I thought of adopting the 'dummy checks' methodology. i.e. Do dummy checks when clicking 'New entry' or 'Review' button. This is to ensure that the entries were entered correctly at front end. Only when the user clicks on the 'Send' button, my BAPIs take in a table of request entries and perform the Request_Prepare&Request_Check&Request_Execute one at a time.
    This may be expensive as there will be double the processing needed. One set for dummy checks and one set for the actual backend processing.
    Is there any way that I can create multiple requests in 'transcient' state so that it won't be overwritten and I can still find it when I call the BAPI PT_ARQ_PREPARE_EXECUTE? PT_ARQ_PREPARE_EXECUTE only takes in request IDs instead of request structures.
    Thanks again, Kiran, for replying. Have a good weekend.
    Regards,
    Damien

  • Multiple entries for one album and tracks are diveded between entries

    After adding all my music into iTunes I have some albums listed multiple times with one or two tracks listed in each one. How can I get all the tracks for that album listed all together? Also is there any way to import album art from another program. Windows media player has all the album art and iTunes is missing about 40 percent of them?

    Well, I tried everything in that article and when all my albums are in cover flow view multiple albums covers show for that one album. When I type in the album name, it narrows down to 1 CD.
    As far as not being able to retrieve album artwork, I just do a google image search. After I have saved the pictures I go to the info for any song in that album and add it to artwork.

  • Can I create a PDF fillable form that allows form multiple entries and one submission?

    For example, I would like to enter new hire information for multiple new hire employees and only click the submit button once.

    Good Morning Randy -
    Sorry for not giving you a clear enough description. I was trying to avoid a novel.
    I hope to use FORMSCENTRAL for create a form for on-line users to register for meetings including paying via paypal.  Some of the people register and pay for the meeting by themselves and others are registered by their office assistant, so there might be as many as 25-30 people.
    The individual registrants are easy and doable with FORMSCENTRAL.
    However, for the multiple registrants, I would like to create a form that can handle multiple registrants and only one submission for payment.  So far, I have  only been able to do that by creating a form that has the registrant fields created multiple times.  I would really like to be able to have the set of fields created once unless I need to add the set of fields multiple times.  I am sure that complications keeping track of the total payment due as well.
    Being able to set-up a table with the fields across (left to right) for each registrant would be good.
    Maybe this does not explain it well enough in which case, I can call and explain our need.
    Thanks in advance.
    Paul

  • Updating multiple entries into one field

    Hi i have a legal directory in which when a solicitor
    registers they can select as many or as few areas of law they want.
    I have all of the areas in a check box
    <input type="checkbox" name="areaoflaw" value="Agricultural
    Law">
    <input type="checkbox" name="areaoflaw" value="Aviation
    Law">
    <input type="checkbox" name="areaoflaw" value="Charity
    Law">
    <input type="checkbox" name="areaoflaw" value="Civil
    Liberties & Human Rights">
    <input type="checkbox" name="areaoflaw" value="Computer
    & IT Law">
    <input type="checkbox" name="areaoflaw"
    value="Construction & Civil Engineering">
    <input type="checkbox" name="areaoflaw" value="Consumer
    Problems">
    <input type="checkbox" name="areaoflaw"
    value="Conveyancing (non-UK)">
    <input type="checkbox" name="areaoflaw" value="Corporate
    Finance">
    <input type="checkbox" name="areaoflaw" value="Dental
    negligence">
    <input type="checkbox" name="areaoflaw" value="Debt
    Collection">
    <input type="checkbox" name="areaoflaw" value="Defamation
    Law">
    <input type="checkbox" name="areaoflaw" value="European
    Law">
    <input type="checkbox" name="areaoflaw" value="Education
    Law">
    <input type="checkbox" name="areaoflaw"
    value="Environmental Law">
    <input type="checkbox" name="areaoflaw"
    value="Enfranchisement & Lease extensions">
    <input type="checkbox" name="areaoflaw" value="Fraud">
    <input type="checkbox" name="areaoflaw" value="Insurance
    Miss-selling">
    <input type="checkbox" name="areaoflaw"
    value="Intellectual Property">
    <input type="checkbox" name="areaoflaw"
    value="Landlord">
    <input type="checkbox" name="areaoflaw" value="Tenant">
    <input type="checkbox" name="areaoflaw" value="Licensing
    Law">
    <input type="checkbox" name="areaoflaw" value="Media &
    Entertainment Law">
    <input type="checkbox" name="areaoflaw"
    value="Mediation">
    <input type="checkbox" name="areaoflaw" value="Mental
    Health">
    <input type="checkbox" name="areaoflaw" value="Motoring
    Offences">
    <input type="checkbox" name="areaoflaw" value="Planning
    Law">
    <input type="checkbox" name="areaoflaw"
    value="Professional Negligence">
    <input type="checkbox" name="areaoflaw"
    value="Pharmaceutical Claims">
    <input type="checkbox" name="areaoflaw" value="Regulatory
    Investigations">
    <input type="checkbox" name="areaoflaw" value="Sports
    Claims">
    <input type="checkbox" name="areaoflaw" value="Shipping
    Law">
    <input type="checkbox" name="areaoflaw" value="Tax
    Law">
    <input type="checkbox" name="areaoflaw" value="Travel
    & Tourism">
    <input type="checkbox" name="areaoflaw" value="Welfare
    Benefits">
    When they submit i want it to insert as many areas as they
    have selected but it only submits the last one checked.
    <cfquery name="insertsolicitor" datasource="law4essex"
    dbtype="odbc">
    insert into
    solicitors(companyname,contactname,address1,address2,town,county,postcode,tel,fax,email,w ebsite,areaoflaw)Values('#companyname#','#contactname#','#address1#','#address2#','#town#' ,'#county#','#postcode#','#tel#','#fax#','#email#','#website#','#areaoflaw#')
    </cfquery>
    Does anyone how i can add all or a few of them depending what
    is selected. they should all go into the area of law field in the
    database

    cybertek23, I'd seriously reconsider doing an INSERT INTO
    for these fields as a comma delimited list. This will undoubtedly
    cause nothing but headaches in the near future. A better way might
    be use each checkbox fieldname as its own column name in the dB.
    In any case, see if this works for you:
    <input type="checkbox" name="areaoflaw"
    value="Agricultural Law">
    <input type="checkbox" name="areaoflaw" value="Aviation
    Law">
    <input type="checkbox" name="areaoflaw" value="Charity
    Law">
    <input type="checkbox" name="areaoflaw" value="Civil
    Liberties & Human Rights">
    <input type="checkbox" name="areaoflaw" value="Computer
    & IT Law">
    <input type="checkbox" name="areaoflaw"
    value="Construction & Civil Engineering">
    <input type="checkbox" name="areaoflaw" value="Consumer
    Problems">
    <input type="checkbox" name="areaoflaw"
    value="Conveyancing (non-UK)">
    <input type="checkbox" name="areaoflaw" value="Corporate
    Finance">
    <input type="checkbox" name="areaoflaw" value="Dental
    negligence">
    <input type="checkbox" name="areaoflaw" value="Debt
    Collection">
    <input type="checkbox" name="areaoflaw" value="Defamation
    Law">
    <input type="checkbox" name="areaoflaw" value="European
    Law">
    <input type="checkbox" name="areaoflaw" value="Education
    Law">
    <input type="checkbox" name="areaoflaw"
    value="Environmental Law">
    <input type="checkbox" name="areaoflaw"
    value="Enfranchisement & Lease extensions">
    <input type="checkbox" name="areaoflaw" value="Fraud">
    <input type="checkbox" name="areaoflaw" value="Insurance
    Miss-selling">
    <input type="checkbox" name="areaoflaw"
    value="Intellectual Property">
    <input type="checkbox" name="areaoflaw"
    value="Landlord">
    <input type="checkbox" name="areaoflaw" value="Tenant">
    <input type="checkbox" name="areaoflaw" value="Licensing
    Law">
    <input type="checkbox" name="areaoflaw" value="Media &
    Entertainment Law">
    <input type="checkbox" name="areaoflaw"
    value="Mediation">
    <input type="checkbox" name="areaoflaw" value="Mental
    Health">
    <input type="checkbox" name="areaoflaw" value="Motoring
    Offences">
    <input type="checkbox" name="areaoflaw" value="Planning
    Law">
    <input type="checkbox" name="areaoflaw"
    value="Professional Negligence">
    <input type="checkbox" name="areaoflaw"
    value="Pharmaceutical Claims">
    <input type="checkbox" name="areaoflaw" value="Regulatory
    Investigations">
    <input type="checkbox" name="areaoflaw" value="Sports
    Claims">
    <input type="checkbox" name="areaoflaw" value="Shipping
    Law">
    <input type="checkbox" name="areaoflaw" value="Tax
    Law">
    <input type="checkbox" name="areaoflaw" value="Travel
    & Tourism">
    <input type="checkbox" name="areaoflaw" value="Welfare
    Benefits">
    <!--- ON THE PROCESSING PAGE, CREATE A VAR THAT'S BLANK
    --->
    <cfset listone = "">
    <cfif isDefined("FORM.areaoflaw")>
    <cfloop list="#FORM.areaoflaw#" index="i">
    <!--- APPEND EACH CHECKBOX VALUE THAT WAS SUBMITTED
    --->
    <cfset listone = ListAppend(listone, "#i#")>
    </cfloop>
    </cfif>
    <cfquery name="insertsolicitor" datasource="law4essex"
    dbtype="odbc">
    INSERT INTO solicitors
    (companyname,contactname,address1,address2,town,county,postcode,tel,fax,email,website,are aoflaw)
    VALUES
    ('#companyname#','#contactname#','#address1#','#address2#','#town#','#county#','#postcode #','#tel#','#fax#','#email#','#website#',
    '#i#')
    </cfquery>
    ------------------------------------------------------------------------------------------ --------------------------

  • Delete multiple ical entries at one time

    Somehow a couple of my birthdays managed to multiply when combining calendars. One birthday has about 100 duplicate entries. Has anyone tried ical alarmist - does it work well? Or is there another easy way to delete multiple entries at one time? Thanks

    To my knowledge there is no delete all events option in calendars.  You'll have to delete them one by one.

  • How to save multiple new entries in one shot?

    Hi,
    I am working on a pretty complex Create form. So apart from the standard form fields to allow user to enter the data, one of the sections in this form is a table which allows user to create multiple entries for this entity. And when hitting the "Save" button in this form, it will save all the data plus the multiple entries defined in this table.
    Is it possible to create multiple new entries in a table, and then save all of the new entries at the end? My experience so far is only create and save one new entry at a time.
    Any sample?
    Please advise.
    Thanks.
    -Mina

    Yes, I am using ADF BC.
    Let me explain more in details of the scenario:
    I have a table with "Create New" and "Save" button. The "Create New" button's ActionListener is set to "#{bindings.CreateInsert.execute}", and the "Save" button's ActionListener is set to "#{bindings.Commit.execute}".
    When the "Create New" button is hit, a new row shows up in the table to allow entering data inline. When the "Save" button is hit, it got committed. I would like to allow user to create multiple rows before committing. But currently, after I hit "Create New" button, then enter data, then hit "Create New" button again without committing, it gives error.
    Since this table is part of a form with other fields, I would like to save/commit it until everything in the form are completed, including creating multiple rows in the table.
    Any ideas how to achieve this?
    Any comments are appreciated.
    Thanks.
    -Mina

  • URGENT : How to save multiple entries in a T list at one go

    If I have a T list that contains the colours availiable at a paint shop (just an example), e.g. white, green, red. I want to save the multiple entries in the t-list at any moment to the database column at one go. how can i do it.
    Also the table doesn't contain a column for the colour_code, but instead it has the shop_id and the colour_id corresponding to that shop_id. So i need to insert into the database the colour_id for a particular colour_code as the t-list is just a control item in the data block.
    Please help.
    Abhishek.

    if you use multi-selection Tlist item or create your own Tlist looking form, then you may loop thru these multi-selections and add your logic into this loop.

  • Multiple entries in TEVEN for one time event created by HR-PDC

    Hi experts,
    we have a SAP certified time attendance system connected to our ERP 6.0 system by HR-PDC interface.
    Now it happens from time to time that exactly one time event causes multiple entries in SAP table TEVEN and therefore is shown in the check report PT40.
    The number of duplicate records is always different - up to about 140 entries for one and the same time event in the worst case.
    Except the field PDSNR all the other fields contain exactly the same values.
    I have checkt many of the problematic bookings and I have always just one correct time event in the source application and there is only one data record in the corresponding IDOC too.
    Also the number of transferred records shown in the protocol spool of the report SAPCDT45 is correct and identical to the number of records in the IDOC.
    The first place where I can identify the problem with the duplicate records is the table TEVEN.
    No records are left in the interface table CC1TEV.
    I have seen that within one block of identical time bookings in TEVEN the field PDSNR ist not numbered in one sequence but there are gaps in between that are used for any other entries.
    As I can see in historical entries of TEVEN the problem exists already for years so it does not seem to be in direct connection with the latest support pack or something like that.
    The relevant jobs run every 15 minutes whereby SAPCDT45 is started 5 minutes after RPTCC106.
    Has anyone else experienced this strange behaviour or knows what I could further investigate?
    Many thanks for your replies in advance and best regards
    Günter

    Hi Carlos,
    thanks for your fast reply.
    It seems that an entry for Status A00 or A05 would solve my problems and of course I will try to handle it by this view.
    But do you know whether there is any possibility to find out how it comes to these repeated postings?
    I do not know whether the repeated postings happen in the same package (IDOC) or in an earlier package and to be honest I do not think that the record comes from the source application a second time because there I could find only one record that seems to be correct.
    I also cannot understand how it comes that I have even 140 "identical" entries for one time event.
    Could you please let me know your thoughts about that?
    Anyway I thank you for offering a solution - even if I do not understand the reason for the pborlem.
    Thanks and best regards
    Günter

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • Data Merge specific cells, multiple (unlimited) entries on one page

    HELP!
    I've used the mail merge in the past with publisher to create labels and the like....in it on a single page I would code
    <<address>> and in another part of the page <<next entry, address>> <<next entry, address>>
    and so on and it would fill every area with the next entry in the excel file ad nauseum till complete. It was a simple way to extract specific continuous bits of information and apply it to a document on a single page.
    I haven't been able to find anything similiar with Data Merge but there must be a way since InDesign has been more powerful than publisher in every way so far. Here is a sample of what I am creating
    https://www.dropbox.com/s/7ewkwgmerz89ggf/Sample.pdf
    Basically I have a book where every year my boss has been hand retyping the ENTIRE calendar not just into what you see in the sample above but through out an entire day planner also. I'd like to streamline the process but everytime I try and place a data point it says (for example) <<Day of Month>> and page 1 will ONLY take data point 1. I'm aware of the multiple selections per page function but it wants to lay it out in a grid that doesn't match my document and I have 365 data points to plug in to 2014 and another 365 for page 2 (2015)
    Is there anyway to tell indesign I want <<Day of month, row 2, column 2>> in one box and <<Day of Month, row 3, column 2>> ....<<Day of Month, row 366, column 2>> All on one page so that I can place them precisely through out the document? This would allow me to make a simple adjustment to the CSV each year and then fill in the remainder with nothing more than a click.
    Any help would be appreciated because I'd LOVE to save 20 hours of work every year and huge numbers of mistakes. This has to be something SUPER simple but no tutorial I've found covers it, they all mention the multiple entries per sheet option and that does NOTHING like what I want. I'd have to create 12 documents, data merge them, and then place them into the primary document and that is terrible workflow.  Through out the final document not everything is in a comfortable grid like this so it would be even less useful.
    We use CS3 in case that is relevant for the topic.
    Thanks,
    Tinker

    I'm looking now but not finding anything promising. The calendar scripts all were for formatting very specific calander shapes and I need to be able (on one page) to have 7 entries in a non symmetrical layout (5 works days, then the weekends one over the other). Do you have any recommendations for scripts you like?
    Maybe I'll create a document the holds the information a few date entires per page then place that into the master cropped and moved around as needed. I'm still looking through the exchange for something that makes the tool a little more powerful for me. I'll post it here if I find something that does what I need as that doesn't sound like a very efficient workflow.

  • Enable Multiple entry at table maintanance at a time by more then one user

    Hello all,
    My requirment is to enable the multple user, can login to the same table for making there entry simultaneosuly . i have created the table and table maintance as well. and i have created the new lock object and added the code accrdingly and i have used the custom fm which is generated in the tablemainta function group.
    forex: table xyz user 1 , 2, 3, 4, 5,so on..
    table should allow all user tomake there entry at time and the entry edited one user should be disabled to other user. I have gone the forum i didnt found the correct one ..plz guide me
    regards
    raju

    >
    swathi4 m wrote:
    > This is not happening.
    What is not happening? If you want to control update access to a database table, you'll need to implement a lock object.  Read the SAP help on lock objects or search this forum.

  • Data in the cube is showing multiple entries when compared with ODS

    Hello BW Gurus,
    We have a waste report in production planning on Cube and ODS separately. The same info package loads both targets (which means same infosource) but when we run a report on Cube, the records are showing multiple entries (i.e. Key Figures are not matching when compared to ODS) where as the ODS records are showing correctly as it was in R/3. There are totally 6 key figures out of which 4 pulled from R/3 and 2 are populated in BW.
    An Example:
    Waste report in PP run for plant 1000 for 12/2005 and process order 123456. The operational scrap should be 2.46% and the component scrap should be 3.00% for material 10000000. The report is showing 7.87% for planned operational waste % and 9.6% for planned component waste %. These values are not correct. The ODS values for order 123456 matched the data in R/3 for component and operational scrap.
    There is a Start routine to the ODS and also to the cube. I am not good at ABAP so requesting your Help.
    Here is the ODS Code:
    tables: /BI0/PPRODORDER.
    loop at data_package.
    select single COORD_TYPE
    PRODVERS
    into (/BI0/PPRODORDER-COORD_TYPE,
    /BI0/PPRODORDER-PRODVERS)
    from /BI0/PPRODORDER
    where PRODORDER = data_package-PRODORDER
    and OBJVERS = 'A'.
    if sy-subrc = 0.
    if /BI0/PPRODORDER-COORD_TYPE = 'XXXX'
    or /BI0/PPRODORDER-COORD_TYPE = 'YYYY'.
    data_package-PRODVERS = space.
    else.
    data_package-PRODVERS = /BI0/PPRODORDER-PRODVERS.
    endif.
    endif.
    if data_package-calday = space
    or data_package-calday = '00000000'.
    if data_package-TGTCONSQTY NE 0.
    data_package-calday = data_package-ACTRELDATE.
    endif.
    endif.
    modify data_package.
    endloop.
    Here is Cube Code:
    tables: /BI0/PPRODORDER,
    /BIC/ODS.
    TYPES:
    BEGIN OF ys_mat_unit,
    material TYPE /bi0/oimaterial,
    mat_unit TYPE /bi0/oimat_unit,
    numerator TYPE /bi0/oinumerator,
    denomintr TYPE /bi0/oidenomintr,
    END OF ys_mat_unit.
    DATA:
    l_s_mat_unit TYPE ys_mat_unit,
    e_factor type p decimals 5.
    loop at data_package.
    select single COORD_TYPE
    PRODVERS
    into (/BI0/PPRODORDER-COORD_TYPE,
    /BI0/PPRODORDER-PRODVERS)
    from /BI0/PPRODORDER
    where PRODORDER = data_package-PRODORDER
    and OBJVERS = 'A'.
    if sy-subrc = 0.
    if /BI0/PPRODORDER-COORD_TYPE = 'XXX'
    or /BI0/PPRODORDER-COORD_TYPE = 'YYY'.
    data_package-PRODVERS = space.
    else.
    data_package-PRODVERS = /BI0/PPRODORDER-PRODVERS.
    endif.
    endif.
    if data_package-calday = space
    or data_package-calday = '00000000'.
    if data_package-TGTCONSQTY NE 0.
    data_package-calday = data_package-ACTRELDATE.
    endif.
    endif.
    data_package-agsu = 'GSU'.
    data_package-agsu_qty = 0.
    select single gr_qty
    base_uom
    into (/BIC/ODS-gr_qty,
    /BIC/ODS-base_uom)
    from /BIC/ODS
    where prodorder = data_package-prodorder
    and material = data_package-material.
    if sy-subrc = 0.
    if /BIC/ODS-base_uom = 'GSU'.
    data_package-agsu_qty = /BIC/ODS-gr_qty.
    else.
    SELECT SINGLE * FROM /bi0/pmat_unit
    INTO CORRESPONDING FIELDS OF l_s_mat_unit
    WHERE material = data_package-material
    AND mat_unit = 'GSU'
    AND objvers = 'A'.
    IF sy-subrc = 0.
    IF l_s_mat_unit-denomintr <> 0.
    e_factor = l_s_mat_unit-denomintr /
    l_s_mat_unit-numerator.
    multiply /BIC/ODS-gr_qty by e_factor.
    data_package-agsu_qty = /BIC/ODS-gr_qty.
    ENDIF.
    else.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = /BIC/ODS-gr_qty
    NO_TYPE_CHECK = 'X'
    ROUND_SIGN = ' '
    UNIT_IN = /BIC/ODS-base_uom
    UNIT_OUT = 'GSU'
    IMPORTING
    OUTPUT = DATA_PACKAGE-gsu_qty
    EXCEPTIONS
    CONVERSION_NOT_FOUND = 1
    DIVISION_BY_ZERO = 2
    INPUT_INVALID = 3
    OUTPUT_INVALID = 4
    OVERFLOW = 5
    TYPE_INVALID = 6
    UNITS_MISSING = 7
    UNIT_IN_NOT_FOUND = 8
    UNIT_OUT_NOT_FOUND = 9
    OTHERS = 10.
    endif.
    endif.
    endif.
    modify data_package.
    endloop.
    some how the AGSU qyt is not populating in the cube and when I dbug the code, I could see a clean record in the internal table but not in the cube.
    your suggestion and solutions would be highly appreciated.
    thanks,
    Swathi.

    Hi Swathi
    In ODs we have option of overwriting and addition however in Cube we have only adition.Thats why you are getting multiple enteries.
    If you are running daily full load on the cube then please delete the earlier requests.
    So at one point of time there should be only one full load request in cube. Hope this will solve your problem.
    Regards,
    Monika

  • Picking the value of PBEG and PEND incase of multiple entries 2002 on a day

    Hi Experts,
    Our client's business requirement is to have provision handling multiple entries multiple entries of same subtype of IT 2002 on same day with different Time entries.For example one IT 2002 Styp 1 has entry 10 am to 14 pm & other entry of IT 2002 styp 1 as 14 pm to 16 pm.
    In this scenario I want to have TWT with start time of 1st 2002 record i.e 10 & another TWT with end time of last 2002 record i.e. 16.
    I have written a PCR as
    OUTTPORIGS Origin status
        COLOP*     TIP  >TOP curr.TType
      P
        HRS=PBEG   Set
        ADDDB90T3  Add to day balance
        HRS=PEND   Set
        ADDDB90T4  Add to day balance
    But its giving me value of 2002 start time  as (1014=24) & END time (1416=30) respectively.
    Since TIP will have entries with origin E & A as well with P  and any entry can be 1st or last entry depending on time, I can't use VRSTFIRST & VARSTLAST.
    Please suggest me how to handle such scenario through PCR. Is there a way we can make decision on From & To of TIP entries.
    You can also suggest me if such need can be handled at masterdata level so that we can have just one entry
    Regards
    S S
    Hi All,
    Please also suggest me a better operation to pick the value of PBEG and PEND incase of multiple entries various subtypes of 2002 on same day.I need to compare start- end time of 2002 with 2011 entries and calculate total attendence hrs. Once again, I can't use VRSTFIRST & VRSTLAST as 1st & last TIP entry could be come from any infotype viz 2011,2002, 2001.
    Regards
    Sunita
    Edited by: Sunita on Feb 5, 2011 10:02 AM

    If you want to do it the T-SQL way, follow this article I wrote on deleting duplicates..
    http://sqlsaga.com/sql-server/how-to-remove-duplicates-from-a-table-in-sql-server/
    To read about what ranking functions does and how will they help you use this link..
    http://sqlsaga.com/sql-server/what-is-the-difference-between-rank-dense_rank-row_number-and-ntile-in-sql-server/
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

Maybe you are looking for