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: 

Clears GL Account..

former_member188829
Active Contributor
0 Kudos

Hi,

Our Client have Open items in a particular GL account. Every month end he will get the statement from the Bank. By seeing the Bank statement end user manually clears the above GL account by using T code F-04 (Post with clearing).

Now they want to avoid manul entry. Do we have any method which will support my requirement.

Continuous to this thread..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

hope this will help you.

Reward if help.

REPORT zfi_gl_fss0

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_gl OCCURS 0,

saknr(010), " GL Account

bukrs(004), " Company Code

waers(005), " Currency

xsalh(001), " BAl Local Curr Ind

mwskz(002), " Tax Category

  • xopvw(001), " Open Item Ind

  • xkres(001), " Line Item Ind

zuawa(003), " Sort Key

fstag(004), " Field Category

END OF i_gl.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X', " Flag

c_tax VALUE '0'. " Tax Category

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_gl

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Upload the Data from Internal Table

LOOP AT i_gl.

  • Initial Screen

PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'

'2001'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ACC_CRE'.

PERFORM bdc_field USING 'BDC_CURSOR'

'GLACCOUNT_SCREEN_KEY-SAKNR'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'

i_gl-saknr.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-BUKRS'

i_gl-bukrs.

perform bdc_dynpro using

'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=TAB02'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'

i_gl-WAERS.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XSALH'

i_gl-XSALH.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'

i_gl-MWSKZ.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-ZUAWA'.

  • perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'

  • i_gl-XOPVW.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'

c_x."i_gl-XKRES.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'

i_gl-ZUAWA.

perform bdc_dynpro using

'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-FSTAG'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'

i_gl-FSTAG.

  • Call The Transaction

PERFORM bdc_transaction USING 'FSS0'.

ENDLOOP.

  • Close the BDC Session

PERFORM close_group.

2 REPLIES 2

Former Member
0 Kudos

Hi

hope this will help you.

Reward if help.

REPORT zfi_gl_fss0

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_gl OCCURS 0,

saknr(010), " GL Account

bukrs(004), " Company Code

waers(005), " Currency

xsalh(001), " BAl Local Curr Ind

mwskz(002), " Tax Category

  • xopvw(001), " Open Item Ind

  • xkres(001), " Line Item Ind

zuawa(003), " Sort Key

fstag(004), " Field Category

END OF i_gl.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X', " Flag

c_tax VALUE '0'. " Tax Category

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_gl

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Upload the Data from Internal Table

LOOP AT i_gl.

  • Initial Screen

PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'

'2001'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ACC_CRE'.

PERFORM bdc_field USING 'BDC_CURSOR'

'GLACCOUNT_SCREEN_KEY-SAKNR'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'

i_gl-saknr.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-BUKRS'

i_gl-bukrs.

perform bdc_dynpro using

'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=TAB02'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'

i_gl-WAERS.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XSALH'

i_gl-XSALH.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'

i_gl-MWSKZ.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-ZUAWA'.

  • perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'

  • i_gl-XOPVW.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'

c_x."i_gl-XKRES.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'

i_gl-ZUAWA.

perform bdc_dynpro using

'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-FSTAG'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'

i_gl-FSTAG.

  • Call The Transaction

PERFORM bdc_transaction USING 'FSS0'.

ENDLOOP.

  • Close the BDC Session

PERFORM close_group.

former_member188829
Active Contributor
0 Kudos

Hi,

i did BDC for this Requirement.