ABAP Code to  Select Invoices from VBRP

Hi
I have the following code to summrise the invoice total by
Z_VBRP_NETWR_TOT =
IF Z_VBRP = 'X'.
select sum( NETWR ) sum( FKIMG ) from VBRP
into (Z_VBRP_NETWR_TOT, Z_VBRP_FKIMG_TOT)
where
AUBEL = VBAP-VBELN
and
AUPOS = VBAP-POSNR
and
SHKZG = ' '.
ENDIF.
The problem I have is when a proforma invoice and normal invoice is issued then the values are doubled, we just want to report on 1 invoice and not both, I checked the VBRK table and the difference between the 2 is field VGTYP. Therefore I added in the a AND statement before the ENDIF statement : and VGTYP = ‘J’.
This is ok when there are 2 invoices eg field VGTYP = "C" or "J" but when there is only 1 type "C" I want the program to sum all the as per the above code, is there ELSE statement I should use?
thanks
Joe

Hi Joe,
try to do the following steps:
*1 First of all define a internal table and structure with the following four fields:
TYPES: BEGIN OF TYPE TY_INV_DAT,
               AUBEL TYPE VBRP-AUBEL,
               AUPOS TYPE VBRP-AUPOS,
               NETWR TYPE VBRP-NETWR,
               FKIMG TYPE VBRP-FKIMG
             END OF TYPE LT_INV_DATA,
             TY_T_INV_DAT TYPE STANDARD TABLE OF TY_INV_DAT.
DATA: LT_INV_DATA TYPE TY_T_INV_DAT,
          LS_INV_DATA TYPE TY_INV_DAT.
*2. Select and store the data in the internal table.(I think that this kind of selection will improver also the performance of your coding)
select AUBEL AUPOS NETWR  FKIMG  from VBRP
into table lt_inv_data
where  AUBEL = VBAP-VBELN
    and  AUPOS = VBAP-POSNR
    and  SHKZG = space.
if sy-subrc  = 0.
*3 proceed to delete the duplicate entries.
SORT LT_INV_DATA BY AUBEL ASCENDING AUPOS ASCENDING.
DELETE ADJACENT DUPLICATES FROM LT_INV_DATA COMPARING AUBEL AUPOS.
*  summarize table amounts/quantities.
  clear:  Z_VBRP_NETWR_TOT, Z_VBRP_FKIMG_TOT.
  loop at lt_inv_data into ls_inv_data.
   add ls_inv_data-NETWR to Z_VBRP_NETWR_TOT.
   add ls_inv_data-FKIMG to Z_VBRP_FKIMG_TOT.
  endloop.
endif.
Regards,
Marc.

