Follow-up question on ZXM08U16 table E_TDRSEG  (function group XM08)

Rich's suggestion worked (on how to retype the E_TDRSEG table received from MIRO by include ZXM08U16 in the function group XM08.
Before asking my new follow-up question, let me recap the original SAP typing of this table and the way I've retyped it (following Rich's instructions):
The original SAP typing is:
E_TDRSEG TYPE  MMCR_TDRSEG
TYPES: mmcr_tdrseg TYPE mmcr_drseg OCCURS 0,
TYPES: BEGIN OF mmcr_drseg_co.
        INCLUDE STRUCTURE cobl_mrm_d.
TYPES: cr LIKE drseg_cr    OCCURS 0,
       unpl_refwr TYPE refwr,
       END OF mmcr_drseg_co.
TYPES: BEGIN OF mmcr_drseg.
        INCLUDE STRUCTURE drseg.
TYPES: cr LIKE drseg_cr OCCURS 0,
       co TYPE mmcr_drseg_co OCCURS 0,
       sm LIKE drseg_sm OCCURS 0,
       charact TYPE rbcharact_instance OCCURS 3,
                                       "instances of characteristics
       uebgmat  TYPE matnr,
       uebrblgp TYPE rblgp,
       selkz_db TYPE selkz,
       rblgp_old TYPE rblgp,           "rblgp before aggregation
       END OF mmcr_drseg.
I retyped this as follows:
TYPES:
  ty_cobl_mrm_d        TYPE cobl_mrm_d,
  ty_drseg_cr          TYPE STANDARD TABLE OF drseg_cr with DEFAULT KEY,
  ty_drseg_sm          TYPE STANDARD TABLE OF drseg_sm with DEFAULT KEY,
  ty_charact           TYPE STANDARD TABLE OF rbcharact_instance with DEFAULT KEY,
  BEGIN OF ty_mmcr_drseg_co.
    INCLUDE            TYPE ty_cobl_mrm_d.
    TYPES:
      cr               TYPE ty_drseg_cr ,
      unpl_refwr       TYPE refwr,
  END OF   ty_mmcr_drseg_co,
  ty_co                TYPE STANDARD TABLE OF ty_mmcr_drseg_co
                       WITH DEFAULT KEY,
  BEGIN OF ty_mmcr_drseg.
    INCLUDE            TYPE drseg.
    TYPES:
      cr               TYPE ty_drseg_cr,
      co               TYPE ty_co,
      sm               TYPE ty_drseg_sm,
      charact          TYPE ty_charact,        "instances of characteristics
      uebgmat          TYPE matnr,
      uebrblgp         TYPE rblgp,
      selkz_db         TYPE selkz,
      rblgp_old        TYPE rblgp,             "rblgp before aggregation
  END OF   ty_mmcr_drseg.
  DATA:
    x_mmcr_drseg       TYPE mmcr_drseg,
    x_mmcr_drseg_oo    TYPE ty_mmcr_drseg,
    it_mmcr_drseg      TYPE STANDARD TABLE OF ty_mmcr_drseg,
    x_drseg_cr         TYPE drseg_cr,
    x_drseg_sm         TYPE drseg_sm,
    x_drseg_co         TYPE ty_mmcr_drseg_co.
