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: 

hi guys please give me sample code for call transaction that handles error

Former Member
0 Kudos

hi guys, please give me sample code for call transaction that handles error,

please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.

please do help me as it is urgent.

thanks and regards.

prasadnn.

3 REPLIES 3

Former Member
0 Kudos

Hi Prasad,

Check this code.

Source Code for BDC using Call Transaction

*Code used to create BDC

&----


*& Report ZBDC_EXAMPLE *

*& *

&----


*& Example BDC program, which updates net price of item 00010 of a *

*& particular Purchase order(EBELN). *

*& *

&----


REPORT ZBDC_EXAMPLE NO STANDARD PAGE HEADING

LINE-SIZE 132.

*----


  • Data declaration

TABLES: ekko, ekpo.

TYPES: BEGIN OF t_ekko,

ebeln TYPE ekko-ebeln,

waers TYPE ekko-waers,

netpr TYPE ekpo-netpr,

err_msg(73) TYPE c,

END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

wa_ekko TYPE t_ekko,

it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

wa_error TYPE t_ekko,

it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,

wa_success TYPE t_ekko.

DATA: w_textout LIKE t100-text.

DATA: gd_update TYPE i,

gd_lines TYPE i.

*Used to store BDC data

DATA: BEGIN OF bdc_tab OCCURS 0.

INCLUDE STRUCTURE bdcdata.

DATA: END OF bdc_tab.

*Used to stores error information from CALL TRANSACTION Function Module

DATA: BEGIN OF messtab OCCURS 0.

INCLUDE STRUCTURE bdcmsgcoll.

DATA: END OF messtab.

*----


*Screen declaration

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME

TITLE text-001. "Purchase order Num

SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.

SELECTION-SCREEN END OF BLOCK block1.

SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME

TITLE text-002. "New NETPR value

PARAMETERS: p_newpr(14) TYPE c obligatory. "LIKE ekpo-netpr.

SELECTION-SCREEN END OF BLOCK block2.

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

*START-OF-SELECTION

START-OF-SELECTION.

  • Retrieve data from Purchase order table(EKKO)

SELECT ekkoebeln ekkowaers ekpo~netpr

INTO TABLE it_ekko

FROM ekko AS ekko INNER JOIN ekpo AS ekpo

ON ekpoebeln EQ ekkoebeln

WHERE ekko~ebeln IN so_ebeln AND

ekpo~ebelp EQ '10'.

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

*END-OF-SELECTION

END-OF-SELECTION.

  • Check data has been retrieved ready for processing

DESCRIBE TABLE it_ekko LINES gd_lines.

IF gd_lines LE 0.

  • Display message if no data has been retrieved

MESSAGE i003(zp) WITH 'No Records Found'(001).

LEAVE TO SCREEN 0.

ELSE.

  • Update Customer master data (instalment text)

LOOP AT it_ekko INTO wa_ekko.

PERFORM bdc_update.

ENDLOOP.

  • Display message confirming number of records updated

IF gd_update GT 1.

MESSAGE i003(zp) WITH gd_update 'Records updated'(002).

ELSE.

MESSAGE i003(zp) WITH gd_update 'Record updated'(003).

ENDIF.

  • Display Success Report

  • **********************

  • Check Success table

DESCRIBE TABLE it_success LINES gd_lines.

IF gd_lines GT 0.

  • Display result report column headings

PERFORM display_column_headings.

  • Display result report

PERFORM display_report.

ENDIF.

  • Display Error Report

  • ********************

  • Check errors table

DESCRIBE TABLE it_error LINES gd_lines.

  • If errors exist then display errors report

IF gd_lines GT 0.

  • Display errors report

PERFORM display_error_headings.

PERFORM display_error_report.

ENDIF.

ENDIF.

&----


*& Form DISPLAY_COLUMN_HEADINGS

&----


  • Display column headings

----


FORM display_column_headings.

WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.

SKIP.

WRITE:2 'The following records updated successfully:'(013).

WRITE:/ sy-uline(42).

FORMAT COLOR COL_HEADING.

WRITE:/ sy-vline,

(10) 'Purchase Order'(004), sy-vline,

(11) 'Old Netpr'(005), sy-vline,

(11) 'New Netpr'(006), sy-vline.

WRITE:/ sy-uline(42).

ENDFORM. " DISPLAY_COLUMN_HEADINGS

&----


*& Form BDC_UPDATE

&----


  • Populate BDC table and call transaction ME22

----


FORM bdc_update.

PERFORM dynpro USING:

'X' 'SAPMM06E' '0105',

' ' 'BDC_CURSOR' 'RM06E-BSTNR',

' ' 'RM06E-BSTNR' wa_ekko-ebeln,

' ' 'BDC_OKCODE' '/00', "OK code

