Skip to Content

Fi zprogram to clear line items from FB05 and update FEBAN going to dump in Quality but ok in Dev.

Hi Abapers,

BDC zprogram to clear line items from FB05 and then update table FEBAN with the document number generated from FB05 working fine in dev but going to dump in quality. Tried in background also but still there is a session timeout. I am sharing my complete code. Please let me know where there is a performance issue in this program.

TABLES: T012K, BSIS, FEBEP, ZBDS_BANK, BSEG, FEBKO.

TYPES: BEGIN OF TY_T012K.
INCLUDE TYPE T012K.
TYPES: HKONT1 TYPE HKONT,
HKONT2 TYPE HKONT,
END OF TY_T012K.

TYPES: BEGIN OF TY_BSIS.
INCLUDE TYPE BSIS.
TYPES: ZUONR1 TYPE CHAR13,
END OF TY_BSIS.

DATA: LT_T012K TYPE STANDARD TABLE OF TY_T012K,
LW_T012K TYPE TY_T012K,
LT_BSIS1 TYPE STANDARD TABLE OF TY_BSIS,
LT_BSIS2 TYPE STANDARD TABLE OF TY_BSIS,
LW_BSIS1 TYPE TY_BSIS,
LW_BSIS2 TYPE TY_BSIS,
LT_FEBEP1 TYPE STANDARD TABLE OF FEBEP,
LT_FEBEP2 TYPE STANDARD TABLE OF FEBEP,
LW_FEBEP1 TYPE FEBEP,
LW_FEBEP2 TYPE FEBEP.

TYPES: BEGIN OF TY_FINAL,
KUKEY TYPE KUKEY_EB, " Short key (surrogate)
ESNUM TYPE ESNUM_EB, " Memo record number (line item number in bank statement)
BUDAT TYPE BUDAT, " Document Date
BLDAT TYPE BLDAT, " Posting Date
AZDAT TYPE AZDAT_EB, " Statement Date
BLART TYPE BLART, " Document type
MONAT TYPE MONAT, " Period
BUKRS TYPE BUKRS, " Company Code
WAERS TYPE WAERS, " Currency
BSCHL TYPE BSCHL, " Posting Key
WRBTR TYPE CHAR13, " Amount
ZUONR TYPE DZUONR, " Assignment Number
SGTXT TYPE SGTXT, " Item Text
HKONT TYPE HKONT, " GL Account
HKONT1 TYPE HKONT, " GL Account + 1
HKONT2 TYPE HKONT, " GL Account + 2
KOART TYPE KOART, " Account Type
BELNR TYPE BELNR_D, " Accounting Document Number
EPERL TYPE EPERL_EB, " Line Item Completed
VB1OK TYPE VB1OK_EB, " Update 1 OK
GSBER TYPE GSBEI_EB, " Business area to which an account is assigned
GJAHR TYPE GJAHR, " Financial Year
HTEXT TYPE CHAR13, " Header Text
RTEXT TYPE CHAR16, " Reference Text
RKTXT TYPE CHAR20, " Reference Key
END OF TY_FINAL.

DATA: LT_FINAL TYPE STANDARD TABLE OF TY_FINAL,
LW_FINAL TYPE TY_FINAL.

DATA: LT_ZBDS_BANK TYPE STANDARD TABLE OF ZBDS_BANK,
LW_ZBDS_BANK TYPE ZBDS_BANK,
LT_FEBKO TYPE STANDARD TABLE OF FEBKO,
LW_FEBKO TYPE FEBKO.

****************************BDC Declarations***************************************
DATA: BEGIN OF BDCDATA OCCURS 1.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.

******** Errors in BDC
DATA BEGIN OF IT_ERR1 OCCURS 1.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA END OF IT_ERR1.

DATA: W_MODE TYPE C.
DATA: LV_BLDAT TYPE CHAR10.
DATA: LV_BUDAT TYPE CHAR10.
DATA: LV_PDATE TYPE CHAR10.
****************************BDC Declarations***************************************

