Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC for FF67 not displaying the line itmes of second page

Former Member
0 Kudos
951

Hi all,

I am using the Z BDC report Manual Bank Statement Upload (FF67). The BDC is as mentioned below :

We are using start variant in the BDC.

The report is working fine but the issue is that suppose if their are 45 line items and on one page we can have only 30 line items . Then only 30 line items are been displayed . It is not taking the line items which have come on the second page. Please advsie . Below is the code of the BDC.

-


REPORT zfi_bank_recon.

TABLES : febko.

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA : i_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA : BEGIN OF itab OCCURS 0,

vgman TYPE febmka-vgman,

valut TYPE char10, "febep-valut,

kwbtr TYPE char17, "febmka-kwbtr,

chect_kf TYPE febmkk-chect_kf,

sgtxt_kf TYPE febmkk-sgtxt_kf,

count(6) TYPE n,

END OF itab.

DATA : BEGIN OF error OCCURS 0,

msg TYPE string,

END OF error.

DATA :flag,

update VALUE 'A',

mode VALUE 'N'.

DATA : aznum1 TYPE aznum,

lv_esbtr TYPE febko-esbtr,

lv_esvoz TYPE febko-esvoz,

lv_opening TYPE char17, "febmka-kwbtr,

lv_closing TYPE char17. "febmka-kwbtr.

&----


&

*& Selection screen

&----


&

SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text.

PARAMETERS : bukrs LIKE febmka-bukrs OBLIGATORY,

hbkid LIKE febmka-hbkid OBLIGATORY,

hktid LIKE febmka-hktid OBLIGATORY,

azdat LIKE febmka-azdat OBLIGATORY,

aznum LIKE febmka-aznum OBLIGATORY,

budtm LIKE febmka-budtm OBLIGATORY DEFAULT sy-datum.

SELECTION-SCREEN : END OF BLOCK blk.

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text1.

PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.

SELECTION-SCREEN : END OF BLOCK blk1.

AT SELECTION-SCREEN.

SELECT SINGLE * FROM febko INTO febko

WHERE bukrs = bukrs AND hbkid = hbkid AND

hktid = hktid AND aznum = aznum

  • AND budtm = budtm

AND azdat = azdat.

IF sy-subrc EQ 0.

MESSAGE e038(000) WITH 'Statement' aznum 'already uploaded; No further processing done'.

ENDIF.

  • At Selection Screen Event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = p_file.

*& Start of Selection

START-OF-SELECTION.

CLEAR : flag.

PERFORM data_upload.

PERFORM check_data.

IF itab[] IS NOT INITIAL AND flag IS INITIAL..

PERFORM open_group.

REFRESH bdcdata.

PERFORM bdcdata. " USING LV_OPENING LV_CLOSING.

PERFORM bdc_insert.

PERFORM close_group.

ENDIF.

*& Form check_data

FORM check_data.

LOOP AT itab.

DATA : int(6) TYPE n.

CLEAR : int.

int = sy-tabix.

IF itab-vgman IS INITIAL.

CONCATENATE 'Transaction type should not be blank : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-valut IS INITIAL.

CONCATENATE 'Value Date should not be blank : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-kwbtr IS INITIAL.

CONCATENATE 'Amount should not be blank : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-chect_kf IS INITIAL.

CONCATENATE 'Bank Reference should not be blank : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-vgman NE 'DLF1'

AND itab-vgman NE 'DLF2'.

CONCATENATE 'A Transaction type is not used : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-vgman EQ 'DLF1'

AND itab-kwbtr LE 0.

CONCATENATE 'As per Transaction type, the Amount should be Positive : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

IF itab-vgman EQ 'DLF2'

AND itab-kwbtr GE 0.

CONCATENATE 'As per Transaction type, the Amount should be Negative : Record no' int INTO error-msg SEPARATED BY space.

APPEND error.

CLEAR : error.

ENDIF.

ENDLOOP.

IF error[] IS NOT INITIAL.

WRITE : / 'Error found in upload file'.

SKIP 2 .

LOOP AT error.

WRITE : / error-msg.

ENDLOOP.

flag = 'X'.

ENDIF.

CLEAR : lv_esbtr, lv_esvoz, aznum1, lv_opening, lv_closing.

IF flag IS INITIAL.

SELECT MAX( DISTINCT aznum ) FROM febko INTO aznum1

WHERE bukrs = bukrs AND hbkid = hbkid AND hktid = hktid.

IF sy-subrc = 0.

SELECT SINGLE esbtr esvoz FROM febko INTO (lv_esbtr,lv_esvoz)

WHERE bukrs = bukrs AND hbkid = hbkid AND hktid = hktid AND aznum = aznum1 .

IF lv_esvoz = 'S'.

lv_opening = lv_esbtr * -1.

ELSE.

lv_opening = lv_esbtr.

ENDIF.

lv_closing = lv_opening.

ENDIF.

LOOP AT itab.

lv_closing = lv_closing + itab-kwbtr.

DATA : lv_count(6) TYPE n.

lv_count = lv_count + 1.

MOVE lv_count TO itab-count .

MODIFY itab FROM itab.

CLEAR : itab.

ENDLOOP.

ENDIF.

ENDFORM. "check_data

*& Form data_upload

FORM data_upload.

DATA: loc_filename TYPE string.

loc_filename = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = loc_filename

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. "data_upload