'X' 'SAPMM06E' '0120',

' ' 'BDC_CURSOR' 'EKPO-NETPR(01)',

' ' 'EKPO-NETPR(01)' p_newpr,

' ' 'BDC_OKCODE' '=BU'. "OK code

  • Call transaction to update customer instalment text

CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'

MESSAGES INTO messtab.

  • Check if update was succesful

IF sy-subrc EQ 0.

ADD 1 TO gd_update.

APPEND wa_ekko TO it_success.

ELSE.

  • Retrieve error messages displayed during BDC update

LOOP AT messtab WHERE msgtyp = 'E'.

  • Builds actual message based on info returned from Call transaction

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

msgid = messtab-msgid

msgnr = messtab-msgnr

msgv1 = messtab-msgv1

msgv2 = messtab-msgv2

msgv3 = messtab-msgv3

msgv4 = messtab-msgv4

IMPORTING

message_text_output = w_textout.

ENDLOOP.

  • Build error table ready for output

wa_error = wa_ekko.

wa_error-err_msg = w_textout.

APPEND wa_error TO it_error.

CLEAR: wa_error.

ENDIF.

  • Clear bdc date table

CLEAR: bdc_tab.

REFRESH: bdc_tab.

ENDFORM. " BDC_UPDATE

----


  • FORM DYNPRO *

----


  • stores values to bdc table *

----


  • --> DYNBEGIN *

  • --> NAME *

  • --> VALUE *

----


FORM dynpro USING dynbegin name value.

IF dynbegin = 'X'.

CLEAR bdc_tab.

MOVE: name TO bdc_tab-program,

value TO bdc_tab-dynpro,

'X' TO bdc_tab-dynbegin.

APPEND bdc_tab.

ELSE.

CLEAR bdc_tab.

MOVE: name TO bdc_tab-fnam,

value TO bdc_tab-fval.

APPEND bdc_tab.

ENDIF.

ENDFORM. " DYNPRO

&----


*& Form DISPLAY_REPORT

&----


  • Display Report

----


FORM display_report.

FORMAT COLOR COL_NORMAL.

  • Loop at data table

LOOP AT it_success INTO wa_success.

WRITE:/ sy-vline,

(10) wa_success-ebeln, sy-vline,