PARAMETERS: P_HBKID TYPE HBKID OBLIGATORY,
P_BUKRS TYPE BUKRS OBLIGATORY,
P_GJAHR TYPE GJAHR.
PARAMETERS: N_MODE AS CHECKBOX DEFAULT 'X'.
PARAMETERS: A_MODE AS CHECKBOX.

SELECT * FROM T012K
INTO TABLE LT_T012K
WHERE BUKRS = P_BUKRS
AND HBKID = P_HBKID.

SELECT * FROM ZBDS_BANK
INTO TABLE LT_ZBDS_BANK
WHERE BUKRS = P_BUKRS
AND HBKID = P_HBKID.

SELECT * FROM FEBKO
INTO TABLE LT_FEBKO
WHERE BUKRS = P_BUKRS
AND HBKID = P_HBKID.

LOOP AT LT_T012K INTO LW_T012K.
LW_T012K-HKONT1 = LW_T012K-HKONT + 1.
LW_T012K-HKONT2 = LW_T012K-HKONT + 2.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = LW_T012K-HKONT1
IMPORTING
OUTPUT = LW_T012K-HKONT1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = LW_T012K-HKONT2
IMPORTING
OUTPUT = LW_T012K-HKONT2.

MODIFY LT_T012K FROM LW_T012K.
ENDLOOP.

IF NOT LT_T012K IS INITIAL.

SELECT * FROM BSIS
INTO TABLE LT_BSIS1
FOR ALL ENTRIES IN LT_T012K
WHERE HKONT = LT_T012K-HKONT1
AND BSCHL = '40'
AND SHKZG = 'S'.

SELECT * FROM BSIS
INTO TABLE LT_BSIS2
FOR ALL ENTRIES IN LT_T012K
WHERE HKONT = LT_T012K-HKONT2
AND BSCHL = '50'
AND SHKZG = 'H'.

ENDIF.

DELETE LT_BSIS1 WHERE ZUONR = ''.
DELETE LT_BSIS2 WHERE ZUONR = ''.

IF NOT LT_BSIS1 IS INITIAL.

LOOP AT LT_BSIS1 INTO LW_BSIS1.
LW_BSIS1-ZUONR1 = LW_BSIS1-ZUONR.
MODIFY LT_BSIS1 FROM LW_BSIS1.
ENDLOOP.

SELECT * FROM FEBEP
INTO TABLE LT_FEBEP1
FOR ALL ENTRIES IN LT_BSIS1
WHERE CHECT = LT_BSIS1-ZUONR1.

ENDIF.

IF NOT LT_BSIS2 IS INITIAL.

LOOP AT LT_BSIS2 INTO LW_BSIS2.
LW_BSIS2-ZUONR1 = LW_BSIS2-ZUONR.
MODIFY LT_BSIS2 FROM LW_BSIS2.
ENDLOOP.

SELECT * FROM FEBEP
INTO TABLE LT_FEBEP2
FOR ALL ENTRIES IN LT_BSIS2
WHERE CHECT = LT_BSIS2-ZUONR1.

ENDIF.

LOOP AT LT_FEBEP1 INTO LW_FEBEP1.

CLEAR: LW_BSIS1.
SORT LT_BSIS1 BY ZUONR1.

READ TABLE LT_BSIS1 INTO LW_BSIS1 WITH KEY ZUONR1 = LW_FEBEP1-ZUONR BINARY SEARCH.

IF SY-SUBRC = 0.
IF ( LW_BSIS1-ZUONR = LW_FEBEP1-ZUONR AND LW_BSIS1-WRBTR = LW_FEBEP1-KWBTR ).

CLEAR: LW_T012K.
SORT LT_T012K BY HKONT1.
READ TABLE LT_T012K INTO LW_T012K WITH KEY HKONT1 = LW_BSIS1-HKONT BINARY SEARCH.
IF SY-SUBRC = 0.
LW_FINAL-HKONT = LW_T012K-HKONT.
ENDIF.