But here's my question.  To load the new table from the SAP table, I've had to use the code below.  Is there any way to simplify this code?  (I don't think there is because the drseg structure is included in the old and the new, so you can't simply say new-drseg = old-drseg.  But maybe there's another way to do it and I'm not seeing it.  Also, note that I had to loop on each of  the inner three tables because it wouldn't compile when I tried statements of the form "new-table[] = old-table[].)
  LOOP AT e_tdrseg INTO x_mmcr_drseg.
    x_mmcr_drseg_oo-anln1     = x_mmcr_drseg-anln1.
    x_mmcr_drseg_oo-anln2     = x_mmcr_drseg-anln2.
    x_mmcr_drseg_oo-aplzl     = x_mmcr_drseg-aplzl.
    x_mmcr_drseg_oo-arewr     = x_mmcr_drseg-arewr.
    x_mmcr_drseg_oo-areww     = x_mmcr_drseg-areww.
    x_mmcr_drseg_oo-aufnr     = x_mmcr_drseg-aufnr.
    x_mmcr_drseg_oo-aufpl     = x_mmcr_drseg-aufpl.
    x_mmcr_drseg_oo-basme     = x_mmcr_drseg-aufpl.
    x_mmcr_drseg_oo-bedat     = x_mmcr_drseg-bedat.
    x_mmcr_drseg_oo-begru     = x_mmcr_drseg-begru.
    x_mmcr_drseg_oo-bewae     = x_mmcr_drseg-bewae.
    x_mmcr_drseg_oo-ekgrp     = x_mmcr_drseg-ekgrp.
    x_mmcr_drseg_oo-bpmng     = x_mmcr_drseg-bpmng.
    x_mmcr_drseg_oo-bprme     = x_mmcr_drseg-bprme.
    x_mmcr_drseg_oo-bpumn     = x_mmcr_drseg-bprme.
    x_mmcr_drseg_oo-bpumz     = x_mmcr_drseg-bpumz.
    x_mmcr_drseg_oo-bpwem     = x_mmcr_drseg-bpwem.
    x_mmcr_drseg_oo-bprem     = x_mmcr_drseg-bprem.
    x_mmcr_drseg_oo-bsmng     = x_mmcr_drseg-bsmng.
    x_mmcr_drseg_oo-budat     = x_mmcr_drseg-budat.
    x_mmcr_drseg_oo-bukrs     = x_mmcr_drseg-bukrs.
    x_mmcr_drseg_oo-bwtar     = x_mmcr_drseg-bwtar.
    LOOP at x_mmcr_drseg-cr INTO x_drseg_cr.
      APPEND x_drseg_cr TO x_mmcr_drseg_oo-cr.
    ENDLOOP..
    LOOP at x_mmcr_drseg-co INTO x_drseg_co.
      APPEND x_drseg_co TO x_mmcr_drseg_oo-co.
    ENDLOOP..
    LOOP at x_mmcr_drseg-sm INTO x_drseg_sm.
      APPEND x_drseg_sm TO x_mmcr_drseg_oo-sm.
    ENDLOOP..
    x_mmcr_drseg_oo-charact   = x_mmcr_drseg-charact.
    x_mmcr_drseg_oo-uebgmat   = x_mmcr_drseg-uebgmat.
    x_mmcr_drseg_oo-uebrblgp  = x_mmcr_drseg-uebrblgp.
    x_mmcr_drseg_oo-selkz_db  = x_mmcr_drseg-selkz_db.
    x_mmcr_drseg_oo-rblgp_old = x_mmcr_drseg-rblgp_old.
  ENDLOOP.

Hi
I don't think, I'm agree with you, u can only replace some statament:
LOOP AT E_TDRSEG INTO X_MMCR_DRSEG.
  X_MMCR_DRSEG_OO-ANLN1     = X_MMCR_DRSEG-ANLN1.
  X_MMCR_DRSEG_OO-ANLN2     = X_MMCR_DRSEG-ANLN2.
  X_MMCR_DRSEG_OO-APLZL     = X_MMCR_DRSEG-APLZL.
  X_MMCR_DRSEG_OO-AREWR     = X_MMCR_DRSEG-AREWR.
  X_MMCR_DRSEG_OO-AREWW     = X_MMCR_DRSEG-AREWW.
  X_MMCR_DRSEG_OO-AUFNR     = X_MMCR_DRSEG-AUFNR.
  X_MMCR_DRSEG_OO-AUFPL     = X_MMCR_DRSEG-AUFPL.
  X_MMCR_DRSEG_OO-BASME     = X_MMCR_DRSEG-AUFPL.
  X_MMCR_DRSEG_OO-BEDAT     = X_MMCR_DRSEG-BEDAT.
  X_MMCR_DRSEG_OO-BEGRU     = X_MMCR_DRSEG-BEGRU.
  X_MMCR_DRSEG_OO-BEWAE     = X_MMCR_DRSEG-BEWAE.
  X_MMCR_DRSEG_OO-EKGRP     = X_MMCR_DRSEG-EKGRP.
  X_MMCR_DRSEG_OO-BPMNG     = X_MMCR_DRSEG-BPMNG.
  X_MMCR_DRSEG_OO-BPRME     = X_MMCR_DRSEG-BPRME.
  X_MMCR_DRSEG_OO-BPUMN     = X_MMCR_DRSEG-BPRME.
  X_MMCR_DRSEG_OO-BPUMZ     = X_MMCR_DRSEG-BPUMZ.
  X_MMCR_DRSEG_OO-BPWEM     = X_MMCR_DRSEG-BPWEM.
  X_MMCR_DRSEG_OO-BPREM     = X_MMCR_DRSEG-BPREM.
  X_MMCR_DRSEG_OO-BSMNG     = X_MMCR_DRSEG-BSMNG.
  X_MMCR_DRSEG_OO-BUDAT     = X_MMCR_DRSEG-BUDAT.
  X_MMCR_DRSEG_OO-BUKRS     = X_MMCR_DRSEG-BUKRS.
  X_MMCR_DRSEG_OO-BWTAR     = X_MMCR_DRSEG-BWTAR.
  X_MMCR_DRSEG_OO-CR[]      = X_MMCR_DRSEG-CR[].
  X_MMCR_DRSEG_OO-CO[]      = X_MMCR_DRSEG-CO[].
  X_MMCR_DRSEG_OO-SM[]      = X_MMCR_DRSEG-SM[].
  X_MMCR_DRSEG_OO-CHARACT   = X_MMCR_DRSEG-CHARACT.
  X_MMCR_DRSEG_OO-UEBGMAT   = X_MMCR_DRSEG-UEBGMAT.
  X_MMCR_DRSEG_OO-UEBRBLGP  = X_MMCR_DRSEG-UEBRBLGP.
  X_MMCR_DRSEG_OO-SELKZ_DB  = X_MMCR_DRSEG-SELKZ_DB.
  X_MMCR_DRSEG_OO-RBLGP_OLD = X_MMCR_DRSEG-RBLGP_OLD.
ENDLOOP.
If you want to use APPEND statament u need to refresh the target table at very loop:
LOOP AT E_TDRSEG INTO X_MMCR_DRSEG.
  X_MMCR_DRSEG_OO-ANLN1     = X_MMCR_DRSEG-ANLN1.
  X_MMCR_DRSEG_OO-ANLN2     = X_MMCR_DRSEG-ANLN2.
  X_MMCR_DRSEG_OO-APLZL     = X_MMCR_DRSEG-APLZL.
  X_MMCR_DRSEG_OO-AREWR     = X_MMCR_DRSEG-AREWR.
  X_MMCR_DRSEG_OO-AREWW     = X_MMCR_DRSEG-AREWW.
  X_MMCR_DRSEG_OO-AUFNR     = X_MMCR_DRSEG-AUFNR.
  X_MMCR_DRSEG_OO-AUFPL     = X_MMCR_DRSEG-AUFPL.
  X_MMCR_DRSEG_OO-BASME     = X_MMCR_DRSEG-AUFPL.
  X_MMCR_DRSEG_OO-BEDAT     = X_MMCR_DRSEG-BEDAT.
  X_MMCR_DRSEG_OO-BEGRU     = X_MMCR_DRSEG-BEGRU.
  X_MMCR_DRSEG_OO-BEWAE     = X_MMCR_DRSEG-BEWAE.
  X_MMCR_DRSEG_OO-EKGRP     = X_MMCR_DRSEG-EKGRP.
  X_MMCR_DRSEG_OO-BPMNG     = X_MMCR_DRSEG-BPMNG.
  X_MMCR_DRSEG_OO-BPRME     = X_MMCR_DRSEG-BPRME.
  X_MMCR_DRSEG_OO-BPUMN     = X_MMCR_DRSEG-BPRME.
  X_MMCR_DRSEG_OO-BPUMZ     = X_MMCR_DRSEG-BPUMZ.
  X_MMCR_DRSEG_OO-BPWEM     = X_MMCR_DRSEG-BPWEM.
  X_MMCR_DRSEG_OO-BPREM     = X_MMCR_DRSEG-BPREM.
  X_MMCR_DRSEG_OO-BSMNG     = X_MMCR_DRSEG-BSMNG.
  X_MMCR_DRSEG_OO-BUDAT     = X_MMCR_DRSEG-BUDAT.
  X_MMCR_DRSEG_OO-BUKRS     = X_MMCR_DRSEG-BUKRS.
  X_MMCR_DRSEG_OO-BWTAR     = X_MMCR_DRSEG-BWTAR.
  REFRESH: X_MMCR_DRSEG_OO-CR,
           X_MMCR_DRSEG_OO-CO,
           X_MMCR_DRSEG_OO-SM.
  APPEND LINES OF: X_MMCR_DRSEG-CR TO X_MMCR_DRSEG_OO-CR,
                   X_MMCR_DRSEG-CO TO X_MMCR_DRSEG_OO-CO
                   X_MMCR_DRSEG-SM TO X_MMCR_DRSEG_OO-SM.
  X_MMCR_DRSEG_OO-CHARACT   = X_MMCR_DRSEG-CHARACT.
  X_MMCR_DRSEG_OO-UEBGMAT   = X_MMCR_DRSEG-UEBGMAT.
  X_MMCR_DRSEG_OO-UEBRBLGP  = X_MMCR_DRSEG-UEBRBLGP.
  X_MMCR_DRSEG_OO-SELKZ_DB  = X_MMCR_DRSEG-SELKZ_DB.
  X_MMCR_DRSEG_OO-RBLGP_OLD = X_MMCR_DRSEG-RBLGP_OLD.
ENDLOOP.
Max

Similar Messages

  • Upgrade - Green Question mark in SPAU for Function Group

    Hi,
    I am facing a problem while doing upgrade to ECC 6.0.
    There is a function group  KYPR  which has 2 function modules showing Green Question Mark.                                                                               
    REPORT_DIRECTORY_MAINTAIN     
         REPORT_IMPORT_FOR_TRANSPORT   
    I tried running the background program SAPRUPGM
    as suggested by SAP, but that does not solve the problem.
    Also looked at some of the notes, but not able to find any appropriate solution.
    Any help is appreciated.
    Regards
    Vinod

    did you check the forum, there are many answers ? [http://www.sdn.sap.com/irj/scn/advancedsearch?query=spaugreenquestion+mark#sdn_content_category_value_forums]
    Could you tell us what you tried ? (what about OSS connection test, etc.)

  • Function group for table T007V

    Hi,
    How can I find out table maintenance function group for standard SAP tables. If it does not exist then in which package should I create it.
    Thanks,
    Prateek

    Function Group are not assigned to tables... Function Group are assigned to Maintenance Views .. since no standard maintenance view exist for this table...
    So no function group is associated...
    You can create table maintenance for this table and assign any Z- Function Group u like..
    Reward if usefl
    Regards
    Prax

  • How to change function group in table maintenance

    Hello experts,
    I am having a problem transporting a custom table. Now, what I want to do is to just create a new function group under the table maintenance option in se11. Now, I can't seem to change my custom table's function group. How do I do that? thanks a lot and have a nice day guys!

    Hai
    You have to re-generate the table maintenance, when new fields are added, system doesn't automatically insert them in it.
    So go to MAINTENANCE TABLE GENERATOR for your table and press icon for updating.
    Here choose NEW FIELD options and press ENTER.
    Anyway I prefer to set somes parameters of EXPERT MODE as REFRESH OVERVIEW SCREEN
    goto ur table> utilities> table maintenance generator> change>press enter> reason give additional fields>expert mode--> enter...
    Thanks & Regards
    Sreenu

  • Function group in tablenaintenance generator.

    hi experts,
           can anybody please tell me why we create a function group
          while creating a table maintenance generator?
    what is the utility of creating a function group.
    regards
    pankaj

    Function Groups
    Function groups are containers for function modules. You cannot execute a function group. When you call a function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded). For further information, refer to Organization of External Procedure Calls.
    The following diagram shows the structure of a function group: The name of a function group, fgrpcan be up to 26 characters long. This is used by the system to create the components of the group (main program and corresponding include programs). When you create a function group or function module in the Function Builder , the main program and include programs are generated automatically.
    The main program SAPLfgrp contains nothing but the INCLUDE statements for the following include programs:
    キ LfgrpTOP. This contains the FUNCTION-POOL statement (equivalent for a function group of the REPORT or PROGRAMstatement) and global data declarations for the entire function group.
    キ LfgrpUXX. This contains further INCLUDEstatements for the include programs LfgrpU01, LfgrpU02,... These includes contain the actual function modules.
    キ The include programs LfgrpF01, LfgrpF02,... can contain the coding of subroutines that can be called with internal subroutine calls from all function modules of the group.
    The creation of these INCLUDE programs is supported from the ABAP Workbench by forward navigation (for example creation of a subroutine include by double clicking on the name of a subroutine in a PERFORM statement within a function module).
    You cannot declare a COMMON PART in a function group. Function groups have their own table work areas (TABLES). Function groups encapsulate data. In this respect, they are a precursor of ABAP Objects (see From Function Groups to Objects ).
    All of the function modules in a function group can access the global data of the group. For this reason, you should place all function modules that use the same data in a single function group. For example, if you have a set of function modules that all use the same internal table, you could place them in a function group containing the table definition in its global data.
    Function groups, like executable programs and module pools, can contain screens (selection screens and lists) as components. User input is processed either in dialog modules or in the corresponding event blocks in the main program of the function group. There are special include programs in which you can write this code. In this way, you can use function groups to encapsulate single screens or screen sequences.
    In SAP, it is a function group - instead of function - that is loaded into active memory.
    Function ( or function module ) is the one that you call from the program to do things.
    A function group contains functionally related function modules, global variables and procedures .
    To display / edit function module you use SE37,
    To display / edit function group you use SE80 .
    Reward if found helpful,
    regards
    palak

  • Dump-Phenomenon No Auth Function Group HRSSC00TRACKING

    Hi guys,
    we have a strange phenomenon occuring and I can't come up with an explanation, please help:
    On our production System we went productive on EHP 4 yesterday. I got a call from basis team today that we have about 2000 Dumps DAILY in production. The problem is the following:
    User XXX has no authority for Function Group HRSSC00TRACKING.
    I traced the error down to Function Module HRXSS_SER_RFW_RFC_GET_FORM which is responsible for parts of the JAVA environment in process of the ESS Scenario for the Payslip. So this error occurs EVERY time when a user calls his payslip on ESS (we have over 20000 Users...). However, the end user functionality is not influenced by this. The end users o not get any error.
    The error can be reproduced on the QS System.
    The error can NOT be reproduced on Development System.
    The respective R3-Roles with the authorities for the Portal Role which contains the authority for our customer ESS Role are All Equal on all three Systems. The Role does not contain the authority for this function group, which explains why it isn't working on prod and QS. But this should also reflect on Development then, which it doesn't. I'm confused with this and don't know where to approach. There are no SAP-Notes concerning this.  X-Search only turns up one thread which doesnt help either:
    Vehicle use eform not appearing
    The Stacks on ECC and Portal are Equal for all Systems in the Landscape and there is no Stack-Missmatch.
    I know we could just assign the authority and transport the Role "because hey, it might just work out" but this still doesn't clarify the situation and makes it all even more troublesome. Also I probably won't be able to reason with our Authority expert because the error can'r be reproduced on all systems....
    help me obi wan kenobi sdn, you're my only hope
    best regards, Lukas

    Yeah, when taking a closer look at *hr_ssc_create_service_object both tables are called WITHIN the FM which the users don't have the RFC Authority for. No other choice than giving the authority then...
    The Dump opccurs at:
    >>>FUNCTION hr_ssc_create_service_object
    FUNCTION hr_ssc_create_service_object.
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(SERVICE_APPL_TYPE) TYPE  SSC_SERVICE_APPL_TYPE DEFAULT
    *"       'WDJAVA'
    *"     VALUE(SERVICE_APPL_PATH) TYPE  SSC_SERVICE_APPL_PATH OPTIONAL
    *"     VALUE(SERVICE_APPL_NAME) TYPE  SSC_SERVICE_APPL_NAME
    *"     VALUE(START_TIME_STAMP) TYPE  SSC_UTC_TIMESTAMP_START
    *"     VALUE(END_TIME_STAMP) TYPE  SSC_UTC_TIMESTAMP_END OPTIONAL
    *"     VALUE(OBJECT_PLVAR) TYPE  PLVAR OPTIONAL
    *"     VALUE(OBJECT_OTYPE) TYPE  OTYPE OPTIONAL
    *"     VALUE(OBJECT_ID) TYPE  HROBJID OPTIONAL
    *"     VALUE(TRACKING_ID) TYPE  SSC_TRACKING_ID OPTIONAL
    *"     VALUE(INITIATOR_ROLE) TYPE  SSC_INITIATOR_ROLE OPTIONAL
    *"  EXPORTING
    *"     VALUE(IS_TRACKING_ACTIVE) TYPE  BOOLE_D
      DATA:
          central_switch         TYPE t5sscswitchon,
          services               TYPE STANDARD TABLE OF t5ssctrackxss,
          service                TYPE t5ssctrackxss,
          services_count         TYPE i,
          service_object         TYPE REF TO if_pobj_process_object,
          service_attributes     TYPE pobjt_levelkey_with_attributes,
          service_attribute      TYPE pobjs_levelkey_with_attributes,
          attribute              TYPE pobjs_level_attribute,
          service_guid           TYPE pobj_level_guid,
          role                   TYPE t5asrprocrole,
          message                TYPE swr_msglin,               "#EC NEEDED
          msg                    TYPE symsg.
      CONSTANTS:
          true                   TYPE boole_d VALUE 'X'.
      SELECT SINGLE * FROM t5sscswitchon INTO central_switch.
      is_tracking_active = central_switch-tracking_on.
      CHECK is_tracking_active = true.
      SELECT * FROM t5ssctrackxss INTO TABLE services WHERE appl_type = service_appl_type
                                                      AND   appl_path = service_appl_path
                                                      AND   appl_name = service_appl_name.
    In my opinion
    SELECT SINGLE * FROM t5sscswitchon INTO central_switch.
      is_tracking_active = central_switch-tracking_on.
      CHECK is_tracking_active = true.
    should be called before the FM is called itself... :-(((
    UPDATE:
    Yes, the error occurs for all users. That's why we have over 2000 Dumps daily on production
    best regards...
    Lukas
    Edited by: Lukas Weigelt on Jun 15, 2011 4:42 PM
    Edited by: Lukas Weigelt on Jun 15, 2011 4:44 PM

  • Function modules and function groups

    Hi alll
       Can anybody explain me abt function module and function groups...please
    Thanks and Regards
    vijaya

    <b>Function groups</b> are containers for function modules. You cannot execute a function group. When you call an function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded).
    The name of a function group can be up to 26 characters long. This is used by the system to create the components of the group (main program and corresponding include programs). When you create a function group or
    function module in the Function Builder [Ext.] , the main program and include programs are generated automatically.
    When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.
    The name of the main program is assigned by the system. This is made up of the prefix SAPL followed by the function group name. For example, the main program for function group SXXX is called SAPLSXXX.
    The names of the include files begin with L followed by the name of the function group, and conclude with UXX ( or TOP for the TOP include). The TOP include contains global data declarations that are used by all of the function modules in the function group. The other include file within the main program is used to hold the function modules within the group.
    You cannot declare a COMMON PART in a function group. Function groups have their own table work areas (TABLES). Function groups encapsulate data.
    All of the function modules in a function group can access the global data of the group. For this
    reason, you should place all function modules that use the same data in a single function group.
    For example, if you have a set of function modules that all use the same internal table, you could
    place them in a function group containing the table definition in its global data.
    Like executable programs (type 1) and module pools (type M), function groups can contain screens, selection screens, and lists. User input is processed either in dialog modules or in the corresponding event blocks in the main program of the function group. There are special include programs in which you can write this code. In this way, you can use function groups to
    encapsulate single screens or screen sequences.
    For function module, have a look at
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    I hope it helps.
    Best Regards,
    Vibha

  • Transfer values between Function Groups

    This may be a very silly question. I have two function groups x and y. X calls a z function module which is in the same funcion group as X. Now I want to pass some value that x gave to z to Y function module . How do I do it??

    I think function Z shouldn't called by X, but Y.
    Infact X and Z are in the same group so they can see the global variables of group.
    For example:
    GROUP 1 -> Function X, Z.
    TOP include.
    DATA: FIELD1 TYPE C.
    DATA X_BKPF LIKE STANDARD TABLE OF BKPF.
    FUNCTION A.
    FIELD1 = 1.
    X_BKPF = .....
    ENDFUNCTION.
    FUNCTION Z.
    EXPORTING
      REFERENCE(FIELD)
    TABLES
        T_BKPF...
      FIELD = FIELD1. "Take field1 value
      T_BKPF[] = X_BKPF[] "Take table values
    ENDFUNCTION.
    Group 2 Y
    FUNCTION Y.
    CALL FUNCTION Z
      IMPORTING FIELD = FIELD_Y
      TABLES    T_BKPF = T_BKPF_Y.
    ENDFUCTION.
    Message was edited by: max bianchi

  • Function Groups

    Hi....
       Any body send me what are the uses of the include programs generates function groups while creating...?
       And what is the Difference between those two?
       And in which cases we have to go for change them?
       Thank you,
       Naveen Inuganti.

    Hi
    Include Programs
    Include programs are global R/3 Repository objects. They are solely for modularizing source code, and have no parameter interface.
    They have the following functions:
    Library: Include programs allow you to use the same source code in different programs. For example, this can be useful if you have lengthy data declarations that you want to use in different programs.
    Order. Include programs allow you to manage complex programs in an orderly way. Function groups and module pools use include programs to store parts of the program that belong together. The ABAP Workbench supports you extensively when you create such complex programs by creating the include programs automatically and by assigning them unique names. A special include is the TOP include of a program. If you name it according to the naming convention, it is always included in program navigation and in the syntax check.
    Creating Your Own Include Programs
    If you create an include program yourself, you must assign it the type I in its program attributes. You can also create or change an include program by double-clicking on the name of the program after the INCLUDE statement in your ABAP program. If the program exists, the ABAP Workbench navigates to it. If it does not exist, the system creates it for you.
    An include program cannot run independently, but must be built into other programs. Include programs can contain other includes.
    The only restrictions for writing the source code of include programs are:
    Include programs cannot call themselves.
    Include programs must contain complete statements.
    You must ensure that the statements of your include program fit logically into the source code of the programs from which it is called. Choosing Check while editing an include program in the ABAP Editor is normally not sufficient for this.
    se37 funcation group used for funcation module store on sap library.
    Function Groups
    function group creates two includes.
    include lfgidtop.
    include lfgiduxx. wher fgid is function group
    The first include program-lfgidtop-is known as the top include. Within it you can place global data definitions. These are data definitions that are global to all function modules within the group.
    The second include program-lfgiduxx-is known as the UXX. You are not allowed to modify the UXX. The system will automatically place an include statement in the UXX for each function module you create in this function group. For the first function module, the statement include lfgidu01 will be inserted into the UXX. When you create a second function module in this group, the system will add a second statement: include lfgidu02.
    Function groups are containers for function modules. You cannot execute a function group. When you call a function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded). For further information, refer to Organization of External Procedure Calls.
    The following diagram shows the structure of a function group: The name of a function group, fgrpcan be up to 26 characters long. This is used by the system to create the components of the group (main program and corresponding include programs). When you create a function group or function module in the Function Builder , the main program and include programs are generated automatically.
    The main program SAPLfgrp contains nothing but the INCLUDE statements for the following include programs:
    In SAP, it is a function group - instead of function - that is loaded into active memory.
    Function ( or function module ) is the one that you call from the program to do things.
    A function group contains functionally related function modules, global variables and procedures .
    To display / edit function module you use SE37,
    To display / edit function group you use SE80 .
    Reward If Helpfull,
    Naresh.

  • Please give me answers for the following interview questions ?

    Dear  friends,
    Greets............................................
              Pls give me solutions for th following questions?
    1.How to  record BDC using Call Transaction without screen sequence of a particular transaction code?
    2.How to initiate the Call Transaction by coding without using Call Transaction Mode 'S' or 'A'.
    3.How to run the BDC program without legacy file from Presentation Server. If   Application Server how?
    4.How BDC overcomes BAPI?
    5.Difference between Function Module and BAPI.
    6.How to create a BAPI.
    7.How to display Footer text in last page of the script.
    8.How to display Footer text in last page of the script without touching the layout only using print program.
    9. Standard text creation without using SO10 . How to save?
    where to save? How to include in the print program?
    10.How Script overcomes Smartforms?
    11. How to access smartforms thru programs without using SSF_FUNCTION_MODULE_NAME.
    12.In smartforms First page should be portriat and second page must be landscape format. Is it possible?
    13.How to create internal table globally.
    14. How to delete F4 help for a particular field in the selection screen.
    15.How to set the password field in the selection screen as it is in the initail screen containing Client, Username,Password.
    17. How to use the Hash table algorithm and how access it.
    18. Prerequisites for  FOR ALL ENTRIES.
    19.MENTION  the Tcode for performance issue Other than SLIN,SE30,ST05 ?
    20. Table Types?
    21SAP LUW
    22.Types of Lock objects.
    Thanks in Advance********************************************
    Regards
    Raj kumar

    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Reports
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Debugging Document.
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Remote Function Call:
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Refer this
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    http://www.techinterviews.com/?p=198
    http://www.techinterviews.com/?p=326
    http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.geekinterview.com/Interview-Questions/SAP-R-3/ABAP
    http://sap.ittoolbox.com/documents/popular-q-and-a/abap-sample-interview-questions-3240
    http://www.sap-img.com/abap/abap-interview-question.htm
    http://www.allinterview.com/Interview-Questions/ABAP.html
    links for OO ABAP.
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com.
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    some more materials.
    Go through the following Documents Links & Materials for ABAP Objects
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/sap.user72/blog/2005/05/10/a-small-tip-for-the-beginners-in-oo-abap
    /people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
    /people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Hi,
    Please go through the following :
    ABAP Interview Questions
    1. How data is stored in cluster table?
    Each field of cluster table behaves as tables which contains the no. of entries.
    2. What are client dependant objects in abap/sap?
    SAP Script layout, text element, and some DDIC objects.
    3. On which even we can validate the input fields in module progams?
    In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.)
    4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically?
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material group for the plant.
    5. How do you get output from IDOC?
    Data in IDOc is stored in segments, the output from Idoc is obtained by reading the data stored in its respective segments.
    6. When top of the page event is triggered?
    After excuteing first write statement in start-of-selection event.
    7. Can we create field without data element and how?
    In SE11 one option is available above the fields strip. Data element/ direct type.
    8. How do we debug sapscript?
    Go to SE71 give lay set name , go to utilities select debugger mode on.
    9. Which transaction code can I used to analyze the performance of ABAP program.
    TCode AL21.
    10. How can I copy a standard table to make my own z_table.
    Go to transaction SE11. Then there is one option to copy table. Press that button. Enter the name of the standard table and in the Target table enter Z table name and press enter.
    1. What is the use of 'outerjoin'
    Ans. With the use of outer join you can join the tables even there is no entry in all the tables used in the view.
    In case of inner join there should be an entry in al the tables use in the view.
    2. When to use logical database?
    Ans. Advantage of Logical databases:
    less coding s required to retrieve data compared to normal internel tables.
    Tables used LDB are in hierarchial structure.
    3. What is the use of 'table index'?
    Ans .Index is used for faster access of data base tables.
    4. What is the use of 'FOR ALL ENTRIES'?
    Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.
    If there r more than 10000 records SELECT FOR ALL ENTRIES is used.
    Performance wise SELECT FOR ALL ENTRIES is better to use.
    5. Can you set up background processing using CALL TRANSACTION?
    Yes,Using No Screen Mode.
    6. What are table buffers?
    Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed
    directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
    Buffering is useful if table needs to be accessed more no. of times in a program.
    ABAP Technical Interview Questions:
    1. What is the typical structure of an ABAP program?
    2. What are field symbols and field groups.? Have you used "component idx of structure" clause with field groups?
    3. What should be the approach for writing a BDC program?
    4. What is a batch input session?
    5. What is the alternative to batch input session?
    6. A situation: An ABAP program creates a batch input session. We need to submit the program and the batch session in background. How to do it?
    7. What is the difference between a pool table and a transparent table and how they are stored at the database level?
    8. What are the problems in processing batch input sessions? How is batch input process different from processing on line?
    9. What do you define in the domain and data element?
    10. What are the different types of data dictionary objects?
    11. How many types of tables exist and what are they in data dictionary?
    12. What is the step-by-step process to create a table in data dictionary?
    13. Can a transparent table exist in data dictionary but not in the database physically?
    14. What are the domains and data elements?
    15. Can you create a table with fields not referring to data elements?
    16. What is the advantage of structures? How do you use them in the ABAP programs?
    17. What does an extract statement do in the ABAP program?
    18. What is a collect statement? How is it different from append?
    19. What is open sql vs native sql?
    20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
    21. What is the meaning of ABAP editor integrated with ABAP data dictionary?
    22. What are the events in ABAP language?
    23. What is an interactive report? What is the obvious diff of such report compared with classical type reports?
    24. What is a drill down report?
    25. How do you write a function module in SAP? Describe.
    26. What are the exceptions in function module?
    27. What is a function group?
    28. How are the date abd time field values stored in SAP?
    29. What are the fields in a BDC_Tab Table?
    30. Name a few data dictionary objects?
    31. What happens when a table is activated in DD?
    32. What is a check table and what is a value table?
    33. What are match codes? Describe?
    34. What transactions do you use for data analysis?
    35. What is table maintenance generator?
    36. What are ranges? What are number ranges?
    37. What are select options and what is the diff from parameters?
    38. How do you validate the selection criteria of a report? And how do you display initial values in a selection screen?
    39. What are selection texts?
    40. What is CTS and what do you know about it?
    41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it?
    42. What is the client concept in SAP? What is the meaning of client independent?
    43. Are programs client dependent?
    44. Name a few system global variables you can use in ABAP programs?
    45. What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement?
    46. How do you take care of performance issues in your ABAP programs?
    47. What are datasets?
    48. How to find the return code of a stmt in ABAP programs?
    49. What are interface/conversion programs in SAP?
    50. Have you used SAP supplied programs to load master data?
    2. Adapted from response by Maram Roja on Tuesday, June 15, 2004
    1. What are the techniques involved in using SAP supplied programs? Do you prefer to write your own programs to load master data? Why?
    2. What are logical databases? What are the advantages/disadvantages of logical databases?
    3. What specific statements do you using when writing a drill down report?
    4. What are different tools to report data in SAP? What all have you used?
    5. What are the advantages and disadvantages of ABAP query tool?
    6. What are the functional areas? User groups? How does ABAP query work in relation to these?
    7. Is a logical database a requirement/must to write an ABAP query?
    8. What is the structure of a BDC sessions.
    9. What are Change header/detail tables? Have you used them?
    10. What do you do when the system crashes in the middle of a BDC batch session?
    11. What do you do with errors in BDC batch sessions?
    12. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs?
    13. Is it possible to run host command from SAP environment? How do you run?
    14. What kind of financial periods exist in SAP? What is the relevant table for that?
    15. Does SAP handle multiple currencies? Multiple languages?
    16. What is a currency factoring technique?
    17. How do you document ABAP programs? Do you use program documentation menu option?
    18. What is SAPscript and layout set?
    19. What are the ABAP commands that link to a layout set?
    20. What is output determination?
    ABAP Interview Questions
    1.Without using Tcode SE11, How can we enter the values in to the table???
    2.What is the difference between Collect statement and Append Statement???
    3.What do you mean by correction and Transportation system???
    4.What is the difference between User Exits and BADI????
    5.How can we identify User exits in our screen???
    6.What do you mean by Inbound and Outbound interface???
    7.In realtime do we configure ALE systems or Administator will take care of that??
    8.How to release an object???
    9.What is the flow of a Sales document???
    10.What is the flow of Purchase order???
    12.What is the flow of Invoice???
    13.What are the standard IDOC's used???
    14.What do you mean by table control???Where will we use this???
    15.What are field symbols??Where will we use these symbols???
    Deepti
    1. There are other ways of entering data into a DB table. ex. B D C
    2. Collect statement collect/adds the records basing on a key field. allows to create summarised data sets.
    Append will append/add a record at the end of existing records
    8. to release an object - use se10/se9
    9. sales doc flow: S. A. - S. O. - Delivery - Billing
    12. Delivery - invoice.
    15. field symbols are used for dynamic allocation. at runtime u can assign a concrete field to field-symbol.
    Kishore
    1. you can go to abap editor (se38) and use insert statement for insertion update for update and modify for modifications.
    2. collect will not allow duplicate entries, while append can allow duplicates.
    3. if any changes are made to objects they are to be transported to different systems i.e, change and transport.
    4. in user exits we go by general method for enhancements while BADIs we use objects (oops concepts)
    methods for enhancement.
    14. table controls are enhanced version for step loops where we can expand rows .main difference between these two
    is step loop can be expanded to two lines table controls can`t.
    15. field symbols are just like pointers concept which are used in C language. We use them when we want to refer to
    the fields considered,it doesnt allocate any memory for it.
    Venu Rapolu
    1. Ans: Using BDC., LSMW,,ALE., BAPI
    2. Ans: Collect: it adds the numeric fields to the existing non numeric key field records., thereby avoiding duplicate
    values., and append will simply adds the record
    3 . Ans: The CTS contains work bench organizer and transport system :
    The workbench organizer is used to record and contol changes to the ABAP/4 development objects;
    The transport system is used to move objects from an SAP dev.system to production system
    6. Ans: Outbound interface is used to send IDocs to the ALE server.,
    Inbound interface is used to Analyse the received Idoc.
    7. Ans: We (ABAPers) don't do.
    8. Ans: se09 or se10
    13. Ans: MATMAS
    CREMAS
    DEBMAS
    GLMAST etc...
    14. Ans: to display records in table format., we use in Screens
    15. Ans: we assign the field content at run time with ASSIGN stmt.
    Satish D
    1. goto se16 u can view the table contents
    2. collect will collects all the numeric fields of nonnumeric field values
    append will append record at the end of table
    3. when we are creatiing new task like dev. a new prg.. after completion of dev. that will be trnsported to testing system or production system to do that we are assigning an
    transport request from our dev.class(system) by using se09
    4. badis are dev. by class and inheritence methods where as user exitsdev by SAP only and empty shells filled wit user logic
    5. go to system then status
    6. outbound generating an idoc in ale layer with master_idoc_create_messgetype,
    inbound is receivng system with idoc_inbound_process, gives an return variable wether it is sucess or not
    7. no we have to configur that
    8. go to se09 or se01 there write your task no and use release button it will asks whats the other system name
    and number enter them and relase by pressing jeep button
    9. inquiry
    quotation
    sales order
    shipping
    delivery
    invoice
    return goods
    12. after creation of delivry note invoice is prepared
    13. master_idoc_distribute will generate standard idoc
    Deepti
    I am enclosing some of answers which I know.
    1. We can use t.Code SE16 to enter values into table only if table maintainence is allowed for that table.
    2. Append will add new entries into the table where as collect add into the numeric type fields if other charatcer fields
    matches to your selection criteria.
    3. CTS used for creation of ABAP development transport requests.The transaction code for this is SE10.
    4. UserExits r used for adding additional functionality to the existing SAP standard transactions.Using UserExits we can add additional functionality standard SAP functionality without making any changes to the original code.BADI is a standardized interface for ABAP sources that enables partners and customers to enhance SAP-delivered programs in their namespace.
    5 .We can identify User exits by using transactions CMOD and SMOD.
    6. After entering transaction code SE10 select the transport request which u want to transport and click on transport icon(Truck symbol) to release it.
    10. Purchase Requistion->RFQ->Vendor Evaluation->Purchase Order(ME21).
    14. Table control is the only facility provide thru dialog programming when we come acrosse the use of updating standared,deletion,insertion and all database operations.
    15. Field symbols r pointers to the existing data types(like 'C') which does not allocate any memory space. These are used faster access of data.
    Answers to some ABAP Interview Questions:
    Questions which I have faced in an interview:
    1) What is runtime analysis? Have you used this?
    2) What is meant by performance analysis? Have done anything to improve the performance?
    3) How to transfer the objects? Have to transferred any objects?
    4) How did you test the developed objects?
    5) What is the difference between SAP Memory and ABAP Memory?
    6) In order to upload Purchase order details, how you handle multiple values for a single field?
    Eg: Item field may contain no. of values for a record
    7) What is the procedure you followed to upload the data?
    8) How did you handle errors in Call Transaction?
    9) Among the Call Transaction and Session Method, which is faster?
    10) What are the difference between Interactive and Drill Down Reports?
    11) How to pass the variables to forms?
    12) How to create a link between modified form and modified print program?
    13) What is the table, which contain the details of all the name of the programs and forms?
    14) How did you test the form u developed? How did you taken print?
    15) What are Standard Texts?
    16) What is the difference between Clustered Tables and Pooled Tables?
    17) What is pf-status?
    18) Among "Move" and "Move Corresponding", which is efficient one?
    19) What are the output type and Tcodes?
    20) Where we use Chain and Endchain?
    21) Do you use select statement in loop endloop, how will be the performance? To improve the performance?
    22) In select-options, how to get the default values as current month first date and last date by default?
    Eg: 1/12/2004 and 31/12/2004
    Go thru these answers:
    1) What is runtime analysis? Have you used this?
    It's checks program execution time in microseconds. When you go to se30.if you give desired program name in performance file. It will take you to below screen. You can get how much past is your program.
    2) What is meant by performance analysis? Have done
    3) How to transfer the objects? Have you transferred any objects?
    4) How did you test the developed objects?
    I was testing a developed object. There are two types of testing
    - Negative testing
    - Positive testing
    In negative testing we will give negative data in input and we check any errors occurs.
    In positive testing we will give positive data in input for checking errors.
    8) How did you handle errors in Call Transaction?
    We can create a internal table like 'bsgmcgcoll'. All the messages will go to internal table. We can get errors in this internal table.
    Below messages are go to internal table. when you run the call transaction.
    - Message type
    - Message id
    - Message Number
    - Variable1
    - Variable2
    - Variable3
    9) Among the Call Transaction and Session Method, which is faster?
    Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.
    10) What are the difference between Interactive and Drill Down Reports?
    ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list.
    Drill down report is nothing but interactive report...drilldown means above paragraph only.
    11) How to pass the variables to forms?
    12) What is the table, which contain the details of all the name of the programs and forms?
    Table cont

  • TABLE(CAST()) function not returning the correct results in few scenarios.

    I am using TABLE(CAST()) operation in PL/SQL and it is returning me no data.
    Here is what I have done:
    1.     Created Record type
    CREATE OR REPLACE TYPE target_rec AS OBJECT
    target__id          NUMBER(10),
    target_entity_id NUMBER(10),
    dd           CHAR(3),
    fd           CHAR(3),
    code      NUMBER(10),
    target_pct      NUMBER,
    template_nm VARCHAR2(50),
    p_symbol      VARCHAR2(10),
    pm_init          VARCHAR2(3),
    target_name     VARCHAR2(20),
    targe_type     VARCHAR2(30),
    target_caption     VARCHAR2(30),
    sort_order      NUMBER (4)
    2.     Created Table type
    CREATE OR REPLACE TYPE target_arr AS TABLE OF target_rec
    3.     Created Stored procedure which accepts parameter of type target_arr and runs the Table(Cast()) function on it.
         Following is the simplified form of my procedure.
         PROCEDURE get_target_weights
         p_in_template_target IN target_arr,
         p_out_count          OUT NUMBER,
         IS
         BEGIN
              SELECT count(*) into p_out_count
         FROM TABLE(CAST(p_in_template_target AS                     target_arr)) arr;
         END;
    I am calling get_target_weights from my java code and passing p_in_template_target with 10140 records.
    Scenario 1: If target_pct in the last record is 0, p_out_count returned from the procedure is 0.
    Scenario 2: If target_pct in the last record is any other value(say 0.01), p_out_count returned from the procedure is 10140.
    Please help me understand why the Table(Cast()) is not returning the correct results in Scenario 1. Also adding or deleting any record from the test data returns the correct results (i.e. if keep target_pct in the last record as 0 but add or delete any record).
    Let me know how can I attach the test data I am using to help you debugging as I don’t see any Attach file button on Post Message screen on the forum.

    I am not able to reproduce this problem with a small data set. I can only reproduce with the data having 10140 records.
    I am not sure if this is the memory issue as adding a new record also solves the problem.
    This should not be the error because of wrong way of filling the records in java as for testing purpose I just saved the records which I am sending from java in a table. I updated the stored procedure as well to read the data from the table and then perform TABLE(CAST()) operation. I am still getting 0 as the output for scenario 1 mentioned in my last mail.
    Here is what I have updated:
    1.     Created the table target_table
    CREATE Table target_table
    target_id          NUMBER(10),
    target_entity_id NUMBER(10),
    dd           CHAR(3),
    fd           CHAR(3),
    code      NUMBER(10),
    target_pct      NUMBER,
    template_nm VARCHAR2(50),
    p_symbol      VARCHAR2(10),
    pm_init          VARCHAR2(3),
    target_name     VARCHAR2(20),
    target_type     VARCHAR2(30),
    target_caption     VARCHAR2(30),
    sort_order      NUMBER (4)
    2.     Inserted data into the table : The script has around 10140 rows. Pls let me know how can I send it to you
    3.     Updated procedure to read data from table and stored into variable of type target_arr. Run Table(cast()) operation on target_arr and get the count
    PROCEDURE test_target_weights
    IS
         v_target_rec target_table%ROWTYPE;
         CURSOR wt_cursor IS
         Select * from target_table;
         v_count NUMBER := 1;
         v_target_arr cws_target_arr:= target_arr ();
         v_target_arr_rec target_rec;
         v_rec_count NUMBER;
         BEGIN
         OPEN wt_cursor;
         loop
              fetch wt_cursor into v_target_rec; -- fetch data from table into local           record.
              exit when wt_cursor%notfound;
              --move data into target_arr
              v_target_arr_rec :=                     cws_curr_pair_entity_wt_rec(v_target_rec target_id,v_target_rec. target_entity_id,
                        v_target_rec.dd,v_target_rec.fd,v_target_rec.code,v_target_rec.target_pct,
         v_target_rec.template_nm,v_target_rec.p_symbol,v_target_rec.pm_init,v_target_rec.template_name,
         v_target_rec.template_type,v_target_rec.template_caption,v_target_rec.sort_order);
              v_target_arr.extend();
              v_target_arr(v_count) := v_target_arr_rec;
              v_count := v_count + 1;
         end loop;
         close wt_cursor;
         -- run table cast on target_arr
         SELECT count(*) into v_rec_count
         FROM TABLE(CAST(v_target_arr AS target_arr)) arr;
         DBMS_OUTPUT.enable;
         DBMS_OUTPUT.PUT_LINE('p_out_count ' || v_rec_count);
         DBMS_OUTPUT.PUT_LINE('v_count ' || v_count);
    END;
    Output is
    p_out_count 0
    v_count 10140
    Expected output
    p_out_count 10140
    v_count 10140

  • In which condition Table valued function should prefer over SP except use in joins?

    Hi, 
    My requirements is:
    Entity framework needs to call DB object (TVF or SP), which will provide some data to them and they'll work on it at app level.
    DB object would be simple, one result set, it will join 5 tables and get around 30 columns to them. it would be parameterized query so can't use view.
    Now my question is what DB object would be best to use, table valued function or store procedure. and why?
    I google on it, I find some interesting links (example http://technet.microsoft.com/en-us/library/ms187650(v=sql.105).aspx)
    they mentioned conditions to convert SP to TVF but not mentioned the reason, why I should convert?
    Both have same cache plans strategy. SP has so many advantages over TVF, but I don't see any technical advantage of TVF over SP except it can be use in joins or so. 
    so In short my question is, why I can't use SP in all cases, why I would use TVF?, and which Table valued or multi-valued?
    would appreciate your time and response.

    According to a few recent blogs you should be able to use TVP or stored procedure with EF 6.1.2 with ease. In our application we haven't switched yet to 6.1.2 (we're using 6.0.0) and there is no support for stored procedures or functions so we use StoreQuery.
    I am wondering if you can share your experience of using EF with SP or TVP (and document the steps).
    I am also wondering as how exactly it's working behind the scenes and where the full query is taking place. Say, in our case we may want to add some extra conditions after retrieving a set using, say, SP. Would the final query execute on the client (e.g.
    SP executed on the server, result returned and then extra conditions executed on the "client")?
    As I said, right now we're using StoreQuery which means that our extra conditions must be case - sensitive as opposed to SQL Server case insensitive. So, if someone already tried that scenario and can tell me how exactly it works, I would appreciate it.
    Another question about EF - I defined a property as  
     [Column(TypeName = "varchar")]
            public string PhoneNumber { get; set; } // area code + phone
    and in the LINQ query as 
    var query = db.Accounts.Select(a => new AccountsList
    AcctName = a.AcctName,
    Contact = a.Contact,
    FullName = a.FullName,
    AreaCode = a.AreaCode,
    Phone = a.Phone,
    Hidden = a.Hide,
    Hide = a.Hide,
    PhoneNumber = a.AreaCode.Trim() + a.Phone.Trim(),
    AcctTypeId = a.AcctTypeId
    and I see that it's translated into CASE AreaCode IS NULL THEN N'' ELSE RTRIM(LTRIM(areaCode)) END + ... 
    My question is - why EF does it if there is no mentioning at all in the class as how NULL is supposed to be treated. Is it a bug?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • JDBC Adapter Call a Table-Valued Function

    Hello to all,
    we're using the JDBC adapter to access a MS SQL-Server 2008.
    I have to call a "Table-Valued Function" via JDBC.
    Has anybody done this?
    I've tried to call it like a stored procedure with the following:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <fLGBuchungenSAP>
              <Tablename action="execute">
                   <table>dbo.fLGBuchungenSAP</table>
              </Tablename>
         </fLGBuchungenSAP>
    </ns1:LGBuchungSAP_REQ>
    but I get following error:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP' (structure 'fLGBuchungenSAP'): com.microsoft.sqlserver.jdbc.SQLServerException:
    Fehler bei der Anforderung für 'fLGBuchungenSAP' (Prozedur), weil 'fLGBuchungenSAP' ein Tabellenwertfunktion-Objekt ist.
    Calling with a select-statement also fails:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <STATEMENT_NAME>
              <Tablename action="SELECT">
                   <table>dbo.fLGBuchungenSAP(&apos;20101101 00:00:00&apos;, &apos;20110101 00:00:00&apos;)</table>
              </Tablename>
         </STATEMENT_NAME>
    </ns1:LGBuchungSAP_REQ>
    with error:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Eingangs-Message -->
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP('20101101 00:00:00', '20110101 00:00:00')' (structure 'STATEMENT_NAME'): java.lang.IndexOutOfBoundsException: Index: 4, Size: 4</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Please advice
    Regards
    Christian

    Hello to all,
    I solved the problem.
    You have to call it this way:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyzde/pi/mav/kantine">
         <STATEMENT>
              <LGBuchungSAP action="SQL_DML">
                   <access>select * from dbo.fLGBuchungenSAP(&apos;$DatumVon$&apos;, &apos;$DatumBis$&apos;)</access>
                   <key>
                        <DatumVon>20101101 00:00:00</DatumVon>
                        <DatumBis>20110101 00:00:00</DatumBis>
                   </key>
              </LGBuchungSAP>
         </STATEMENT>
    </ns1:LGBuchungSAP_REQ>
    But I get the next error: "A result set was generated for the update task"
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LGBuchungSAP' (structure 'STATEMENT'): com.microsoft.sqlserver.jdbc.SQLServerException: Es wurde ein Resultset für den Aktualisierungsvorgang generiert.</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>

  • How to declare variable in table valued function

    hello.
    i have the following code to define a inline table valued function
    but the use of cmn.ReshteId('Lf_WL') as a function in where clause is not good performance.
    Alter function lf.fn_WholeLifeBn_GetForm(@ViewKind tinyint, @CurrentLocation int) returns table
    as
    return
    select B.*
    from lf.fn_LifeBN_GetForm(@ViewKind, @CurrentLocation) B
    where Reshte = cmn.ReshteId('Lf_WL')
    for better performance following code is good:
    declare @Reshte smallint
    set @Reshte = cmn.ReshteId('Lf_TS')
    select B.*
    from lf.fn_LifeBN_GetForm(@ViewKind, @CurrentLocation) B
    where Reshte = @Reshte
    but can not use it as the first code block in inline function.
    please help for define a good function.

    What do you think about Multi-Statement Table-Valued UDFs?
    create function Func(@Var int)
    returns @T table(ColName int)
    as
    begin
      insert into @T(ColName) values (@Var)
      return
    end
    select * from Func(10)
    select * from Func(20)
    ---or
    alter function Func()
    returns @T table(ColName int)
    as
    begin
      declare @Var int
      set @Var = 10
      insert into @T(ColName) values (@Var)
      return
    end
    select * from Func()
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • SQL: Issue with running out of storage on server when running table-valued function

    SQL Version: 2008 (not r2)
    Problem:  I'm getting the following error message when running a table-valued function:
    Msg 1105, Level 17, State 2, Line 1
    Could not allocate space for object 'dbo.SORT temporary run storage:  141072001204224' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files
    to the filegroup, or setting autogrowth on for existing files in the filegroup.
    Request:  Could anyone tell me if there are modifications that I could make to my SQL code to avoid this storage issues?
    Thanks,
    ....bob sutor
    Code Facts:
    The JCCD table is a large table 2MM records
    The other tables in the JOINS are very small 15 records or less
    SQL Function Code:
    ALTER FUNCTION [dbo].[xcft_XAWP_GLBalance_JCCD_Detail]()
    RETURNS @JCGLDetail TABLE
          JCCo tinyint
        , Job varchar(10)
        , PostingSource varchar(10)
        , CostToDate numeric(12,2)
        , Phase varchar(20)
        , EarnType smallint
        , LiabilityType smallint
        , CostType tinyint
        , ControllingSetting varchar(30)
        , GLAccountCharged varchar(20)
        , DeptNum varchar(10)
        , DeptDesc varchar(30)
        , JCDC_CostType tinyint
        , CostTypeGL_Open varchar(20)
        , CostTypeGL_Closed varchar(20)
        , JCDO_ExcludePR varchar(1)
        , JCDO_Phase varchar(20)
        , PhaseGL_Open varchar(20)
        , PhaseGL_Closed  varchar(20)
        , JCDL_LiabType smallint
        , LiabTypeGL_Open varchar(20)
        , LiabTypeGL_Closed varchar(20)
        , JCDE_EarnType smallint
        , EarnTypeGL_Open varchar(20)
        , EarnTypeGL_Closed varchar(20)
    AS
    BEGIN
     DECLARE
     @WIPMonthCurrent date
     SET @WIPMonthCurrent = (Select TOP 1 WIPMonth FROM udxcWIPMonths WHERE ActiveWIPPeriod = 'Y')
     INSERT INTO @JCGLDetail
          JCCo
        , Job
        , PostingSource
        , CostToDate
        , Phase
        , EarnType
        , LiabilityType
        , CostType
        , DeptNum
        , DeptDesc
        , JCDC_CostType
        , CostTypeGL_Open
        , CostTypeGL_Closed
        , JCDO_ExcludePR
        , JCDO_Phase
        , PhaseGL_Open
        , PhaseGL_Closed
        , JCDL_LiabType
        , LiabTypeGL_Open
        , LiabTypeGL_Closed
        , JCDE_EarnType
        , EarnTypeGL_Open
        , EarnTypeGL_Closed
     SELECT  
         JCCD.JCCo, JCCD.Job, JCCD.Source, sum(JCCD.ActualCost) AS CostToDate, JCCD.Phase, JCCD.EarnType, JCCD.LiabilityType, JCCD.CostType
       , JCDM.Department, JCDM.Description
       , JCDC.CostType AS JCDC_CostType, JCDC.OpenWIPAcct AS CostTypeGL_Open, JCDC.ClosedExpAcct AS CostTypeGL_Closed
       , JCDO.ExcludePR AS JCDO_ExcludePR, JCDO.Phase AS JCDO_Phase, JCDO.OpenWIPAcct AS PhaseGL_Open, JCDO.ClosedExpAcct AS PhaseGL_Closed
       , JCDL.LiabType AS JCDL_LiabType, JCDL.OpenBurdenAcct AS LiabTypeGL_Open, JCDL.ClosedBurdenAcct AS LiabTypeGL_Closed
       , JCDE.EarnType AS JCDE_EarnType, JCDE.OpenLaborAcct AS EarnTypeGL_Open, JCDE.ClosedLaborAcct AS EarnTypeGL_Closed
     FROM JCCD
     LEFT JOIN JCJP ON JCCD.JCCo = JCJP.JCCo AND JCCD.Job = JCJP.Job
     LEFT JOIN JCCM ON JCJP.JCCo = JCCM.JCCo AND JCJP.Contract = JCCM.Contract
     LEFT JOIN JCDM ON JCCM.JCCo = JCDM.JCCo AND JCCM.Department = JCDM.Department
     LEFT JOIN JCDC ON JCDM.JCCo = JCDC.JCCo AND JCDM.Department = JCDC.Department AND JCCD.CostType = JCDC.CostType
     LEFT JOIN JCDE ON JCDM.JCCo = JCDE.JCCo AND JCDM.Department = JCDE.Department AND JCCD.EarnType = JCDE.EarnType
     LEFT JOIN JCDO ON JCDM.JCCo = JCDO.JCCo AND JCDM.Department = JCDO.Department AND JCCD.Phase = JCDO.Phase
     LEFT JOIN JCDL ON JCDM.JCCo = JCDL.JCCo AND JCDM.Department = JCDL.Department AND JCCD.LiabilityType = JCDL.LiabType
     LEFT JOIN xcft_XAWP_FiscalPeriodCutoffs_ForWIPMonth() AS cutoffs ON JCCD.JCCo = cutoffs.GLCo
     WHERE
          JCCD.Mth <= cutoffs.FiscalYear_LastMonth
         AND JCCD.Job IN(SELECT JobNum FROM budxcWIPData_SQL WHERE WIPMonth = @WIPMonthCurrent)
         AND JCCD.JCCo IN(SELECT JCCo FROM JCCO WHERE udExcludeFromWIP <> 'Y' or udExcludeFromWIP IS NULL)
         --AND LTRIM(RTRIM(JCCD.Job)) = '71-'
     GROUP BY
         JCCD.JCCo, JCCD.Job, JCCD.Source, JCCD.Phase, JCCD.EarnType, JCCD.LiabilityType, JCCD.CostType
       , JCDM.Department, JCDM.Description
       , JCDC.CostType, JCDC.OpenWIPAcct, JCDC.ClosedExpAcct
       , JCDO.ExcludePR, JCDO.Phase, JCDO.OpenWIPAcct, JCDO.ClosedExpAcct
       , JCDL.LiabType, JCDL.OpenBurdenAcct, JCDL.ClosedBurdenAcct
       , JCDE.EarnType, JCDE.OpenLaborAcct, JCDE.ClosedLaborAcct
     UPDATE @JCGLDetail
      SET
          ControllingSetting =
        CASE WHEN Phase = JCDO_Phase AND JCDO_ExcludePR = 'N' THEN 'PhaseOverride-PR Excluded'
          WHEN Phase = JCDO_Phase AND JCDO_ExcludePR = 'Y'
           AND EarnType NOT IN(Select EarnType FROM JCDE WHERE JCDE.JCCo = JCCo AND JCDE.Department = DeptNum)
           AND LiabilityType NOT IN(Select LiabType FROM JCDL WHERE JCDL.JCCo = JCCo AND JCDL.Department = DeptNum)
           THEN 'PhaseOverride-PR Not Excluded'
          WHEN EarnType = JCDE_EarnType THEN 'Earn Type Override'
          WHEN LiabilityType = JCDL_LiabType THEN 'Liability Type Override'
          ELSE 'Cost Type' END
     UPDATE @JCGLDetail
      SET
          GLAccountCharged =
        CASE WHEN ControllingSetting = 'PhaseOverride-PR Excluded' OR ControllingSetting = 'PhaseOverride-PR Not Excluded'
          THEN PhaseGL_Open
          WHEN ControllingSetting = 'Earn Type Override' THEN EarnTypeGL_Open
          WHEN ControllingSetting = 'Liability Type Override' THEN LiabTypeGL_Open
          ELSE CostTypeGL_Open END
    RETURN 
    END
    Bob Sutor

    well, did you either restart the instance or add another tempdb file (no restart required) to let other transactions  continue on the server.
    or check if autogrowth was limited, change that to unlimnited , to the transactions conintue..
    the function may be dumping the data on to tempdb, how much data are you excepting back...what are indexes on the tables
    Hope it Helps!!

Maybe you are looking for

  • ITunes on one computer/multiple profiles

    ITunes 5.0.1 opens on my profile but will not open on my kids' profiles on same compter. I think everything was OK until I upgraded to 5.0 Just upgraded to 5.0.1 but same problem

  • Terminal Emulation/TN5250 on a Blackberry

    All - I am looking for some software to do terminal emulation on the Blackberry.  I used to use MobileSSH from Rove, but now that they have incorporated it into Mobile Admin, I can no longer purchase just MobileSSH and the cost has also rised about 3

  • Window area in Mapviewer

    I would like to window an area in Mapviewer using mouse. Is there any example code or anybody willing to share. Thanks in advance. PN

  • URL history from browser

    I would like to set up a web page that displays a list of URL links- a bookmarks or favorites page that you can access anywhere. When you're on a web page that you want to bookmark, I would like to go directly to my bookmark page by clicking on it fr

  • Eval formula node expression​s

    Hi What are the acceptable formula inputs for the Eval Formula Node VI? The help files do not mention much. It took me a long time to work out that 2*pi needed to be written pi(2). I would also like to know if I can perform 'if' statements and what t