&----


*& Form bdcdata

FORM bdcdata. " USING lv_opening TYPE febko-ssbtr

" lv_closing TYPE febko-esbtr.

DATA : day(2),

month(2),

year(4),

date(10).

year = azdat+0(4).

month = azdat+4(2).

day = azdat+6(2).

CONCATENATE day month year INTO date.

CONDENSE : date.

          • Comment

PERFORM bdc_dynpro USING 'SAPMF40K' '0101'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/EVORG'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKA-AZDAT'.

PERFORM bdc_dynpro USING 'SAPMF40K' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKA-VARI_START'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTE'.

PERFORM bdc_field USING 'FEBMKA-KONT_INT'

'X'.

PERFORM bdc_field USING 'FEBMKA-FDIS_SEL'

'X'.

PERFORM bdc_field USING 'FEBMKA-VARI_START'

'Z0001'.

PERFORM bdc_field USING 'FEBMKA-DEBI_MID'

'D'.

PERFORM bdc_field USING 'FEBMKA-KRED_MID'

'K'.

PERFORM bdc_field USING 'FEBMKA-WVAR_ART'

'4'.

PERFORM bdc_field USING 'FEBMKA-BUCH_VAL'

'X'.

PERFORM bdc_dynpro USING 'SAPMF40K' '0101'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKA-ESALD'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'FEBMKA-BUKRS'

bukrs.

PERFORM bdc_field USING 'FEBMKA-HBKID'

hbkid.

PERFORM bdc_field USING 'FEBMKA-HKTID'

hktid.

PERFORM bdc_field USING 'FEBMKA-AZNUM'

aznum.

PERFORM bdc_field USING 'FEBMKA-AZDAT'

date.

PERFORM bdc_field USING 'FEBMKA-SSALD'

lv_opening.

PERFORM bdc_field USING 'FEBMKA-ESALD'

lv_closing.

PERFORM bdc_dynpro USING 'SAPMF40K' '8000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKK-SGTXT_KF(01)'.

SORT itab DESCENDING BY count.

LOOP AT itab.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SICH'.

PERFORM bdc_field USING 'FEBMKA-VGMAN(01)'

itab-vgman.

PERFORM bdc_field USING 'FEBEP-VALUT(01)'

itab-valut.

PERFORM bdc_field USING 'FEBMKA-KWBTR(01)'

itab-kwbtr.

PERFORM bdc_field USING 'FEBMKK-CHECT_KF(01)'

itab-chect_kf.

PERFORM bdc_field USING 'FEBMKK-SGTXT_KF(01)'

itab-sgtxt_kf.

PERFORM bdc_dynpro USING 'SAPMF40K' '8000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKK-SGTXT_KF(01)'.

ENDLOOP.

PERFORM bdc_dynpro USING 'SAPMF40K' '8000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKA-KWBTR(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SICH'.

PERFORM bdc_dynpro USING 'SAPMF40K' '0101'.

PERFORM bdc_field USING 'BDC_CURSOR'

'FEBMKA-BUKRS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0100'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=NO'.

ENDFORM. "bdcdata

&----


*& Form OPEN_GROUP

FORM open_group .

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = 'BANK_STAT'

user = sy-uname.

  • keep = 'X'.

ENDFORM. " OPEN_GROUP

*& Form CLOSE_GROUP

FORM close_group .

CALL FUNCTION 'BDC_CLOSE_GROUP'.

CALL TRANSACTION 'SM35'.

ENDFORM. " CLOSE_GROUP

*& Form bdc_insert

FORM bdc_insert.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'FF67'

TABLES

dynprotab = bdcdata.

ENDFORM. " bdc_insert

----


  • Start new screen *

----


FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. "BDC_DYNPRO

----


  • Insert field *

----


FORM bdc_field USING fnam fval.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDFORM. "BDC_FIELD

1 ACCEPTED SOLUTION

Former Member
0 Kudos
201

Hi,

Use:

If line item = 30.

OKCODE = 'P++'. --->For next page after every 30 line items.

endif.

Or:(Sumilate in BDC)

1 . New line. -


>Get the Fcode/Sy-ucomm value of New line(Icon on menu bar)

2.Enter Line Item.

Follow this after every line item.

Hope this resolves the issue.

Regards,

Gurpreet

5 REPLIES 5

Former Member
0 Kudos
202

Hi,

Use:

If line item = 30.

OKCODE = 'P++'. --->For next page after every 30 line items.

endif.

Or:(Sumilate in BDC)

1 . New line. -


>Get the Fcode/Sy-ucomm value of New line(Icon on menu bar)

2.Enter Line Item.

Follow this after every line item.

Hope this resolves the issue.

Regards,

Gurpreet

0 Kudos
201

Thanks Gurpreet.

Will check and let you know.

0 Kudos
201

Hi,

Is your problem solved ? Same problem faced by me.

Regards,

Kalpik Shah

Former Member
0 Kudos
201

Hi Mohit,

please say the recording that you have done for this code.I am doing the same functionality.can you please brief me the approach you have used.

Thanks & Regards,

Asha Latha Surapaneni,

SAP-ABAP

Former Member
0 Kudos
201

Hi Mohit Trivedi,

I have seenthat you have posted this question long back,but please help me in understanding the approach you have followed.

Thanks & regards,

Asha Latha Surapaneni.