CLEAR: LW_ZBDS_BANK.
SORT LT_ZBDS_BANK BY BUKRS HBKID.
READ TABLE LT_ZBDS_BANK INTO LW_ZBDS_BANK WITH KEY BUKRS = P_BUKRS HBKID = P_HBKID BINARY SEARCH.
IF SY-SUBRC = 0.
LW_FINAL-GSBER = LW_ZBDS_BANK-GSBER_KF.
ENDIF.

CLEAR: LW_FEBKO.
SORT LT_FEBKO BY BUKRS HBKID.
READ TABLE LT_FEBKO INTO LW_FEBKO WITH KEY BUKRS = P_BUKRS HBKID = P_HBKID BINARY SEARCH .
IF SY-SUBRC = 0.
LW_FINAL-AZDAT = LW_FEBKO-AZDAT.
CONCATENATE LW_FEBKO-HBKID LW_FEBKO-HKTID '`' LW_FEBKO-AZIDT+2(7) INTO LW_FINAL-RTEXT.
REPLACE '`' WITH ' ' INTO LW_FINAL-RTEXT.
ENDIF.

LW_FINAL-EPERL = 'X'.
LW_FINAL-VB1OK = 'X'.
LW_FINAL-KOART = 'S'.
LW_FINAL-BUDAT = LW_BSIS1-BUDAT.
LW_FINAL-BLDAT = LW_BSIS1-BLDAT.
LW_FINAL-BLART = LW_BSIS1-BLART.
LW_FINAL-MONAT = LW_BSIS1-MONAT.
LW_FINAL-BUKRS = LW_BSIS1-BUKRS.
LW_FINAL-WAERS = LW_BSIS1-WAERS.
LW_FINAL-BSCHL = LW_BSIS1-BSCHL.
LW_FINAL-WRBTR = LW_BSIS1-WRBTR.
LW_FINAL-ZUONR = LW_BSIS1-ZUONR.
LW_FINAL-SGTXT = LW_BSIS1-SGTXT.
LW_FINAL-HKONT1 = LW_BSIS1-HKONT.
LW_FINAL-GJAHR = LW_BSIS1-GJAHR.
LW_FINAL-KUKEY = LW_FEBEP1-KUKEY.
LW_FINAL-ESNUM = LW_FEBEP1-ESNUM.
CONCATENATE LW_BSIS1-XBLNR LW_BSIS1-BUKRS LW_BSIS1-GJAHR INTO LW_FINAL-RKTXT.
CONCATENATE LW_FEBEP1-KUKEY LW_FEBEP1-ESNUM INTO LW_FINAL-HTEXT.
ENDIF.
ENDIF.
APPEND LW_FINAL TO LT_FINAL.
CLEAR LW_FINAL.

ENDLOOP.

LOOP AT LT_FEBEP2 INTO LW_FEBEP2.

CLEAR: LW_BSIS2.
SORT LT_BSIS2 BY ZUONR.
READ TABLE LT_BSIS2 INTO LW_BSIS2 WITH KEY ZUONR1 = LW_FEBEP2-ZUONR BINARY SEARCH.
IF SY-SUBRC = 0.
IF ( LW_BSIS2-ZUONR = LW_FEBEP2-ZUONR AND LW_BSIS2-WRBTR = LW_FEBEP2-KWBTR ).
CLEAR: LW_T012K.
SORT LT_T012K BY HKONT2.
READ TABLE LT_T012K INTO LW_T012K WITH KEY HKONT2 = LW_BSIS2-HKONT BINARY SEARCH.
IF SY-SUBRC = 0.
LW_FINAL-HKONT = LW_T012K-HKONT.
ENDIF.

