How to process AT END OF command for company code and transaction number.

Hi,
  I  have report with selection screen with company code and key date.  Based ON key date given I should calculate Accrued interest for all transaction with in each company code.
    When I run report with one company code it works fine. But when I run with multiple company codes the amounts are messed up.
I am getting all company codes with transaction details in to ITAB1 like this below, and PERFORM get_processdata. has my calculation for interest rate.
  SORT itab1 BY company_code  transaction.
  LOOP AT itab1 INTO wa_tab1.
    itab2 = wa_tab1.
    APPEND itab2.
    AT END OF transaction.
       PERFORM get_processdata.
    ENDAT.
  ENDLOOP.
Thank you.

Hello,
You need to use AT New event to clear your total variables.
AT New - this will go for first time also but we want to clear variables from second time. it requires flag to stop going it first time
Pseudo code:
clear: flag.
Loop at itab1 to itab2.
At New.
if flag eq c_x.
clear: <total variables>, intenal tables.
move c_x to flag.
endif.
tab2 = wa_tab1.
APPEND itab2.
AT END OF transaction.
PERFORM get_processdata.
ENDAT.
ENDLOOP.

Similar Messages

  • How to calculate no.of records for a specific company Code and Transaction

    Hi All,
    Could you please help me how to calculate or count no.of records, in a table which are having a specific Company Code and Transaction Code and populate  in an output table displaying that these many records are present for this company code and Transaction code.
    The table is having the data like this:
    LOB   TRAN CODE    COUNT
    X1                             1   
    X1                              2   
    X1                              3   
    X1                              4   
    F1   NB                      5   
    F1   NB                     6   
    F1   NB                     7   
    F1   NB                    8   
    F1   NB                    9   
    F1   NB                    10  
    F1   NB                    11  
    F1   NB                    12  
    F1   NB                     13  
    F1   NB                     14  
    F1   NB                     15  
    F1   NB                     16  
    F1   NB                     17  
    F1   NB                     18
    F1   NB                    19  
    F1   NB                    20  
    F1   NB                   21  
    F1   NB                   22  
    F1   NB                   23  
    F1                          24  
    F1                         25  
    F1                         26  
    F1                         27  
        In the above table there are totally 27 records,where as the no.of records with F1 as company code and NB as transaction code are 18..so i have to display like F1 NB and 18 as one record as output.
    Thanks and Regards,
    Johny

    You can go for Control Breaks for your requirement.
    First sort the internal table by company code and transaction. Declare a counter variable.
    Now loop the internal table and increment the counter variable. within the loop use AT END OF tcode.......ENDAT. Within the control break append the counter variable as well as the company code and tcode to some other ITAB and clear the counter.
    This will give you the total number of records for a combination of co code and tcodes.
    This will be a good reference for your requirement. What I am doing here is, for each Vendor i am calculating total number of deliveries and amounts for that vendor. For every new vendor i am writing the ouput on to a list and clearing the counter variables.
      LOOP AT t_vend_prod_grp INTO fs_vend_prod_grp.
        w_total_delv = w_total_delv + 1.
        w_total_amt = w_total_amt + fs_vend_prod_grp-dmbtr.
        AT NEW matkl.
          w_mat_grp = fs_vend_prod_grp-matkl.
    * To display the material group and the header texts for the data
    * grouped by material group and vendor.
          SKIP 1.
          WRITE:  text-mtk  COLOR COL_HEADING
                                  INTENSIFIED,
                / w_mat_grp COLOR COL_NORMAL
                                  INTENSIFIED OFF.
          SKIP 1.
          FORMAT COLOR COL_HEADING ON INTENSIFIED.
          ULINE  1(54).
          WRITE:/ sy-vline,
                2 text-ven,
               12 sy-vline,
                  text-dlv,
               26 sy-vline,
               38 text-amt,
                  sy-vline,
               46 text-cur,
               54 sy-vline.
          ULINE /1(54).
          FORMAT COLOR COL_HEADING OFF INTENSIFIED.
        ENDAT.                             " AT NEW MATKL
        AT END OF lifnr.
    * To display the actual data for the grouping based on Material group
    * and Vendor.
          FORMAT COLOR COL_NORMAL ON INTENSIFIED OFF.
          WRITE: / sy-vline,
                 2 fs_vend_prod_grp-lifnr COLOR COL_KEY,
                12 sy-vline,
                   w_total_delv,
                26 sy-vline,
                   w_total_amt CURRENCY text-usd,
                   sy-vline,
                46 text-usd,
                54 sy-vline.
          FORMAT COLOR COL_NORMAL OFF INTENSIFIED OFF.
          CLEAR: w_total_amt,
                 w_total_delv.
        ENDAT.                             " AT END OF LIFNR
      ENDLOOP.                             " LOOP AT T_VEND_PROD_GRP

  • How to derive Company Code and Vendor Number from CDHDR / CDPOS ?

    Hi everyone,
    This is my first post and my apologies if this is a wrong forum to ask this.
    I'm creating an analytic that will track changes to the vendor master.  I know that I have to look into CDHDR and CDPOS tables and that CDHDR.OBJECTCLAS = KRED.
    However, part of the requirements is to be able to filter the results by Company Code and Vendor Number as well.  How do I do this? How can I link CDHDR to LFA1/LFB1 to get the company code and vendor code?
    Any information will be highly appreciated
    Thanks!

    I think you would have gotten answers sooner in the abap forum :P. Anyways the change pointer tables are kept in a different format, not in the normal flatly structured tables. What this means is that the data which comes through the pointer tables are somewhat encrypted. The object class and id present you records; Each change in master data (where the option is set) is recorded in these pointer tables.
    I believe there is a function module for converting the data into a readable format; that data should have your company code/vendor number in it.  You cannot link the chdr and lfa tables directly- you will need to first convert the data from the pointer tables

  • Authorization object for company code and profit center together

    Hi all,
    Please help me with the following requirement..
    Company Code = ABCD
    Profit Center = *
    The user is authorized to run the report for company code ABCD only but any profit center within this company code.
    2       Company Code = *
    Profit Center = WXYZ
    The user is authorized to run the report for Profit Center WXYZ only but any company code.
    3       Company Code = *
    Profit Center = *
    The user is authorized to run the report for any company code and profit center.
    The same user could have 1 and 2. So, in this case he should be able to run a report for the total inventory of company code ABCD, and a report for total inventory of profit center WXYZ only regardless company code.
    He should not have visibility to other company codes inventory other then profit center WXYZ.
    Regards,
    Raj

    Hi ,
    Anyone please help me..
    Regards,
    Raj

  • How can we block the asset class for company code

    Hi Experts,
    At what level we can define asset class and how can we block the asset class for particular company code in group company
    Regards,
    Harish

    Dear Harish,
    You can block the asset through OAOA at asset class level blocking at Asset Class level, and same you can block for creation at a chart of depreciation level from AM05.
    And for additional acquisition you can block from AS05. I hope this will solve your issue. If you have doubts feel free to share.
    Regards,
    Pankaj A Bhalerao.

  • What table I could find the Tax Identification Number for Company Code...

    Hi experts,
    I'm debugging a program, the problem is it displays the wrong TIN #. I looked at T001z which I thought I could use but it ain't working. I need to get the TIN # for Company Code and for Customer.
    Points for helpful  ideas... Thanks!

    Hi Maui,
    KNB1 contains the following key fields:
    KUNNR - Customer code
    BUKRS - Company Code
    So, you will be able to get the information from a Customer in a specific Company Code.
    I hope it helps you.
    Regards,
    Daniel.

  • How to build search help for company code (BUK) in SRM

    Hello,
    I am new to SRM and was wondering if any have come across similar requirement. I am a workflow developer and we are building a custom table to derive deadline escalation timelines. We are also adding a field in our custom table for company code so that we can have company specific deadlines. table T001 is empty in SRM and hence we are unable to use F4 (search help). Is there existing functionality in SRM that gets this search from the backend ECC system and displays when F4 is pressed. How can I use that functinoality?
    Appreciate any info folks.
    Thanks again.
    Samir

    Hi
    Which SRM version are you using ?
    <b>Related links -></b>
    Re: Search Help on SRM front end screen
    F4 Help for WBS Element
    Re: Company Code defaults
    Re: Search help for Custom Item level field
    Custom field in SRM as a dropdown field with values stored in R/3
    Calendar help for Date i/p field in SRM 5.0 shopping cart
    Company code
    Problems assigning values via F4 or search help
    Also There is a standard table in SRM which contains Plant data ->
    <b>BBP_LOCMAP</b> (Mapping Table Business Partner --> System --> Location)
    Try creating a  custom search help based on this Table, defined as selection method and assign the same to the related field.
    Do let me know.
    Regards
    - Atul

  • How to use the same services-config for the local and remote servers.

    My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="amfphp-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="amfphp">
                    <channels>
                        <channel ref="my-amfphp"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    I think the problem  is the line
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    but I'm not sure how to use the same services-config for the local and remote servers.

    paul.williams wrote:
    You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
    The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
    Hi Paul,
    In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
    -services=path/to/services-config.xml
    IF
    services-config.xml
    have tokens in it and user have not specified additional
    -context-root
    and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
    Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
    for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
    -services=path/to/services-config.xml
    have been specified durring compilation.
    I dont know any better way to exmplain this, but in summary there is two places that you can tell swf  about service confogiration,
    1) pass -services=path/to/services-config.xml  parameter to compiler this way you tell swf file up front about all that good stuff,
    or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .

  • HT2731 How do I enrol in iTunes u? It asks for a code and I don't no what that means and my iPod does this wierd thing!....

    Hey I need help in enrollment on iTunes u I already did my appleID but then it asks for a code and idk what that is. Btw I need iTunes u to catch up in school cuz some things I'm bad at and I tried diff. Things in school and it didn't work so I'm trying this out, school has just begun... It would b totally awesome if some1 could get back to me on this plz email me at [email protected]..........and I also have troubles with my iPod touch 4g, when I'm searching things on the google app my iPods screen turns black for 5 seconds then goes to the home screen and it does this every time I'm in the google app and sometimes it does this when I'm playing a game or looking on iTunes plz help me!!!! P.s I won't b on here very much so if you have an answer for me email me :) at [email protected]      :) :)

    I am using MAC OSx 10.5.8 (9L31a) as my operation system.  The TV says "No signal.  Check connected device's power, cable connection and source selection."  Seems to me that that goes in hand with what the Samsung tech said about the Mac needing to be forces to use the external display.  But how do I do that?

  • I bought Photoshop CS6 Extended(education edition) for Mac. Now ik want to install it on my (new) macbook. I have the product code and serial number. I receive an error code: may be a false copy. How can I install this program?

    In 2012, I bought Photoshop CS6 Extended (education edition) for Mac. Now I want to install it on my new Macbook. I have the correct serial number and product code, but I receive an error message: the software may be a false copy etc....What to do?

    Here is a copy of the error
    This means : Installation failed.
    Verification of the Adobe Software failed
    The product you want to install is no valid Adobe product and seems to be falsified.
    HUgo
    Op 29-aug.-2014, om 23:42 heeft Jeff A Wright <[email protected]> het volgende geschreven:
    I bought Photoshop CS6 Extended(education edition) for Mac. Now ik want to install it on my (new) macbook. I have the product code and serial number. I receive an error code: may be a false copy. How can I install this program?
    created by Jeff A Wright in Downloading, Installing, Setting Up - View the full discussion
    Hugo please turn off your e-mail signature.
    If your serial number is listed as being valid at http://www.adobe.com/ then I would recommend obtaining a fresh copy of the installation files.  You can find details on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
    To download a fresh copy of the installation files please see Download CS6 products.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6685617#6685617
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Downloading, Installing, Setting Up by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Have an ipod and then got the wife an iphone4. all passwords are screwed up. she can not access playstore cuz she doesn't have password. i can not get find any help on how to get or update a password for the ipod. and then get her a separate password for

    have an ipod and then got the wife an iphone4. all passwords are screwed up. she can not access playstore cuz she doesn't have password. i can not get find any help on how to get or update a password for the ipod. and then get her a separate password for her iphone. we need to save her photos, music, etc to ? icloud and the phone stuff to verizon cloud? so when she gets her new Iphone6 she can have all her "stuff" back on the new phone. hope this makes sense. please offer suggestions here or at [email protected] thanks for your help!

    Oh no! I'm sorry to see there's a lot of confusion here and data shared, x-rayDon. We can definitely work to fix. This happens when two devices share the same Apple ID, so she will need to reset hers. She can do so by assessing this link Apple - My Apple ID. You will need to decide who will keep the account if want separate Apple IDs since purchases cannot be shared unless you do Family Sharing.
    RobinD_VZW
    Follow us on twitter @VZWSupport

  • HT204150 How did my family end up with with others contacts and how do I resolve??

    How did my family end up with with others contacts and how do I resolve??

    Welcome to the Apple community.
    One way this would occur, is if you were to be sharing your iCloud account with other users. Ideally each person should have their own iCloud account.
    I note in another of your threads, that you say you have lost your phone. It's possible that someone has found it and has started to use your iCloud account on it.

  • HOW TO DO BILLING IN STO BETWEEN TWO COMPANY CODES?

    Hi All,
    I have done sto between two plants of two different company codes.
    PO generated(ME21N)
    delivery in background(VL10B)
    PICK N PGI(VL02N)
    Stock Posting (MIGO)
    All the steps completed and stock overview is also reflected the transfer.
    Now Can any body clarify me about do a billing document should be raised between two plants?
    what is process to track accounts in each company code abt stock transfer?
    Thanks in advance.
    Please clarify with steps to do after MIGO.
    Regards,
    reddyy

    Hi Reddy
    The intercompany there are 2 processes
    Intercompany STO means there is a stock transfer happens between two plants of different company codes
    For that del type used is NLCC order type is NB
    Not del type NL as written by you
    After the STO the suppying company will bill the ordering company that is intercompany billing
    I beleive this is what the process you are trying as per the heading of your thread
    Another is intercompany sales followed by intercompany billing and this is what Mr.Murali had sent settings
    For this no STO is reqd
    The supplying plant will deliver directly to the customer who lies in the sales set up of ordering plant
    NO STO here
    After the supply is over the ordering company will bill the customer F2 inv and the supplying plant will bill the ordering plant/company
    The billing will be between company code to company code that is intercompany
    Scenario 1 is Intercompany STO followed by intercompany billing
    Whatever we move from 1 plant to another is stock transfer
    Scenario 2 is Intercompanysales followed by intercompany billing
    Whatever we supply to the end customer is is sales
    By going tro the initial thread once again you are trying  Intercompany STO only
    The del type you are using is wrong and it should be NLCC
    _I think you are mixed between both as per my knowledge you cant map this as that and that as this
    They both are process wise different_
    Pls tell exactly where you are struck?
    Regards
    Raja

  • Steps to define company code and its dependent entries for mm,pm

    Hi Experts,
    kindly share that how to define company code and its dependent assignments for PM & MM module

    Dear Hitendra
    Company code, Contolling area, Profit Center are Financials related fields and are mapped under FI Enterprise structure as its Org unit. Plant (Logistics Plant) is defined in MM. Related modules like PP, PM, SD extend this logistics plant in their repsective modules as Production Planning Plant, Production Plant, Maintenance Planning Plant, Maintenance Plant, Sales Plant etc.
    Company code is never defined in any logistics moudle , its in Financials where it is defined. It is then assigned to the Plant in logistics thru which the company code gets populated easily in respective modules.In contolling end, its controlling area that talks.
    IMG-->SAP Customizing Implementation Guide->Enterprise Structure-->Definition-->Financial Accounting-->Edit, Copy, Delete, Check Company Code
    This is a very broad upper level details for your query. Please search the SCN in relevant spaces for more information.
    Award points if the above explanation was useful...
    KR
    Murad Ahmed.

  • Retriggering Release strategy for PR with Document Type, Company Code and Price Range as Characaterstics

    Hi Friends,
    I have a issue to fix. The issue is releated to PR.
    There are some PR's in the system which has wrong release strategy picked up or wrong approvers picked up due to some congif change. now that the config changes are rectified correctly, we need to find a solution to correct the PR's which got affected due this.
    I have to retrigger the release strategy for all the affected PR's.
    The characterstics which we have consider for release strategy is Document Type, Company Code and Price Range.
    Can anyone suggest how can we retrigger the PR in bulk or individual to all the affected PR's, so that it picks up correct release strategy as per new config changes.
    Regards,
    Manjunath K

    Hi,
    Refer the discussion to triggers release again on release code addition/change in release strategy.
    release code is changed on PR release strategy - old PR can´t be approved
    Regards,
    Biju K

Maybe you are looking for

  • Error in installing CS5

    Hello, I have tried to install CS5 in my MacBook Air OS 10.8.5 I installed all the programs  Bridge, Device Central, Extension Manager, Illustrator, InDesign, Media Encoder, Photoshop but I do not succeed in installing Acrobat X Pro: I have tried 2 t

  • Itunes wont get my artwork!!!

    i keep getting frustrated by itunes making me go find low-res artwork on google FOR ALBUMS IT CARRIES!! i recently got the album "Grey Britain" by "Gallows" and despite being in the itunes store, i cant get the artwork for it! i made sure the info ma

  • Payment Processing Tab function in PO

    Dear Friends, In Purchase order at header payment processing tab is there. Cab any one explain me how it works.?? can i make its use to make retention money of vendor , how we can do it?? Regards, Mahesh.

  • Does the Photosmart 8250 or B209a have an accessory tray for printing directly onto a CD or DVD?

    OS is XP Pro.  I have not found anything on the web yet This question was solved. View Solution.

  • When will there be a update for Mail, we all need it soon.

    Seeing the hundreds of bugs and problems with Mail on this and other forums, when can we expect a update? PS: My problem is the wrong or no sound plays when emails arrive. Rodney waiting 3 months.