Application Development and Automation 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: 
Read only

regarding errors in BDC

Former Member
0 Likes
1,672

Hi Experts,

I would like to know which type of errors will occur while uploading the data using session and call transaction methods.And how to handle the errors?

7 REPLIES 7
Read only

Former Member
0 Likes
1,238

u can assign an internal table with structure of <b>BDCMSGCOLL</b>

it solve u r problem

when u look in to the structure u get whole information about that one

Rewards if it helps u

Vijay Pawar

Read only

Former Member
0 Likes
1,238

Hi!

The typical errors:

- during uploading: the file is opened by another application - this can be controlled, by checking the value of SY-SUBRC, after the GUI_UPLOAD method

- during the BDC run: during a modification, the modified entry can be modifyed by another user and this prevents it from updating

I suggest to use BDC instead of call transaction. It's a bit slower, but all errors can be handled in SM35 transaction.

Regards

Tamá

Read only

Former Member
0 Likes
1,238

Hi Surya,

<b>Error handling in Session Method</b>

If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.

<b>Error Handling in CALL TRANSACTION</b>

When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:

Steps for the error handling in CALL TRANSACTION

1. Internal table for the data (structure similar to your local file)

2. BDCTAB like BDCDATA

3. Internal table BDCMSG like BDCMSGCOLL

4. Internal table similar to Ist internal table

(Third and fourth steps are for error handling)

5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)

6. Loop at itab.

Populate BDCTAB table.

Call transaction <tr.code> using <Bdctab>

Mode <A/N/E>

Update <S/A>

Messages <BDCMSG>.

Perform check.

Refresh BDCTAB.

Endloop.

7 Form check.

IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).

Call function Format_message.

(This function is called to store the message given by system and to display it along with record)

Append itab2.

Display the record and message

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
1,238

Hi,

If you use Session Method, you can see the errors in SM35 session.

If you use call Transaction method. Errors have to be Programmatically handled.

Declare internal Table with structure BDCMSGCOLL..

DATA: BEGIN OF MESSTAB OCCURS 0.

INCLUDE STRUCTURE BDCMSGCOLL.

DATA: END OF MESSTAB.

CALL TRANSACTION 'F-02'

USING BDCDATA

MODE 'N'

UPDATE 'S'

MESSAGES INTO MESSTAB.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

  • ID = SY-MSGID

  • LANG = '-D'

NO = SY-MSGNO

V1 = SY-MSGV1

V2 = SY-MSGV2

V3 = SY-MSGV3

V4 = SY-MSGV4

IMPORTING

MSG = V_MSG

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

LOOP AT MESSTAB.

IF P_RESULT = 'E'.

  • if messtab-msgtyp = 'E'.

CONCATENATE MESSTAB-MSGTYP':' V_MSG INTO V_MSG.

WRITE : / V_MSG.

SKIP.

CLEAR : V_MSG.

  • endif.

ELSEIF P_RESULT = 'S'.

  • if messtab-msgtyp = 'S'.

CONCATENATE MESSTAB-MSGTYP':' V_MSG INTO V_MSG.

WRITE : / V_MSG.

SKIP.

CLEAR : V_MSG.

ENDIF.

  • endif.

ENDLOOP.

Reward if useful.

Thanks,

USR

Read only

Former Member
0 Likes
1,238

Hi Surya,

go through this info.

hi,

this will be usefull to u

Steps for submitting data for Batch Processing

1. Analyze the transactions for which a BDC program.

The user has to determine the sequence of screens in the transactions and the information about all the fields in every screen. To do this the user must run the transaction .

Then select System ? Status. This will give the screen number and the module pool associated with this screen of the transaction. These two are the most important fields that the user would need in order to write the BDC program.

2. Use transaction SE38 to write the BDC program. This ABAP/4 program should reads the external data that is to be entered in the SAP System and stores the data in a "batch-input session." A session stores the actions that are required to enter data using normal SAP transactions. This is done by basically using three functions:

BDC_OPEN_GROUP

BDC_INSERT

BDC_CLOSE_GROUP.

3. To create a batch input session, use the function BDC_OPEN_GROUP. This function has the following 5 parameters :