CLEAR: LW_ZBDS_BANK.
SORT LT_ZBDS_BANK BY BUKRS HBKID.
READ TABLE LT_ZBDS_BANK INTO LW_ZBDS_BANK WITH KEY BUKRS = P_BUKRS HBKID = P_HBKID BINARY SEARCH.
IF SY-SUBRC = 0.
LW_FINAL-GSBER = LW_ZBDS_BANK-GSBER_KF.
ENDIF.

CLEAR: LW_FEBKO.
SORT LT_FEBKO BY BUKRS HBKID.
READ TABLE LT_FEBKO INTO LW_FEBKO WITH KEY BUKRS = P_BUKRS HBKID = P_HBKID BINARY SEARCH.
IF SY-SUBRC = 0.
LW_FINAL-AZDAT = LW_FEBKO-AZDAT.
CONCATENATE LW_FEBKO-HBKID LW_FEBKO-HKTID '`' LW_FEBKO-AZIDT+2(7) INTO LW_FINAL-RTEXT.
REPLACE '`' WITH ' ' INTO LW_FINAL-RTEXT.
ENDIF.

LW_FINAL-EPERL = 'X'.
LW_FINAL-VB1OK = 'X'.
LW_FINAL-KOART = 'S'.
LW_FINAL-BUDAT = LW_BSIS2-BUDAT.
LW_FINAL-BLDAT = LW_BSIS2-BLDAT.
LW_FINAL-BLART = LW_BSIS2-BLART.
LW_FINAL-MONAT = LW_BSIS2-MONAT.
LW_FINAL-BUKRS = LW_BSIS2-BUKRS.
LW_FINAL-WAERS = LW_BSIS2-WAERS.
LW_FINAL-BSCHL = LW_BSIS2-BSCHL.
LW_FINAL-WRBTR = LW_BSIS2-WRBTR.
LW_FINAL-ZUONR = LW_BSIS2-ZUONR.
LW_FINAL-SGTXT = LW_BSIS2-SGTXT.
LW_FINAL-HKONT2 = LW_BSIS2-HKONT.
LW_FINAL-GJAHR = LW_BSIS2-GJAHR.
LW_FINAL-KUKEY = LW_FEBEP2-KUKEY.
LW_FINAL-ESNUM = LW_FEBEP2-ESNUM.
CONCATENATE LW_BSIS2-XBLNR LW_BSIS2-BUKRS LW_BSIS2-GJAHR INTO LW_FINAL-RKTXT.
CONCATENATE LW_FEBEP2-KUKEY LW_FEBEP2-ESNUM INTO LW_FINAL-HTEXT.
ENDIF.
ENDIF.
APPEND LW_FINAL TO LT_FINAL.
CLEAR LW_FINAL.

ENDLOOP.

DELETE LT_FINAL WHERE WRBTR = 0.

*************************** BDC *********************************


LOOP AT LT_FINAL INTO LW_FINAL.

CLEAR: BDCDATA.
REFRESH: BDCDATA.