(11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,

(11) p_newpr, sy-vline.

CLEAR: wa_success.

ENDLOOP.

WRITE:/ sy-uline(42).

REFRESH: it_success.

FORMAT COLOR COL_BACKGROUND.

ENDFORM. " DISPLAY_REPORT

&----


*& Form DISPLAY_ERROR_REPORT

&----


  • Display error report data

----


FORM display_error_report.

LOOP AT it_error INTO wa_error.

WRITE:/ sy-vline,

(10) wa_error-ebeln, sy-vline,

(11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,

(73) wa_error-err_msg, sy-vline.

ENDLOOP.

WRITE:/ sy-uline(104).

REFRESH: it_error.

ENDFORM. " DISPLAY_ERROR_REPORT

&----


*& Form DISPLAY_ERROR_HEADINGS

&----


  • Display error report headings

----


FORM display_error_headings.

SKIP.

WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.

SKIP.

WRITE:2 'The following records failed during update:'(008).

WRITE:/ sy-uline(104).

FORMAT COLOR COL_HEADING.

WRITE:/ sy-vline,

(10) 'Purchase Order'(009), sy-vline,

(11) 'Netpr'(010), sy-vline,

(73) 'Error Message'(012), sy-vline.

WRITE:/ sy-uline(104).

FORMAT COLOR COL_NORMAL.

ENDFORM. " DISPLAY_ERROR_HEADINGS

Hope this resolves your query.

Reward all the helpful answers.

Regards

Former Member
0 Kudos

Hi,

Check this code,

DATA : BEGIN OF it_dummy OCCURS 0,

dummy(100) TYPE c,

END OF it_dummy.

DATA : BEGIN OF it_xk01 OCCURS 0,

lifnr(10) TYPE c,

bukrs(4) TYPE c,

ekorg(4) TYPE c,

ktokk(4) TYPE c,

name1(30) TYPE c,

sortl(10) TYPE c,

land1(3) TYPE c,

spras(2) TYPE c,

akont(6) TYPE c,

fdgrv(2) TYPE c,

waers(3) TYPE c,

END OF it_xk01,

BEGIN OF it_bank OCCURS 0,

banks(3) TYPE c,

bankl(10) TYPE c,

bankn(10) TYPE c,

koinh(30) TYPE c,

lifnr(10) TYPE c,

END OF it_bank.

DATA : it_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,

it_bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

filename = 'C:\VENDOR.TXT'

filetype = 'ASC'

TABLES

data_tab = it_dummy.

LOOP AT it_dummy.

IF it_dummy-dummy+0(2) = '11'.

it_xk01-lifnr = it_dummy-dummy+2(10).

it_xk01-bukrs = it_dummy-dummy+12(4).

it_xk01-ekorg = it_dummy-dummy+16(4).

it_xk01-ktokk = it_dummy-dummy+20(4).

it_xk01-name1 = it_dummy-dummy+24(30).

it_xk01-sortl = it_dummy-dummy+54(10).

it_xk01-land1 = it_dummy-dummy+64(3).

it_xk01-spras = it_dummy-dummy+67(2).

it_xk01-akont = it_dummy-dummy+69(6).

it_xk01-fdgrv = it_dummy-dummy+75(2).

it_xk01-waers = it_dummy-dummy+77(3).

APPEND it_xk01.

ELSE.

it_bank-banks = it_dummy-dummy+2(3).

it_bank-bankl = it_dummy-dummy+5(10).

it_bank-bankn = it_dummy-dummy+15(10).

it_bank-koinh = it_dummy-dummy+25(30).

it_bank-lifnr = it_dummy-dummy+55(10).

APPEND it_bank.

ENDIF.

ENDLOOP.

LOOP AT it_xk01.

REFRESH it_bdcdata.

PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RF02K-REF_LIFNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RF02K-LIFNR'

it_xk01-lifnr.

PERFORM bdc_field USING 'RF02K-BUKRS'

it_xk01-bukrs.

PERFORM bdc_field USING 'RF02K-EKORG'

it_xk01-ekorg.

PERFORM bdc_field USING 'RF02K-KTOKK'

it_xk01-ktokk.

PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-TELX1'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'LFA1-NAME1'

it_xk01-name1.

PERFORM bdc_field USING 'LFA1-SORTL'

it_xk01-sortl.

PERFORM bdc_field USING 'LFA1-LAND1'

it_xk01-land1.

PERFORM bdc_field USING 'LFA1-SPRAS'

it_xk01-spras.

PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-KUNNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBK-KOINH(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

DATA : fnam(20) TYPE c,

idx TYPE c.

MOVE 1 TO idx.

LOOP AT it_bank WHERE lifnr = it_xk01-lifnr.

CONCATENATE 'LFBK-BANKS(' idx ')' INTO fnam.

PERFORM bdc_field USING fnam

it_bank-banks.

CONCATENATE 'LFBK-BANKL(' idx ')' INTO fnam.

PERFORM bdc_field USING fnam

it_bank-bankl.

CONCATENATE 'LFBK-BANKN(' idx ')' INTO fnam.

PERFORM bdc_field USING fnam

it_bank-bankn.

CONCATENATE 'LFBK-KOINH(' idx ')' INTO fnam.

PERFORM bdc_field USING fnam

it_bank-koinh.

idx = idx + 1.

ENDLOOP.

PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBK-BANKS(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB1-FDGRV'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'LFB1-AKONT'

it_xk01-akont.

PERFORM bdc_field USING 'LFB1-FDGRV'

it_xk01-fdgrv.

PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB1-ZTERM'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB5-MAHNA'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFM1-WAERS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'LFM1-WAERS'

it_xk01-waers.

PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.

PERFORM bdc_field USING 'BDC_CURSOR'

'WYT3-PARVW(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

CALL TRANSACTION 'XK01' USING it_bdcdata

MODE 'A'

UPDATE 'S'

MESSAGES INTO it_bdcmsgcoll.

ENDLOOP.

----


  • FORM BDC_DYNPRO *

----


  • ........ *

----


  • --> PROG *

  • --> SCR *

----


FORM bdc_dynpro USING prog scr.

CLEAR it_bdcdata.

it_bdcdata-program = prog.

it_bdcdata-dynpro = scr.

it_bdcdata-dynbegin = 'X'.

APPEND it_bdcdata.

ENDFORM.

----


  • FORM BDC_FIELD *

----


  • ........ *

----


  • --> FNAM *

  • --> FVAL *

----


FORM bdc_field USING fnam fval.

CLEAR it_bdcdata.

it_bdcdata-fnam = fnam.

it_bdcdata-fval = fval.

APPEND it_bdcdata.

ENDFORM.

-


Check the below links also

https://www.sappoint.com/abap/bdcconcept.pdf

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

https://www.sap-img.com/abap/question-about-bdc-program.htm

https://www.sapdevelopment.co.uk/bdc/bdchome.htm

https://www.planetsap.com/bdc_main_page.htm

Reward Points if Useful

KIShi.

Former Member
0 Kudos

hi,

you can handle errors using BDCMSGCOLL and FORMAT_MESSAGES.and even u can open session for unprocessed records.

after call transaction syntax if sy-subrc <> 0.

write session logic.In sm35 you can check error log

check below coding:

REPORT ZSR_CALL_SESSION .

TABLES : LFA1, RF02K.

DATA : BEGIN OF ITAB OCCURS 0 ,

LIFNR LIKE RF02K-LIFNR,

KTOKK LIKE RF02K-KTOKK,

NAME1 LIKE LFA1-NAME1,

SORTL LIKE LFA1-SORTL,

LAND1 LIKE LFA1-LAND1,

SPRAS LIKE LFA1-SPRAS,

END OF ITAB.

DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,

BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'c:\call.txt'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

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.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

  • DEST = FILLER8

GROUP = 'hmgroup'

HOLDDATE = SY-DATUM

KEEP = 'X'

USER = SY-UNAME

  • RECORD = FILLER1

  • PROG = SY-CPROG

  • IMPORTING

  • QID =

  • EXCEPTIONS

  • CLIENT_INVALID = 1

  • DESTINATION_INVALID = 2

  • GROUP_INVALID = 3

  • GROUP_IS_LOCKED = 4

  • HOLDDATE_INVALID = 5

  • INTERNAL_ERROR = 6

  • QUEUE_ERROR = 7

  • RUNNING = 8

  • SYSTEM_LOCK_ERROR = 9

  • USER_INVALID = 10

  • OTHERS = 11

.

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 ITAB.

REFRESH BDCTAB.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '100'.

PERFORM BDC_FIELD USING 'bdc_cursor' 'RF02K-ktokk'.

PERFORM BDC_FIELD USING 'bdc_okcode' '/00'.

PERFORM BDC_FIELD USING 'RF02K-LIFNR' ITAB-LIFNR.

PERFORM BDC_FIELD USING 'RF02K-ktokk' ITAB-KTOKK.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '110'.

PERFORM BDC_FIELD USING 'bdc_cursor' 'lfa1-spras'.

PERFORM BDC_FIELD USING 'bdc_okcode' '/00'.

PERFORM BDC_FIELD USING 'lfa1-name1' ITAB-NAME1.

PERFORM BDC_FIELD USING 'lfa1-sortl' ITAB-SORTL.

PERFORM BDC_FIELD USING 'lfa1-land1' ITAB-LAND1.

PERFORM BDC_FIELD USING 'lfa1-spras' ITAB-SPRAS.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '120'.

PERFORM BDC_FIELD USING 'bdc_cursor' 'lfa1-kunnr'.

PERFORM BDC_FIELD USING 'bdc_okcode' '/00'.

PERFORM BDC_DYNPRO USING 'SAPMF02K' '130'.

PERFORM BDC_FIELD USING 'bdc_cursor' 'lfbk-banks(01)'.

PERFORM BDC_FIELD USING 'bdc_okcode' '/00'.

PERFORM BDC_DYNPRO USING 'SAPLSP01' '300'.

PERFORM BDC_FIELD USING 'bdc_okcode' '/=yes'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'XK01'

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

DYNPROTAB = BDCTAB

  • EXCEPTIONS

  • INTERNAL_ERROR = 1

  • NOT_OPEN = 2

  • QUEUE_ERROR = 3

  • TCODE_INVALID = 4

  • PRINTING_INVALID = 5

  • POSTING_INVALID = 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.

*call transaction 'XK01' using bdctab mode 'a' update 'a' messages into bdcmsg.

*read table bdcmsg with KEY MSGTYP = 'E'.

*CALL FUNCTION 'FORMAT_MESSAGE'

  • EXPORTING

  • ID = bdcmsg-MSGID

  • LANG = 'EN'

  • NO = bdcmsg-MSGNR

  • V1 = bdcmsg-MSGV1

  • V2 = bdcmsg-MSGV2

  • V3 = bdcmsg-MSGV3

  • V4 = bdcmsg-MSGV4

  • IMPORTING

  • MSG = bdcmsg-MSGV1

    • 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.

*WRITE 😕 bdcmsg-MSGV1.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

  • EXCEPTIONS

  • NOT_OPEN = 1

  • QUEUE_ERROR = 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.

&----


*& Form bdc_dynpro

&----


  • text

----


  • -->P_P1 text

  • -->P_P2 text

----


FORM BDC_DYNPRO USING P_P1

P_P2.

CLEAR BDCTAB.

BDCTAB-PROGRAM = P_P1.

BDCTAB-DYNPRO = P_P2.

BDCTAB-DYNBEGIN = 'X'.

APPEND BDCTAB.

ENDFORM. " bdc_dynpro

&----


*& Form bdc_field

&----


  • text

----


  • -->P_P3 text

  • -->P_P4 text

----


FORM BDC_FIELD USING P_P3

P_P4.

CLEAR BDCTAB.

BDCTAB-FNAM = P_P3.

BDCTAB-FVAL = P_P4.

APPEND BDCTAB.

ENDFORM. " bdc_field