a. CLIENT which is by default set to SY_MANDT. It is the client in which the session is to be processed.

b. GROUP which is the name of the BDC session. This parameter is important because it is with this name that the user will recognize the BDC session in the batch input queue. Using this name process the BDC session.

c. USER which is usually set to SY-UNAME. It is the user name for starting the session in background.

d. KEEP indicates whether the session should be kept or deleted after processing. If ‘ ‘ then the session is deleted. If ‘X’ then the session is retained even after it is successfully processed without any errors.

e. HOLDDATE Lock date. The session is locked and may not be processed until after the date that is specified. Default: No lock date, session can be processed immediately. A lock date is optional.

4. Populate the bdcdata table .

The user may define the table as follows:

DATA: BEGIN OF BDCDATA OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF BDCDATA.

This bdcdata structure has the following fields:

• PROGRAM

Name of the program.

• DYNPRO

Number of the screen. Set this field only in the first record for the screen.

• DYNBEGIN

Indicates the first record for the screen. Set this field to X only in the first record for the screen. (Reset to ' ' (blank) for all other records.)

• FNAM

Name of a field in the screen. The FNAM field is not case-sensitive.

• FVAL

Value for the field named in FNAM.

5. The next step is to submit the BDC session. Use the BDC_INSERT function module to add a transaction to a batch input session. Specify the transaction that is to be started in the call to BDC_INSERT.

BDC_INSERT takes the following parameters:

• TCODE

The code of the transaction that is to be run. TCODE is an EXPORTING parameter in the function module.

• DYNPROTAB

The BDCDATA structure that contains the data that is to be processed by the transaction. DYNPROTAB is a tables parameter in the function module.

6. The final step is to close the BDC session. Use the BDC_CLOSE_GROUP function module to close a session. Once a session is closed, it can be processed.

7. Running this program will create a batch input session by the name that is specified in the GROUP parameter in the BDC_CREATE_GROUP function call.

8. Transaction SM35 can be used to process the submitted session. This transaction can be used to check the status of all BDC sessions.

2.2. Summary: Creating Batch Input Session:

• Open Batch Input group

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = GROUP

USER = USER

KEEP = KEEP.

• Fill in the Data for Transaction in an internal table 'BDCDATA'

FORM INSERT_SCREEN USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

FORM INSERT_FIELD USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM.

• Insert Transacton

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'ME21'

TABLES

DYNPROTAB = BDCDATA.

• Close Batch Input group

CALL FUNCTION 'BDC_CLOSE_GROUP'.

Finally to process Batch Input Session, first execute the BDC ABAP. This will create

a BDC session. Run transaction 'SM35' & processes the BDC session.

Some useful URLs

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

http://www.sap-img.com/abap/learning-bdc-programming.htm

http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm

The difference between CallTransaction and Sessionmethod.

In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling. It can also be used for real-time interfaces and custom error handling & logging features. Whereas in

Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.

difference between batch input and call transaction in BDC

Session method.

1) synchronous processing.

2) can tranfer large amount of data.

3) processing is slower.

4) error log is created

5) data is not updated until session is processed.

Call transaction.

1) asynchronous processing

2) can transfer small amount of data

3) processing is faster.

4) errors need to be handled explicitly

5) data is updated automatically

regards,

Read only

0 Likes
1,238

Thank u very much

I want the types of errors that occur while uploading the data,processing the data and uploading the data.

Read only

Former Member
0 Likes
1,238

Go through this program how to gownload the errors and again execute the program.

REPORT zra_gl_cr NO STANDARD PAGE HEADING LINE-SIZE 255.

TYPE-POOLS: truxs.

DATA: it_raw TYPE truxs_t_text_data.

DATA:messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA:messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF i_mess OCCURS 0,

l_mstring(480),

msgnr(5),

msgv1(15),

END OF i_mess.

DATA:i_mess1 LIKE i_mess OCCURS 0 WITH HEADER LINE.

DATA: l_mstring(480),l_mstring1(480).

DATA: BEGIN OF it_itab OCCURS 0,

saknr(10), "G/L a/c number.

bukrs(4), "Company Code.