PERFORM BDC_DYNPRO USING 'SAPMF05A' '0122'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
CLEAR: LV_BLDAT.
CONCATENATE LW_FINAL-BLDAT+6(2) '.' LW_FINAL-BLDAT+4(2) '.' LW_FINAL-BLDAT+0(4) INTO LV_BLDAT.
PERFORM BDC_FIELD USING 'BKPF-BLDAT'
LV_BLDAT. "record-BLDAT_001.
PERFORM BDC_FIELD USING 'BKPF-BLART'
'ZR'. "record-BLART_002.
PERFORM BDC_FIELD USING 'BKPF-BUKRS'
LW_FINAL-BUKRS. "record-BUKRS_003.
CLEAR: LV_BLDAT.
CONCATENATE LW_FINAL-BUDAT+6(2) '.' LW_FINAL-BUDAT+4(2) '.' LW_FINAL-BUDAT+0(4) INTO LV_BUDAT.
PERFORM BDC_FIELD USING 'BKPF-BUDAT'
LV_BUDAT. "record-BUDAT_004.
PERFORM BDC_FIELD USING 'BKPF-MONAT'
LW_FINAL-MONAT. "record-MONAT_005.
PERFORM BDC_FIELD USING 'BKPF-WAERS'
LW_FINAL-WAERS. "record-WAERS_006.
PERFORM BDC_FIELD USING 'BKPF-XBLNR'
LW_FINAL-RTEXT. "'15128OPR 16001'.
PERFORM BDC_FIELD USING 'BKPF-BKTXT'
LW_FINAL-HTEXT. "'N1000MU116-465711434'.
PERFORM BDC_FIELD USING 'BKPF-AWTYP'
'BKPF'.
PERFORM BDC_FIELD USING 'BKPF-AWKEY'
LW_FINAL-RKTXT. "'1111'.
PERFORM BDC_FIELD USING 'FS006-DOCID'
'*'.
PERFORM BDC_FIELD USING 'RF05A-NEWBS'
LW_FINAL-BSCHL. "record-NEWBS_010.
PERFORM BDC_FIELD USING 'RF05A-NEWKO'
LW_FINAL-HKONT. "record-NEWKO_011.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'BSEG-SGTXT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SL'.
PERFORM BDC_FIELD USING 'BSEG-WRBTR'
LW_FINAL-WRBTR. "record-WRBTR_012.
CLEAR: LV_PDATE.
CONCATENATE SY-DATUM+6(2) '.' SY-DATUM+4(2) '.' SY-DATUM+0(4) INTO LV_PDATE.
PERFORM BDC_FIELD USING 'BSEG-VALUT'
LV_PDATE. "record-VALUT_013.
PERFORM BDC_FIELD USING 'BSEG-ZUONR'
LW_FINAL-ZUONR. "record-ZUONR_014.
PERFORM BDC_FIELD USING 'BSEG-SGTXT'
LW_FINAL-SGTXT. "record-SGTXT_015.
PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
LW_FINAL-GSBER. "'COBL-GSBER'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTE'.
PERFORM BDC_FIELD USING 'COBL-GSBER'
LW_FINAL-GSBER. "'1000'.
PERFORM BDC_FIELD USING 'COBL-FIPEX'
'NONBUDGET'.
PERFORM BDC_FIELD USING 'COBL-FIPOS'
'NONBUDGET'.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0710'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
LW_FINAL-BUKRS. "'RF05A-XPOS1(16)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PA'.
PERFORM BDC_FIELD USING 'RF05A-AGBUK'
LW_FINAL-BUKRS. "record-AGBUK_019.
IF LW_FINAL-BSCHL = '40'.
PERFORM BDC_FIELD USING 'RF05A-AGKON'
LW_FINAL-HKONT1. "record-AGKON_020.
ELSEIF LW_FINAL-BSCHL = '50'.
PERFORM BDC_FIELD USING 'RF05A-AGKON'
LW_FINAL-HKONT2. "record-AGKON_020.
ENDIF.
PERFORM BDC_FIELD USING 'RF05A-AGKOA'
'S'. "record-AGKOA_021.
PERFORM BDC_FIELD USING 'RF05A-XNOPS'
'X'.
PERFORM BDC_FIELD USING 'RF05A-XPOS1(01)'
''.
PERFORM BDC_FIELD USING 'RF05A-XPOS1(16)'
'X'.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0731'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
LW_FINAL-ZUONR. "'RF05A-SEL01(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PA'.
PERFORM BDC_FIELD USING 'RF05A-SEL01(01)'
LW_FINAL-ZUONR. "record-SEL01_01_025.
PERFORM BDC_DYNPRO USING 'SAPDF05X' '3100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF05A-ABPOS'.
PERFORM BDC_FIELD USING 'RF05A-ABPOS'
'1'. "record-ABPOS_026.
IF N_MODE = 'X'.
CALL TRANSACTION 'FB05' USING BDCDATA
MODE 'N' UPDATE 'S'
MESSAGES INTO IT_ERR1.
ELSEIF A_MODE = 'X'.
CALL TRANSACTION 'FB05' USING BDCDATA
MODE 'A' UPDATE 'S'
MESSAGES INTO IT_ERR1.

