ISU function module bapi_utilinstallation_chanfact

hi,
i hv to use bapi_utilinstallation_chanfact to replace due date field BIS in ETTIFN table to the sy-datum.what are the parameters that i hv to pass & which table should i pass(i am currently passing it the AMOUNTTABLE structure).what parameters hv to b passed to OVERWRITE(i.e. export field parameter.
plz help.
urgent help required.
<REMOVED BY MODERATOR>
thanks in advance,
anand.
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 6:05 PM

Hello I would also like to use the function BAPI_UTILINSTALLATION_CHANFACT and I am passing my variables into the table <b>FLAGTABLE STRUCTURE  BAPI_INSTLN_FLAG OPTIONAL</b>.
I would like to ask in which way I should pass these parameteres.  Cause in my case I would like to do the exact same thing as what you have here - modifying the END DATE (DUEDATE) of an existing record. 
Any kind assistance would help.
Thanks in Advance.
Jamison

Similar Messages

  • ISU Function Module

    Hi All,
    This is related to a function module in ISU.
    Please tell me how the function module works -
    " BAPI_BUS2002_SET_STATUS "
    What shall me the input parameters to get the output( the output will me changed status of the service order)
    Thx...
    Paul

    HI
    GOOD
    BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
    FU BAPI_BUS2002_SET_STATUS
    Text
    Set/Reset Status for BUS2002 (Network)
    Functionality
    You can use the BAPI BAPI_BUS2002_SET_STATUS to revoke one system status (UNDO_SYSTEM_STATUS) and one user status (UNDO_USER_STATUS) respectively, or to set one system status (SET_SYSTEM_STATUS) and one user status (SET_USER_STATUS) respectively, in the network header (NUMBER).
    At the same time, you can revoke one system status and one user status, or set one system status and one user status in a list of activities for the network.
    The following system statuses are supported for the network header:
    'REL' Released (I0002) set
    'LKD' Locked (I0043) set/revoke
    'TECO' Technically completed (I0045) set/revoke
    'CLSD' Closed (I0046) set/revoke
    'AALK' Account Assignment locked (I0064) set/revoke
    'DLFL' Deletion flag (I0076) set/revoke
    The following system statuses are supported for the network operations:
    'REL' Released (I0002) set
    'TECO' Technically completed (I0045) set/revoke
    'CLSD' Closed (I0046) set/revoke
    'AALK' Account Assignment locked (I0064) set/revoke
    'DLFL' Deletion flag (I0076) set/revoke
    'DSEX' Dates set by external system (I0029) set/revoke
    User statuses can be set or revoked in accordance with the status profile assigned to the network header or network activities. They must be transferred via the key in the relevant log-on language.
    The processing sequence is as follows:
    1. Network header:
    a) Revoke system status
    b) Revoke user status
    c) Set system status
    d) Set user status
    2. Network operations:
    a) Revoke system status
    b) Revoke user status
    c) Set system status
    d) Set user status
    If you cannot set/revoke a system/user status, all of the other activities will still be executed.
    The inheritance of statuses is not integrated between the project and the network. A status change only affects the current network and not any other assigned projects/WBS elements.
    Milestone functions are not supported.
    The call of the BAPI can be repeated until a LUW (Logical Unit of Work) is completed with the BAPIs BAPI_PS_PRECOMMIT and BAPI COMMIT WORK.
    Notes
    1. Definition "Processing Unit"
    In the following, the term "processing unit" refers to a series of related processing steps.
    The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION.
    Afterwards, the individual BAPIs listed below can be used several times, if required.
    The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequent COMMIT WORK (for example, the statement COMMIT WORK, the BAPI "BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
    After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".
    In principal, the following applies to each individual processing unit.
    2. Creation of a Processing Unit
    Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once.
    Afterwards, the following individual BAPIs can be used within a processing unit - they can also be used more than once, taking into account the "One-Project-Principle" explained below. This also means that an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI.
    Except for the BAPIs explicitly named below, you can only call up BAPIs that execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below!
    Business Object ProjectDefinitionPI
    BAPI Method
    BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle
    BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change
    BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete
    BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus
    BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple
    BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple
    BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple
    Business Object WBSPI
    BAPI Method
    BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple
    BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple
    BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple
    BAPI_BUS2001_SET_STATUS WBSPI.SetStatus
    Business Object NetworkPI
    BAPI Method
    BAPI_BUS2002_CREATE NetworkPI.CreateFromData
    BAPI_BUS2002_CHANGE NetworkPI.Change
    BAPI_BUS2002_DELETE NetworkPI.Delete
    BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
    BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple
    BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple
    BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple
    BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
    BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple
    BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
    The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
    3. One-Project Principle
    For technical reasons, only the project definition and the WBS elements of one project can be processed in a processing unit.
    More than one project is used, for example, if
    You create or change more than one project
    You have changed a project and want to change a network to which WBS elements from a different project are assigned
    You want to change various networks to which WBS elements from different projects are assigned
    You create or change a WBS assignment in a network so that a WBS element from a second project is used
    WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).
    If you define a report for calling BAPIs, this means that:
    The report may use a maximum of one project per processing unit. The individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processing unit.
    4. All-Or-Nothing Principle
    If an error occurs in a processing unit in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN contains at least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible.
    If an error occurs in an individual BAPI and despite this you call the BAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
    If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, the program that is currently in process is terminated and message CNIF_PI 056 is issued with message type X.
    This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
    Note that the processing unit to which this happens can no longer be successfully closed and therefore, no new processing unit can be started.
    However, you can set the current processing unit back to an initialized status by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method BapiService.TransactionRollback). Technically speaking, this means that the previous LUW is terminated and a new LUW is started in the current processing unit.
    Note that in this case, the current processing unit does not have to be re-initialized.
    Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all individual BAPIs carried out up to the rollback are discarded. After a rollback, you can, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI.
    However, you can close the processing unit again after a rollback, using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, and the precommit carried out after the rollback, finish without errors.
    You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
    5. Procedure in the Case of Errors
    As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options:
    Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
    Execute a rollback in the current processing unit.
    6. Rules for Posting
    After you have successfully called the individual BAPIs of a processing unit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT".
    If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
    In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit.
    It is also not permitted to call the PRECOMMIT more than once in a processing unit.
    7. Recommendation "COMMIT WORK AND WAIT"
    If an object created in a processing unit is to be used in a subsequent processing unit (for example, as an account assignment object in a G/L account posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI "BAPI_TRANSACTION_COMMIT" accordingly.
    8. Field Selection
    The field selection is a tool for influencing the user interface (that is, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or required-entry) are not taken into account.
    9. Using a date in the BAPI interface
    The BAPI must be provided with the date in the internal format YYYYMMDD (year month day). No special characters may be used.
    As a BAPI must work independent of user, the date cannot and should not be converted to the date format specified in the user-specific settings.
    10. Customer Enhancements of the BAPIs
    For the BAPIs used to create and change project definitions, WBS elements, networks, activities, and activity elements, you can automatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVU that have been defined for customer enhancements in the standard system.
    For this purpose, help structures that contain the respective key fields, as well as the CI include of the table are supplied. The BAPIs contain the parameter ExtensionIN in which the enhancement fields can be entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
    CI Include Help Structure   Key
    CI_PROJ BAPI_TE_PROJECT_DEFINITION   PROJECT_DEFINITION
    CI_PRPS BAPI_TE_WBS_ELEMENT   WBS_ELEMENT
    CI_AUFK BAPI_TE_NETWORK   NETWORK
    CI_AFVU BAPI_TE_NETWORK_ACTIVITY   NETWORK ACTIVITY
    CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT   NETWORK ACTIVITY ELEMENT
    Procedure for Filling Standard Enhancements
    Before you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table enhancement fields, add a data record to the container ExtensionIn:
    STRUCTURE:    Name of the corresponding help structure
    VALUEPART1:   Key of the object + start of the data part
    VALUEPART2-4: If required, the continuation of the data part
    VALUPART1 to VALUPART4 are therefore filled consecutively, first with the keys that identify the table rows and then with the values of the customer-specific fields. By structuring the container in this way, it is possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
    Note that when objects are changed, all fields of the enhancements are overwritten (as opposed to the standard fields, where only those fields for which the respective update indicator is set are changed). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
    Checks and Further Processing
    Using the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdI BAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks).
    In the BAdI's second method, you can program that the data transferred to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
    For more information, refer to the SAP Library under Cross-Application Components -> Business Framework Architecture -> Enhancements, Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
    The return parameter RETURN will contain an error message if an error occurred during processing. After the call, the table E_MESSAGE_TABLE contains all messages that were created during processing.
    Further Information
    You  can find additional information in the SAP Library under Project System -> Structures -> Project System Interfaces -> PS-EPS Interface to External Project Management Systems.
    Parameters
    NUMBER
    UNDO_SYSTEM_STATUS
    UNDO_USER_STATUS
    SET_SYSTEM_STATUS
    SET_USER_STATUS
    RETURN
    I_ACTIVITY_SYSTEM_STATUS
    I_ACTIVITY_USER_STATUS
    E_RESULT
    Exceptions
    Function Group
    CNIF_STATUS_2002
    thanks
    mrutyun

  • Function module to change the address on the business partner in SAP-ISU.

    Can some one send me the function module to change the address of businees partner in SAP ISU.

    Hi,
    The FM you are looking for is BAPI_BUSINESS_PARTNER_CHANGE
    You can use the table PARTNERADDR to fill the Address of the Partner.
    Hope this helps.

  • How to create the INBOUND Function Module for INBOUND IDOCs

    Hi Friends,
    Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
    which are recieved from XI Server ?
    I am working in SAP-ISU
    Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
    We have a Standard INBOUND FUNCTION MODULE
    IDOC_INPUT_ISU_MR_UPLOAD
    which Uploads the Meter Reading Results.
    I copied the Same function Module into ZIDOC_INPUT_
    and working on it.
    Can any one suggest me, whether i am going in correct way or not.
    In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
    BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
    My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
    Can I Use the Same BAPI
    BAPI_MTRREADDOC_UPLOAD
    to Update the below fields,
    EABL-SERNR
    EABL-ZWNUMMER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS
    EABL-ADATTATS
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Kindly Suggest me,
    Thanks in Advance,
    Ganesh

    Hello Ganesh
    I think you are going completely astray with you z-function module for IDoc processing.
    If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
    EABL-SERNR => BAPIEABLU-SERIALNO
    EABL-ZWNUMMER =>REGISTER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS => ACTUALMRTIME
    EABL-ADATTATS => ACTUALMRDATE
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
    Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
    - BAPI_TE_EABL
    - BAPI_TE_EOSB
    Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
    Regards
      Uwe

  • Urgent help in function modules

    Hi Gurus,
    Please send me the names of the related function modules of ISU.also if possible send examples or tutorials of FM creation and the coding involved in it.
    My email is [email protected]
    All Replies will be rewarded.

    Check the links below for details about creating Function Modules:
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://www.erpgenie.com/abap/functions.htm
    Check this link for how to create the function module exit..
    http://sap.niraj.tripod.com/id62.html

  • CRM Tables or Function Module in SAP CRM related Contract Account ot MPAN no.

    Hi Team,
    Could you please tell me  Any table or Function Module in CRM which is related to Contract Accont or MPAN Number( ISU).
    My Query is- Just I want to confirm that Data are exist in CRM system on the  basis of Contract Account or MPAN Number.
    Regards,
    Arif 

    Hi Mohd,
    Table for Contract Account in CRM is Business Agreement Table CRMM_BUAG & CRMM_BUAG_H
    To get the BP linkage CRMV_BUAG_ATTR
    Regards,
    Naresh

  • Function Module to post doc through FPE1 Tcode

    Hi Experts.
    Can you please let mw know the function module used to post doc through FPE1 Tcode in ISU Module?
    Regards,
    surya

    Hi.
    Here is my code. The FM not posting any document.
    DATA:DOCUMENTHEADER   LIKE BAPIDFKKKO,
         PARTNERPOSITIONS LIKE BAPIDFKKOP OCCURS 0 WITH HEADER LINE,
         DOCUMENTNUMBER   LIKE BAPIDFKKKO-DOC_NO,
         RETURN           LIKE BAPIRET2.
    START-OF-SELECTION.
    CLEAR:PARTNERPOSITIONS,PARTNERPOSITIONS[].
    PARTNERPOSITIONS-COMP_CODE = '0400'.
    PARTNERPOSITIONS-CONT_ACCT = '000550116672'.
    PARTNERPOSITIONS-MAIN_TRANS = '6000'.
    PARTNERPOSITIONS-SUB_TRANS = '3021'.
    PARTNERPOSITIONS-DIVISION = '03'.
    PARTNERPOSITIONS-DOC_DATE = SY-DATUM.
    PARTNERPOSITIONS-POST_DATE = SY-DATUM.
    PARTNERPOSITIONS-CURRENCY = 'ZAR'.
    PARTNERPOSITIONS-AMOUNT = '1016190'.
    PARTNERPOSITIONS-BUSPARTNER = '4999924191'.
    PARTNERPOSITIONS-G_L_ACCT = '0008291003'.
    PARTNERPOSITIONS-TAX_CODE = 'A1'.
    PARTNERPOSITIONS-NET_DATE = SY-DATUM.
    PARTNERPOSITIONS-ITEM = '01'.
    PARTNERPOSITIONS-CMMT_ITEM = '1103003'.
    PARTNERPOSITIONS-FUNDS_CTR = '924320'.
    PARTNERPOSITIONS-FUND = 'COJ'.
    PARTNERPOSITIONS-FM_ORIG_AREA = '1000'.
    PARTNERPOSITIONS-FM_CATEGORY = 'G'.
    PARTNERPOSITIONS-CLEAR_REAS = '03'.
    PARTNERPOSITIONS-APPL_AREA = 'R'.
    APPEND PARTNERPOSITIONS.
    CLEAR:DOCUMENTHEADER.
    DOCUMENTHEADER-FIKEY = '10021901/SWF'.
    DOCUMENTHEADER-DOC_TYPE = 'TC'.
    DOCUMENTHEADER-CREATED_BY = SY-UNAME.
    DOCUMENTHEADER-DOC_DATE = SY-DATUM.
    DOCUMENTHEADER-POST_DATE = SY-DATUM.
    DOCUMENTHEADER-CURRENCY = 'ZAR'.
    DOCUMENTHEADER-APPL_AREA = 'R'.
    DOCUMENTHEADER-DOC_SOURCE_KEY = '01'.
    BREAK-POINT.
    CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'
      EXPORTING
        TESTRUN                       = 'X'
        DOCUMENTHEADER                = DOCUMENTHEADER
      COMPLETEDOCUMENT              =
      NET_RECEIVABLES               =
    IMPORTING
       DOCUMENTNUMBER                =  DOCUMENTNUMBER
       RETURN                        =  RETURN
    TABLES
       PARTNERPOSITIONS              =  PARTNERPOSITIONS[].
    WRITE:/ DOCUMENTNUMBER.

  • Functional module to calculate GST

    Hi Guys
    I am working on SAP-ISU and developing the concession summary report. I need to calculate the gst on the concession amount from ECONCPOST table. The table has taxcode. Can you please let me know the standard SAP functional module which retuns the gst(%) or calculate the tax on the given amount using the taxcode?
    Thanks in advance

    Check it below thread :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/047ab790-0201-0010-a9b1-e612f8b71dcd
    Tax Determination

  • URGENT: Function modules or BAPIs

    Hi Experts,
    I need function modules or BAPI to get the open items and cleared items G/L Account wise.
    Useful replies will be surely awarded.

    Hi Chakradhar,
    Check tcode : BAPI
    u will get all bapis there.
    Regards,
    Hemant

  • How to attached class or function module in FD03

    Hi Guys
    I want to attached CL_ATTACHMENT_LIST for retriving attachment list from fd03 please help to attached the function module in my program?
    regards
    Piroz
    report zfir_aged_debtors no standard page heading
                             line-size 255.
    Type group
    type-pools:
      slis.                        " ALV types
    Tables
    tables:
      adrc,               " Addresses
      bsad,               " Accounting: Customer secondary index (Cleared)
      bsid,               " Accounting: Customer secondary index (Open)
      kna1,               " Customer master: General data
      knkk,               " Customer master: Credit management
      knvk.               " Customer master: Contact persons
    Types
    types:
      begin of ty_bsadbsid,
        bukrs like bsad-bukrs,              " Company code
        kunnr like bsad-kunnr,              " Customer
        gjahr like bsad-gjahr,              " Fiscal year
        belnr like bsad-belnr,              " Accounting document number
        buzei like bsad-buzei,              " Line item
        budat like bsad-budat,              " Posting date
        bldat like bsad-bldat,              " Document date
        waers like bsad-waers,              " Currency
        xblnr like bsad-xblnr,              " Reference
        shkzg like bsad-shkzg,              " Debit/credit indicator
        dmbtr like bsad-dmbtr,              " Amount
        zfbdt like bsad-zfbdt,              " Baseline date for due date
                                            " calculation
        zbd1t like bsad-zbd1t,              " Cash discount days 1
        zbd2t like bsad-zbd2t,              " Cash discount days 2
        zbd3t like bsad-zbd3t,              " Net payment terms period
        rebzg like bsad-rebzg,              " Number of the invoice
        rebzt like bsad-rebzt,              " Follow on document type
      end of ty_bsadbsid,
      ty_it_bsadbsid type ty_bsadbsid occurs 0,
      begin of ty_merged,
        kunnr      like kna1-kunnr,         " Customer number
        name1      like adrc-name1,         " Name
        city1      like adrc-city1,         " City
        post_code1 like adrc-post_code1,    " Post code
        street     like adrc-street,        " Street
        house_num1 like adrc-house_num1,    " House number
        tel_number like adrc-tel_number,    " Telephone number
        fax_number like adrc-fax_number,    " Fax number
        namev      like knvk-namev,         " First name
        namew      like knvk-name1,         " Last name
        telf1      like knvk-telf1,         " Telephone number
        klimk      like knkk-klimk,         " Credit limit
        skfor      like knkk-skfor,         " Total receivables
        total      like bsad-dmbtr,         " Total amount
        rast1      like bsad-dmbtr,         " Amount period 1
        rast2      like bsad-dmbtr,         " Amount period 2
        rast3      like bsad-dmbtr,         " Amount period 3
        rast4      like bsad-dmbtr,         " Amount period 4
        rast5      like bsad-dmbtr,         " Amount period 5
        rast6      like bsad-dmbtr,         " Amount period 6
      end of ty_merged,
      ty_it_merged type ty_merged occurs 0.
    Internal tables
    data:
    Internal table to store customer line items from BSAD and BSID
      it_bsadbsid type ty_it_bsadbsid,
    Internal table to store field catalog for ALV function call
      it_fieldcat type slis_t_fieldcat_alv,
    Internal table to store summarised data for report output
      it_merged   type ty_it_merged.
    Structures
    data:
    Display variant structures
      st_tvariant  like disvariant,
      st_variant   like disvariant.
    Constants
    constants:
      co_delim_dash    type c
                       value '-',
      co_false         type c                      " False
                       value space,
      co_koart_d       like faede-koart            " Customer account type
                       value 'D',
      co_save_u        type c                      " User display variant
                       value 'U',                  " saving allowed.
      co_shkzg_h       like bsid-shkzg             " Debit/Credit indicator
                       value 'H',                  " for credit
      co_shkzg_s       like bsid-shkzg             " Debit/Credit indicator
                       value 'S',                  " for debit
      co_selected      type c                      " Value of selected radio
                       value 'X',                  " button or checkbox
      co_true          type c                      " True
                       value co_selected.
    Variables
    data:
      va_exit          type c.
    Selection screen definition
    selection-screen: begin of block b1 with frame title text-001.
    select-options:
      s_kunnr for bsad-kunnr.                     " Customer number
    parameters:
      p_kkber like knkk-kkber,                    " Credit control area
      p_pafkt like knvk-pafkt,                    " Contact function
      p_datum like sy-datum.                      " Report date
    selection-screen: begin of line,
                      comment 01(30) text-006,
                      position pos_low.
    parameters:
      rastbis1 like rfpdo1-allgrogr               " Due date sorted 1
               default '000',
      rastbis2 like rfpdo1-allgrogr               " Due date sorted 2
               default '000',
      rastbis3 like rfpdo1-allgrogr               " Due date sorted 3
               default '000',
      rastbis4 like rfpdo1-allgrogr               " Due date sorted 4
               default '000',
      rastbis5 like rfpdo1-allgrogr               " Due date sorted 5
               default '000'.
    selection-screen: end of line.
    selection-screen: end of block b1,
                      begin of block b2 with frame title text-002.
    parameters:
      p_varint like disvariant-variant.           " Display variant.
    selection-screen: end of block b2.
    Initialisation
    initialization.
    Provide default periods for due date sorted list.
      rastbis1 = 0.
      rastbis2 = 30.
      rastbis3 = 60.
      rastbis4 = 90.
      rastbis5 = 120.
    Default report date to current.
      p_datum = sy-datlo.
    Default credit control area to BP01.
      p_kkber = 'BP01'.
    At selection screen on value request for
    at selection-screen on value-request for p_varint.
    Provide display variant list for this program.
      call function 'REUSE_ALV_VARIANT_F4'
        exporting
          is_variant = st_variant
          i_save     = co_save_u
        importing
          e_exit     = va_exit
          es_variant = st_tvariant
        exceptions
          not_found  = 2.
      if sy-subrc eq 2.
        message id sy-msgid type 'S'
                number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        if va_exit eq space.
          st_variant = st_tvariant.
          p_varint = st_tvariant-variant.
        endif.
      endif.
    At selection screen
    at selection-screen.
    Load display variant.
      if not p_varint is initial.
        move st_variant to st_tvariant.
        move p_varint to st_tvariant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
          exporting
            i_save     = co_save_u
          changing
            cs_variant = st_tvariant.
        st_variant = st_tvariant.
      else.
        clear st_variant.
        st_variant-report = sy-repid.
      endif.
      if p_kkber is initial.
      Ensure credit control area is specified.
        message e000(zgen) with 'Credit control area must be specified'.
      endif.
      if p_pafkt is initial.
      Ensure contact person function is specified.
        message e000(zgen) with 'Contact person function must be specified'.
      endif.
    Start of selection
    start-of-selection.
    Extract open customer items from BSID
      select bukrs kunnr gjahr belnr buzei budat bldat waers xblnr shkzg
             dmbtr zfbdt zbd1t zbd2t zbd3t rebzg rebzt
             from  bsid
             into  table it_bsadbsid
             where kunnr in s_kunnr
             and   budat le p_datum.
    Extracct cleared customer items from BSAD
      select bukrs kunnr gjahr belnr buzei budat bldat waers xblnr shkzg
             dmbtr zfbdt zbd1t zbd2t zbd3t rebzg rebzt
             from  bsad
             appending table it_bsadbsid
             where kunnr in s_kunnr
             and   budat le p_datum
             and   augdt ge p_datum.
    Ensure that items were not selected twice while getting data from the
    open and cleared items tables (Only if transaction occured during
    report run).
      sort it_bsadbsid by bukrs belnr gjahr buzei.
      delete adjacent duplicates from it_bsadbsid
             comparing bukrs belnr gjahr buzei.
      if it_bsadbsid[] is initial.
      No data found for selection
        message s001(zgen).
        exit.
      endif.
    Merge data for report output
      perform merge_data tables it_bsadbsid
                                it_merged.
    Build field catalog
      perform build_field_catalog tables it_fieldcat.
    Output report via ALV
      perform output_report_via_alv tables it_fieldcat
                                           it_merged.
    *&      Form  merge_data
          text
    form merge_data  tables   pa_it_bsadbsid type ty_it_bsadbsid
                              pa_it_merged   type ty_it_merged.
    Local work areas
    data:
      lwa_bsadbsid type ty_bsadbsid,
      lwa_merged   type ty_merged.
    Local structures
    data:
      lst_faede    like faede.
    Local variables
    data:
      lva_daysover type i,
      lva_merged_tabix like sy-tabix.
      loop at pa_it_bsadbsid into lwa_bsadbsid.
      Lookup merged entry for customer
        clear lwa_merged.
        read table pa_it_merged into lwa_merged
                                with key kunnr = lwa_bsadbsid-kunnr
                                binary search.
        lva_merged_tabix = sy-tabix.
        if sy-subrc ne 0.
        Create new merged record for customer
          lwa_merged-kunnr = lwa_bsadbsid-kunnr.
        Get customer details from KNA1
          clear kna1.
          select single *
                 from   kna1
                 where  kunnr eq lwa_bsadbsid-kunnr.
        Get customer address details from ADRC
          clear adrc.
          select single *
                 from   adrc
                 where  addrnumber eq kna1-adrnr
                 and    date_from  le p_datum.
          lwa_merged-name1      = adrc-name1.
          lwa_merged-city1      = adrc-city1.
          lwa_merged-post_code1 = adrc-post_code1.
          lwa_merged-street     = adrc-street.
          lwa_merged-house_num1 = adrc-house_num1.
          lwa_merged-tel_number = adrc-tel_number.
          lwa_merged-fax_number = adrc-fax_number.
        Get credit limit details from KNKK
          clear knkk.
          select single *
                 from   knkk
                 where  kunnr eq lwa_bsadbsid-kunnr
                 and    kkber eq p_kkber.
          lwa_merged-klimk = knkk-klimk.
          lwa_merged-skfor = knkk-skfor.
        Get customer contact person details from KNVK
          clear knvk.
          select single *
                 from   knvk
                 where  kunnr eq lwa_bsadbsid-kunnr
                 and    pafkt eq p_pafkt.
          lwa_merged-namev = knvk-namev.
          lwa_merged-namew = knvk-name1.
          lwa_merged-telf1 = knvk-telf1.
          insert lwa_merged into pa_it_merged index lva_merged_tabix.
        endif.
      Interpret debit/credit indicator
        case lwa_bsadbsid-shkzg.
          when co_shkzg_h.
          Credit
            lwa_bsadbsid-dmbtr = 0 - lwa_bsadbsid-dmbtr.
          when co_shkzg_s.
          Debit
        endcase.
      Perform ageing
        clear lst_faede.
        move-corresponding lwa_bsadbsid to lst_faede.
        lst_faede-koart = co_koart_d.
        call function 'DETERMINE_DUE_DATE'
          exporting
            i_faede = lst_faede
          importing
            e_faede = lst_faede
          exceptions
            others  = 1.
        lva_daysover = p_datum - lst_faede-netdt.
      Accumulate total.
        add lwa_bsadbsid-dmbtr to lwa_merged-total.
        if lva_daysover le rastbis1.
          add lwa_bsadbsid-dmbtr to lwa_merged-rast1.
        else.
          if lva_daysover le rastbis2 or
             rastbis3 is initial.
            add lwa_bsadbsid-dmbtr to lwa_merged-rast2.
          else.
            if lva_daysover le rastbis3 or
               rastbis4 is initial.
              add lwa_bsadbsid-dmbtr to lwa_merged-rast3.
            else.
              if lva_daysover le rastbis4 or
                 rastbis5 is initial.
                add lwa_bsadbsid-dmbtr to lwa_merged-rast4.
              else.
                if lva_daysover le rastbis5.
                  add lwa_bsadbsid-dmbtr to lwa_merged-rast5.
                else.
                  add lwa_bsadbsid-dmbtr to lwa_merged-rast6.
                endif.
              endif.
            endif.
          endif.
        endif.
      Update the merged record
        modify pa_it_merged from lwa_merged index lva_merged_tabix.
      endloop.
    endform.                    " merge_data
    *&      Form  build_field_catalog
          text
    form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
    Local work areas
      data:
        lwa_fieldcat   type slis_fieldcat_alv.
    --WG1K903216: Start Insert-
      data: v_datum type datum,
            v_mdmth type datum,
            v_datxt type string,
            v_noday type i.
    --WG1K903216: End Insert---
      refresh pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'KUNNR'.
      lwa_fieldcat-ref_tabname   = 'KNA1'.
      lwa_fieldcat-ref_fieldname = 'KUNNR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '1'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'NAME1'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'NAME1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '2'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'CITY1'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'CITY1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '3'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'POST_CODE1'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'POST_CODE1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '4'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'STREET'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'STREET'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '5'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'HOUSE_NUM1'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'HOUSE_NUM1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '6'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'TEL_NUMBER'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'TEL_NUMBER'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '7'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'FAX_NUMBER'.
      lwa_fieldcat-ref_tabname   = 'ADRC'.
      lwa_fieldcat-ref_fieldname = 'FAX_NUMBER'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '8'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'NAMEV'.
      lwa_fieldcat-ref_tabname   = 'KNVK'.
      lwa_fieldcat-ref_fieldname = 'NAMEV'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '9'.
      lwa_fieldcat-seltext_l     = 'Contact first name'.
      lwa_fieldcat-seltext_m     = 'Contact Fname'.
      lwa_fieldcat-seltext_s     = 'Ctct Fname'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'NAMEW'.
      lwa_fieldcat-ref_tabname   = 'KNVK'.
      lwa_fieldcat-ref_fieldname = 'NAME1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '10'.
      lwa_fieldcat-seltext_l     = 'Contact last name'.
      lwa_fieldcat-seltext_m     = 'Contact Lname'.
      lwa_fieldcat-seltext_s     = 'Ctxt Lname'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'TELF1'.
      lwa_fieldcat-ref_tabname   = 'KNVK'.
      lwa_fieldcat-ref_fieldname = 'TELF1'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '11'.
      lwa_fieldcat-seltext_l     = 'Contact phone no.'.
      lwa_fieldcat-seltext_m     = 'Contact phone'.
      lwa_fieldcat-seltext_s     = 'Ctct Phne'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'KLIMK'.
      lwa_fieldcat-ref_tabname   = 'KNKK'.
      lwa_fieldcat-ref_fieldname = 'KLIMK'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '12'.
      lwa_fieldcat-seltext_l     = 'Credit limit'.
      lwa_fieldcat-seltext_m     = 'Credit limit'.
      lwa_fieldcat-seltext_s     = 'Crdt limit'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'SKFOR'.
      lwa_fieldcat-ref_tabname   = 'KNKK'.
      lwa_fieldcat-ref_fieldname = 'SKFOR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '13'.
      lwa_fieldcat-seltext_l     = 'Credit used'.
      lwa_fieldcat-seltext_m     = 'Credit used'.
      lwa_fieldcat-seltext_s     = 'Crdt used'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'TOTAL'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '14'.
      lwa_fieldcat-seltext_l     = 'Total'.
      lwa_fieldcat-seltext_m     = 'Total'.
      lwa_fieldcat-seltext_s     = 'Total'.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST1'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '15'.
    --WG1K903216: Start Delete-
    concatenate '<'
                 rastbis2
                 into lwa_fieldcat-seltext_l
                 separated by space.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis2.
    Always use the middle of the report month as a heading reference date.
      concatenate p_datum+0(6) '15' into v_mdmth.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '+'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST2'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '16'.
    --WG1K903216: Start Delete-
    concatenate rastbis1
                 rastbis2
                 into lwa_fieldcat-seltext_l
                 separated by co_delim_dash.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis1.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '+'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST3'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '17'.
    --WG1K903216: Start Delete-
    concatenate rastbis2
                 rastbis3
                 into lwa_fieldcat-seltext_l
                 separated by co_delim_dash.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis2.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '-'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST4'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '18'.
    --WG1K903216: Start Delete-
    concatenate rastbis3
                 rastbis4
                 into lwa_fieldcat-seltext_l
                 separated by co_delim_dash.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis3.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '-'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST5'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '19'.
    --WG1K903216: Start Delete-
    concatenate rastbis4
                 rastbis5
                 into lwa_fieldcat-seltext_l
                 separated by co_delim_dash.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis4.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '-'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
      clear lwa_fieldcat.
      lwa_fieldcat-tabname       = 'PA_IT_MERGED'.
      lwa_fieldcat-fieldname     = 'RAST6'.
      lwa_fieldcat-ref_tabname   = 'BSAD'.
      lwa_fieldcat-ref_fieldname = 'DMBTR'.
      lwa_fieldcat-row_pos       = '1'.
      lwa_fieldcat-col_pos       = '20'.
    --WG1K903216: Start Delete-
    concatenate '>'
                 rastbis5
                 into lwa_fieldcat-seltext_l
                 separated by space.
    --WG1K903216: End Delete---
    --WG1K903216: Start Insert-
      clear: v_datum,
             v_datxt.
      v_noday = rastbis5.
      call function 'ZWAG_DATE_CALCULATOR'
        exporting  i_datum         = v_mdmth
                   i_noday         = v_noday
                   i_oprnd         = '-'
        importing  e_datum         = v_datum
        exceptions invalid_operand = 1.
      call function 'ZWAG_END_MONTH'
        exporting  i_datum         = v_datum
        importing  e_datum         = v_datum
                   e_datxt         = v_datxt
        exceptions invalid_date    = 1.
      concatenate 'Due By' v_datxt into lwa_fieldcat-seltext_l
        separated by space.
    --WG1K903216: End Insert---
      lwa_fieldcat-seltext_m     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-seltext_s     = lwa_fieldcat-seltext_l.
      lwa_fieldcat-ddictxt       = 'L'.
      append lwa_fieldcat to pa_it_fieldcat.
    endform.                    " build_field_catalog
    *&      Form  output_report_via_alv
          text
    form output_report_via_alv
                        tables pa_it_fieldcat type slis_t_fieldcat_alv
                               pa_it_merged   type ty_it_merged.
    Local variables
      data:
        lva_repid    like sy-repid,
        lva_formname type slis_formname.
      lva_repid = sy-repid.
      lva_formname = 'USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program      = lva_repid
          i_callback_user_command = lva_formname
          i_save                  = 'A'
          is_variant              = st_variant
          it_fieldcat             = pa_it_fieldcat[]
        tables
          t_outtab                = pa_it_merged
        exceptions
          program_error           = 1
          others                  = 2.
    endform.                    " output_report_via_alv

    Hi shiva
    Thanks for your help,
    Can you check this coding and revert me back ASAP Please.
    REPORT BDS_GOS_CONNECTION.
    DATA : logical_system LIKE BAPIBDS01-log_system.
           CLASSNAME LIKE BAPIBDS01-CLASSNAME
           OBJKEY LIKE SWOTOBJID-objkey.
    PARAMETERS: pa_lo_sys BAPIBDS01-log_system,
                pa_class like BPIBDS01-CLASSNAME,
                pa_objkey like swotobjidobjkey.
    AT SELECTION-SCREEN.
    CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
             EXPORTING
                  bor_id             = bor_id
             IMPORTING
                  logical_sytem      = pa_lo_sys.
                  classname          = pa_class.
                  objkey            = pa_objkey.
             EXCEPTIONS
                  no_objects_found     = 1
                  internal_error       = 2
                  internal_gos_error   = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    clear v_attno1.
    i_object1-typeid = 'BUS2012'.
    i_object1-catid  = 'BO'.
    i_object1-instid = i_yItem-docno.
    call method cl_gos_attachment_query=>count_for_object
       exporting
        is_object = i_object1
        ip_arl    = space
       receiving
        rt_stat   = i_stat1.
    read table i_stat1 into wa_stat1 index 1.
    if sy-subrc eq c_0.
        move wa_stat1-counter to v_attno1.
    endif.             
    CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
    is_object = object
    ip_arl =    space
    RECEIVING
    rt_stat = lt_stat.
    READ TABLE lt_stat INDEX 1 into ls_stat.
    count = ls_stat-counter.
    *The object has to be a concatenation of your document, like this:
    CONCATENATE object-instid tab-gjahr INTO object-instid.
    ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
    ENDIF.

  • Function Module to Release Scheduled Jobs

    Dear All,
    I have a requirement to create all the background jobs in SCHEDULED status, this is achieved by using the function modules JOB_OPEN, JOB_SUBMIT and JOB_CLOSE.
    Now at a later point of time, i want to release only a few jobs, which were created using the above mentioned procedure. Insead of doing it manually, is there any way to automate this step ??
    Regards,
    kartik

    Dear Mr. Parupalli,
    That solved my problem. Thank you.
    Regards,
    kartik

  • Call RFC Function Module and return 1000 records at a time

    I would like to call a Remote Enabled Function Module from a non SAP system.  This function module will select data from the database and return it to the calling program.
    Suppose there are 100,000 records that need to be returned, but the calling module would like the data in chunks of 1000 records.  Therefore the calling program would call the FM 100 times. 
    How do I code the function module to know on each subsequent call to grab the next chunk of 1000 records? 
    Let me know if additional information is needed.
    Thanks,
    Aaron

    Hello,
    Here is how you can go for this issue:
    1. Create one RFC function module with following parameter. These parameters are with respective of chunking logic.
         Import: Package Size
         Export: Total number of records
         Changing: chunk count
    Implement following logic:
    1. First of you need to know how many chunks you need to fetch for that get the count of total number of records. This is one  
        time activity so you better maintain one flag import parameter will be set to 'X' only first call.
    2. Get the number of chunk using total number of records / chunk size for e.g. 1000 / 100 so chunk count = 10.
    3. Define internal chunk counter in function module which will be used to locate the correct chunk depending on the chunk
        counter value sent from calling program.
    4. Send first call with package size 100 and chunk count = 1, execute select statement and increment internal
        chunk count check if chunk count = internal chunk count in current case chunk count = 1 so exit select statement and return
        with first chunk.
    5. Send second call with package size 100 and chunk count = 2. Execute select statement and check chunk count with internal
        chunk counter, in current case it will be 1 so skip that data and go for next chunk of 100 records increment internal chunk  
        counter. In this case it will match with external chunk count = 2. load output table with that data and return to calling program.
    6. Repeat step 4 until you reach last chunk.
    You need to use SELECT...ENDSELECT with PACKAGE SIZE addition so for every loop it will return number of records mentioned in package size.
    Hope this helps.
    Thanks,
    Augustin.

  • Error while passing a table to a function module

    Hi Iam passing a table g_tab of length 376 flat structure to the function module..under TABLES section parameter.
    Changedocument_read_headers.
    iam getting a complile time error like the below displayed thing. Can u tell me how to solve this ?
    In the function module interface, you can specify only
    fields of a specific type and length under "I_CDHDR".
    Although the currently specified field
    "G_CDHDR_TAB" is the correct type, its length is incorrect.
    Edited by: kiran kumar on Jul 7, 2008 8:53 AM

    probably u making a mistake while declaring the table
    declare it like this in the tables section:
    S_JOB     LIKE     RNGE_OBJID
    where s_job is the internal table name and RANGE_OBJID is a structure type and NOT an internal table type.

  • RFC Error While Invoking A Remote Function Module.

    I am invoking A remote function module while invoking it get  an exception when i see the error logs
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:      Screen output without connection to user.                           , error key: RFC_ERROR_SYSTEM_FAILURE at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101) at... [see details]
    can anyone pls tell me what the error is..
    regards
    Nilesh Taunk.

    Hi Nilesh Taunk,
    You can go through the following steps
    -o JCO Exceptions 1. http://help.sap.com/saphelp_nw04s/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm
    -o JCO Exceptions 2. http://help.sap.com/saphelp_nw04/helpdata/en/f6/e002416225f023e10000000a155106/frameset.htm
    -o Restart of the J2EE instance and try re-importing the RFC model. Sometimes it helps.
    -o Logon into WebDynpro Content Administrator as a J2EE Admin and check if the JCO Connections and User /pwd of your application is correct. You can <b>ping </b>or <b>test your JCO connections</b>. if something is wrong, enter the values again for JCO n retest them.
    -o Try undeploying or removing the complete application and redeploy it.
    Tu undeploy please go to
    Go to <b>Visual Admin -> Server -> Services -> Deploy ->
    </b>
    Under Runtime Tab
    select the server, open the tree , you would find the webdypro list there.
    Now select an application, first stop it, remove it and redeploy if necessary.
    Let us know if you could solve the problem or not, gud luck!
    Rgds,
    Sreenivas.

  • Error while generating Web Service from a function module.

    Hi Experts,
    I am trying to create a web service from function module by doing the steps as mentioned in the below document:
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417800)ID1146834250DB10778842957931285337End?rid=/library/uuid/80fa3dff-ce76-2a10-3f94-f3df8f2db5a2&overridelayout=true
    When i save it as an local object instead of generating the Web Service it gives me the below error:
    "Error during activation of Web Service"
    Kindly let me know what needs to be done inorder to resolve this issue.
    I have a feeling that this error may be with respect to some authorizations, in that case how do we resolve it
    Helpful Inputs Awaited.!!!
    Thanks
    Dhwani

    Hi Dhawani,
    Hi Pavan,
    Can you please elaborate...how this will help??
    Thanks
    Dhwani
    I dont know the specific reason but internally there may some inconsistancy but i faced the same error and i tried with saving it in the package.
    Thanks