ktoks(4), "G/L a/c group.

xplacct(1), "P&L statement account.

xbilk(1), "Balance sheet account.

txt20_ml(20), "G/L a/c short text.

txt50_ml(50), "G/L a/c long text.

waers(5), "Account currency.

MWSKZ(2),

mitkz(1), "Reconciliation a/c for a/c type.

xopvw(1), "Open item management

xkres(1), "Line item display.

zuawa(3), "Sort Key.

fstag(4), "Field status group.

xintb(1), "Post automatically only.

hbkid(5), "House bank.

hktid(5), "Account id.

vzskz(2), "Interest indicator

END OF it_itab.

DATA: hdate LIKE sy-datum.

************************************************************************

          • Selection Screen *****

************************************************************************

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 5(15) text-103. " FOR FIELD P_FILE1.

SELECTION-SCREEN POSITION 25.

PARAMETERS : p_file1 LIKE rlgrap-filename.

SELECTION-SCREEN END OF LINE.

************************************************************************

          • Initialization *****

************************************************************************

INITIALIZATION.

************************************************************************

          • At Selection Screen *****

************************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.

  • Perform file_selection will help to select the location of the file

PERFORM file_selection.

************************************************************************

          • Start-Of-Selection *****

************************************************************************

START-OF-SELECTION.

  • Perform data_upload will help to upload the data from the flat file

  • to the internal table.

PERFORM data_upload.

  • PERFORM open_group.

  • Peform bdc_upload will help to upload the data from the internal

  • table into its respective fields.

  • PERFORM bdc_fspo.

PERFORM bdc_upload.

PERFORM exp_log.

  • PERFORM close_group.

  • Perform display_log will prepare a log for the data that has been

  • uploaded

  • PERFORM display_log.

************************************************************************

        • End-Of-Selection ****

************************************************************************

END-OF-SELECTION.

&----


*& Form file_selection

&----


  • To select the location of the file

----


FORM file_selection .

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = ' '

def_path = 'C:\'

mask = ',.txt,.xls.'

mode = 'O'

title = 'Open a excel file'

IMPORTING

filename = p_file1

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

ENDFORM. " file_selection

&----


*& Form data_upload

&----


  • To upload the data from the file location to the internal table.

----


FORM data_upload .

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

  • I_FIELD_SEPERATOR =

i_line_header = 'X'

i_tab_raw_data = it_raw

i_filename = p_file1

TABLES

i_tab_converted_data = it_itab

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

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 bdc_upload

&----


  • To upload the data from the internal table into its respective fields.

----


FORM bdc_upload .

LOOP AT it_itab.

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'

it_itab-SAKNR.

perform bdc_field using 'GLACCOUNT_SCREEN_KEY-BUKRS'

it_itab-BUKRS.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=2102_GROUP'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-KTOKS'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-KTOKS.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'

it_itab-XPLACCT.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=2102_BS_PL'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-XBILK'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-KTOKS.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'

it_itab-XPLACCT.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'

it_itab-XBILK.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=ENTER'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-KTOKS.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'

it_itab-XBILK.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'

it_itab-TXT20_ML.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'

it_itab-TXT50_ML.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-BILKT'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'

it_itab-saknr.

PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=TAB02'.

PERFORM bdc_field USING 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-KTOKS'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-ktoks.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'

it_itab-txt20_ml.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'

it_itab-txt50_ml.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-BILKT'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'

it_itab-saknr.

****

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=TAB02'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-KTOKS'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-KTOKS.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-KTOKS'.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-KTOKS.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'

it_itab-XBILK.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'

it_itab-TXT20_ML.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'

it_itab-TXT50_ML.

perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'

it_itab-saknr.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=ENTER'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'

it_itab-waers.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'

it_itab-MWSKZ.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'

it_itab-mitkz.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-XOPVW'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'

it_itab-XOPVW.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'

it_itab-XKRES.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'

it_itab-ZUAWA.

*******************

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'

it_itab-xplacct.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'

it_itab-xbilk.

  • IF it_itab-xbilk = 'X'.

*

  • PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=TAB03'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'GLACCOUNT_SCREEN_CCODE-WAERS'.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-WAERS'

  • it_itab-waers.