ENDIF.

ENDLOOP.

LOOP AT IT_ERR1.
WRITE:/ IT_ERR1-TCODE, IT_ERR1-MSGTYP, IT_ERR1-MSGV1, IT_ERR1-FLDNAME .
CLEAR IT_ERR1.
ENDLOOP.

PERFORM UPDATE_FEBEP.


*&---------------------------------------------------------------------*
*& Form bdc_dynpro
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0019 text
* -->P_0020 text
*----------------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM
DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "bdc_dynpro
*&---------------------------------------------------------------------*
*& Form bdc_field
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0024 text
* -->P_0025 text
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM
FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM. "bdc_field
*&---------------------------------------------------------------------*
*& Form UPDATE_FEBEP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM UPDATE_FEBEP .

DATA: LT_BSEG TYPE STANDARD TABLE OF BSEG,
LW_BSEG TYPE BSEG,
LV_BELNR TYPE BELNR_D.

DATA: LT_FEBEP_TEMP TYPE STANDARD TABLE OF FEBEP,
LW_FEBEP_TEMP TYPE FEBEP.

LOOP AT LT_FINAL INTO LW_FINAL.

SELECT SINGLE * INTO LW_BSEG
FROM BSEG
WHERE ZUONR = LW_FINAL-ZUONR.

IF SY-SUBRC = 0.
LW_FINAL-BELNR = LW_BSEG-BELNR.
MODIFY LT_FINAL FROM LW_FINAL.
CLEAR: LW_FINAL.
ENDIF.

ENDLOOP.

CLEAR: LW_FINAL.
LOOP AT LT_FINAL INTO LW_FINAL.
LW_FEBEP_TEMP-KUKEY = LW_FINAL-KUKEY.
LW_FEBEP_TEMP-ESNUM = LW_FINAL-ESNUM.
LW_FEBEP_TEMP-BELNR = LW_FINAL-BELNR.
LW_FEBEP_TEMP-GJAHR = LW_FINAL-GJAHR.
LW_FEBEP_TEMP-EPERL = LW_FINAL-EPERL.
LW_FEBEP_TEMP-VB1OK = LW_FINAL-VB1OK.
LW_FEBEP_TEMP-ZUONR = LW_FINAL-ZUONR.
APPEND LW_FEBEP_TEMP TO LT_FEBEP_TEMP.
CLEAR: LW_FEBEP_TEMP.
ENDLOOP.

CLEAR: LW_FEBEP_TEMP.
LOOP AT LT_FEBEP_TEMP INTO LW_FEBEP_TEMP.
UPDATE FEBEP SET EPERL = 'X'
VB1OK = 'X'
BELNR = LW_FEBEP_TEMP-BELNR
GJAHR = LW_FEBEP_TEMP-GJAHR
WHERE KUKEY = LW_FEBEP_TEMP-KUKEY
AND ESNUM = LW_FEBEP_TEMP-ESNUM.
COMMIT WORK.
ENDLOOP.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 10, 2017 at 12:24 PM

    You get a timeout, so you must now find the step which duration cause the problem, use SAT or ST05 for this. (Also BSEG is a cluster table so perform some search on FI index tables)

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

    • Use one of the secondary index for not-cleared items : BSIS for a G/L account BSIK/BSID for vendor/customer, Also add the company code and account/customer/vendor number in your SELECT.

      Also when you answer, create a comment, else I dont get any notification...

      Regards,
      Raymond

  • Jan 10, 2017 at 02:15 PM

    hi raymond,

    I know bseg is a cluster table and has lot of issues on performance. I want to know is there any other fi table from where i can select belnr after FB05 process wrt zuonr. Please let me know. I think the select statement on bseg inside the loop is causing all the issues.

    Add comment
    10|10000 characters needed characters exceeded