Error in call transaction bdc
hello,
i'm prepare a bdc program for F-22, when i record the process through shdb, an error occurs said a field must be filled( but the field is not on the current screen), and when a press enter a popup dialog said i can fill the field in the next screen.
but when i fill my bdcdata in program according the recording, and then use call transaction to do the BDC job, it stops on the error (Note that when recording, i can press enter and modify the error in the next screen).
could someone give a solution ??
thank you !!
and the message after recording is
Number 1
Transaction F-22
SY-SUBRC 0
Messages
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0330WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
S F5 312 Document 100001677 was posted in company code 3100
Similar Messages
-
How to rectify the errors through call transaction metod in bdc
how to rectify the errors through call transaction metod in bdc
Hi ,
View the highlited part of the below code.
REPORT ygfrivat1 NO STANDARD PAGE HEADING
LINE-SIZE 165
MESSAGE-ID yif_groc.
Program YGFRIVAT1
Function Report to Upload the VAT Adjustment File.
Author ARENAPU
Date 11.05.2007
PMTS AM12810157
Transport G6DK937834
Description:
Modification log:
1. Changed by :
Changed on :
PMTS :
Transport :
Tag :
Description :
T A B L E S D E C L A R A T I O N S
TABLES: edidc, "Control record (IDoc)
edids, "Status Record (IDoc)
t001w.
Internal Tables Declaration.
Internal table to hold data from table EDIDS
DATA: BEGIN OF t_edids OCCURS 0,
docnum LIKE edids-docnum,
logdat LIKE edids-logdat,
logtim LIKE edids-logtim,
countr LIKE edids-countr,
credat LIKE edids-credat,
uname LIKE edids-uname,
END OF t_edids,
Internal table to hold data from table EDIDC
BEGIN OF t_edidc OCCURS 0,
docnum LIKE edidc-docnum,
rcvprt LIKE edidc-rcvprt,
rcvprn LIKE edidc-rcvprn,
credat LIKE edidc-credat,
END OF t_edidc,
Internal table to hold data from upload file
BEGIN OF t_tab OCCURS 0,
cust(10), "site/customer number
date(10), "transaction date
currency(04), "currency
extnbr(15), "external reference number
pos-cont(05), "POS controler
pos-id(25), "POS id
cashier(10), "cashier name
qualif(04), "qualifier of the article
matnr(25), "article number
qty(10), "quantity
sale(16), "sale value
pos-tr(04), "POS transfert type
paymeth(04), "payment method
final(35), "final price
tarcur(04), "target currency
assign(35), "assignment day
error,
END OF t_tab,
Internal table for Report display.
BEGIN OF t_tab1 OCCURS 0,
cust(10), "site/customer number
date(10), "transaction date
currency(04), "currency
extnbr(15), "external reference number
pos-cont(05), "POS controler
pos-id(25), "POS id
cashier(10), "cashier name
qualif(04), "qualifier of the article
matnr(25), "article number
qty(16) TYPE p DECIMALS 2, "quantity
sale(16) TYPE p DECIMALS 2, "sale value
pos-tr(04), "POS transfert type
paymeth(04), "payment method
final(16) TYPE p DECIMALS 2, "final price
tarcur(04), "target currency
assign(35), "assignment day
END OF t_tab1,
t_tab_temp LIKE t_tab OCCURS 0 WITH HEADER LINE,
Internal table to Validate Customer no.
BEGIN OF t_check OCCURS 0,
werks LIKE t001w-werks,
vkorg LIKE t001w-vkorg,
value(40),
END OF t_check,
t_check_temp LIKE t_check OCCURS 0 WITH HEADER LINE.
Internal table to hold data from table ZCS_PARAM.
DATA: BEGIN OF t_zcs_param OCCURS 0.
INCLUDE STRUCTURE zcs_param.
DATA: vkorg LIKE t001w-vkorg,
END OF t_zcs_param.
*Internal table to hold Messages.
DATA: BEGIN OF t_message OCCURS 0,
msgnum TYPE msgnum,
msgtyp TYPE msgtyp,
msgtxt TYPE msgtext,
END OF t_message.
*Work area for table t_message
DATA : w_message LIKE LINE OF t_message.
Internal table to hold BDC data
DATA: t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,
Internal table to collect error messages
messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
*Internal table to hold messages from call transaction
DATA: BEGIN OF t_text OCCURS 0,
desc(150),
msgtxt(100),
END OF t_text.
D A T A D E C L A R A T I O N S
DATA: n TYPE i,
gv_status(11) TYPE c, "Shows status, Production or Test
gv_exit TYPE c, "Exit Flag
gv_qty(16) TYPE p DECIMALS 2, "Variable to sum Quantity
gv_sale(16) TYPE p DECIMALS 2, "Variable to sum Amount
gv_final(16) TYPE p DECIMALS 2. "Variable to sum Final Amount
DATA: w_text(100),
gv_mode TYPE c,
error TYPE c. "Flag to Indicate error.
CONSTANSTS DECLARATION
CONSTANTS : gc_fieldname LIKE dynpread-fieldname VALUE 'P_FNAME',
gc_seq_no LIKE zcs_param-seq_no VALUE '00110',
gc_object LIKE zcs_param-object VALUE 'YGFVAT',
gc_paraname LIKE zcs_param-paraname VALUE 'VKORG',
gc_back TYPE c VALUE 'N',
gc_error TYPE c VALUE 'E',
gc_all TYPE c VALUE 'A'.
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) text-002 FOR FIELD p_test.
PARAMETERS : p_test AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-006.
PARAMETERS : rb_back RADIOBUTTON GROUP rb1 DEFAULT 'X',
rb_error RADIOBUTTON GROUP rb1,
rb_all RADIOBUTTON GROUP rb1.
SELECTION-SCREEN END OF BLOCK a2.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*Subroutine to provide F4 help for file name
PERFORM fr_get_filename.
I N I T I A L I Z A T I O N
INITIALIZATION.
*Subroutine to check authorization.
PERFORM fr_authority_check.
T O P - O F - P A G E
TOP-OF-PAGE.
*Subroutine to diplay header
PERFORM fr_display_header.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
*Subroutine to upload data from presentation server.
PERFORM fr_upload_data.
*Subroutine to validate records from uploaded file.
PERFORM fr_validate_data.
*Subroutine to build report internal table.
PERFORM fr_build_rep.
E N D - O F - S E L E C T I O N
END-OF-SELECTION.
*Subroutine to display report.
PERFORM fr_write_report.
F O R M S U B R O U T I N E S
*& Form fr_get_filename
text
FORM fr_get_filename.
DATA : lv_repid LIKE sy-repid, " Report id
lv_file LIKE ibipparms-path. " File Path
lv_repid = sy-repid.
F4 help for file path.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = lv_repid
dynpro_number = syst-dynnr
field_name = gc_fieldname " p_fname1
IMPORTING
file_name = lv_file.
IF NOT lv_file EQ space.
p_fname = lv_file.
ELSE.
MESSAGE e999 WITH 'Invalid Path'(005).
ENDIF.
ENDFORM. " fr_get_filename
*& Form fr_upload_data
text
FORM fr_upload_data.
DATA: lv_fname TYPE string.
CLEAR lv_fname.
lv_fname = p_fname.
Uploading file from PC or presentation server to internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_fname
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = t_tab
EXCEPTIONS
file_open_error = 1.
IF sy-subrc <> 0.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
MOVE text-m01 TO w_message-msgtxt.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
ENDIF.
ENDFORM. " fr_upload_data
*& Form fr_validate_data
text
FORM fr_validate_data.
DATA : lv_lines1 TYPE i,
lv_lines2 TYPE i.
*Obtain Status depending on Check box selected.
IF p_test IS INITIAL.
gv_status = 'PRODUCTION'.
ELSE.
gv_status = 'TEST RUN'.
ENDIF.
*Batch Mode
CLEAR gv_mode.
IF rb_back EQ 'X'. "No Display
MOVE gc_back TO gv_mode.
ELSEIF rb_error EQ 'X'. "Error Only
MOVE gc_error TO gv_mode.
ELSEIF rb_all EQ 'X'. "All Screens
MOVE gc_all TO gv_mode.
ENDIF.
IF NOT t_tab[] IS INITIAL.
SORT t_tab BY cust.
REFRESH t_tab_temp.
t_tab_temp[] = t_tab[].
SORT t_tab_temp BY cust.
DELETE ADJACENT DUPLICATES FROM t_tab_temp COMPARING cust.
IF NOT t_tab_temp[] IS INITIAL.
SELECT werks vkorg FROM t001w
INTO TABLE t_check
FOR ALL ENTRIES IN t_tab_temp
WHERE werks = t_tab_temp-cust+0(4).
IF sy-subrc = 0.
SORT t_check BY werks.
ENDIF.
LOOP AT t_check.
IF t_check-vkorg <> ' '.
MOVE t_check-vkorg TO t_check-value.
MODIFY t_check TRANSPORTING value.
ENDIF.
ENDLOOP.
ENDIF.
FREE t_tab_temp.
ENDIF.
IF NOT t_check[] IS INITIAL.
REFRESH t_check_temp.
t_check_temp[] = t_check[].
SORT t_check_temp BY value.
DELETE ADJACENT DUPLICATES FROM t_check_temp COMPARING value.
IF NOT t_check_temp[] IS INITIAL.
SELECT * FROM zcs_param INTO TABLE t_zcs_param
FOR ALL ENTRIES IN t_check_temp
WHERE seq_no EQ gc_seq_no
AND object EQ gc_object
AND paraname EQ gc_paraname
AND value EQ t_check_temp-value.
IF sy-subrc = 0.
SORT t_zcs_param BY value.
ENDIF.
ENDIF.
FREE t_check_temp.
ENDIF.
IF NOT t_tab[] IS INITIAL.
LOOP AT t_tab.
READ TABLE t_check WITH KEY werks = t_tab-cust BINARY SEARCH.
IF sy-subrc <> 0.
MOVE 'X' TO t_tab-error.
MODIFY t_tab TRANSPORTING error.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
CONCATENATE t_tab-cust text-030
INTO w_message-msgtxt SEPARATED BY space.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
EXIT.
ELSE.
READ TABLE t_zcs_param WITH KEY value = t_check-vkorg
BINARY SEARCH.
IF sy-subrc <> 0.
MOVE 'X' TO t_tab-error.
MODIFY t_tab TRANSPORTING error.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
CONCATENATE text-003 t_tab-cust text-004 t_check-vkorg
INTO w_message-msgtxt SEPARATED BY space.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
EXIT.
ELSE.
PERFORM fr_format_tab.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
DESCRIBE TABLE t_tab LINES lv_lines1.
IF lv_lines1 <> 0.
DELETE t_tab WHERE error EQ 'X'.
ENDIF.
DESCRIBE TABLE t_tab LINES lv_lines2.
IF lv_lines2 <> 0.
IF lv_lines2 <> lv_lines1.
EXIT.
ELSE.
IF p_test IS INITIAL.
LOOP AT t_tab.
*Subroutine to build BDC table
PERFORM fr_fill_bdctab.
*Subroutine to Post Data into SAP.
PERFORM fr_data_posting.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " fr_validate_data
*& Form fr_write_log
text
FORM fr_write_log.
CLEAR error.
error = 'X'.
WRITE:/1 'Msg No'(027), 10 'Type'(028), 20 'Text'(029).
ULINE:/1(120).
FORMAT RESET.
LOOP AT t_message.
IF t_message-msgtyp = 'E'.
FORMAT COLOR 6 INTENSIFIED .
ELSEIF t_message-msgtyp = 'W'.
FORMAT COLOR 3 INTENSIFIED .
ELSEIF t_message-msgtyp = 'I'.
FORMAT COLOR 5 INTENSIFIED .
ENDIF.
WRITE:/1 t_message-msgnum,
10 t_message-msgtyp,
20 t_message-msgtxt.
FORMAT RESET.
ENDLOOP.
ULINE:/1(120).
ENDFORM. " fr_write_log
*& Form fr_write_report
text
FORM fr_write_report.
CLEAR gv_exit.
LOOP AT t_message.
IF t_message-msgtyp = 'E'.
gv_exit = 'X'.
EXIT.
ENDIF.
ENDLOOP.
IF NOT gv_exit IS INITIAL.
EXIT.
ELSE.
PERFORM fr_display_report.
IF NOT t_text[] IS INITIAL.
Subroutine for Display Call Transaction messages.
PERFORM fr_write_msg.
ENDIF.
ENDIF.
ENDFORM. " fr_write_report
*& Form fr_display_report
text
FORM fr_display_report.
IF NOT t_tab1[] IS INITIAL.
CLEAR: gv_qty, gv_sale, gv_final.
LOOP AT t_tab1.
WRITE:/1(10) t_tab1-cust,
13(10) t_tab1-date,
25(05) t_tab1-currency,
32(14) t_tab1-extnbr,
48(09) t_tab1-pos-cont,
60(18) t_tab1-matnr,
80(16) t_tab1-qty RIGHT-JUSTIFIED ,
98(16) t_tab1-sale RIGHT-JUSTIFIED ,
116(07) t_tab1-paymeth,
125(16) t_tab1-final RIGHT-JUSTIFIED,
143(06) t_tab1-tarcur,
152(12) t_tab1-assign.
gv_qty = t_tab1-qty + gv_qty.
gv_sale = t_tab1-sale + gv_sale.
gv_final = t_tab1-final + gv_final.
ENDLOOP.
FORMAT COLOR 3.
ULINE: /(164).
WRITE:/ 'TOTALS',
80(16) gv_qty RIGHT-JUSTIFIED,
98(16) gv_sale RIGHT-JUSTIFIED,
125(16) gv_final RIGHT-JUSTIFIED,
182 ''.
ULINE: /(164).
FORMAT RESET.
ENDIF.
ENDFORM. " fr_display_report
*& Form FR_DISPLAY_HEADER
text
FORM fr_display_header.
IF error IS INITIAL.
FORMAT COLOR 1.
WRITE:/ 'Date upload :'(007), 25 sy-datum, 38 ''.
WRITE:/ 'Production or Test Run:'(008), 25 gv_status, 38 ''.
WRITE:/ 'Upload User Logon :'(009), 25 sy-uname, 38 ''.
ULINE: /(164).
WRITE:/1(04) 'Site'(010),
13(10) 'Date'(011),
25(05) 'Curr.'(012),
32(14) 'Receipt'(013),
48(09) 'Cashier'(014),
60(18) 'Article'(015),
92 'Qty'(016),
102 'Item Amount'(017),
116(7) 'M.o.P.'(018),
128 'Tender Amount'(019),
143(6) 'T.Curr'(020),
152(12) 'Assignment'(021).
ULINE:/(164).
FORMAT RESET.
ENDIF.
ENDFORM. " FR_DISPLAY_HEADER
*& Form fr_newdynpro
text
FORM fr_newdynpro USING program LIKE bdcdata-program
dynpro LIKE bdcdata-dynpro.
t_bdcdata-program = program .
t_bdcdata-dynpro = dynpro.
t_bdcdata-dynbegin = 'X'.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " fr_newdynpro
*& Form fr_loadfield
text
FORM fr_loadfield USING field LIKE bdcdata-fnam
value.
t_bdcdata-fnam = field.
t_bdcdata-fval = value.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " fr_loadfield
*& Form fr_fill_bdctab
text
FORM fr_fill_bdctab.
REFRESH t_bdcdata.
PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
PERFORM fr_loadfield USING 'G_DATUM' t_tab-date.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BON'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '500'.
PERFORM fr_loadfield USING 'WPSCB01-POSKREIS' t_tab-pos-cont.
PERFORM fr_loadfield USING 'WPSCB01-KASSID' t_tab-pos-id.
PERFORM fr_loadfield USING 'WPSCB01-BELEGWAERS' t_tab-currency.
PERFORM fr_loadfield USING 'WPSCB01-CSHNAME' t_tab-cashier.
PERFORM fr_loadfield USING 'WPSCB01-BONNUMMER' t_tab-extnbr.
PERFORM fr_loadfield USING 'E1WPB02-QUALARTNR(01)' t_tab-qualif.
PERFORM fr_loadfield USING 'E1WPB02-ARTNR(01)' t_tab-matnr.
PERFORM fr_loadfield USING 'E1WPB02-MENGE(01)' t_tab-qty.
PERFORM fr_loadfield USING 'WPSCB03-KONDVALUE(01)' t_tab-sale.
PERFORM fr_loadfield USING 'E1WPB02-VORGANGART(01)' t_tab-pos-tr.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'ZAHL'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
PERFORM fr_loadfield USING 'WPSCB06-ZAHLART' t_tab-paymeth.
PERFORM fr_loadfield USING 'WPSCB06-SUMME' t_tab-final.
PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
PERFORM fr_loadfield USING 'WPSCB06-ZUONR' t_tab-assign.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'SAVE'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
PERFORM fr_loadfield USING 'WPSCB06-ZAHLART' t_tab-paymeth.
PERFORM fr_loadfield USING 'WPSCB06-SUMME' t_tab-final.
PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
PERFORM fr_loadfield USING 'WPSCB06-ZUONR' t_tab-assign.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
PERFORM fr_newdynpro USING 'SAPLSPO1' '0200'.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'YES'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
PERFORM fr_loadfield USING 'G_DATUM' t_tab-date.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
ENDFORM. " fr_fill_bdctab
*& Form fr_data_posting
text
FORM fr_data_posting.
IF NOT t_bdcdata[] IS INITIAL.
REFRESH messtab.
CALL TRANSACTION 'WPUK' USING t_bdcdata
MODE gv_mode
UPDATE 'S'
MESSAGES INTO messtab.
IF sy-subrc = 0 .
CLEAR w_text.
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = sy-langu
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = w_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
MOVE w_text TO t_text-msgtxt.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Posted Sucessfully'(032)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
ENDLOOP.
ELSE.
CLEAR w_text.
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = sy-langu
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = w_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
MOVE w_text TO t_text-msgtxt.
IF messtab-msgnr EQ '213'.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Posted Sucessfully'(032)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
EXIT. ELSE.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Not Posted'(033)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " fr_data_posting
*& Form fr_authority_check
text
FORM fr_authority_check.
AUTHORITY-CHECK OBJECT 'Y_VATADJ'
ID 'VKORG' FIELD t001w-vkorg
ID 'TCD' FIELD 'YGFVAT'.
IF sy-subrc NE 0.
MESSAGE e999 WITH text-m02.
ENDIF.
ENDFORM. " fr_authority_check
*& Form fr_write_msg
text
FORM fr_write_msg.
SKIP.
ULINE:/(164).
WRITE:/
'Messages encountered while Calling Transaction WPUK'(025),
90 'Message Text'(026).
ULINE:/1(164).
LOOP AT t_text.
WRITE:/1 t_text-desc,
90 t_text-msgtxt,
164 ''.
ENDLOOP.
ULINE:/1(164).
ENDFORM. " fr_write_msg
*& Form FR_BUILD_REP
text
FORM fr_build_rep.
IF error IS INITIAL.
IF NOT t_tab[] IS INITIAL.
LOOP AT t_tab.
MOVE:
t_tab-cust TO t_tab1-cust, "site/customer number
t_tab-date TO t_tab1-date, "transaction date
t_tab-currency TO t_tab1-currency, "currency
t_tab-extnbr TO t_tab1-extnbr, "external reference number
t_tab-pos-cont TO t_tab1-pos-cont, "POS controler
t_tab-pos-id TO t_tab1-pos-id, "POS id
t_tab-cashier TO t_tab1-cashier, "cashier name
t_tab-qualif TO t_tab1-qualif, "qualifier of the article
t_tab-matnr TO t_tab1-matnr, "article number
t_tab-pos-tr TO t_tab1-pos-tr, "POS transfert type
t_tab-paymeth TO t_tab1-paymeth, "payment method
t_tab-tarcur TO t_tab1-tarcur, "target currency
t_tab-assign TO t_tab1-assign.
REPLACE ',' WITH '.' INTO t_tab-qty.
CONDENSE t_tab-qty NO-GAPS.
MOVE t_tab-qty TO t_tab1-qty.
REPLACE ',' WITH '.' INTO t_tab-sale.
CONDENSE t_tab-sale NO-GAPS.
MOVE t_tab-sale TO t_tab1-sale.
REPLACE ',' WITH '.' INTO t_tab-final.
CONDENSE t_tab-final NO-GAPS.
MOVE t_tab-final TO t_tab1-final.
APPEND t_tab1.
CLEAR t_tab1.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " FR_BUILD_REP
*& Form fr_format_tab
text
FORM fr_format_tab.
DATA : lv_qty TYPE string.
IF NOT t_tab-qty IS INITIAL.
IF t_tab-qty+0(1) EQ '-'.
CLEAR lv_qty.
MOVE t_tab-qty TO lv_qty.
CLEAR t_tab-qty.
SHIFT lv_qty LEFT CIRCULAR.
CONDENSE lv_qty NO-GAPS.
MOVE lv_qty TO t_tab-qty.
MODIFY t_tab TRANSPORTING qty.
ENDIF.
ENDIF.
ENDFORM. " fr_format_tab -
Catching error in call transaction
Hi,
Can anyone tell me how to catch errors in call transaction method.
Please provide step by step guide.
Thanks,
ShipraHi Shipra...
This is the way...
data : It_MSG type table of BDCMSGCOLL with header line.
DATA : V_MESSAGE TYPE STRING.
LOOP AT ITAB.
PERFORM MAP_BDCDATA.
CALL Transaction 'MK01'
USING it_bdcdata
MODE 'N'
Messages into IT_MSG.
if sy-subrc ne 0. "when the Transaction is unsuccessful
**Display the Error messages
LOOP AT IT_MSG WHERE MSGTYP = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
msgtyp = it_msg-msgtyp
msgno = it_msg-msgnr
msgid = it_msg-msgid
msgv1 = it_msg-msgv1
msgv2 = it_msg-msgv2
IMPORTING
MESSAGE = V_MESSAGE.
WRITE:/ V_MESSAGE.
ENDLOOP.
REFRESH : IT_BDCDATA, IT_MSG.
ENDLOOP.
<b>Reward if Helpful.</b> -
Errors in Call transaction and Session method.
Hi all
Please explain me in detail with example how to handle errors in call transaction method and session method.
Thanks in advance
Manu.Hi,
In Session Method Datawill be stored in session.In that session u can find error recods.
In CALL Transation useing 'FORMAT_MESSAGE' Function Module u can catch the errors.
ex:
LOOP AT it_messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_messtab-msgid
lang = it_messtab-msgspra
no = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
msg = g_msg
EXCEPTIONS
OTHERS = 0.
IF it_messtab-msgtyp = 'S'.
it_sucess-sucess_rec = g_msg.
it_sucess-lifnr = it_header-lifnr." Based on your field
it_sucess-tabix = v_lines.
APPEND it_sucess.
ELSEIF it_messtab-msgtyp = 'E'.
it_error-error_rec = g_msg.
it_error-lifnr = it_header-lifnr.
it_error-tabix = v_lines.
APPEND it_error.
ELSE.
it_info-info_rec = g_msg.
it_info-lifnr = it_header-lifnr.
it_info-tabix = v_lines.
APPEND it_info.
ENDIF.
ENDLOOP.
LOOP AT IT_BDC_MESSAGES.
IF IT_BDC_MESSAGES-msgtyp = 'E'.
SELECT single * FROM t100 WHERE
sprsl = it_BDC_MESSAGES-msgspra
AND arbgb = IT_BDC_MESSAGES-msgid
AND msgnr = IT_BDC_MESSAGES-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ELSE.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
Reward if useful.
Regards,
Narasimha -
Hi all,
In my program I am trying to handle errors in call transaction method using bdcmsgcoll and format_message.To check this I have given some false data like trying to create materials which are already in mara tables. The data is not updated in the mara tables but No error messages are populated into the bdcmsgcoll structure. The status of all messges is success. How do messages get populated into bdcmsgcoll ?
I am forwardimng my code too. Can anyone please explain me what's happening ? For what type of errors, Error messages get poplated into bdcmsgcoll ?
report Z_MAT_CALL
no standard page heading line-size 255.
data : begin of material occurs 0,
matnr like mara-matnr, " Material Number
mbrsh like mara-mbrsh, " Industry sector
mtart like mara-mtart, " material Type
maktx like makt-maktx, " Material Description
meins like mara-meins, " Base Unit of Measure
end of material.
data fnam type string value 'C:\BW\MAT.TXT'.
*---- BDCDATA
data : bdcdata like bdcdata occurs 0 with header line,
itab like bdcmsgcoll occurs 0 with header line,
mesg(100).
*---- Uploading data into internal table from flat File.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = fnam "'C:\BW\MAT.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
tables
data_tab = material.
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 material.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
material-matnr.
perform bdc_field using 'RMMG1-MBRSH'
material-mbrsh.
perform bdc_field using 'RMMG1-MTART'
material-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
material-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
material-meins.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_transaction using 'MM01'.
refresh bdcdata.
endloop.
*LOOP AT iTAB.
*WRITE: / iTAB-TCODE,
*iTAB-DYNAME,
*iTAB-DYNUMB,
*iTAB-MSGTYP,
*iTAB-MSGSPRA,
*iTAB-MSGID,
*iTAB-MSGNR.
*ENDLOOP.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
CLEAR BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
CLEAR BDCDATA.
ENDFORM.
Form bdc_transaction
form bdc_transaction using value(tcode).
call transaction tcode using bdcdata
mode 'N'
update 'S' messages into itab.
if sy-subrc Ne 0.
read table itab with key msgtyp = 'E'.
if sy-subrc = 0.
perform check.
endif.
endif.
endform. " bdc_transaction
Form check
form check .
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = itab-msgid
lang = sy-langu
no = itab-msgnr
v1 = itab-msgv1
v2 = itab-msgv2
v3 = itab-msgv3
v4 = itab-msgv4
IMPORTING
msg = mesg
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.
endform. " check
Regards,
Varun.Hi
DATA : T_BDCMSGCOLL TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
DATA : WA_BDCMSGCOLL TYPE BDCMSGCOLL.
DATA : ERR_LOG TYPE MESSAGE.
Call Transaction MM01
IF W_FLAG NE 'X'.
CALL TRANSACTION 'MM01' USING T_BDCDATA OPTIONS FROM WA_CTU_PARAMS
MESSAGES INTO T_BDCMSGCOLL.
COMMIT WORK AND WAIT.
DESCRIBE TABLE T_BDCMSGCOLL LINES N.
IF N <> 0.
LOOP AT T_BDCMSGCOLL INTO WA_BDCMSGCOLL.
CLEAR ERR_LOG.
W_MSGNO = WA_BDCMSGCOLL-MSGNR.
CALL FUNCTION 'WRITE_MESSAGE'
EXPORTING
MSGID = WA_BDCMSGCOLL-MSGID
MSGNO = W_MSGNO
MSGTY = WA_BDCMSGCOLL-MSGTYP
IMPORTING
MESSG = ERR_LOG.
Error that occurs during transactoon
IF ERR_LOG-MSGTY = 'E'.
MOVE-CORRESPONDING T_UPLOAD TO T_DOWNLOAD.
MOVE ERR_LOG-MSGTX TO T_DOWNLOAD-MSG.
APPEND T_DOWNLOAD.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
check structure declaration and code it may be useful
regards
vinod -
Error on calling a BDC from web dynpro while it runs fine through FM.
I have created a function module for calling transaction ima2n using a BDC. This function module runs as intended, if function module is executed using SE37. if I call the same function module from ABAP dynpro view, on some event. I get the below error. I have debugged the function module but it runs fine. If i debug function module and run the BDC in mode "A" then i can see that BDC is performing the intended actions. This is a strange behaviour.. Please help.
ABAP Dynpro Error
Error when processing your request
What has happened?
The URL http://dev.corp.bharatpetroleum.com:8000/sap/bc/webdynpro/sap/zcapex_appln/ was not called due to an error.
Note
The following error text was processed in the system D01 : Exception condition "CREATE_ERROR" raised.
The error occurred on the application server dev_D01_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Function: TREEV_CREATE_COLUMN_TREE of program SAPLCNT4
Form: TVAR_INIT of program SAPLAIA1
Module: INIT_VARIANTEN_TREE of program SAPLAIA1
What can I do?
If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system D01 in transaction ST22.
If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server dev_D01_00 in transaction SM21.
If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server dev_D01_00 . In some situations, you may also need to analyze the trace files of other work processes.
If you do not yet have a user ID, contact your system administrator.
Error code: ICF-IE-http -c: 100 -u: TESTAUTH32 -l: E -s: D01 -i: dev_D01_00 -w: 0 -d: 20111109 -t: 123625 -v: RABAX_STATE -e: RAISE_EXCEPTION
HTTP 500 - Internal Server Error
Your SAP Internet Communication Framework Team
ST22 Dump screen
User and Transaction
Client.............. 100
User................ "TESTAUTH32"
Language Key........ "E"
Transaction......... "IMA2N "
Transactions ID..... "4EB9F7AE3E2403D7E10000000A481584"
Program............. "SAPLCNT4"
Screen.............. "SAPLAIA1 0306"
Screen Line......... 5
Information on Caller ofr "HTTP" Connection:
Plug-in Type.......... "HTTP"
Caller IP............. "10.72.46.106"
Caller Port........... 8000
Universal Resource Id. "/sap/bc/webdynpro/sap/zcapex_appln/"
Information on where terminated
Termination occurred in the ABAP program "SAPLC
"TREEV_CREATE_COLUMN_TREE".
The main program was "SAPLAIA1 ".
In the source code you have the termination poi
of the (Include) program "LCNT4U74".
Error occurred during batch input processing
Source Code :
CONTAINER
CHANGING
HANDLE
TREE_CONTROL_NOT_EXISTING
FAILED
CREATE_ERROR
CNTL_SYSTEM_ERROR.
IF NOT TREE_CONTROL_NOT_EXISTING IS INITIAL
RAISE TREE_CONTROL_NOT_EXISTING.
ELSEIF NOT FAILED IS INITIAL.
RAISE FAILED.
ELSEIF NOT CREATE_ERROR IS INITIAL.
-->>>>>>>>>RAISE CREATE_ERROR. " failed on this line
ELSEIF NOT CNTL_SYSTEM_ERROR IS INITIAL.
RAISE CNTL_SYSTEM_ERROR.
ENDIF.
regards,
Parag AgrawalHi,
as BDC is calling screens and in Webdynpro ABAP you cannot use SAP GUI sceeen, you are getting short dump.
Refer CNTL_SYSTEM_ERROR in webservices from r/3 system
Thanks,
Chandra -
Hi,
Let me know why this issue is coming.
I'M doing a bdc using call transaction and want to catch the error messages and throw back as alvoutput.
my code is
PERFORM bdc_dynpro using 'X' 'SAPMV50A' '0101' '' ''.
PERFORM bdc_dynpro using 'X' 'SAPMV50A' '4004' '' ''.
PERFORM bdc_dynpro using '' '' '' 'LIKP-VBELN' wa_likp-vbeln.
PERFORM bdc_dynpro using '' '' '' 'BDC_OKCODE' 'WABU_T'.
CALL TRANSACTION 'VL02N'
USING itab_bdcdata
MODE lv_tmpmode
UPDATE 'S'
MESSAGES INTO itab_messages.
IF sy-subrc NE 0.
PERFORM messages.
ENDIF.
what the message that i'm getting in itab_messages is "
Start screen does not exist in batch input data".
please let me know why this error is coming.
--sudhaHi,
no need to call the screen num 101.
4004 is the first screen number of the transaction code vl02n.
regards.
sriram. -
Catching Errors in Call Transaction
Hi All,
I have develop the BDC using call transaction for MM01 transaction but i need to catch the success messages as well as errors in a log file that i wanna download. below is the code for the same and is it mandatory to give the update mode.please let me know.
DATA: i_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,
i_error TYPE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY,
p_mode(1) DEFAULT 'A'.
p_erfile TYPE rlgrap-filename.
SELECTION-SCREEN : BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETER: PBROW_HD TYPE I, PEROW_HD TYPE I, PBCOL_HD TYPE I, PECOL_HD TYPE I.
SELECTION-SCREEN : END OF BLOCK BLK1.
DATA: T_EXCEL LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
Data: begin of record occurs 0,
MATNR(40),
MBRSH(01),
MTART(04),
MAKTX(40),
MEINS(03),
MATKL(09),
BISMT(18),
UMREN_02(05),
UMREN_03(05),
MEINH_02(03),
MEINH_03(03),
UMREZ_02(05),
UMREZ_03(05),
WERKS(04),
EKGRP(3) ,
LGORT(04),
DISMM(02),
DISPO(03), "Cash Discount Indicator
DISLS(02),
BESKZ(1),
DZEIT(3),
FHORI(3),
PERKZ(1),
MTVFP(02),
IPRKZ(01),
END OF RECORD.
DATA: v_filename LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM read_file CHANGING p_file.
CALL FUNCTION 'F4_FILENAME'
* EXPORTING
* PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE.
start-of-selection.
PERFORM upload_file.
PERFORM bdc
PERFORM error_download
FORM UPLOAD_FILE .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = PBCOL_HD
i_begin_row = PBROW_HD
i_end_col = PECOL_HD
i_end_row = PEROW_HD
TABLES
intern = T_EXCEL
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
LOOP AT T_EXCEL.
CASE T_EXCEL-COL.
WHEN 1. MOVE T_EXCEL-VALUE TO record-MATNR.
WHEN 2. MOVE T_EXCEL-VALUE TO record-MBRSH.
WHEN 3. MOVE T_EXCEL-VALUE TO RECORD-MTART.
WHEN 4. MOVE T_EXCEL-VALUE TO RECORD-MAKTX.
WHEN 5. MOVE T_EXCEL-VALUE TO RECORD-MEINS.
WHEN 6. MOVE T_EXCEL-VALUE TO RECORD-MATKL.
WHEN 7. MOVE T_EXCEL-VALUE TO RECORD-BISMT.
WHEN 8. MOVE T_EXCEL-VALUE TO RECORD-UMREN_02.
WHEN 9. MOVE T_EXCEL-VALUE TO RECORD-UMREN_03.
WHEN 10. MOVE T_EXCEL-VALUE TO RECORD-MEINH_02.
WHEN 11. MOVE T_EXCEL-VALUE TO RECORD-MEINH_03.
WHEN 12. MOVE T_EXCEL-VALUE TO RECORD-UMREZ_02.
WHEN 13. MOVE T_EXCEL-VALUE TO RECORD-UMREZ_03.
WHEN 14. MOVE T_EXCEL-VALUE TO RECORD-WERKS.
WHEN 15. MOVE T_EXCEL-VALUE TO RECORD-EKGRP.
WHEN 16. MOVE T_EXCEL-VALUE TO RECORD-LGORT.
WHEN 17. MOVE T_EXCEL-VALUE TO RECORD-DISMM.
WHEN 18. MOVE T_EXCEL-VALUE TO RECORD-DISPO.
WHEN 19. MOVE T_EXCEL-VALUE TO RECORD-DISLS.
WHEN 20. MOVE T_EXCEL-VALUE TO RECORD-BESKZ.
WHEN 21. MOVE T_EXCEL-VALUE TO RECORD-DZEIT.
WHEN 22. MOVE T_EXCEL-VALUE TO RECORD-FHORI.
WHEN 23. MOVE T_EXCEL-VALUE TO RECORD-PERKZ.
WHEN 24. MOVE T_EXCEL-VALUE TO RECORD-MTVFP.
WHEN 25. MOVE T_EXCEL-VALUE TO RECORD-IPRKZ.
ENDCASE.
AT END OF ROW.
APPEND record.
CLEAR record.
ENDAT.
ENDLOOP.
ENDFORM. " UPLOAD_FILE
*& Form BDC
text
--> p1 text
<-- p2 text
FORM BDC .
loop at record.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSW'.
perform bdc_field using 'RMMG1-MATNR'
record-matnr.
perform bdc_field using 'RMMG1-MBRSH'
record-mbrsh.
perform bdc_field using 'RMMG1-MTART'
record-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=ZU01'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-BISMT'.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARA-MATKL'
record-matkl.
perform bdc_field using 'MARA-BISMT'
record-bismt.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=ZU02'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=MAIN'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'SMEINH-UMREZ(03)'.
perform bdc_field using 'SMEINH-UMREN(02)'
record-umren_02.
perform bdc_field using 'SMEINH-UMREN(03)'
record-umren_03.
perform bdc_field using 'SMEINH-MEINH(02)'
record-meinh_02.
perform bdc_field using 'SMEINH-MEINH(03)'
record-meinh_03.
perform bdc_field using 'SMEINH-UMREZ(02)'
record-umrez_02.
perform bdc_field using 'SMEINH-UMREZ(03)'
record-umrez_03.
*perform bdc_dynpro using 'SAPLMGMM' '4300'.
*perform bdc_field using 'BDC_OKCODE'
'=MAIN'.
*perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
*perform bdc_field using 'MAKT-MAKTX'
record-maktx.
*perform bdc_dynpro using 'SAPLMGMM' '4004'.
*perform bdc_field using 'BDC_OKCODE'
'=SP02'.
*perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
*perform bdc_field using 'MAKT-MAKTX'
record-maktx.
*perform bdc_field using 'MARA-MEINS'
record-meins.
*perform bdc_field using 'MARA-MATKL'
record-matkl.
*perform bdc_field using 'MARA-BISMT'
record-bismt.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=SP09'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '0081'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
record-werks.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP10'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARC-EKGRP'.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-EKGRP'
record-ekgrp.
perform bdc_field using 'MARA-MATKL'
record-matkl.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP11'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4040'.
perform bdc_field using 'BDC_OKCODE'
'=SP12'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '0081'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-LGORT'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-LGORT'
record-lgort.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP13'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-EKGRP'
record-ekgrp.
perform bdc_field using 'MARC-DISMM'
record-dismm.
perform bdc_field using 'MARC-DISPO'
record-dispo.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISLS'.
perform bdc_field using 'MARC-DISLS'
record-disls.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'SP14'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARC-BESKZ'
record-beskz.
perform bdc_field using 'BDC_CURSOR'
'MARC-FHORI'.
perform bdc_field using 'MARC-FHORI'
record-fhori.
perform bdc_field using 'MARC-DZEIT'
record-dzeit.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP15'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARC-PERKZ'
record-perkz.
perform bdc_field using 'BDC_CURSOR'
'MARC-MTVFP'.
perform bdc_field using 'MARC-MTVFP'
record-mtvfp.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP19'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP20'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARA-IPRKZ'
record-iprkz.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP23'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
CALL TRANSACTION 'MM01' USING i_bdcdata MODE p_mode.
CLEAR I_BDCDATA[].
ENDLOOP.
ENDFORM. " BDC
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
ENDFORM.
FORM bdc_field USING fnam fval.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
ENDFORM.
FORM ERROR_DOWNLOAD .
DATA: v_errorpath TYPE string.
v_errorpath = p_erfile.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = v_errorpath
filetype = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = i_error
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
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.Can't read your code, but what you need would be something like
CALL TRANSACTION ... USING bdcdata MESSAGES it_messages UPDATE ...
In messages you will have both succesfully performed steps (field MSGTYP = 'S' ) and the ones which failed (MSGTYP = 'E'),
so simply loop at that table and create error log based on that messages, then download it.
Regards
Marcin -
Error in CALL TRANSACTION and SESSION Method
I have 8 records (1,2,3,4,5,6,7,8) to update into SAP database using CALL TRANSACTION and SESSION Method. If there is a error in 6th record. What happens in both call transaction and session method.
Please let me know which records will process and what about the error record. How to process only the error record if all other records have updated into database.Hi Patil_sumeet,
if your code for this is not protected secret of some federal agency, you may read [How to post code in SCN, and some things NOT to do...|How to post code in SCN, and some things NOT to do...; and then post relevant lines here.
According to the facts presented until know it may have been better to ask Radio Eriwan
Regards
Clemens -
Timeout Error in Call Transaction on Asynchronous Abap Proxy
Hi Gurus!!
We have a problem with a Call Transaction on Asynchronous Abap Proxy. When the process of Call Transaction (transaction CO02) takes more than 10 minutes, the process is cancelled with sy-subrc 1001 and the Abap Proxy continues with the execution. Strangely, there is a short dump in ST22 on transaction CO02, although on the ABAP Proxy we don't get any dump.
When this process is called from a Background Job no dumps are get.
Somebody knows if there is a problem with the Asynchronous ABAP Proxy executing CALL TRANSACTION statementent?
Thanks and regards,
Manuel.and the message after recording is
Number 1
Transaction F-22
SY-SUBRC 0
Messages
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0330WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
S F5 312 Document 100001677 was posted in company code 3100 -
Error when Calling Transaction in ABAP Proxy
Hi All,
I'm trying to call a transaction in synchronous ABAP Proxy, but there's a CNTL_ERROR in the details of SXMB_MONI.
I've checked some threads related to this problem, but they're not solved yet.
Please advise, can I use "call transaction" in synchronous ABAP Proxy ? Is there any additional setting / code to prevent the error ?
Thanks in advance,
Andy SHi Stefan,
I'm trying to assign marketing attributes in our CRM Business Partner Transaction, which is triggered by messages sent from some 3rd party application.
Recently, I find out that this transaction (TCode BP) raise the same error (CNTL_ERROR) if run background from SM35. So the problem is not about calling transaction in ABAP Proxy, but due to the TCode BP itself.......
My ABAPER friend is trying to find the BAPI to replace this call transaction .........
Thanks a lot for your response........
Regards,
Andy S -
TIME_OUT Error in calling transaction IP10
Hi all,
I would like to ask help from you guys, i am currently handling an error when using transaction IP30 (RISTRA20). The program returns an error (Message No. 00341)stating that the "texts from the batch input are not output. Only a placeholder".
Hope anyone can help me figure this out.
Note: In Transaction IP30, Transaction IP10 is being called. The error arises at this point.
Thanks in advance!Hi John,
I dont know what transaction are you talking about...
But if it is TIME_OUT.... you need to check for any OSS Notes available for this problem.
If not send a product error message to SAP.
There cannot be anyother solution,,,, if it is time_out.
go ahead. -
Call transaction BDC with different user id
Hello,
We have a BDC program for creating Invoice using "CALL TRANSACTION VF01" method. But there are are few user IDs accessing this program who do not have authorisation to VF01. So requirement is to create Invoice with a common user id.
Please help if it is possible to call transaction with different user id. Please also provide you inputs if you can suggest some other way to fulfill this requirement.
Thanks & Regards,
RohitHi Rohit,
if users are not authorized to post invoice, why is it required to surpass the checks?
A Question the business should answer.
It should not be the consultants obligation to find doubtable ways.
Regards
Clemens -
Can we record two transactions and use for a Call-transaction BDC?
can we record two transactions and upload data using Call-transaction method in BDC ?IF not why?
Hi Prakash,
Here i used two transactions.
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
********Rewards some points. -
Error in 'Call Transaction 'LS24'
Hi Abapers,
I am unable to go back to List after pressing back button for this Particular Transaction 'LS24'.It is wokring fine with other Transactions MM03,CS03.
WHEN 'test'.
SET PARAMETER ID 'LGN' FIELD L_WA_VENTRIES-LGNUM.
SET PARAMETER ID 'MAT' FIELD L_WA_VENTRIES-MATNR.
SET PARAMETER ID 'WRK' FIELD L_WA_VENTRIES-WERKS.
CALL TRANSACTION 'LS24' AND SKIP FIRST SCREEN.
thx in advance.
Any idea?
With best regards
Sudip..
Edited by: Sudip Samal on Jul 2, 2009 6:28 PM
Moderator message - Cross post locked
Edited by: Rob Burbank on Jul 2, 2009 12:38 PMSo what messages you are getting in messtab?
sy-subrc = 1.001 means transaction not completed with the given data, this may be due to wrong data passed.
Analyze messtab, you will come to know of the error.
Regards
Karthik D
Maybe you are looking for
-
Is adobe photoshop elements 2.0 still worth ?
I couldn't afford to buy the latest version of photoshop elements so I went ahead and got me this 2.0 version but after a few attempts I can not install it in my windows vista PC...please help
-
How to read a file on specific Directory
How to read a specific file on specific folder , For ex , in D: contain lot of directory , Let as assume �program �- Directory. �xxx.txt�-file, How to read �xxx.txt� file from program Directory, Give me simple pgm ,
-
When I go to download or update any apps I get an error 110
I have a HTC Incredible 2 and everytime I go to download or update an app it says Installation error Unknown reason - 110. How do I fix this? ASAP
-
Field catalog issue using REUSE_ALV_FIELDCATALOG_MERGE
Hello experts, I am using FM REUSE_ALV_FIELDCATALOG_MERGE and the field catalog is created fron the program. The field catalog finds the date field from the program but my internal table has been changed to make the date output YYYY/MM/DD. When I inp
-
We have an application running on IBM websphere server with the following JVM and heap settings Heap Settings Min Hep : 750MB, MaxHeap : 1500 MB JVM Settings -XX:PermSize=64m -XX:MaxPermSize=128m -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC In the verbo