*

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'

  • it_itab-xopvw.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'

  • it_itab-mitkz.

  • ENDIF.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XKRES'

  • it_itab-xkres.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'

  • it_itab-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'

  • it_itab-fstag.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XINTB'

  • it_itab-xintb.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HBKID'

  • it_itab-hbkid.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HKTID'

  • it_itab-hktid.

  • PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-VZSKZ'

  • it_itab-vzskz.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=TAB03'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-WAERS'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'

it_itab-WAERS.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'

it_itab-MWSKZ.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'

it_itab-MITKZ.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'

it_itab-ZUAWA.

perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

perform bdc_field using 'BDC_OKCODE'

'=ENTER'.

perform bdc_field using 'BDC_CURSOR'

'GLACCOUNT_SCREEN_CCODE-FSTAG'.

perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'

it_itab-FSTAG.

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'

it_itab-FSTAG.

  • PERFORM bdc_transaction USING 'FS00'.

CALL TRANSACTION 'FS00' USING bdcdata MODE 'A'

UPDATE 'S'

MESSAGES INTO messtab1.

PERFORM mess1.

REFRESH bdcdata[].

ENDLOOP.

ENDFORM. " bdc_upload

&----


*& Form bdc_fspo

&----


  • text

----


FORM bdc_fspo .

LOOP AT it_itab.

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'

it_itab-saknr.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-KTOPL'

'1000'.

PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=2102_GROUP'.

PERFORM bdc_field USING 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-KTOKS'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-ktoks.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'

it_itab-xplacct.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'

it_itab-xbilk.

PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SAVE'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'

it_itab-ktoks.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'

it_itab-xplacct.

PERFORM bdc_field USING 'BDC_CURSOR'

'GLACCOUNT_SCREEN_COA-TXT50_ML'.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'

it_itab-txt20_ml.

PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'

it_itab-txt50_ml.

*perform bdc_transaction using 'FSP0'.

CALL TRANSACTION 'FSP0' USING bdcdata MODE 'A'

UPDATE 'S'

MESSAGES INTO messtab.

PERFORM mess.

REFRESH bdcdata[].

ENDLOOP.

ENDFORM. " bdc_fspo

&----


*& Form mess

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM mess . "fsp0

LOOP AT messtab.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = messtab-msgid

lang = messtab-msgspra

no = messtab-msgnr

v1 = messtab-msgv1

v2 = messtab-msgv2

v3 = messtab-msgv3

v4 = messtab-msgv4

IMPORTING

msg = l_mstring

EXCEPTIONS

not_found = 1

OTHERS = 2.

CONDENSE l_mstring.

i_mess1-l_mstring = l_mstring(250).

i_mess1-msgnr = messtab1-msgnr.

i_mess1-msgv1 = messtab1-msgv1.

APPEND i_mess1.

ENDLOOP.

ENDFORM. " mess

&----


*& Form mess1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM mess1 . "fs00

LOOP AT messtab1.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = messtab1-msgid

lang = messtab1-msgspra

no = messtab1-msgnr

v1 = messtab1-msgv1

v2 = messtab1-msgv2

v3 = messtab1-msgv3

v4 = messtab1-msgv4

IMPORTING

msg = l_mstring1

EXCEPTIONS

not_found = 1

OTHERS = 2.

CONDENSE l_mstring1.

i_mess-l_mstring = l_mstring1(250).

i_mess-msgnr = messtab1-msgnr.

i_mess-msgv1 = messtab1-msgv1.

APPEND i_mess.

ENDLOOP.

ENDFORM. " mess1

&----


*& Form exp_log

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM exp_log .

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'c:\temp\error_fsp0.txt'

filetype = 'DAT'

TABLES

data_tab = i_mess1.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'c:\temp\error_fs00.txt'

filetype = 'DAT'

TABLES

data_tab = i_mess.

ENDFORM. " exp_log

&----


*& Form bdc_dynpro

&----


  • text

----


  • -->PROGRAM text

  • -->DYNPRO text

----


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

Rewords points,

Rgds,

P.Naganjana Reddy