Similar Messages

  • To write ABAP code to retrieve data from RSTMANPART table

    hello everyone...
    Actually, i need help to write a ABAP code....
    i need to record the number of data records which is transferred and added to 3 cubes... i need to read the latest request number from the RSSTATMANPART table, for the 3 datatargets,  and gather the transferred records, added records , start time n end time from that specific req num....
    And i have to store it in an internal table....
    Please help me with the same.....
    Thanks....
    Edited by: neethacj on Dec 2, 2010 10:27 AM

    Dear Neetha,
    The table name is RSSTATMANPART.
    Now the relevant fields are
    DTA(Data Target)
    DTA_TYPE(Data Target Type = Cube)
    RNR (Request ID)
    STATUS(Data Load Status )
    TSTATUS(Technical Status)
    DATUM_ANF(Request date)
    DATUM_VERB(Loaded Date)
    ZEIT_ANF(Start Time)
    ZEIT_VERB(Finishing Time)-->just do one load and compare the entries with Process monitor
    OLTPSOURCE(Datasource).
    ANZ_RECS(Transferred Records)
    INSERT_RECS(Inserted Records)
    *Create an Internal Table :
    DATA: IT_MANPART1 TYPE TABLE OF RSSTATMANPART,
               IT_MANPART2 TYPE TABLE OF RSSTATMANPART,
              IT_MANPART3 TYPE TABLE OF RSSTATMANPART,
               WA_MANPART LIKE LINE OF IT_MANPART1.
    *Fill the internal table
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART1  WHERE 
    DTA = 'CUBE1'.
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART2  WHERE 
    DTA = 'CUBE1'.
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART3  WHERE 
    DTA = 'CUBE1'.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    It will fill up your Internal table with all the requests of the RSSTATMANPART for the three Infocubes.The requests have been sorted in descending order ,the most latest will be at the top.
    You can do whatever you want to do with these three internal tables..you can have them in one talbe also..depends on ur exact requirement.
    Regards,
    RK

  • ABAP Code Date Selection for InfoPackage Scheduler

    Hello Group
    I need to automate the selection of valid condition records for an extraction that have a From and To date range.
    I noticed there is an option (Routine for time interval) to write ABAP code along with a template that is available in the InfoPackage.
    I think the logic for the selection would be any record
    Valid from       <= today
    Valid to           >= today
    Can anyone help with the ABAP code?
    The template is as follows:
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rsldpsel.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    form compute_time_dependent_dates
      changing p_datefrom type d
               p_dateto   type d
               p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.
    Thank You for your help!!
    Frank

    I resolved the problem . I have changed the order of read table l_t_range because I need the header .
    In the loop at datos I add the line l_t_range-iobjnm = 'ZXGE_UNO'.
    The problem wasn't the call RFC it was that I built l_t_range bad. I need the infoObject name.
    This is correct!!
    READ TABLE L_T_RANGE WITH KEY
             FIELDNAME = '/BIC/ZXGE_UNO'.
    LOOP AT DATOS.
          L_T_RANGE-FIELDNAME = '/BIC/ZXGE_UNO'.
          L_T_RANGE-IOBJNM = 'ZXGE_UNO'.
          L_T_RANGE-SIGN = 'I'.
          L_T_RANGE-OPTION = 'EQ'.
          CONCATENATE '00' DATOS-WA+3(4) INTO L_T_RANGE-LOW.
          APPEND L_T_RANGE.
        ENDLOOP.
    *READ TABLE L_T_RANGE WITH KEY+
    +*FIELDNAME = '/BIC/ZXGE_UNO'.+
    +*    L_IDX = SY-TABIX.+
    +*    MODIFY L_T_RANGE INDEX L_IDX
    Thanks a lot
    Ana

  • ABAP Code to Read Characteristic from Another DSO

    Gurus and Experts,
    Plain and simple, I need a piece of ABAP code that reads a characteristic value from a different DSO.
    Here is the story. I have a data flow from DSO Delivery1 to DSO Delivery2. I need to write a code in the start routine of the transformation to read Sales_Doc_Type from DSO Sales1. The condition is, if Delivery1-Ref_Doc_Nr = Sales1-Sales_Nr then Delivery1-Sales_Doc_Type = Sales1_Sales_Doc_Type.
    I am a beginner in SAP BI and know nothing about ABAP. But I do have experience in SQL and Java.
    Any help or links or direction will be appriciated. Thanks in advance.
    Herru

    Hello,
    I think there is a correction in your Ques. That there are two DSO Delivery1 and Sales1...... I Hope this is Ok.
    Tables Required:----  Go To SE11 and *<DSO_NAME>00 You will get active table for your DSO. EG. /bic/Delivary100 and /bic/sales100
    Logic In start Riutine:----
    1. Define structure in Global Def. for Sales1 DSO.
    2. Also Define Internal table in Global Def. (I hope you know the syntax)
    3. now you will find that start writing code from below.
            Inclue:------ Select Statement from Slaes1 DSO into itab for all entries in source package.
    4. Loop source_package assigning <result_fields>.
    read itab into wa where Sales1-Sales_Nr = <result_fields>-Ref_Doc_Nr.
    <result_fields>-Sales_Doc_Type = wa-Sales1_Sales_Doc_Type.
    endloop.
    This logic will work..........
    If still you are find it difficult then take some abaper help.
    Regards,
    Ankit.

  • Craete a simple abap object to select data from a table and display

    Hi,
    I know the concept of abap objects but i never worked on it,
    can any one give me simple example of how to create an abap object to display data from mara table.also please send me documents or info regd ABAP OBJECTS.
    I want to write a simple report in terms of abap object
    Regards,
    Sowjanya

    hi,
    Here is hte sample program in se38.
    REPORT ZFGLI00003
    *-- Include for data declarations and performs
    include ZFGLI00003_f01.
    *--Include for Classes and their Implementation
    include ZFGLI00003_cl.
    *                selection-screen                                      *
    *-- Selection Values : Block1
    selection-screen begin of block b1 with frame title text-001.
    *--         Ledger
    parameters: p_rldnr  like zzprodnt-rldnr default 'NP'.
    *--         Fiscal year
    parameters: p_ryear  like zzprodnt-ryear.
    *--         Period(month)
    parameters: p_rpmax  like zzprodnt-rpmax.
    selection-screen end of block b1.
    *-- Selection Values : Block2
    selection-screen begin of block b2 with frame title text-002.
    *--              Company ID's
    select-options : s_glcomp  for ZZPRODNT-ROBUKRS .
    *--              Profit Center
    select-options : s_prctr   for ZZPRODNT-RPRCTR .
    *--              Product Assignment
    select-options : s_prasn   for ZZPRODNT-RZZWWZ01 .
    *--              Corporate Brand
    select-options : s_crpbd   for ZZPRODNT-RZZWWZ05 .
    selection-screen end of block b2.
    *-- Selection Values : Block3  Download Options
    selection-screen begin of block b3 with frame title text-003.
    parameters : p_local radiobutton group 1,
                 p_unix  radiobutton group 1,
                 p_path  like rlgrap-filename obligatory
                         default 'C:P20Z_Formatted.txt'(009).
    selection-screen end of block b3.
    *            At Selection-Selection on value-request  for file path    *
    at selection-screen on value-request for p_path.
      if p_unix <> 'X'.
    *-- Getting F4 help for output file
        perform get_filename changing p_path.
      else.
        message i999(zi) with
              'Sorry !! Function not available for UNIX file.'(i01).
      endif.
    *-- At selection screen validations
    at selection-screen on p_path.
      if p_unix <> 'X'.
    *-- Validate local file
        if p_path+1(2) <> ':'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      else.
    *-- Validate unix file
        if p_path+0(1) <> '/'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      endif.
    *                   Initialization                                    *
    initialization.
    *-- Initialize the period
      perform init_period changing p_rpmax p_ryear.
    *                    start-of-selection                               *
    start-of-selection.
      data : o_tm1_intf type ref to lcl_tm1_intf.
      create object o_tm1_intf.
    *-- Extract the data from ZZPRODNT
      call method o_tm1_intf->get_data exporting e_rldnr  = p_rldnr
                                                 e_ryear  = p_ryear
                                                 e_rpmax  = p_rpmax
                                                 e_glcomp = s_glcomp[]
                                                 e_prctr  = s_prctr[]
                                                 e_prasn  = s_prasn[]
                                                 e_crpbd  = s_crpbd[]
                                       importing i_subrc  = v_subrc.
    *   INCLUDE ZFGLI00003_CL                                              *
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf definition.
      public section.
    *-- Data Declaration
        data  : lv_date     type sy-datum,       "Date
                lv_time     type sy-uzeit,       "Time
                lv_count    type i,              "Count for total records
                lv_acsline  type zfgl014-acsline,"ACS line code
                lv_amt_curr type zzprodnt-kslvt, "current month amount
                lv_amt_ytd  type zzprodnt-kslvt, "YTD Amount
                lv_check,                        "check if any record is
                                                 "downloaded
                lv_msg(100),                     "message
                lv_count_s(5)  ,                 "Count for total(char)
                lv_amt_curr_s(23),               "Current month amount(char)
                lv_amt_ytd_s(23),                "YTD Amount(char)
                lv_ksl_pd(17),                   "KSLxx
                lv_period(2) type n.             "month(period)
    *-- Types Declaration
        types : ty_rldnr type zzprodnt-rldnr,    "Type for Ledger
                ty_ryear type zzprodnt-ryear,    "Type for Fiscal Year
                ty_rpmax type zzprodnt-rpmax,    "Type for Period
                ty_glcomp type range of char4,   "Type for company selection
                ty_prctr type range of char10,   "Type for profit center sel
                ty_prasn type range of char6,    "Type for prod assignmt sel
                ty_crpbd type range of char4,    "Type for Corp Brand sel
                begin of ty_file,                "Type for File
                  line(150),
                end of ty_file,
                begin of ty_ZZPRODNT,            "Type-ledger summary table
                  company       type OBUKR,      "Company
                  gl_acct       type RACCT,      "GL Account
                  cst_ctr       type KOSTL,      "Cost Center
                  prt_ctr       type PRCTR,      "Profit Center
                  rfarea        type FKBER,      "Functional Area
                  wbs_ele       type PS_POSID,   "WBS Element
                  prd_***       type RKEG_WWZ01, "Product Assignment
                  corp_bd       type RKEG_WWZ05, "Corporate Brand
                  ksl01         type KSLXX9,     "Total of transactions - 01
                  ksl02         type KSLXX9,     "Total of transactions - 02
                  ksl03         type KSLXX9,     "Total of transactions - 03
                  ksl04         type KSLXX9,     "Total of transactions - 04
                  ksl05         type KSLXX9,     "Total of transactions - 05
                  ksl06         type KSLXX9,     "Total of transactions - 06
                  ksl07         type KSLXX9,     "Total of transactions - 07
                  ksl08         type KSLXX9,     "Total of transactions - 08
                  ksl09         type KSLXX9,     "Total of transactions - 09
                  ksl10         type KSLXX9,     "Total of transactions - 10
                  ksl11         type KSLXX9,     "Total of transactions - 11
                  ksl12         type KSLXX9,     "Total of transactions - 12
                  ksl13         type KSLXX9,     "Total of transactions - 13
                  ksl14         type KSLXX9,     "Total of transactions - 14
                  ksl15         type KSLXX9,     "Total of transactions - 15
                  ksl16         type KSLXX9,     "Total of transactions - 16
                end of ty_ZZPRODNT.
    *-- Structure Declaration
    *           Structure for final file
        data  : x_file         type ty_file,
    *           Structure for Product Ledger Summary table
                x_ZZPRODNT     type ty_ZZPRODNT,
    *           Structure for Functional Area to ACS line mapping
                x_zfgl014      type zfgl014.
    *-- Internal Table Declaration
    *           Table for records of Product Ledger Summary table
        data  : it_ZZPRODNT     type table of ty_ZZPRODNT,
    *           Table for final file
                it_file         type table of ty_file,
    *           Table for Functional Area to ACS line mapping
                it_zfgl014      type table of zfgl014.
    *-- Method Declaration.
        methods : get_data      importing e_rldnr  type ty_rldnr
                                          e_ryear  type ty_ryear
                                          e_rpmax  type ty_rpmax
                                          e_glcomp type ty_glcomp
                                          e_prctr  type ty_prctr
                                          e_prasn  type ty_prasn
                                          e_crpbd  type ty_crpbd
                                exporting i_subrc type sy-subrc.
    endclass.                    "lcl_tm1_intf DEFINITION
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf implementation.
    *-- Method get_data selects the North American Product Ledger Summary
    *   table data and then maps the Functional Area to ACS line to get
    *   the ACS line code
      method get_data.
    *-- Local Variable
        DATA: L_ZZPRODNT TYPE TY_ZZPRODNT.
    *-- Get the data from North American Product Ledger Summary table
        select robukrs
               racct
               rcntr
               rprctr
               rfarea
               rzzwbs_el
               rzzwwz01
               rzzwwz05
               ksl01
               ksl02
               ksl03
               ksl04
               ksl05
               ksl06
               ksl07
               ksl08
               ksl09
               ksl10
               ksl11
               ksl12
               ksl13
               ksl14
               ksl15
               ksl16
          from zzprodnt
          into table it_ZZPRODNT
         where rldnr    = e_rldnr
           and ryear    = e_ryear
           and rpmax    = e_rpmax
           and ROBUKRS  in e_glcomp
           and RPRCTR   in e_prctr
           and RZZWWZ01 in e_prasn
           and RZZWWZ05 in e_crpbd.
        if sy-subrc = 0.
          loop at it_ZZPRODNT into l_zzprodnt.
            condense l_ZZPRODNT-rfarea no-gaps.
            if l_ZZPRODNT-rfarea is initial.
              delete it_ZZPRODNT.
            endif.
          endloop.
    *-- Get the Functional Area to ACS line code mapping data
          select *
            from zfgl014
            into table it_zfgl014
             for all entries in it_ZZPRODNT
           where fkber = it_ZZPRODNT-rfarea .
          if sy-subrc = 0.
          endif.
        endif.
        i_subrc = sy-subrc.
      endmethod.                    "get_data
    endclass.                    "lcl_tm1_intf IMPLEMENTATION
    *   INCLUDE ZFGLI00003_F01                                             *
    *                             Table
    tables : zzprodnt.
    *                          Data Declaration
    data : v_subrc type sy-subrc.
    *&      Form  get_filename
    *  Description : This subroutine is used for F4 Prompting
    form get_filename changing p_path like rlgrap-filename.
    *-- Local variables
      data : lv_file  like ibipparms-path, "Local file for upload/download
             lv_repid like syst-cprog,     "ABAP program, caller in external
                                           "procedures
             lv_dynnr type syst-dynnr.     "Current screen No
      lv_repid = syst-cprog.
      lv_dynnr = syst-dynnr.
    *-- Function module used for F4 help
      call function 'F4_FILENAME'
           exporting
                program_name  = lv_repid
                dynpro_number = lv_dynnr
           importing
                file_name     = lv_file.
      move lv_file to p_path.
    endform.                    " get_filename
    *&      Form  init_period
    FORM init_period changing p_rpmax p_ryear.
      if sy-datum+4(2) = 01.
        p_rpmax = 12.
        p_ryear = sy-datum+0(4) - 1.
      else.
        p_rpmax = sy-datum+4(2) - 1.
        p_ryear = sy-datum+0(4).
      endif.
    ENDFORM.                    " init_period
    Hope this helps.
    Regards,
    Richa

  • ABAP code needed to convert from 0calmonth2 & 0calyear to 0calmonth

    Hi SAP GURUS,
    Can anybody give me the ABAP code to convert from 0calmonth2 and 0calyear to 0calmonth.and please suggest me whether i have to write start routine or end routine in transformations.
    Thanks ALL.

    hi,
    in the transformation map 0calmonth2 and 0calyear to the 0calmonth field, and from drop down choose routine.
    there will be an area where it will be mentioned write your piece of code below this line.
    paste the below code:
    Concatenate source_fields-0calmonth2 source_fields-0calyear into result.
    also delete the line result = .
    save the routine and execute the package.
    regards,
    Arvind.

  • ABAP code for Hierarchy Loading from Flat File

    Hi,
    Can anyone give me some idea / ABAP code for generating parent - child relationships (NODEIDS) from a flat file and load into BW.
    Best regards
    Any insight into this development is highly appreciated

    Hi,
    also have a look at this how to to get informations about the file structure:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
    /manfred

  • 11i AP - Processing payment by selecting invoices from different pay sites

    Hi
    In 11i Payables can a payment be processed with invoices from different pay sites?
    For Ex I have a Standard Invoice which has pay site as ABCD-10 and a Credit Memo for the same supplier which has a pay site named - EFGY-15.
    Can this two documents be selected while processing one payment ?
    Need help ASAP
    Thank you
    SS

    Hi Can you try the payment type as manual instead of quick and make the payment.
    In that way you should be able to make payments for differenct sites of the same supplier.
    Regards,
    MPH

  • Error in Abap code when combining data from two tables

    Hi,
    I got error in my code when  i try to select data based on two tables
    error message Unknown column name "(" field list. field list. field list. field list.
    select ( WLK1~ARTNR )
              into ZOXE1D0041-ZZPROMO
              from WLK1 INNER JOIN T001W
              ON WLK1FILIA = T001WKUNNR.
              where WLK1-PFLKN NE 'P' AND
              WLK1-QUELL NE '2'.
    Table 1 WLK1
    ARTNR   FILIA       PFLKN                  QUELL
    001         C001        P                           2
    002         C001        A                          1
    Table 2  T001W
    KUNNR                WERKS
    C001                    P001
    My requirement is to extract from article number from table WLK1 where the customer number (FILIA) matches with Customer number from (T001W) and plant (WERKS).
    In conclusion I like to have this only this row
    ARTNR   FILIA       PFLKN                  QUELL
    002         C001        A                          1

    Hi
    You need to append every article number after each select is performed
    is this an intermal table ZOXE1D0041 with header line ? if yes
    then do this way
    select WLK1~ARTNR
    into ZZARTICLE
    from WLK1 INNER JOIN T001W
    ON WLK1FILIA = T001WKUNNR
    where WLK1~PFLKN NE 'P' AND
    WLK1~PFLKN NE 'S' AND
    WLK1~QUELL NE '2'.
    ZOXE1D0041-ZZLISTARTICLE = ZZARTICLE.
    Append ZOXE1D0041.  " <edited>
    endselect.
    then ZOXE1D0041 will have all article numbers.
    Edited by: Sonal Patel on Sep 5, 2009 10:27 AM

  • ABAP Code Changes During Upgrade from 4.7C to ECC6

    Hi all,
    I'm in process of collecting information for our next upgrade.
    We are on 4.7C and are planning to upgrade to ECC6. We wanted to know what changes shall be required on ABAP side during this upgrade. e.g. certain ABAP commands which are obselete, few tables , few fucntional modules being obselete.
    Any specific functional areas/transcation codes being obselete which in turn would make Uer Exit redudant etc.....
    Could somebody please help me out with some info regarding this upgrade? Some links or any hint you can give would help me a lot. (Whether technical or functional..all very welcome!).
    Thanks in advance
    Moderator message: topic too broad to be answered in a forum thread, many people had to go through this, please search for available information/documentation.
    Edited by: Thomas Zloch on Jun 14, 2011 9:31 AM

    Hi ,
    I too got an error of this type .
    The resolution is as follows :
    login as user SAP<SID> in the oracle database .
    SQL> drop tabel <tablename>;
    Restart the upgrade from PARMVNT_SHD phase.
    Regards
    Ratnajit

  • ABAP SQL Query (Select data from intervals)

    Hi All,
    From    To      Temp
    101      200     1111
    201      300     2222
    301      400     3333
    401      500     4444
    501      600     5555
    From, To & Temp are three Fields.
    Consider the above table, if i enter input as 150, need to pick 1111.
    If the input is inbetween of From & To values means I want to pick the exact
    Data from temp field.
    Thanks
    Hema
    Edited by: hema prabakaran on Jan 19, 2009 7:54 AM
    Edited by: hema prabakaran on Jan 19, 2009 8:30 AM

    Hi
    Data: itab type table of tbl with header line.
    select * from tbl into table itab.
    if sy-subrc eq 4.
    Message E000(YJK).
    else.
            loop at itab.
             if v_temp between itab-from and itab-to.
                   write itab-temp.
                   exit.
             else.
                  continue.
            endif.
            endloop.
    endif.
    You can use the above code.
    It is not possible to use select stmt with your i/p variable in the where clause as that field is not present in table.
    hope this helps
    Regards,
    Jayanthi.K

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • ABAP Code Problem in Start Routine to Fill the value from Look-up Table ???

    Hi all,
         I am trying to fill the values of DOC_NUMBER & PLANT from look-up table /BIC/AZSD_O0700 (Billing Item ODS) for each BILL_NUM in Start Routine for Update Rules of Billing Header ODS and modify the data_package.
    What is wrong with the below ABAP code, PLEASE ???
    data: it_data type standard table of data_package_structure
            with header line
            with non-unique default key initial size 0.
    types: begin of billing_item_type,
                 BILL_NUM          like /BIC/AZSD_O0700-BILL_NUM,
                 DOC_NUMBER   like /BIC/AZSD_O0700-DOC_NUMBER,
                 PLANT               like /BIC/AZSD_O0700-PLANT,
             end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data[] = DATA_PACKAGE[].
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
        select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
               from /BIC/AZSD_O0700
               where  BILL_NUM  = it_data-BILL_NUM
               and    FISCVARNT = it_data-fiscvarnt.
        endselect.
        if sy-subrc = 0.
           move-corresponding it_data to DATA_PACKAGE.
        endif.
      endloop.
      modify DATA_PACKAGE.
    Thanks,
    Venkat.

    Hi Venkat,
      Two things -One is the performance and the other ... there is no Append  within the loop.
      Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
       Let me know if you need more help.
    Best regards,
    Kazmi
    data: it_data type standard table of data_package_structure
    with header line
    with non-unique default key initial size 0.
    types: begin of billing_item_type,
    BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
    DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
    PLANT like /BIC/AZSD_O0700-PLANT,
    end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data] = DATA_PACKAGE[.
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
    select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
    from /BIC/AZSD_O0700
    where BILL_NUM = it_data-BILL_NUM
    and FISCVARNT = it_data-fiscvarnt.
    endselect.
    if sy-subrc = 0.
    move-corresponding it_data to DATA_PACKAGE.
    Append DATA_PACKAGE.
    endif.
    endloop.

  • Execute ABAP Code Inspector from Outside of SAP

    Hi all...
    For reporting purpose, I would like to use ABAP Code Inspector (transaction SCI) for generating output as a file, it should call from outside of SAP through RFC function module and generate the list (output) as flat file (or XML), does anyone have been done with similar work like this? I wonder if you could share your experience with me...
    thanks in advance,
    yayan irianto.

    I managed to set up the variant, however found a problem.
    I used "Search ABAP Statement Patterns" under "Search Functs" and set the pattern like followings.
    SELECT + INTO *
    SELECT SINGLE + INTO *
    However following statements were detected.
    SELECT * INTO TABLE IT_DRAW FROM DRAW.
    SELECT MANDT INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE * INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE MANDT INTO TABLE IT_DRAW FROM DRAW.
    It's because + means one ABAP token in the code inspector.
    Is there anyway to find only "SELECT SINGLE *" and "SELECT *" ?

  • Accessing Selected Value from Payment Terms (Item 47) in AR Invoice Form

    Hi,
    Have just started working in SAP Business One and SDK adn would really appreciate any help I could receive.
    I'm trying to access the selected value from Payment Terms field(Item 47) in the AR Invoice Form.
    Have successfully managed to do this against Customer Code field using the following code-:
    Private Sub eventHandlerTest(ByVal FormUID As String, pVal As SAPbouiCOM.ItemEvent, BubbleEvent As Boolean)
        Dim frm As SAPbouiCOM.Form
        Dim itmCustomer As SAPbouiCOM.Item
        Dim edtCustomer As SAPbouiCOM.EditText
        Dim itmRemark As SAPbouiCOM.Item
        Dim edtRemark As SAPbouiCOM.EditText
        Dim FieldNo As String
        Set frm = SBO_Application.Forms(FormUID)
        Set itmCustomer = frm.Items(pVal.ItemUID)
        Set edtCustomer = itmCustomer.Specific
        If UCase(edtCustomer.Value) = "CALECH1" Then
            FieldNo = "16"
            Set itmRemark = frm.Items(FieldNo)
            Set edtRemark = itmRemark.Specific
            edtRemark.String = "E"
        End If
    End Sub
    However when doing the same thing for Payment Terms I get the error "Run-time error '13': type mismatch" on the line
    Set edtOrderType = itmOrderType.Specific
    Thanks

    Hi,
    On the new invoice's form item 47 is ComboBox and I guess it's stay in the same type when you open existing invoice. So try to work with this item like with ComboBox. But if you need only get some information about existing invoice, you don't need to fork with the screen objects - you can get all you need from the DI Document object. Open Document object with Invoice type, find invoice and check PaymentGroupCode property.
    Best regards,
    Mark

Maybe you are looking for

  • Fixed Assets - Tax Book Depreciation Reset

    Hello Fixed Assets Experts, My company recently reorganized our parent company, and now has the following scenario: Due to legal changes, we need to start over the useful life on our tax books (10 and 11) and restart the calculation of depreciation b

  • Firefox will not download to my iPad. Why?

    It's say that safari can not download

  • App Store says I downloaded an app but it never fully downloaded?

    So I was downloading an app (keynote) but it never fully downloaded. Like it froze mid download. So I refreshed the iPad and when I checked, it was nowhere in my apps.  So I went back to the App Store to re-download it, but when I found the app, the

  • Lenovo r400 bluetooth not working

    I have lenovo R400  7440DT5on which i have ubuntu and windows 7 on 2 separate partition. I installed windows 7 on my lenovo more than a year ago. I also installed the bluetooth driver from the ibm website. Bluetooth was working on my windows 7 3-4 mo

  • Edges are jaggy when I downsize.

    I have edited footage shot at 1920x1080, shot on Sony EX3 50i in HQ mode. When I output via 'Share' at 1920x1080 everything is fine but when I set screen size to smaller at 579x328 or similar all edges in shot are jaggy not smooth. Can you help? Than