Maybe you are looking for

  • Hi there how are you guys out there of this forum? I got a question for y'a

    Hi there how are you guys out there of this forum? I got a question for y'all I wanted to know how I could record different folders using iTunes Cause when recorded 2000 thongs on the DVD There were 2000 songs to go through So I really wanted to have

  • How to get the serial Numbers issued for an STO

    Hi, I created my own STO and mapped a serialised material for the same using transaction. I increased the stock by issuing serial numbers. The /SYCLO/MM_DOPURCHASEORDER_GET BAPI returns the PO header, item and longtext details. I want the serial numb

  • Custom Icon for Lync Custom Menus

    We can create custom menus in LYNC Client by setting some  registry values.  But we are not able set custom icons fro the same(instead of default ICON). Is there any to set custom Icon for Custom Menus. Thanks in advance,

  • To count number of occurances of a char in a very large string

    Hi All, I like to count the no of occurances of a char in a a very large string. for example char ch - 'c' string str - "practical example is always needed" c occured 2 times in the above string. Thanks, J.Kathir

  • Extreme and b/g router

    Hi, Can I use my current Netgear b/g DSL modem-router to provide a b/g network and connect a new Airport Extreme via ethernet to supply an n network. (Obviously separate SSID and channnel) If so, how would the NAT / DHCP settings look? Thanks for any