Performance of syncronous scenario
Hi,
I need suggestions as to how to handle the following scenario.
When a user enters data in one field (say employee number)of the SAP screen the data must be used in XI to call a webservice
and get results(employee details) from it and fill up other fields in the screen.
I can develop a synchronous scenario easily but i want to know if i would have performance issues later.
What factors should i consider?
Is there any other approach that i can follow?
Dear Siva
For such a requirement you would have to go for a syncronous scenario. However for performance perspective, you can create a web service which takes multiple employee numbers and returns details for all of them in one shot, instead of retrieving emplyee details one by one.
Regards
Monika
Similar Messages
-
Any more configureation needed for RFC -File Syncronous scenario?
HI Experts,
I am working on File to RFC syncronous scenario.
I imported RFC which has Mess, Res and Excep
I have ED which has only Mess
Now I need to send file using File Adaptor to ECC using RFC and ECC has to send resp back to File using File Adaptor.
I created:
MI
MI_File_Meg_os (File Message Output Syncronous) ---> Mess ED
> MT_Res -
> DT_Res
MI_RFC_Meg_is (Input RFC Message ) ---> Mess
> Resp
I cretaed MM for (Message and Response), IM (mapped for both mess and respose) and activated.
I created 3 Communicaiton Channel (File_Sender, File_Receiver and RFC_Receiver), Rec Determination, Sender Aggrement and Receiver Aggrement.
Do I need to create any more objects or configure ?
Thanks in Advance,
RajeevYou need RFC CC and Filereceiver CC too
Sender Agreement
Do I need to make sender CC for RFC or File receiver CC?
both
Interface determination,
for mapping File request to RFC and RFC response to File
Sender or receiver Aggrements
sender agreements with FileSender CC and receiver agreement for File receiver CC
For getting back Ack from ECC?
RFC is synchronous and can return response
goto wiki and check for pi there is exact scenario
rajesh -
Performance In Simple Scenarios
I have done some performance testing to see if asynchronous triggers performs any better than synchronous triggers in a simple audit scenario -- capturing record snapshots at insert, update and delete events to a separate database within the same instance of SQL Server.
Synchronous triggers performed 50% better than asynchronous triggers; this was with conversation reuse and the receive queue activation turned off, so the poor performance was just in the act of forming and sending the message, not receiving and processing. This was not necessarily surprising to me, and yet I have to wonder under what conditions would we see real performance benefits for audit scenarios.
I am interested if anyone has done similar testing, and if they received similar or different results. If anyone had conditions where asynchronous triggers pulled ahead for audit scenarios, I would really like to hear back from them. I invite any comments or suggestions for better performance.
The asynchronous trigger:
Code Snippet
ALTER TRIGGER TR_CUSTOMER_INSERT ON DBO.CUSTOMER
FOR INSERT AS
BEGIN
DECLARE
@CONVERSATION UNIQUEIDENTIFIER ,
@MESSAGE XML ,
@LOG_OPERATION CHAR(1) ,
@LOG_USER VARCHAR(35) ,
@LOG_DATE DATETIME;
SELECT TOP(1)
@CONVERSATION = CONVERSATION_HANDLE ,
@LOG_OPERATION = 'I' ,
@LOG_USER = USER() ,
@LOG_DATE = GETDATE()
FROM SYS.CONVERSATION_ENDPOINTS;
SET @MESSAGE =
( SELECT
CUST_ID = NEW.CUST_ID ,
CUST_DESCR = NEW.CUST_DESCR ,
CUST_ADDRESS = NEW.CUST_ADDRESS ,
LOG_OPERATION = @LOG_OPERATION ,
LOG_USER = @LOG_USER ,
LOG_DATE = @LOG_DATE
FROM INSERTED NEW
FOR XML AUTO );
SEND ON CONVERSATION @CONVERSATION
MESSAGE TYPE CUSTOMER_LOG_MESSAGE ( @MESSAGE );
END;
The synchronous trigger:
Code Snippet
ALTER TRIGGER TR_CUSTOMER_INSERT ON DBO.CUSTOMER
FOR INSERT AS
BEGIN
DECLARE
@LOG_OPERATION CHAR(1) ,
@LOG_USER VARCHAR(15) ,
@LOG_DATE DATETIME;
SELECT
@LOG_OPERATION = 'I' ,
@LOG_USER = USER() ,
@LOG_DATE = GETDATE()
INSERT INTO SALES_LOG.DBO.CUSTOMER
SELECT
CUST_ID = NEW.CUST_ID ,
CUST_DESCR = NEW.CUST_DESCR ,
CUST_ADDRESS = NEW.CUST_ADDRESS ,
LOG_OPERATION = @LOG_OPERATION ,
LOG_USER = @LOG_USER ,
LOG_DATE = @LOG_DATE
FROM INSERTED NEW
END;Synchronous audit has to do one database write (one insert). Asynchronous audit has to do at least an insert and an update (the SEND) plus a delete (the RECEIVE) and an insert (the audit itself), so that is 4 database writes. If the destination audit service is remote, then the sys.transmission_queue operations have to be added (one insert and one delete). So clearly there is no way asynchronous audit can be on pair with synchronous audit, there are at least 3 more writes to complete. And that is neglecting all the reads (like looking up the conversation handle etc) and all the marshaling/unmarshaling of the message (usually some fairly expensive XML processing).
Within one database the asynchronous pattern is apealing when the trigger processing is expensive (so that the extra cost of going async is negligible) and reducing the original call response time is important. It could also help if the audit operations create high contention and defering the audit reduces this. Some more esoteric reasons is when asynchronous processing is desired for architecture reasons, like the posibility to add a workflow triggered by the original operation and desire to change this workflow on-the-fly without impact/down time (eg. more consumers of the async message are added, the message is schreded/dispatched to more processing apps and triggers more messages downstream etc etc).
If the audit is between different databases even within same instance then the problem of availabilty arrises (audit table/database may be down for intervals, blocking the orginal operations/application).
If the audit is remote (different SQL Server isntances) then using Service Broker solves the most difficult problem (communication) in addition to asynchronicity and availability, in that case the the synchrnous pattern (e.g. using a linked server) is really a bad choice. -
The performance of synchronous scenarios?
Hi gurus,
We are planing to implement the integration between SAP and WMS(Warehouse management system) . The customer wants all the scenarios (Purchase Order, goods received,...) to be synchronous. Although it's good from the functional point, I think the performance may be not good.
We also need to consider the timeout isssue. For example, when the network is down or the application data is wrong, then the sender system will wait a long time or received the cause of wrong application data. If the application data is wrong, whether we should allow user to save the data in sender system? If not, they will cry if no solutions found in short time. If yes, it will cause the inconsistent data in two systems.
What do you think about this? Is the performance bad according to your experience? How to deal with the wrong application data case? Any help will be appreciated!We are planing to implement the integration between SAP and WMS(Warehouse management system) . The customer
wants all the scenarios (Purchase Order, goods received,...) to be synchronous.
What are your end system protocols....if you are planning to use IDOC then SYNC Communication is not supported.
If the application data is wrong, whether we should allow user to save the data in sender system?
Better if an ACK mechanism is built which will indicate to the SAP system if the data is correct/ incorrect....If incorrect the SAP system can be configured to re-send the data.
I do not find it a good option that wrong application data is stored in the system.....if required for business analysis then fine you can archive the wrong data into some other location.
Is the performance bad according to your experience?
It depends on the volume of data that you will be transacting for a defined duration of time.
How to deal with the wrong application data case?
This is something which the business consultants have to decide.
Regards,
Abhishek. -
** Queue Performance in BPM scenarios
Hi friends,
How about the Queue performance when processing lot of messages at the same time ? For example, if 100 files are picked up and processed by BPM (at the same time), all files processed by the queue XBQO$PE_<Task> Ex: XBQO$PE_WS90000041and the result are delivered thru transaction queues ex: XBTOY0_<4 digit queue> .
My doubt is a) Will this slow performance when processing lot of files like 200,300 b) Is it required to increase any queue parameter ?
Kindly clarify, friends.
Kind Regards,
Jeg P.Hey,
refer to the link for the performance issues.
/people/swen.conrad/blog/2006/12/22/xi-ccbpm-performance-under-perform-or-out-perform
If you think the performance is slow then you can go for multiple Queues.
refer to this link for the configuration of multiple Queues.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0ff0006-3901-2a10-9e97-a71b423da545
reward points if useful.
regards,
Milan -
BADI calls to Syncronous scenario in XI/PI
Can anyone explain how to use the BADI to make a call to get the info in Syncronous communication
Thanks
RPHI
You can use the RFC adapter in XI to make Sync call to BADI.
Whats the detail requirement.
Thanks
Gaurav -
Syncronous RFC to File Server Scenario
Hello,
I have this requirement for the XI Scrnario.
SAP 4,6 (RFC) needs to pick up XML file placed on Remote File Server.
RFC need to be executed on SAP which should make a call to XI and in turn File server, pickup the XML file from the server, bring it back to XI , do mapping and send the structure back to RFC.
This is Syncronous scenario.
Can naybody tell me how to do it.
i have searched it, but got more confused.
Appriciate your help.
Thanks.
DKthere exist a way around for this,but there are few(may be lot) constraints on it.
first of all you should know all the directories before hand from which you can get files,secondly you should know about the filenames too
what you can do is give all the directory names in the sender file adapter,similarly give the corresponding fileanames as well,XI will pick all the files in all the directories which satisfy the criteria one thing you need to make sure here is that if you don't want a certain file to be picked by XI,then it must either not exist in the directory or it must have a different names.
even though this is not completely dynamic but it solves the prupose if all the constraints are fulfilled and sender file adapter has been configured properly
Thanx
Aamir -
Serious Performance Problems in ABAP Reports
Hi All,
We are developing ABAP reports for SAP IS-U/CCS Modules and facing Performance issues.Whole scenario is given below.Please suggest some solution.
1. Total No. Of Business Partners = 1500000
2. Reports Selection Criteria are of two types:
a) GSBER(Business Area) - Selection for atleast 200000 Business Partners
b) Cokey(Division) - Selection for around 1000 to 50000 Business Partners
3. For implementing our reports logic we have to access several tables all of which are very large.They are :
Table Name No. of records (Appx)
DBERCHV 20000000
DBERCHZ1 20000000
DBERDLB 20000000
DFKKKO 20000000
DFKKOP 20000000
EANLH 4000000
ERCH 10000000
ERCHC 10000000
ETTIFN 30000000
EVER 1500000
FKKVKP 1500000
TECOKT 500
TGSBT 12
4. Due to large no. of records we are facing problems at two levels:
a) OpenSQL Statement is taking too much time for data selection
b) Since large no. of records are selected Corresponding loops and data processing also takes much time
5. We have tried almost all ABAP Performance optimization techniques such as using Index, SQL optimization techniques,Read Table Optimization, Loop Statement Optimization etc. but there is not much improvement.
6. For example one of our Reports "R15" takes around 1500 seconds for 1000 Business Partners.
Its Code is attached below:
<b>a) ZISU_SCHL_LTR15_BAPI - Program which schedules actual R15 report in background</b>
*& Report ZISU_SCHL_LTR15_BAPI *
*& Developed By : Piyusha Kirwai *
*& Date : 02/12/2005 *
*& Purpose : To Schedule the LT R 15 prog in background and store
*& the File for Manual R-15 into server.
REPORT ZISU_SCHL_LTR15_BAPI NO STANDARD PAGE HEADING.
TABLES ZEVERFKKVKP.
DATA: DYFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
DATA: IT_TAB TYPE FILETABLE,
GD_SUBRC TYPE I.
DATA: LV_GSBER TYPE TGSBT-GSBER.
RANGES R_COKEY FOR ZEVERFKKVKP-COKEY.
DATA: BEGIN OF GT_TECOKT OCCURS 100,
COKEY TYPE TECOKT-COKEY,
LTEXT TYPE TECOKT-LTEXT,
END OF GT_TECOKT,
BEGIN OF GT_TE422 OCCURS 100,
TERMSCHL TYPE TE422-TERMSCHL,
TERMTEXT TYPE TE422-TERMTEXT,
END OF GT_TE422.
DATA: BEGIN OF GWA_MANUAL_DATA,
COL_1(5) TYPE C,
COL_2(10) TYPE C,
COL_3(40) TYPE C,
COL_4(40) TYPE C,
COL_5(10) TYPE C,
COL_6(19) TYPE C,
COL_7(19) TYPE C,
COL_8(19) TYPE C,
COL_9(19) TYPE C,
COL_10(19) TYPE C,
COL_11(19) TYPE C,
COL_12(10) TYPE C,
COL_13(19) TYPE C,
COL_14(19) TYPE C,
COL_15(19) TYPE C,
COL_16(19) TYPE C,
COL_17(19) TYPE C,
COL_18(19) TYPE C,
END OF GWA_MANUAL_DATA,
GT_MANUAL_DATA LIKE GWA_MANUAL_DATA OCCURS 0,
GT_INTERN_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*&-----FOR UPLOADING FILE TO SERVER------------------------------------*
DATA: LV_SERVER_FILE_PREFIX(60) TYPE C.
DATA: LV_SERVER_DATAFILE_NAME(60) TYPE C.
DATA: LV_SERVER_ERRFILE_NAME(60) TYPE C.
DATA: ENDT LIKE SY-UZEIT,
ENDD LIKE SY-DATUM,
JOBCOUNT TYPE TBTCJOB-JOBCOUNT.
SELECTION-SCREEN BEGIN OF BLOCK 001 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: SO_GSBER FOR ZEVERFKKVKP-GSBER OBLIGATORY,
SO_COKEY FOR ZEVERFKKVKP-COKEY OBLIGATORY,
SO_MRU FOR ZEVERFKKVKP-ABLEINH.
PARAMETERS: P_BMNTH(7) TYPE C OBLIGATORY.
SELECT-OPTIONS: SO_GPART FOR ZEVERFKKVKP-GPART.
SELECTION-SCREEN END OF BLOCK 001.
SELECTION-SCREEN BEGIN OF BLOCK 002 WITH FRAME TITLE TEXT-003.
PARAMETERS: P_COMPUT RADIOBUTTON GROUP R15,
P_INCLUD RADIOBUTTON GROUP R15,
P_FILE TYPE RLGRAP-FILENAME MODIF ID ACT.
SELECTION-SCREEN END OF BLOCK 002.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(83) TEXT-004.
SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN BEGIN OF LINE.
* SELECTION-SCREEN COMMENT 8(40) TEXT-005.
*SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK 003 WITH FRAME TITLE TEXT-002.
PARAMETERS P_SCHL TYPE C AS CHECKBOX.
PARAMETERS : P_IMMED RADIOBUTTON GROUP SCH ,
P_DT_TM RADIOBUTTON GROUP SCH,
P_DATE TYPE SY-DATUM MODIF ID SHL,
P_TIME TYPE SY-UZEIT MODIF ID SHL.
SELECTION-SCREEN END OF BLOCK 003.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN ON SO_GSBER.
IF NOT SO_GSBER-LOW IS INITIAL.
SELECT SINGLE GSBER FROM TGSBT INTO LV_GSBER
WHERE GSBER = SO_GSBER-LOW.
IF SY-SUBRC <> 0.
MESSAGE E007(ZISU).
ENDIF.
ENDIF.
IF NOT SO_GSBER-HIGH IS INITIAL .
SELECT SINGLE GSBER FROM TGSBT INTO LV_GSBER
WHERE GSBER = SO_GSBER-HIGH.
IF SY-SUBRC <> 0.
MESSAGE E007(ZISU).
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON P_BMNTH.
**check the validity of Billing month format and for valid billing month
IF P_BMNTH CO '0123456789/'.
IF P_BMNTH CP '++++/++'.
IF P_BMNTH+5(2) > 12.
MESSAGE E002(ZISU) WITH 'from'.
ENDIF.
** current year is less than year entered
IF SY-DATUM(4) < P_BMNTH(4).
MESSAGE E003(ZISU) WITH 'from'.
ELSEIF SY-DATUM(4) = P_BMNTH(4).
** month in future
IF SY-DATUM+4(2) < P_BMNTH+5(2).
MESSAGE E004(ZISU) WITH 'from'.
ENDIF.
ENDIF.
ELSE.
MESSAGE E001(ZISU) WITH 'from'.
ENDIF.
ELSE.
** entry have some invalid char
MESSAGE E010(ZISU).
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_COKEY-LOW.
**for geting the CO account assigment key of the entered Business area
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM DIVISON_DATA_GET CHANGING SO_COKEY-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_COKEY-HIGH.
**for geting the CO account assigment key of the entered Business area
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM DIVISON_DATA_GET CHANGING SO_COKEY-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_MRU-LOW.
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM MRU_DATA_GET CHANGING SO_MRU-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_MRU-HIGH.
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM MRU_DATA_GET CHANGING SO_MRU-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
REFRESH: IT_TAB.
**Opens File Open Dialog Box for selecting input file.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'Select File'
DEFAULT_FILENAME = '*.xls'
MULTISELECTION = ' '
CHANGING
FILE_TABLE = IT_TAB
RC = GD_SUBRC.
LOOP AT IT_TAB INTO P_FILE.
* so_fpath-sign = 'I'.
* so_fpath-option = 'EQ'.
* append so_fpath.
ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ACT'.
IF P_INCLUD = ' '.
SCREEN-INPUT = '0'.
ELSE.
SCREEN-INPUT = '1'.
ENDIF.
ENDIF.
IF SCREEN-GROUP1 = 'SHL'.
IF P_DT_TM = 'X'.
SCREEN-INPUT = '1'.
ELSE.
SCREEN-INPUT = '0'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
INITIALIZATION.
P_DATE = SY-DATUM.
P_TIME = SY-UZEIT + 180.
START-OF-SELECTION.
IF P_INCLUD = 'X' AND P_FILE IS INITIAL.
MESSAGE 'Enter the Manual R-15 File' TYPE 'E'.
ENDIF.
* IF P_INCLUD = 'X'.
* PERFORM UPLOAD_EXCEL_FILE.
* CONCATENATE 'R15' SY-DATUM '-' SY-UZEIT INTO LV_SERVER_FILE_PREFIX.
* CONCATENATE LV_SERVER_FILE_PREFIX '-' 'LT.TMP' INTO
* LV_SERVER_DATAFILE_NAME.
* OPEN DATASET LV_SERVER_DATAFILE_NAME
* FOR OUTPUT
* IN TEXT MODE
* ENCODING DEFAULT.
* LOOP AT GT_MANUAL_DATA INTO GWA_MANUAL_DATA.
* IF ( GWA_MANUAL_DATA-COL_6 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_7 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_8 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_9 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_10 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_11 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_13 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_14 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_15 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_16 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_17 CN '0123456789 '
* AND GWA_MANUAL_DATA-COL_18 CN '0123456789 ' ).
* MESSAGE 'Character Data in Numerical Field' TYPE 'E'.
* ENDIF.
* TRANSFER GWA_MANUAL_DATA TO LV_SERVER_DATAFILE_NAME.
* ENDLOOP.
* CLOSE DATASET LV_SERVER_DATAFILE_NAME.
* ENDIF. " P_INCLUD = 'X'.
IF P_SCHL = 'X'.
IF P_IMMED = 'X'.
CALL FUNCTION 'C14B_ADD_TIME'
EXPORTING
I_STARTTIME = SY-UZEIT
I_STARTDATE = SY-DATUM
I_ADDTIME = '000010'
IMPORTING
E_ENDTIME = ENDT
E_ENDDATE = ENDD.
ELSEIF P_DT_TM = 'X'.
ENDD = P_DATE.
ENDT = P_TIME.
ENDIF.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
* DELANFREP = ' '
* JOBGROUP = ' '
JOBNAME = 'R15JOB'
* SDLSTRTDT = ENDD
* SDLSTRTTM = ENDT
* JOBCLASS =
IMPORTING
JOBCOUNT = JOBCOUNT
* CHANGING
* RET =
* EXCEPTIONS
* CANT_CREATE_JOB = 1
* INVALID_JOB_DATA = 2
* JOBNAME_MISSING = 3
* OTHERS = 4
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF P_INCLUD = 'X'.
PERFORM UPLOAD_EXCEL_FILE.
CONCATENATE 'R15' SY-DATUM '-' SY-UZEIT INTO LV_SERVER_FILE_PREFIX.
CONCATENATE LV_SERVER_FILE_PREFIX '-' JOBCOUNT 'LT.TMP' INTO
LV_SERVER_DATAFILE_NAME.
CONDENSE LV_SERVER_DATAFILE_NAME.
OPEN DATASET LV_SERVER_DATAFILE_NAME
FOR OUTPUT
IN TEXT MODE
ENCODING DEFAULT.
IF SY-SUBRC NE 0.
MESSAGE 'Error in Creating File on Server' TYPE 'E'.
ENDIF.
LOOP AT GT_MANUAL_DATA INTO GWA_MANUAL_DATA.
IF ( GWA_MANUAL_DATA-COL_6 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_7 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_8 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_9 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_10 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_11 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_13 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_14 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_15 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_16 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_17 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_18 CN '0123456789 ' ).
MESSAGE 'Character Data in Numerical Field' TYPE 'E'.
ENDIF.
TRANSFER GWA_MANUAL_DATA TO LV_SERVER_DATAFILE_NAME.
ENDLOOP.
CLOSE DATASET LV_SERVER_DATAFILE_NAME.
IF SY-SUBRC NE 0.
MESSAGE 'Error in Creating File on Server' TYPE 'E'.
ENDIF.
ENDIF. " P_INCLUD = 'X'.
SUBMIT ZISU_LTR15_TUNE
WITH SO_GSBER IN SO_GSBER
WITH SO_COKEY IN SO_COKEY
WITH SO_MRU IN SO_MRU
WITH SO_GPART IN SO_GPART
WITH P_BMNTH = P_BMNTH
WITH P_COMPUT = P_COMPUT
WITH P_INCLUD = P_INCLUD
WITH P_FILE = LV_SERVER_DATAFILE_NAME
USER SY-UNAME VIA JOB 'R15JOB' NUMBER JOBCOUNT AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
* AT_OPMODE = ' '
* AT_OPMODE_PERIODIC = ' '
* CALENDAR_ID = ' '
* EVENT_ID = ' '
* EVENT_PARAM = ' '
* EVENT_PERIODIC = ' '
JOBCOUNT = JOBCOUNT
JOBNAME = 'R15JOB'
* LASTSTRTDT = NO_DATE
* LASTSTRTTM = NO_TIME
* PRDDAYS = 0
* PRDHOURS = 0
* PRDMINS = 0
* PRDMONTHS = 0
* PRDWEEKS = 0
* PREDJOB_CHECKSTAT = ' '
* PRED_JOBCOUNT = ' '
* PRED_JOBNAME = ' '
SDLSTRTDT = ENDD
SDLSTRTTM = ENDT
* STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
STRTIMMED = P_IMMED
* TARGETSYSTEM = ' '
* START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
* START_ON_WORKDAY_NR = 0
* WORKDAY_COUNT_DIRECTION = 0
* RECIPIENT_OBJ =
* TARGETSERVER = ' '
* DONT_RELEASE = ' '
* TARGETGROUP = ' '
* DIRECT_START =
* IMPORTING
* JOB_WAS_RELEASED =
* CHANGING
* RET =
* EXCEPTIONS
* CANT_START_IMMEDIATE = 1
* INVALID_STARTDATE = 2
* JOBNAME_MISSING = 3
* JOB_CLOSE_FAILED = 4
* JOB_NOSTEPS = 5
* JOB_NOTEX = 6
* LOCK_FAILED = 7
* INVALID_TARGET = 8
* OTHERS = 9
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE. " IF NOT TO RUN IN BACKGROUND
IF P_INCLUD = 'X'.
PERFORM UPLOAD_EXCEL_FILE.
CONCATENATE 'R15' SY-DATUM '-' SY-UZEIT INTO LV_SERVER_FILE_PREFIX.
CONCATENATE LV_SERVER_FILE_PREFIX '-' 'LT.TMP' INTO
LV_SERVER_DATAFILE_NAME.
CONDENSE LV_SERVER_DATAFILE_NAME.
OPEN DATASET LV_SERVER_DATAFILE_NAME
FOR OUTPUT
IN TEXT MODE
ENCODING DEFAULT.
IF SY-SUBRC NE 0.
MESSAGE 'Error in Creating File on Server' TYPE 'E'.
ENDIF.
LOOP AT GT_MANUAL_DATA INTO GWA_MANUAL_DATA.
IF ( GWA_MANUAL_DATA-COL_6 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_7 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_8 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_9 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_10 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_11 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_13 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_14 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_15 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_16 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_17 CN '0123456789 '
AND GWA_MANUAL_DATA-COL_18 CN '0123456789 ' ).
MESSAGE 'Character Data in Numerical Field' TYPE 'E'.
ENDIF.
TRANSFER GWA_MANUAL_DATA TO LV_SERVER_DATAFILE_NAME.
ENDLOOP.
CLOSE DATASET LV_SERVER_DATAFILE_NAME.
IF SY-SUBRC NE 0.
MESSAGE 'Error in Creating File on Server' TYPE 'E'.
ENDIF.
ENDIF. " P_INCLUD = 'X'.
IF NOT SY-BATCH IS INITIAL.
SUBMIT ZISU_LTR15_TUNE
WITH SO_GSBER IN SO_GSBER
WITH SO_COKEY IN SO_COKEY
WITH SO_MRU IN SO_MRU
WITH SO_GPART IN SO_GPART
WITH P_BMNTH = P_BMNTH
WITH P_COMPUT = P_COMPUT
WITH P_INCLUD = P_INCLUD
WITH P_FILE = LV_SERVER_DATAFILE_NAME
TO SAP-SPOOL WITHOUT SPOOL DYNPRO.
ELSE.
SUBMIT ZISU_LTR15_TUNE
WITH SO_GSBER IN SO_GSBER
WITH SO_COKEY IN SO_COKEY
WITH SO_MRU IN SO_MRU
WITH SO_GPART IN SO_GPART
WITH P_BMNTH = P_BMNTH
WITH P_COMPUT = P_COMPUT
WITH P_INCLUD = P_INCLUD
WITH P_FILE = LV_SERVER_DATAFILE_NAME.
ENDIF.
ENDIF.
*& Form divison_data_get
* text
* <--P_SO_COKEY_LOW text
FORM DIVISON_DATA_GET CHANGING P_SO_COKEY_LOW.
**to get the search help for division
DATA : LV_LINES TYPE SY-TFILL,
LT_RETURN_TAB LIKE DDSHRETVAL OCCURS 0, " with header line.
LWA_RETURN_TAB LIKE DDSHRETVAL.
DATA: LV_COKEY TYPE ZEVERFKKVKP-COKEY.
**according to the Business area entered]
* break csebdev1.
REFRESH R_COKEY[].
DESCRIBE TABLE SO_GSBER LINES LV_LINES.
** when user has neither pressed the enter key nor selected the values
**using search help
IF LV_LINES = 0.
* loop at so_gsber.
CLEAR R_COKEY.
* if so_gsber-high is initial.
* break csebdev1.
DYFIELDS-FIELDNAME = 'SO_GSBER-LOW'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS.
* r_cokey-sign = 'I'.
* r_cokey-option = 'CP'.
*r_cokey-low = so_gsber-low+0(2).
CONCATENATE DYFIELDS-FIELDVALUE+0(2) '*' INTO R_COKEY-LOW.
* elseif not so_gsber-high is initial.
DYFIELDS-FIELDNAME = 'SO_GSBER-HIGH'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS.
IF NOT DYFIELDS-FIELDVALUE IS INITIAL.
CONCATENATE DYFIELDS-FIELDVALUE+0(2) '99999999' INTO R_COKEY-HIGH.
ENDIF.
* endif.
IF NOT R_COKEY-HIGH IS INITIAL.
R_COKEY-SIGN = 'I'.
R_COKEY-OPTION = 'BT'.
ELSEIF R_COKEY-HIGH IS INITIAL.
R_COKEY-SIGN = 'I'.
R_COKEY-OPTION = 'CP'.
ENDIF.
APPEND R_COKEY.
ENDIF.
* endloop.
* APPEND DYFIELDS.
IF LV_LINES > 0.
* break-point.
IF NOT SO_GSBER[] IS INITIAL.
LOOP AT SO_GSBER.
* r_cokey-sign = 'I'.
* r_cokey-option = 'CP'.
*r_cokey-low = so_gsber-low+0(2).
CONCATENATE SO_GSBER-LOW+0(2) '*' INTO R_COKEY-LOW.
IF NOT SO_GSBER-HIGH IS INITIAL.
CONCATENATE SO_GSBER-HIGH+0(2) '99999999' INTO R_COKEY-HIGH.
ENDIF.
IF NOT R_COKEY-HIGH IS INITIAL.
R_COKEY-SIGN = 'I'.
R_COKEY-OPTION = 'BT'.
ELSEIF R_COKEY-HIGH IS INITIAL.
R_COKEY-SIGN = 'I'.
R_COKEY-OPTION = 'CP'.
ENDIF.
APPEND R_COKEY TO R_COKEY.
ENDLOOP.
ENDIF.
ENDIF.
IF NOT R_COKEY[] IS INITIAL.
* break csebdev1.
REFRESH GT_TECOKT[].
SELECT COKEY LTEXT
FROM TECOKT
INTO TABLE GT_TECOKT
WHERE COKEY IN R_COKEY AND SPRAS = 'EN'.
* %_HINTS ORACLE '("TECOKT","TECOKT~1")'.
ENDIF.
**now call the search help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'COKEY'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
WINDOW_TITLE = 'Division'
VALUE = DYFIELDS-FIELDVALUE
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = GT_TECOKT
* FIELD_TAB =
RETURN_TAB = LT_RETURN_TAB
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 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.
READ TABLE LT_RETURN_TAB INTO LWA_RETURN_TAB INDEX 1.
LV_COKEY = LWA_RETURN_TAB-FIELDVAL.
*break csebdev1.
ENDFORM. " divison_data_get
*& Form upload_excel_file
* text
* --> p1 text
* <-- p2 text
FORM UPLOAD_EXCEL_FILE .
DATA: LV_INDEX TYPE I.
FIELD-SYMBOLS <VAL> TYPE ANY.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 8
I_END_COL = 18
I_END_ROW = 94
TABLES
INTERN = GT_INTERN_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 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.
IF NOT GT_INTERN_DATA[] IS INITIAL.
SORT GT_INTERN_DATA BY ROW COL.
LOOP AT GT_INTERN_DATA.
MOVE GT_INTERN_DATA-COL TO LV_INDEX.
ASSIGN COMPONENT LV_INDEX OF STRUCTURE GWA_MANUAL_DATA TO <VAL>.
MOVE GT_INTERN_DATA-VALUE TO <VAL>.
AT END OF ROW.
APPEND GWA_MANUAL_DATA TO GT_MANUAL_DATA.
CLEAR GWA_MANUAL_DATA.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM. " upload_excel_file
*& Form MRU_DATA_GET
* text
* <--P_SO_MRU_LOW text
FORM MRU_DATA_GET CHANGING LV_MRU.
**to get the search help for Group
DATA : LV_LINES TYPE SY-TFILL,
LT_RETURN_TAB LIKE DDSHRETVAL OCCURS 0,
LWA_RETURN_TAB LIKE DDSHRETVAL.
* lv_mru_p(3) type c.
RANGES R_MRU FOR EANLH-ABLEINH.
**according to the Business area entered
** break csebdev1.
REFRESH R_MRU[].
DESCRIBE TABLE SO_GSBER LINES LV_LINES.
** when user has neither pressed the enter key nor selected the values
**using search help
IF LV_LINES = 0.
CLEAR R_MRU[].
DYFIELDS-FIELDNAME = 'SO_GSBER-LOW'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS.
CONCATENATE DYFIELDS-FIELDVALUE+0(2) '*' INTO R_MRU-LOW.
DYFIELDS-FIELDNAME = 'SO_GSBER-HIGH'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS.
IF NOT DYFIELDS-FIELDVALUE IS INITIAL.
CONCATENATE DYFIELDS-FIELDVALUE+0(2) '99999999' INTO R_MRU-HIGH.
ENDIF.
IF NOT R_MRU-HIGH IS INITIAL.
R_MRU-SIGN = 'I'.
R_MRU-OPTION = 'BT'.
ELSEIF R_MRU-HIGH IS INITIAL.
R_MRU-SIGN = 'I'.
R_MRU-OPTION = 'CP'.
ENDIF.
APPEND R_MRU.
ENDIF. " end lv_lines =0
IF LV_LINES > 0.
IF NOT SO_GSBER[] IS INITIAL.
LOOP AT SO_GSBER.
CONCATENATE SO_GSBER-LOW+0(2) '*' INTO R_MRU-LOW.
IF NOT SO_GSBER-HIGH IS INITIAL.
CONCATENATE SO_GSBER-HIGH+0(2) '99999999' INTO R_MRU-HIGH.
ENDIF.
IF R_MRU-HIGH IS INITIAL.
R_MRU-SIGN = 'I'.
R_MRU-OPTION = 'CP'.
ELSEIF NOT R_MRU-HIGH IS INITIAL.
R_MRU-SIGN = 'I'.
R_MRU-OPTION = 'BT'.
ENDIF.
APPEND R_MRU.
ENDLOOP.
ENDIF. " end so_GSBER[]
ENDIF. " end lv_lines > 0
IF NOT R_MRU[] IS INITIAL.
* break csebdev1.
REFRESH GT_TE422[].
SELECT TERMSCHL TERMTEXT FROM TE422 INTO CORRESPONDING FIELDS OF
TABLE GT_TE422 WHERE TERMSCHL IN R_MRU .
ENDIF.
**now call the search help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'TERMSCHL'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
WINDOW_TITLE = 'Group'
VALUE = DYFIELDS-FIELDVALUE
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = GT_TE422
* FIELD_TAB =
RETURN_TAB = LT_RETURN_TAB
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 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.
READ TABLE LT_RETURN_TAB INTO LWA_RETURN_TAB INDEX 1.
LV_MRU = LWA_RETURN_TAB-FIELDVAL.
ENDFORM. " MRU_DATA_GET
<b>b) ZISU_LTR15_TUNE - Actual R15 report</b>
*& Report ZISU_LTR15_TUNE *
REPORT ZISU_LTR15_TUNE NO STANDARD PAGE HEADING MESSAGE-ID ZISU
LINE-SIZE 250 LINE-COUNT 65.
**Tables
TABLES : EVER,
FKKVKP,
EANLH.
SELECTION-SCREEN BEGIN OF BLOCK SELECTION
WITH FRAME TITLE TEXT-001 . "no intervals.
SELECT-OPTIONS: SO_GSBER FOR EVER-GSBER OBLIGATORY,
SO_COKEY FOR EVER-COKEY,
SO_MRU FOR EANLH-ABLEINH.
PARAMETERS: P_BMNTH(7) TYPE C OBLIGATORY.
PARAMETERS: P_CONT TYPE EVER-VERTRAG.
SELECT-OPTIONS: SO_GPART FOR FKKVKP-GPART.
SELECTION-SCREEN END OF BLOCK SELECTION.
SELECTION-SCREEN BEGIN OF BLOCK PROCESS WITH FRAME.
PARAMETERS: P_COMPUT RADIOBUTTON GROUP R15.
PARAMETERS: P_INCLUD RADIOBUTTON GROUP R15,
P_FILE(60) TYPE C.
SELECTION-SCREEN END OF BLOCK PROCESS.
* Start of Type declaration
TYPES: BEGIN OF ST_TB024 ,
IND_SECTOR TYPE TB024-IND_SECTOR,
TEXTLONG TYPE TB024-TEXTLONG,
END OF ST_TB024,
BEGIN OF ST_TECOKT,
COKEY TYPE TECOKT-COKEY,
LTEXT TYPE TECOKT-LTEXT,
END OF ST_TECOKT,
BEGIN OF ST_TGSBT,
GSBER TYPE TGSBT-GSBER,
GTEXT TYPE TGSBT-GTEXT,
END OF ST_TGSBT,
BEGIN OF ST_TE422,
TERMSCHL TYPE TE422-TERMSCHL,
TERMTEXT TYPE TE422-TERMTEXT,
END OF ST_TE422.
* Start of data declaration
DATA: IT_TAB TYPE FILETABLE,
GD_SUBRC TYPE I.
DATA : GT_TB024 TYPE STANDARD TABLE OF ST_TB024 WITH HEADER LINE
INITIAL SIZE 0,
GT_TECOKT TYPE STANDARD TABLE OF ST_TECOKT
WITH HEADER LINE,
GT_TGSBT TYPE SORTED TABLE OF ST_TGSBT
WITH UNIQUE KEY GSBER WITH HEADER LINE,
GT_TE422 TYPE TABLE OF ST_TE422 WITH HEADER LINE INITIAL SIZE 0,
BEGIN OF GWA_EVER,
VKONT TYPE EVER-VKONTO,
ANLAGE TYPE EVER-ANLAGE,
ABRSPERR TYPE EVER-ABRSPERR,
END OF GWA_EVER,
GT_EVER LIKE TABLE OF GWA_EVER INITIAL SIZE 0,
BEGIN OF GWA_EANLH,
ANLAGE TYPE EANLH-ANLAGE,
BRANCHE TYPE EANLH-BRANCHE,
END OF GWA_EANLH,
GT_EANLH LIKE TABLE OF GWA_EANLH INITIAL SIZE 0,
BEGIN OF GWA_FKKVKP,
VKONT TYPE FKKVKP-VKONT,
KTOKL TYPE FKKVKP-KTOKL,
END OF GWA_FKKVKP,
GT_FKKVKP LIKE TABLE OF GWA_FKKVKP INITIAL SIZE 0,
BEGIN OF GWA_EVER_EANLH_FKKVKP,
VKONT TYPE FKKVKP-VKONT,
ANLAGE TYPE EVER-ANLAGE,
ABRSPERR TYPE EVER-ABRSPERR,
BRANCHE TYPE EANLH-BRANCHE,
KTOKL TYPE FKKVKP-KTOKL,
END OF GWA_EVER_EANLH_FKKVKP,
GT_EVER_EANLH_FKKVKP LIKE TABLE OF GWA_EVER_EANLH_FKKVKP
INITIAL SIZE 0,
GT_EVER_EANLH_FKKVKP_INACT LIKE STANDARD TABLE OF
GWA_EVER_EANLH_FKKVKP INITIAL SIZE 0,
BEGIN OF GWA_ERCH,
BELNR TYPE ERCH-BELNR,
VKONT TYPE ERCH-VKONT,
END OF GWA_ERCH,
GT_ERCH LIKE TABLE OF GWA_ERCH INITIAL SIZE 0,
BEGIN OF GWA_PRINTDOC,
OPBEL TYPE ERDK-OPBEL,
GPART TYPE ERDK-PARTNER,
VKONT TYPE ERDK-VKONT,
BUDAT TYPE ERDK-BUDAT,
FAEDN TYPE ERDK-FAEDN,
END OF GWA_PRINTDOC,
GT_PRINTDOC LIKE TABLE OF GWA_PRINTDOC INITIAL SIZE 0,
BEGIN OF GWA_DBERCHZ1,
BELNR TYPE DBERCHZ1-BELNR,
EIN01 TYPE DBERCHZ1-EIN01,
V_ABRMENGE TYPE DBERCHZ1-V_ABRMENGE,
END OF GWA_DBERCHZ1,
GT_DBERCHZ1 LIKE TABLE OF GWA_DBERCHZ1 INITIAL SIZE 0,
BEGIN OF GWA_ERCHC,
BELNR TYPE ERCHC-BELNR,
OPBEL TYPE ERCHC-OPBEL,
BUDAT TYPE ERCHC-BUDAT,
END OF GWA_ERCHC,
GT_ERCHC LIKE TABLE OF GWA_ERCHC INITIAL SIZE 0,
* arrears for inactive consumers.
BEGIN OF GWA_DFKKOP_INACTIVE_ARR,
OPBEL TYPE DFKKOP-OPBEL,
VKONT TYPE DFKKOP-VKONT,
BETRH TYPE DFKKOP-BETRH,
END OF GWA_DFKKOP_INACTIVE_ARR,
GT_DFKKOP_INACTIVE_ARR LIKE TABLE OF GWA_DFKKOP_INACTIVE_ARR
INITIAL SIZE 0,
BEGIN OF GWA_ETTIFN,
ANLAGE TYPE ETTIFN-ANLAGE,
OPERAND TYPE ETTIFN-OPERAND,
WERT1 TYPE ETTIFN-WERT1,
END OF GWA_ETTIFN,
GT_ETTIFN LIKE SORTED TABLE OF GWA_ETTIFN
WITH NON-UNIQUE KEY ANLAGE OPERAND INITIAL SIZE 0,
BEGIN OF GWA_DBERDLB,
PRINTDOC TYPE DBERDLB-PRINTDOC,
BILLDOC TYPE DBERDLB-BILLDOC,
BILLDOCLINE TYPE DBERDLB-BILLDOCLINE,
NETTOBTR TYPE DBERDLB-NETTOBTR,
END OF GWA_DBERDLB,
GT_DBERDLB LIKE TABLE OF GWA_DBERDLB INITIAL SIZE 0,
BEGIN OF GWA_DBERCHZ1_BILL,
BELNR TYPE DBERCHZ1-BELNR,
BELZEILE TYPE DBERCHZ1-BELZEILE,
TVORG TYPE DBERCHZ1-TVORG,
END OF GWA_DBERCHZ1_BILL,
GT_DBERCHZ1_BILL LIKE TABLE OF GWA_DBERCHZ1_BILL INITIAL SIZE 0,
BEGIN OF GWA_BILLDOC,
PRINTDOC TYPE ERDK-OPBEL,
BILLDOC TYPE DBERDLB-BILLDOC,
END OF GWA_BILLDOC,
GT_BILLDOC LIKE TABLE OF GWA_BILLDOC INITIAL SIZE 0,
BEGIN OF GWA_DBERCHV,
BELNR TYPE DBERCHV-BELNR,
OPERAND TYPE DBERCHV-OPERAND,
EZ_ABRMENGE TYPE DBERCHV-EZ_ABRMENGE,
ABLESGR TYPE DBERCHV-ABLESGR,
ABLESGRV TYPE DBERCHV-ABLESGRV,
END OF GWA_DBERCHV,
GT_DBERCHV LIKE TABLE OF GWA_DBERCHV INITIAL SIZE 0,
BEGIN OF GWA_DFKKOP_ARREAR,
OPBEL TYPE DFKKOP-OPBEL,
VKONT TYPE DFKKOP-VKONT,
HVORG TYPE DFKKOP-HVORG,
TVORG TYPE DFKKOP-TVORG,
BUDAT TYPE DFKKOP-BUDAT,
BETRH TYPE DFKKOP-BETRH,
AUGDT TYPE DFKKOP-AUGDT,
XBLNR TYPE DFKKOP-XBLNR,
END OF GWA_DFKKOP_ARREAR,
GT_DFKKOP_ARREAR LIKE TABLE OF GWA_DFKKOP_ARREAR INITIAL SIZE 0,
BEGIN OF GWA_MASTER_DATA,
SLNO(4) TYPE C,
IND_SECTOR TYPE TB024-IND_SECTOR,
TEXTLONG TYPE TB024-TEXTLONG,
AC_CODE TYPE TFK033D-FUN01,
END OF GWA_MASTER_DATA,
GT_MASTER_DATA LIKE TABLE OF GWA_MASTER_DATA INITIAL SIZE 0,
** internal table for final prepared data
BEGIN OF GWA_FINAL_DATA,
SLNO(4) TYPE C,
IND_SECTOR TYPE TB024-IND_SECTOR, " for testing
INDUSTRY TYPE TB024-TEXTLONG,
AC_CODE TYPE TFK033D-FUN01,
* *for urban partners
UPARTNER TYPE I , "(6) type n,
UBAD_METER TYPE I, "(4) type n,
UINACTIVE TYPE I,
ULOAD(8) TYPE P DECIMALS 2,
UUNITS(8) TYPE P DECIMALS 2,
UDEMANDS(8) TYPE P DECIMALS 2,
UARREARS(8) TYPE P DECIMALS 2, "FKKMAKO-Msalm,
UINACT_ARR(8) TYPE P DECIMALS 2,
BLANK(10) TYPE C,
* *for rural partners
RPARTNER TYPE I , "(6) type n,
RBAD_METER TYPE I , "(4) type n,
RINACTIVE TYPE I,
RLOAD(8) TYPE P DECIMALS 2,
RUNITS(8) TYPE P DECIMALS 2,
RDEMANDS(8) TYPE P DECIMALS 2,
RARREARS(8) TYPE P DECIMALS 2,
RINACT_ARR(8) TYPE P DECIMALS 2,
END OF GWA_FINAL_DATA,
GT_FINAL_DATA LIKE TABLE OF GWA_FINAL_DATA INITIAL SIZE 0,
BEGIN OF GWA_MANUAL_DATA,
COL_1(5) TYPE C,
COL_2(10) TYPE C,
COL_3(40) TYPE C,
COL_4(40) TYPE C,
COL_5(10) TYPE C,
COL_6(19) TYPE C,
COL_7(19) TYPE C,
COL_8(19) TYPE C,
COL_9(19) TYPE C,
COL_10(19) TYPE C,
COL_11(19) TYPE C,
COL_12(10) TYPE C,
COL_13(19) TYPE C,
COL_14(19) TYPE C,
COL_15(19) TYPE C,
COL_16(19) TYPE C,
COL_17(19) TYPE C,
COL_18(19) TYPE C,
END OF GWA_MANUAL_DATA,
GT_MANUAL_DATA LIKE TABLE OF GWA_MANUAL_DATA INITIAL SIZE 0.
** Variables for grand total of all heads.
DATA : GV_T_UPART TYPE I,
GV_T_RPART TYPE I,
GV_T_RINACTIVE TYPE I,
GV_T_UINACTIVE TYPE I,
GV_UDEF_MTR TYPE I,
GV_RDEF_MTR TYPE I,
GV_UCON_LOAD(16) TYPE P DECIMALS 2,
GV_RCON_LOAD(16) TYPE P DECIMALS 2,
GV_UUNITS(16) TYPE P DECIMALS 2,
GV_RUNITS(16) TYPE P DECIMALS 2,
GV_UDEMAND(16) TYPE P DECIMALS 2,
GV_RDEMAND(16) TYPE P DECIMALS 2,
GV_UARREAR(16) TYPE P DECIMALS 2,
GV_RARREAR(16) TYPE P DECIMALS 2,
GV_UINACT_ARR(16) TYPE P DECIMALS 2,
GV_RINACT_ARR(16) TYPE P DECIMALS 2,
GV_U_SD_DMD(16) TYPE P DECIMALS 2,
GV_R_SD_DMD(16) TYPE P DECIMALS 2,
GV_U_SD_ARR(16) TYPE P DECIMALS 2,
GV_R_SD_ARR(16) TYPE P DECIMALS 2,
GV_UR_PART TYPE I,
GV_UR_DEF_MTR TYPE I,
GV_UR_CON_LOAD(16) TYPE P DECIMALS 2,
GV_UR_UNITS(16) TYPE P DECIMALS 2,
GV_UR_DEMAND(16) TYPE P DECIMALS 2,
GV_UR_ARREARS(16) TYPE P DECIMALS 2,
GV_LOWDATE TYPE SY-DATUM,
GV_HIGHDATE TYPE SY-DATUM,
GV_YEAR LIKE DBERCHV-EZ_ABRMENGE,
GV_MONTH LIKE DBERCHZ1-V_ABRMENGE,
GV_MNTH_NAME TYPE T247-KTX.
DATA:
**total meter rent
GV_UTOTMETERRENT TYPE P LENGTH 16 DECIMALS 2,
GV_RTOTMETERRENT TYPE P LENGTH 16 DECIMALS 2,
**for total surcharge
GV_UTOTSURCHRG TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
GV_RTOTSURCHRG TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
**for total ED
GV_UTOTED TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
GV_RTOTED TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
**for total ED Cess
GV_UTOTEDCESS TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
GV_RTOTEDCESS TYPE P LENGTH 16 DECIMALS 2, "dberdlb-nettobtr,
**for total other misc rev
GV_UTOTMISCREV TYPE P LENGTH 16 DECIMALS 2,
GV_RTOTMISCREV TYPE P LENGTH 16 DECIMALS 2,
**for total ED of Free agricultural pump
GV_RTOTEDAGRI TYPE P LENGTH 16 DECIMALS 2,
GV_UTOTEDAGRI TYPE P LENGTH 16 DECIMALS 2,
**for ED cess of Free agriculture pump
GV_RTOTCESSAGRI TYPE P LENGTH 16 DECIMALS 2,
GV_UTOTCESSAGRI TYPE P LENGTH 16 DECIMALS 2,
***data for selection screen data validation
GV_GSBER TYPE EVER-GSBER,
GV_COKEY TYPE EVER-COKEY,
DYFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
GT_INTERN_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
RANGES: R_COKEY FOR TECOKT-COKEY.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN ON SO_GSBER.
IF NOT SO_GSBER-LOW IS INITIAL.
SELECT SINGLE GSBER FROM TGSBT INTO GT_TGSBT-GSBER WHERE
GSBER = SO_GSBER-LOW.
IF SY-SUBRC <> 0.
MESSAGE E007.
ENDIF.
ENDIF.
IF NOT SO_GSBER-HIGH IS INITIAL .
SELECT SINGLE GSBER FROM TGSBT INTO GT_TGSBT-GSBER WHERE
GSBER = SO_GSBER-HIGH.
IF SY-SUBRC <> 0.
MESSAGE E007.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON P_BMNTH.
**check the validity of Billing month format and for valid billing month
IF P_BMNTH CO '0123456789/'.
IF P_BMNTH CP '++++/++'.
IF P_BMNTH+5(2) > 12.
MESSAGE E002 WITH 'from'.
ENDIF.
** current year is less than year entered
IF SY-DATUM(4) < P_BMNTH(4).
MESSAGE E003 WITH 'from'.
ELSEIF SY-DATUM(4) = P_BMNTH(4).
** month in future
IF SY-DATUM+4(2) < P_BMNTH+5(2).
MESSAGE E004 WITH 'from'.
ENDIF.
ENDIF.
ELSE.
MESSAGE E001 WITH 'from'.
ENDIF.
ELSE.
** entry have some invalid char
MESSAGE E010.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_COKEY-LOW.
**for geting the CO account assigment key of the entered Business area
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM DIVISON_DATA_GET CHANGING SO_COKEY-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_COKEY-HIGH.
CLEAR: DYFIELDS[], DYFIELDS.
PERFORM DIVISON_DATA_GET CHANGING SO_COKEY-HIGH.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
* REFRESH: IT_TAB.
***Opens File Open Dialog Box for selecting input file.
* CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
* EXPORTING
* WINDOW_TITLE = 'Select File'
* DEFAULT_FILENAME = '*.xls'
* MULTISELECTION = ' '
* CHANGING
* FILE_TABLE = IT_TAB
* RC = GD_SUBRC.
* LOOP AT IT_TAB INTO P_FILE.
** so_fpath-sign = 'I'.
** so_fpath-option = 'EQ'.
** append so_fpath.
* ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ACT'.
IF P_INCLUD = ' '.
SCREEN-INPUT = '0'.
ELSE.
SCREEN-INPUT = '1'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
* End of Selection screen processing
TOP-OF-PAGE.
DATA : LV_TEXT(70) TYPE C.
FORMAT INTENSIFIED OFF.
WRITE:/50 'CHHATTISGARH STATE ELECTRICITY BOARD',
/42 'R-15 REPORT FOR LT CONSUMERS FOR THE MONTH OF',
GV_MNTH_NAME NO-GAP,'-' NO-GAP, P_BMNTH(4) NO-GAP,
180 'PAGE-NO. -', SY-PAGNO LEFT-JUSTIFIED.
SKIP.
WRITE:/2 'RAO', 15 ':'.
LOOP AT GT_TGSBT WHERE GSBER IN SO_GSBER.
IF STRLEN( LV_TEXT ) > 60.
WRITE: 16 LV_TEXT, / ''.
CLEAR LV_TEXT.
ENDIF.
CONCATENATE LV_TEXT GT_TGSBT-GSBER '-' GT_TGSBT-GTEXT
INTO LV_TEXT SEPARATED BY SPACE.
ENDLOOP.
WRITE: 16 LV_TEXT.
CLEAR LV_TEXT.
WRITE: /2 'Division',15 ':'.
LOOP AT GT_TECOKT.
IF STRLEN( LV_TEXT ) > 60.
WRITE: 16 LV_TEXT, /.
CLEAR LV_TEXT.
ENDIF.
CONCATENATE LV_TEXT GT_TECOKT-COKEY '-' GT_TECOKT-LTEXT
INTO LV_TEXT SEPARATED BY SPACE.
ENDLOOP.
WRITE: 16 LV_TEXT.
CLEAR LV_TEXT.
WRITE: /2 'Group',15 ':'.
LOOP AT GT_TE422 .
IF STRLEN( LV_TEXT ) > 60.
WRITE: 16 LV_TEXT, /.
CLEAR LV_TEXT.
ENDIF.
CONCATENATE LV_TEXT GT_TE422-TERMSCHL '-' GT_TE422-TERMTEXT
INTO LV_TEXT SEPARATED BY SPACE.
ENDLOOP.
WRITE: 16 LV_TEXT.
CLEAR LV_TEXT.
**legends
* write :/ text-028, 15 ':',16 text-029.
**now write the headings on every page
SET LEFT SCROLL-BOUNDARY COLUMN 50.
FORMAT COLOR 1 ON.
WRITE :/1(244) SY-ULINE.
WRITE :/1 SY-VLINE,6 SY-VLINE,50 SY-VLINE, 58 SY-VLINE, 59
'<----------------------------------',
'U R B A N A R E A',
'----------------------------------->'.
WRITE : 151 SY-VLINE, 152
'<----------------------------------',
'R U R A L A R E A',
'----------------------------------->',
244 SY-VLINE.
WRITE :/1 SY-VLINE,
2 'Slno',
6 SY-VLINE,
7 'Revenue Category',
50 SY-VLINE,
51 'A/C',
58 SY-VLINE,
59 'Cons-',
67 SY-VLINE,
68 'Deff',
75 SY-VLINE,
76 'Conn',
89 SY-VLINE,
90 'Sold',
108 SY-VLINE,
109 'Demand',
129 SY-VLINE,
130 'Previous',
151 SY-VLINE,
152 'Cons-',
160 SY-VLINE,
161 'Deff',
168 SY-VLINE,
169 'Conn',
182 SY-VLINE,
183 'Sold',
201 SY-VLINE,
202 'Demand',
222 SY-VLINE,
223 'Previous',
244 SY-VLINE.
WRITE :/1 SY-VLINE,
6 SY-VLINE,
50 SY-VLINE,
51 'Code',
58 SY-VLINE,
59 'umers',
67 SY-VLINE,
68 'mtrs',
75 SY-VLINE,
76 'Load-KW',
89 SY-VLINE,
90 'Units',
108 SY-VLINE,
129 SY-VLINE,
130 'Arrear',
151 SY-VLINE,
152 'umers',
160 SY-VLINE,
161 'mtrs',
168 SY-VLINE,
169 'Load-KW',
182 SY-VLINE,
183 'Units',
201 SY-VLINE,
222 SY-VLINE,
223 'Arrear',
244 SY-VLINE.
WRITE :/1(244) SY-ULINE.
SET LEFT SCROLL-BOUNDARY COLUMN 59.
* Start of Data Selection
START-OF-SELECTION.
SELECT GSBER GTEXT INTO TABLE GT_TGSBT FROM TGSBT
WHERE SPRAS = SY-LANGU.
SELECT IND_SECTOR TEXTLONG INTO TABLE GT_TB024
FROM TB024 WHERE SPRAS = SY-LANGU
AND ( ( IND_SECTOR >= '01' AND IND_SECTOR <= '55' )
OR ( IND_SECTOR = '57' OR IND_SECTOR = '58'
OR IND_SECTOR = '94' ) ).
SELECT SINGLE KTX INTO GV_MNTH_NAME FROM T247
WHERE MNR = P_BMNTH+5(2) AND SPRAS = SY-LANGU.
***master data selection
PERFORM CONSUMER_DATA_SELECTION.
*&--Get Meter Status Connected Load & MF for each installation
PERFORM OPERAND_DATA_SELECTION.
*&--Get the Demand corresponding to each Print documents selected
PERFORM BILLING_DATA_SELECTION.
*&--Get the arrears corresponding to each Print document selected
PERFORM ARREAR_DATA_SELECTION.
*&--To include Mannual R-15 into computerized R-15.
IF P_INCLUD = 'X'.
OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET P_FILE INTO GWA_MANUAL_DATA.
IF SY-SUBRC <> 0.
EXIT.
ELSE.
APPEND GWA_MANUAL_DATA TO GT_MANUAL_DATA.
ENDIF.
ENDDO.
CLOSE DATASET P_FILE.
DELETE DATASET P_FILE.
ENDIF.
END-OF-SELECTION.
* End of data Selection
* Start of Data Processing
PERFORM FINAL_TABLE_PREPARE.
PERFORM FINAL_OUTPUT_PREPARE.
PERFORM FINAL_OUTPUT_DISPLAY.
* End of Data Processing
PERFORM FREE_MEMORY.
*& Form master_data_selection
* text
* --> p1 text
* <-- p2 text
FORM CONSUMER_DATA_SELECTION .
DATA: LV_MAX_DAYS TYPE I,
LV_LAST_DAY(2) TYPE C,
LV_IMONTH TYPE I,
LV_IYEAR TYPE I,
LV_BMNTH TYPE ZERDK_ERCHC-V_ABRMENGE,
LV_BYEAR TYPE ZERDK_ERCHC-EZ_ABRMENGE,
*&----Temporary tables for global internal tables.
LT_DBERCHZ1_TEMP LIKE TABLE OF GWA_DBERCHZ1,
LWA_DBERCHZ1_TEMP LIKE GWA_DBERCHZ1,
LT_ERCH LIKE TABLE OF GWA_ERCH,
LWA_ERCH LIKE GWA_ERCH,
LT_EVER LIKE TABLE OF GWA_EVER.
*DATA: lt_ever_fkkvkp like gwa_ever_eanlh_fkkvkp occurs 0.
LV_IMONTH = P_BMNTH+5(2).
LV_IYEAR = P_BMNTH(4).
LV_BMNTH = P_BMNTH+5(2).
LV_BYEAR = P_BMNTH(4).
CALL FUNCTION 'RTP_US_API_MAX_DAYS_IN_MONTH'
EXPORTING
I_DATE_MONTH = LV_IMONTH
I_DATE_YEAR = LV_IYEAR
IMPORTING
E_MAX_DAYS = LV_MAX_DAYS.
LV_LAST_DAY = LV_MAX_DAYS.
CONCATENATE P_BMNTH(4) P_BMNTH+5(2) LV_LAST_DAY INTO GV_HIGHDATE.
IF SO_GPART[] IS INITIAL.
SELECT VKONTO ANLAGE ABRSPERR
INTO TABLE GT_EVER
FROM EVER
WHERE GSBER IN SO_GSBER
AND COKEY IN SO_COKEY
AND BUKRS = 'CSEB'
AND SPARTE = '01'
AND KOFIZ = '02'.
**get installation no from contract data and check biling class in eanlh
IF GT_EVER[] IS INITIAL.
MESSAGE 'No Business Partner exist for entered selection data' TYPE 'A'.
ENDIF.
IF NOT GT_EVER[] IS INITIAL.
SELECT VKONT KTOKL INTO TABLE GT_FKKVKP
FROM FKKVKP
FOR ALL ENTRIES IN GT_EVER
WHERE VKONT = GT_EVER-VKONT
AND GPART IN SO_GPART.
IF GT_FKKVKP[] IS INITIAL.
MESSAGE 'No Business Partner exist for entered Selection' TYPE 'A'.
ENDIF.
ENDIF.
ELSE.
SELECT VKONT KTOKL INTO TABLE GT_FKKVKP
FROM FKKVKP
WHERE GPART IN SO_GPART.
IF NOT GT_FKKVKP[] IS INITIAL.
SELECT VKONTO ANLAGE INTO TABLE GT_EVER
FROM EVER
FOR ALL ENTRIES IN GT_FKKVKP
WHERE VKONTO EQ GT_FKKVKP-VKONT
AND GSBER IN SO_GSBER
AND COKEY IN SO_COKEY
AND BUKRS EQ 'CSEB'
AND SPARTE EQ '01'
AND KOFIZ EQ '02'.
ENDIF.
ENDIF.
IF GT_EVER[] IS INITIAL AND GT_FKKVKP[] IS INITIAL.
MESSAGE 'No Business Partner exist for entered Selection' TYPE 'A'.
ENDIF.
SELECT ANLAGE BRANCHE INTO TABLE GT_EANLH
FROM EANLH
FOR ALL ENTRIES IN GT_EVER
WHERE ANLAGE EQ GT_EVER-ANLAGE
AND ABLEINH IN SO_MRU
AND AKLASSE EQ'0002'
AND AB <= GV_HIGHDATE
AND BIS => GV_HIGHDATE.
IF GT_EANLH[] IS INITIAL.
MESSAGE 'No Business Partner exist for entered Selection' TYPE 'A'.
ENDIF.
SORT : GT_EVER BY VKONT ANLAGE,
GT_FKKVKP BY VKONT,
GT_EANLH BY ANLAGE.
LOOP AT GT_EANLH INTO GWA_EANLH.
READ TABLE GT_EVER INTO GWA_EVER WITH KEY ANLAGE = GWA_EANLH-ANLAGE.
IF SY-SUBRC = 0.
READ TABLE GT_FKKVKP INTO GWA_FKKVKP
WITH KEY VKONT = GWA_EVER-VKONT.
IF SY-SUBRC = 0.
GWA_EVER_EANLH_FKKVKP-VKONT = GWA_EVER-VKONT.
GWA_EVER_EANLH_FKKVKP-ANLAGE = GWA_EVER-ANLAGE.
GWA_EVER_EANLH_FKKVKP-ABRSPERR = GWA_EVER-ABRSPERR.
GWA_EVER_EANLH_FKKVKP-BRANCHE = GWA_EANLH-BRANCHE.
GWA_EVER_EANLH_FKKVKP-KTOKL = GWA_FKKVKP-KTOKL.
APPEND GWA_EVER_EANLH_FKKVKP TO GT_EVER_EANLH_FKKVKP.
CLEAR GWA_EVER_EANLH_FKKVKP.
ENDIF.
ENDIF.
ENDLOOP.
IF GT_EVER_EANLH_FKKVKP[] IS INITIAL.
MESSAGE 'No Business Partner exist for Selection Data' TYPE 'A'.
ENDIF.
*&----get all the billdocuments for the busines partner's contract
*&----account
SELECT BELNR VKONT INTO TABLE GT_ERCH
FROM ERCH
FOR ALL ENTRIES IN GT_EVER_EANLH_FKKVKP
WHERE VKONT EQ GT_EVER_EANLH_FKKVKP-VKONT.
*&----get the BILL MONTH & BILL YEAR FOR THE BILLDOCUMENTS.
IF NOT GT_ERCH[] IS INITIAL.
SELECT BELNR EIN01 V_ABRMENGE INTO TABLE GT_DBERCHZ1
FROM DBERCHZ1
FOR ALL ENTRIES IN GT_ERCH
WHERE BELNR EQ GT_ERCH-BELNR
AND AKLASSE = '0002'
AND ( ( EIN01 = 'BILL_MNTH1'
AND V_ABRMENGE = P_BMNTH+5(2) )
OR ( EIN01 = 'BILL_YEAR1'
AND V_ABRMENGE = P_BMNTH(4) ) ).
*&---- GET THOSE BILL DOCUMENTS WHICH ARE FOR THE ENTERED BILL MONTH
IF NOT GT_DBERCHZ1[] IS INITIAL.
LOOP AT GT_DBERCHZ1 INTO GWA_DBERCHZ1 WHERE EIN01 = 'BILL_MNTH1'
AND V_ABRMENGE = P_BMNTH+5(2).
READ TABLE GT_DBERCHZ1 INTO LWA_DBERCHZ1_TEMP
WITH KEY BELNR = GWA_DBERCHZ1-BELNR EIN01 = 'BILL_YEAR1'
V_ABRMENGE = P_BMNTH(4).
IF SY-SUBRC = 0.
APPEND LWA_DBERCHZ1_TEMP TO LT_DBERCHZ1_TEMP.
CLEAR: LWA_DBERCHZ1_TEMP.
ENDIF.
ENDLOOP.
GT_DBERCHZ1[] = LT_DBERCHZ1_TEMP[].
ENDIF.
ENDIF.
*&---NOW FIND THE PRINT DOCUMENTS FOR THE SELECTED BILLDOCUMENTS.
IF NOT GT_DBERCHZ1[] IS INITIAL.
SELECT BELNR OPBEL BUDAT FROM ERCHC
INTO TABLE GT_ERCHC
FOR ALL ENTRIES IN GT_DBERCHZ1
WHERE BELNR = GT_DBERCHZ1-BELNR
AND INTOPBEL EQ SPACE
AND SIMULATED EQ SPACE
AND INVOICED EQ 'X'.
ENDIF.
IF NOT GT_ERCHC[] IS INITIAL.
LOOP AT GT_ERCHC INTO GWA_ERCHC.
READ TABLE GT_ERCH INTO GWA_ERCH WITH KEY BELNR = GWA_ERCHC-BELNR.
IF SY-SUBRC = 0.
APPEND GWA_ERCH TO LT_ERCH.
CLEAR GWA_ERCH.
ENDIF.
CLEAR GWA_ERCHC.
ENDLOOP.
ENDIF.
GT_ERCH[] = LT_ERCH[].
FREE: LT_ERCH, LT_DBERCHZ1_TEMP,LWA_DBERCHZ1_TEMP.
LOOP AT GT_EVER_EANLH_FKKVKP INTO GWA_EVER_EANLH_FKKVKP.
* READ TABLE gt_erdk_erchc INTO gwa_erdk_erchc
* WITH KEY vkont = gwa_ever_eanlh_fkkvkp-vkont.
READ TABLE GT_ERCH INTO GWA_ERCH
WITH KEY VKONT = GWA_EVER_EANLH_FKKVKP-VKONT.
IF SY-SUBRC <> 0.
IF GWA_EVER_EANLH_FKKVKP-ABRSPERR = SPACE.
GWA_EVER_EANLH_FKKVKP-ABRSPERR = '01'.
MODIFY GT_EVER_EANLH_FKKVKP FROM GWA_EVER_EANLH_FKKVKP
TRANSPORTING ABRSPERR.
APPEND GWA_EVER_EANLH_FKKVKP TO GT_EVER_EANLH_FKKVKP_INACT.
ENDIF.
ELSE.
IF GWA_EVER_EANLH_FKKVKP-ABRSPERR <> SPACE.
GWA_EVER_EANLH_FKKVKP-ABRSPERR = SPACE.
MODIFY GT_EVER_EANLH_FKKVKP FROM GWA_EVER_EANLH_FKKVKP
TRANSPORTING ABRSPERR.
ENDIF.
ENDIF.
CLEAR GWA_ERCH.
ENDLOOP.
REFRESH GT_TECOKT[].
IF NOT SO_COKEY[] IS INITIAL.
SELECT COKEY LTEXT INTO TABLE GT_TECOKT
FROM TECOKT
WHERE COKEY IN SO_COKEY
AND SPRAS = SY-LANGU .
* %_HINTS ORACLE '("TECOKT","TECOKT~1")'.
ENDIF.
IF NOT SO_MRU[] IS INITIAL.
SELECT TERMSCHL TERMTEXT INTO TABLE GT_TE422
FROM TE422
WHERE TERMSCHL IN SO_MRU.
ENDIF.
*FREE lt_ever_fkkvkp[].
ENDFORM. " consumer_data_selection
*& Form Operand_data_selection
* text
* --> p1 text
* <-- p2 text
FORM OPERAND_DATA_SELECTION .
DATA: LT_EVER_EANLH_FKKVKP_ACT LIKE TABLE OF GWA_EVER_EANLH_FKKVKP.
* SORT gt_ever_eanlh_fkkvkp BY vkont.
CHECK NOT GT_EVER_EANLH_FKKVKP[] IS INITIAL.
**now depending upon the billing month check the time slice date
**the last date of the billing month or the range of billing month
*should fall in between the time slice of the installation
** billing month to is space
**now select operands for processed installation
LT_EVER_EANLH_FKKVKP_ACT[] = GT_EVER_EANLH_FKKVKP[].
DELETE LT_EVER_EANLH_FKKVKP_ACT WHERE ABRSPERR NE SPACE.
IF NOT LT_EVER_EANLH_FKKVKP_ACT[] IS INITIAL.
SELECT ANLAGE OPERAND WERT1
FROM ETTIFN
INTO TABLE GT_ETTIFN
FOR ALL ENTRIES IN LT_EVER_EANLH_FKKVKP_ACT
WHERE ANLAGE = LT_EVER_EANLH_FKKVKP_ACT-ANLAGE
AND OPERAND IN ('MTR_STS','CONN_LOAD','LOAD_CODE','KWH_MF')
AND ( AB <= GV_HIGHDATE AND BIS >= GV_HIGHDATE ).
* %_HINTS ORACLE '("ETTIFN","ETTIFN~003")'.
ENDIF.
ENDFORM. " Operand_data_selection
*& Form billing_data_selection
*&------------------------------Hi,
Please do run time analysis as Rob correctly mentioned or do SQL trace(ST05) to find where the program is consuming more time.
Lanka -
Poor query performance in WebI on top of BEx queries
Hello,
We are using Web Inteliigence i BO 3.1 (SP0) to report on BEx queries (BW 7.0).
We experience however that reporting is much quicker for the same set of data when using BEx Analyzer than when using WebI. In BEx it is acceptable, but in WebI it's not.
How can we optimize the performance in this scenario? What tricks are there?
The amount of data is not huge (max 500 000 records in the cube)
BR,
FredrikHi,
Dennis is right. But if you need to upgrade (and you do) than maybe going to the latest SP is better. It is SP4. With SP3 the WebI Option "Query Striping" has been introduced which brings Performance as well.
Also check
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0bf4691-cdce-2d10-45ba-d1ff39408eb4
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/109b7d63-7cab-2d10-2fbc-be5c61dcf110
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/006b1374-8f91-2d10-fe9c-f9fa12e2f595
Regards
-Seb. -
Performance problems loading an XML file into oracle database
Hello ODI Guru's,
I am trying to load and XML file into the database after doing simple business validations. But the interface takes hours to complete.
1. The XML files are large in size >200 Mb. We have an XSD file for the schema definition instead of a DTD.
2. We used the external database feature for loading these files in database.
The following configuration was used in the XML Data Server:
jdbc:snps:xml?f=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xml&d=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xsd&re=initialLoad&s=CM&db_props=oracle&ro=true
3. Now we reverse engineer the XML files and created models using ODI Designer
4. Similar thing was done for the target i.e. an Oracle database table as well.
5. Next we created a simple interface with one-to-one mapping from the XSD schema to the Oracle database table and executed the interface. This execution takes more than one hour to complete.
6. We are running ODI client on Windows XP Professional SP2.
7. The Oracle database server(Oracle 10g 10.2.0.3) for the target schema as well as the ODI master and work repositories are on the same machine.
8. I tried changing the following properties but it is not making much visible difference:
use_prepared_statements=Y
use_batch_update=Y
batch_update_size=510
commit_periodically=Y
num_inserts_before_commit=30000
I have another problem that when I set batch_update_size to value greater that 510 I get the following error:
java.sql.SQLException: class org.xml.sax.SAXException
class java.lang.ArrayIndexOutOfBoundsException said -32413
at com.sunopsis.jdbc.driver.xml.v.a(v.java)
The main concern is why should the interface taking so long to execute.
Please send suggestions to resolve the problem.
Thanks in advance,
Best Regards,
NikunjApproximately how many rows are you trying to insert?
One of the techniques which I found improved performance for this scenario was to extract from the xml to a flat file, then to use SQL*LOADER or external tables to load the data into Oracle. -
XML Payload Response Syn scenario not comming
Hi all,
I am working in a SOAP-->JDBC syncronous scenario. I am doing an INSERT into a JDBC data base. I am able to do the insert, but I can not map de response message from data base. I get a Mapping error. I guess that this error is due to my definition of the data type of the JDBC response.
I've gone to SXM_MONI but I can not see the payload of the JDBC response.
I have tried with JDBC channel I can not see the xml message.
Does anybody knows what can be happening???
Many thanks.Yes I am using Best Effort
My error is
- <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_CREACION_MENSAJES_WHATSAPP_TO_J~</SAP:P1>
<SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2>
<SAP:P3>on: Cannot create target element /ns0:MT_CREACION_</SAP:P3>
<SAP:P4>MENSAJES_WHATSAPP_RES/MENSAJES. Values missing in~</SAP:P4>
<SAP:AdditionalText />
<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_CREACION_MENSAJES_WHATSAPP_TO_J~; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:MT_CREACION_MENSAJES_WHATSAPP_RES/MENSAJES. Values missing in~</SAP:Stack>
<SAP:Retry>N</SAP:Retry>
</SAP:Error>
I think my DT is not according to the data JDBC is sending me, but i can not validate because I dont see at SXMB_MONI -
Performance issue when opening DOCX Word Doc with Excel Links
Is this a bug or is there a config setting that can prevent Word from needlessly opening Excel repeatedly (upon initial open of a DOCX Word doc) when pre-existing links should NOT be updated. The behavior is good using 2003 formats (DOC & XLS),
but varies significantly (~100:1 range in performance) depending on the test scenario (see below) using DOCX with XLSX.
We can't move our environment to the new XML formats until we can find a fix. We were led to believe Microsoft knew this to be a bug in Office 2007, but it has NOT been corrected in Office 2010. Omitting a detailed explanation for why we need to
do this, here's our test scenarios:
-Currently testing Office 2010 Pro Trial version on WIN XP SP3. (We have found similar results using Office 2007 with Win7 or XP).
-Word Option Deselected/DISABLED: "Update Automatic Links at Open"
-The Word Doc contains 100 linked Excel tables and is 130K in size (DOCX).
-Each link points to the same 10x10 cell range in one Excel Workbook located in same directory as the Word Doc, although other tests using separate directories produced similar results.
-The Excel Links were inserted into Word via Paste Special/Paste Link/MS Excel Worksheet Object.
-The workbook (XLSX) is 15K in size.
-All Links are set for "Manual" update, our testing showed no difference if links are set to "Auto".
-Again, Word is set to NOT update Automatic links when the document is opened.
-Results shown below are for local hard drive test.
-Network response times are slightly greater on 100mb LAN
-Word is completely restarted prior to each test to make sure there's no application caching involved.
LOCAL DRIVE RESPONSE TIMES TO OPEN THE WORD DOC in Docx format:
1. Open the Word Doc from Word with Excel closed - 175 seconds (Excel appears to be opened and closed once per link)
2. Open the Word Doc from Word with Excel open & workbook closed - 33 seconds (Excel appears to be accessed once per link)
3. Open the Word Doc from Word with the linked workbook already open - 7 seconds (Excel appears to be accessed once per link)
4. Rename Excel XLSX workbook so that Word can't find it. Then open Doc the from Word. 1-2 seconds (Excel does not appear to be invoked)
5. Repeat ALL of the above scenarios 1-4 using DOC and XLS files. These files are created with "Save AS" option based on original test files and then re-pasting the links. 1-2 seconds to open the Word Doc (Excel does not appear to be invoked)
Summary
Using DOCX/XLSX, if Word can't find the linked spreadsheet it gives up and performs nicely during file-open. Otherwise, Word performs needless, time-consuming access to Excel, and in the worst case, opens and closes Excel repeatedly in the background.
Testing with DOC/XLS formats gives good performance across all scenarios.It is a known bug and one for which AFAIK, there has been no fix. The only way that I could get around it in a particular application was to do something like save the linked information as document variables and then on opening the document recreate
all the information. My memory on exactly what I did is a bit hazy, but I can go back and check if you are interested.
-- Hope this helps.
Doug Robbins - Word MVP,
dkr[atsymbol]mvps[dot]org
Posted via the Community Bridge
"galmcrantz" wrote in message news:[email protected]...
Is this a bug or is there a config setting that can prevent Word from needlessly opening Excel repeatedly (upon initial open of a DOCX Word doc) when pre-existing links should NOT be updated. The behavior is good using 2003 formats (DOC & XLS), but varies
significantly (~100:1 range in performance) depending on the test scenario (see below) using DOCX with XLSX.
We can't move our environment to the new XML formats until we can find a fix. We were led to believe Microsoft knew this to be a bug in Office 2007, but it has NOT been corrected in Office 2010. Omitting a detailed explanation for why we need to do this,
here's our test scenarios:
-Currently testing Office 2010 Pro Trial version on WIN XP SP3. (We have found similar results using Office 2007 with Win7 or XP).
-Word Option Deselected/DISABLED: "Update Automatic Links at Open"
-The Word Doc contains 100 linked Excel tables and is 130K in size (DOCX).
-Each link points to the same 10x10 cell range in one Excel Workbook located in same directory as the Word Doc, although other tests using separate directories produced similar results.
-The Excel Links were inserted into Word via Paste Special/Paste Link/MS Excel Worksheet Object.
-The workbook (XLSX) is 15K in size.
-All Links are set for "Manual" update, our testing showed no difference if links are set to "Auto".
-Again, Word is set to NOT update Automatic links when the document is opened.
-Results shown below are for local hard drive test.
-Network response times are slightly greater on 100mb LAN
-Word is completely restarted prior to each test to make sure there's no application caching involved.
LOCAL DRIVE RESPONSE TIMES TO OPEN THE WORD DOC in Docx format:
1. Open the Word Doc from Word with Excel closed - 175 seconds (Excel appears to be opened and closed once per link)
2. Open the Word Doc from Word with Excel open & workbook closed - 33 seconds (Excel appears to be accessed once per link)
3. Open the Word Doc from Word with the linked workbook already open - 7 seconds (Excel appears to be accessed once per link)
4. Rename Excel XLSX workbook so that Word can't find it. Then open Doc the from Word. 1-2 seconds (Excel does not appear to be invoked)
5. Repeat ALL of the above scenarios 1-4 using DOC and XLS files. These files are created with "Save AS" option based on original test files and then re-pasting the links. 1-2 seconds to open the Word Doc (Excel does not appear to be invoked)
Summary
Using DOCX/XLSX, if Word can't find the linked spreadsheet it gives up and performs nicely during file-open. Otherwise, Word performs needless, time-consuming access to Excel, and in the worst case, opens and closes Excel repeatedly in the background.
Testing with DOC/XLS formats gives good performance across all scenarios.
Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org -
HOW TO TEST SOAP SENDER TO FILE SCENARIO
Hi gurus,
I have designed and configured SOAP to file scenario.
I have used http://xyz namespace in design time.
I have created two business systems for this sceanrio.
I have downloaded and installed soap client on my system.
When I open this soap client it is asking
1)URL
2)load request from
3)In the editor request tab what should i give.
4)wht is the response tab here
I want to send data to XI from SOAP and then to file.
Please help how to give data and how to get the data format to give in the requst editor?
Points will B rewarded
Regards
SreeniHi,
You can use a SOAP client like Altova XML spy for posting a message to XI.
The best way to do this is to use the generated wsdl for creating a soap request.
once the wsdl file is picked up by the soap client, it automatically generates the url.
now the response which comes back to the soap client is usually a http status code of successful post. (since u r performing an async scenario)
also ensure u use the j2ee port while genrating the wsdl using the "Create Webservice" option in Int Directory.
Also chk the link for the weblog on sender soap scenario.
/people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
Hope this helps.
Award points if found helpful
Cheers!!
Sidharth -
ABAP proxy to HTTP sycnchronous scenario.
Hi All,
I have an ABAP proxy to HTTP syncronous scenario in which the proxy through PI makes an HTTP request to a third party to download a PDF.Once the PDF is sucessfully downloaded we need to send an acknowledgement to ECC system that the download was sucessful and also place the PFD file in an FTP server as well.
Looking forward for any possible ways that the above scenario could be achived in once interface.We are open to use ccBPM to achive this.
Thanks in advance.
Best Regards,
Bhanu.Hi Bhanu,
if this is a sync request to a HTTP receiver (to initiate with the request a PDF upload) you will expect to get a response back to the Proxy sender.
So following the described implementation the response will provide the information about un/successfull PDF load
from the http receiver (so this partner has to provide a response in a sync connect!!!).
If you need the PDF to be moved back to a location near to the proxy sender additionally to the response message the receiver of the proxy trigger has to return both in the sync response but the proxy is not able to receive an attachment.
And... as I know HTTP adapter does not allow to handle attachment. This is only possible with SOAP !
So in such a case the PDF needs to be provided with another adapter (which would allow to use a sync connect Proxy-> HTTP and another one async from the PDF loader via file adapter (file -> file). So this will not require a BPM too!
a) Proxy-> PI -> HTTP (sync)
b) FTP -> PI -> FTP (async)
Result: No BPM required!
Regards
Dirk -
How application module helps for performance improve
Hi Everyone,
I have a sample web-application in which I am connecting with single AM instance (AM for database view object), retrieving some information and then close the connection. I am doing this as,
// making AM instance
<application module instance> = Configuration.createRootApplicationModule(<AM name>, config);
// performing operations
<operation result> = <application module instance>.<access VO with any operation>();
System.out.println("Get result here");
// disconnecting AM instance
<application module instance>.getDBTransaction().disconnect();
Configuration.releaseRootApplicationModule(<application module instance>, true);
These are the activities which are performed by a single user. Now, I am doing stress test on same activities. I am testing the same code with 300 concurrent users (using JMeter with JSP URL). These are working fine. Also I checked multiple times, it always working fine.
Now, I need to do something through which I can improve the performance. I know, I can use AM pool configurations to make this more effective. I have gone through the Oracle documents and checked the same test case with default or recommended pool configurations and I found similar kind of results (there is not much difference).
On other hand, I tried with 'releaseRootApplicationModule' method with false parameter and found better results in default as well as recommended pool configurations.
My question is, is the change of pool configurations recommended by Oracle really work? or do I need to concentrate more on coding part with default pool configurations?
Here, I would like to know, what are the best practice (in code as well as pool configurations), I need to follow if I really want to improve the performance in real scenarios (when our application will access with large no. of concurrent users).
I really look forward some help from experts. I have given a lot of time on this to know how really we can make our application more effective in terms of performance.
I really appreciate for your reply.
Regards,
Dilip Gupta.>
We added the createRootApplicationModule() API (in the oracle.jbo.client.Configuration class) to simplify acquiring an application module from the pool for brief programmatic manipulation before it is released back to the AM pool.
Steve Muench.
>
check [url http://radio-weblogs.com/0118231/2009/08/20.html#a959]Check Your App for Misuse of Configuration.createRootApplicationModule()
Edited by: Mohammad Jabr on May 10, 2012 7:14 AM
Maybe you are looking for
-
Error while reversing Material Invoice document.
when i am trying to Reverse the Material Invoice receipt in MIRO I am getting the following error "Balance not zero: 757.86- debits: 21,171.86 credits: 20,414.00" Message no. M8534 The actual situation is : The total Invoice amount is Rs 20414 Mate
-
I have an IPhone 3g and I am also using Office Business & home and outlook. When I hook up the Iphone to ITunes I see a total of 6 calendars. I use to use Entourage and it is there as is Ical. I want to delete all of the 6 calendars and then load Out
-
Panorama does it need to be turned on or is it a add on not visiable on my computer
I just updated to beta 4 and it was talking about Panorama but it is not showing on the screen and I could not find it in the options or the add ons so I was wondering how it is set up?
-
Shorten environment variable path
I am installing Oracle database 10G on Windows XP. I am getting an error message saying 'The value of the environment variable path is more than 1023 characters.' How do I shorten this path, where do I go? thanks
-
Sleeping Clients - WLC 7.6
We are running 7.6 on our 5508-WLC. We have a number of issues w/ 'i-clients' when they go asleep. From what I can tell, I need to enable the 'sleeping clients' feature (not just the session and idle timeouts). On our WLANs we use Layer-2 (WPA+WPA2