Error Capturing in BDC Call Transaction Method
How does the Errors in BDC Call Transactin is captured ....can you please give same examples of using BDCMSGCOLL and FORMAT_MESSAGES..
Please explain clearly when to used these in real time..
Thankyou
hi,
Here is hte sample code
call transaction 'ME22' using it_bdc
options from x_ctu_params
messages into lt_message.
clear w_success.
if sy-subrc <> 0.
w_success = 'N'.
endif.
loop at lt_message where msgtyp = 'E' or
msgtyp = 'A'.
endloop.
if sy-subrc = 0.
perform format_messages tables lt_message
using lv_msg lv_lines.
* To append error messages
perform append_message tables lt_message
return
using lv_msg.
else.
if w_success = 'N'.
perform format_messages tables lt_message
using lv_msg lv_lines.
perform append_message_err tables lt_message
return
using lv_msg.
else.
perform format_messages tables lt_message
using lv_msg lv_lines.
* To append success messages
perform append_message tables lt_message
return
using lv_msg.
endif.
endif.
refresh: it_bdc,
lt_message.
endat.
endloop.
endif.
form format_messages tables pt_messages structure bdcmsgcoll
using pv_msg pv_lines.
clear : pv_lines,pt_messages,pv_msg.
describe table pt_messages lines pv_lines.
read table pt_messages index pv_lines.
check not pt_messages-msgid is initial.
*-- Function module to format the message given
call function 'FORMAT_MESSAGE'
exporting
id = pt_messages-msgid
lang = sy-langu
no = pt_messages-msgnr
v1 = pt_messages-msgv1
v2 = pt_messages-msgv2
v3 = pt_messages-msgv3
v4 = pt_messages-msgv4
importing
msg = pv_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 into pv_msg.
endif.
endform. " format_messages
Regards,
Richa
Similar Messages
-
Error in BDC CALL TRANSACTION METHOD..
hai i got an error in doing BDC CALL TRANSACTION METHOD
Error:diffrent number of parameters in FORM and PERFORM(routine :FILL_SCREEN_DETAILS:,number of formal parameters :3,number of actual parameters:1)
PROGRAM
REPORT ZDEMO_UPLOAD_COST_CENTER_DATA.
DATA:BEGIN OF WA_DATA,
KOKRS TYPE KOKRS,"CONTROLLING AREA
KOSTL TYPE KOSTL,"COST CENTER
DATAB TYPE DATAB,"START DATE
DATBI TYPE DATBI,"END DATE
KTEXT TYPE KTEXT,"NAME
LTEXT TYPE LTEXT,"DESCRIPTION
VERAK TYPE VERAK,"PERSON RESPONSIBLE
KOSAR TYPE KOSAR, "COST CENTER CATEGORY
KHINR TYPE KHINR,"HIERARCHY AREA
BUKRS TYPE BUKRS,"COMPANY CODE
GSBER TYPE GSBER,"BUISINESS AREA
END OF WA_DATA.
*TYPES:IT_DATA TYPE STANDARD TABLE OF TY_DATA.
DATA:IT_DATA LIKE TABLE OF WA_DATA,
IT_BDCDATA LIKE TABLE OF BDCDATA,
WA_BDCDATA LIKE LINE OF IT_BDCDATA,
IT_BDCMSGCOLL LIKE TABLE OF BDCMSGCOLL,
WA_BDCMSGCOLL LIKE LINE OF IT_BDCMSGCOLL.
DATA :V_FILE TYPE STRING.
CONSTANTS :C_KS01(4) TYPE C VALUE 'KS01',
C_X(1) TYPE C VALUE 'X',
C_A(1) TYPE C VALUE 'A'.
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETER :PA_FILE LIKE FC03TAB-PL00_FILE OBLIGATORY.
SELECTION-SCREEN:END OF BLOCK B1.
*AT SELECTION SCREEN ON VALUE REQUEST
* EVENT TO BE TRIGGERED WHEN WE PRESS F4.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FILE.
PERFORM GET_F4_FOR_FILE USING PA_FILE.
* START-OF-SELECTION
START-OF-SELECTION.
*WE NEED TO MOVE THE PA_FILE INTO ANOTHER VARIABLE OF TYPE STRING
*AS WE ARE GOING TO USE THE SAME IN THE FM:GUI_UPLOAD THERE THE FILE TYPE IS STRING
V_FILE = PA_FILE.
PERFORM UPLOAD_FILE_T0_ITAB USING V_FILE CHANGING IT_DATA.
*FILL THE SCREEN AND FIELD DETAILS
LOOP AT IT_DATA INTO WA_DATA.
REFRESH IT_BDCDATA.
*FIRST SCREEN DETAILS
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0200''X'.
*CURSOR DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-KOKRS'.
*OK CODE DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''/00'.
*CONTROLLING AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOKRS' WA_DATA-KOKRS.
*COST CENTER DETAILS
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOSTL' WA_DATA-KOSTL.
* START DATE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATAB_ANFO' WA_DATA-DATAB.
*END DATE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATBI_ANFO' WA_DATA-DATBI.
*NEXT SCREEN DETAILS
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0299''X'.
*OKCODE DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''=BU'.
*SUBSCRN FIELD DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_SUBSCR''BDC-SUBSCR'.
*CURSOR DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-WAERS'.
*NAME
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KTEXT' WA_DATA-KTEXT.
*DESCRIPTION
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-LTEXT' WA_DATA-LTEXT.
*PERSON RESPONSIBLE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-VERAK' WA_DATA-VERAK.
*COST CENTER CATEGORY
PERFORM FILL_FIELD_DETAILS USING'CSKSZ-KOSAR' WA_DATA-KOSAR.
*HIERARCHY AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KHINR' WA_DATA-KHINR.
*COMPANY CODE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-BUKRS' WA_DATA-BUKRS.
*BUISINESS AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-GSBER' WA_DATA-GSBER.
*CALL THE TRANSACTION
CALL TRANSACTION C_KS01 USING IT_BDCDATA
MODE C_A "ALL SCREENS
"N-NO SCREENS
"E-ERROR SCREENS ONLY
UPDATE 'A' "ASYNCHRONOUS
"SYNCHRONOUS
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
* FORM FILL SCREEN_DETAILS
FORM FILL_SCREEN_DETAILS USING PROGRAM LIKE BDCDATA-PROGRAM
DYNPRO LIKE BDCDATA-DYNPRO
DYNBEGIN LIKE BDCDATA-DYNBEGIN.
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = DYNBEGIN.
APPEND WA_BDCDATA TO IT_BDCDATA.
ENDOFRM.
* FORM FILL_FIELD_DETAILS
FORM FILL_FIELD_DETAILS USING FNAM FVAL.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
ENDFORM.
* FORM GETE_F4_FOR_FILE
*DISPLAY ALL THE FILES IN THE SYSTEM FOR SELECTION
*P_PA_FILE NAME OF THE FILE
FORM GET_F4_FOR_FILE USING P_PA_FILE.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
* EXPORTING
* PROGRAM_NAME = SYST-REPID
* DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'PA_FILE'
* STATIC = ' '
* MASK = ' '
CHANGING
FILE_NAME = PA_FILE.
* EXCEPTIONS
* MASK_TOO_LONG = 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.
* FORM UPLOAD_FILE_TO_ITAB
* FP_V_FILE = FILE NAME
*FP_IT_DATA = INTERNAL TABLE TO STORE THE DATA
FORM UPLOAD_FILE_TO_ITAB USING FP_V_FILE CHANGING FP_IT_DATA LIKE IT_DATA.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FP_V_FILE
HAS_FIELD_SEPARATOR = ' X'
TABLES
DATA_TAB =FP_IT_DATA.
ENDFORM.
Edited by: saifudheenc on Aug 7, 2010 5:09 PMhi
try to add spaces between parameters :
example:
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1' '0200' 'X'.
regards,darek -
Reg Vendor master upload using BDC Call Transaction Method
Hi All,
Thanks in advance.
I am uploading vendor master data using bdc call transaction method for XK01. In that i am getting an error message that the fields " smtp_addr" ( for email) and "time_zone" (for time zone) doesnot exist on the screen '0110' ( this is the second screen) . the field timezone will be displayed on the screen only when we go for communications button and select the URL field .
Do anybody have the solution for this problem. if possible can you give me the code for that screen.Create a recording via SM35 (menu go to=>recording), this will generate automatically the code for filling your bdcdata-table...
-
Error Records in BDC Call transaction
Hi.....
I am new to BDC concept... Can any of u tell me how to collect error records in BDC Call transaction... I already collected error messages through BDCMSGCOL... but i dont know how to collect those error records... here i am using two different flat files for header and line item... and kindly tell me if there is an error in line item how to get it so with relevent header details...
thanks,Hi,
LOOP AT t_bdcmsgcoll INTO w_bdcmsgcoll.
PERFORM f_format_msg USING w_bdcmsgcoll CHANGING w_return.
ENDLOOP.
Form format_msg
DATA : l_mstring(480).
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = w_bdcmsgcoll-msgid
lang = w_bdcmsgcoll-msgspra
no = w_bdcmsgcoll-msgnr
v1 = w_bdcmsgcoll-msgv1
v2 = w_bdcmsgcoll-msgv2
v3 = w_bdcmsgcoll-msgv3
v4 = w_bdcmsgcoll-msgv4
IMPORTING
msg = l_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
End format_msg
you can use the l_mstring to process further and pass to the bapiret2 table
Regards,
Vijaya -
Local mode update in bdc -Call transaction method
what is LOCAL MODE UPDATE in BDC- Call transaction methods ?
Hi,
Try to understand from the below CODE
CALL TRANSACTION 'ZBDCSINGLE' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES INTO IT_BDCMSGCOLL.
REFRESH IT_BDCDATA.
Cheers!! -
Holder(A008) is not maintaing in HRP1001 (BDC - Call Transaction Method)
Dear Friends,
Holder (A008) in HRP1001 is not maintained for some hiried persons through BDC - Call Transaction Method.
Except Holder update eveything is updated in the hrp1001.
When we hire a perosn through PA40, then its automatically maintaining Holder ( A008 ) in HRP1001. But for the same case through BDC program with Call Transaction method, its not maintaining Holder.
What can be reason behind not updating holder in HRP1001. How we can maintain Holder in this case.
Thanks
Rav
Edited by: Rav Jordan on Jan 10, 2012 8:03 AMHi Keshav,
Thanks for your response.
After running
CALL TRANSACTION 'PA40' USING BDCDATA
MODE CTUMODE " 'A'
UPDATE 'A'
MESSAGES INTO MESSTAB.
if sy-subrc eq '0'.
i am selecting perner created from pa0002.
now to update holder i am using fucntion module.
WA_HOLD-AEDTM = SY-DATUM.
WA_HOLD-UNAME = SY-UNAME.
WA_HOLD-OBJID = P_PLANS.
WA_HOLD-BEGDA = DT.
WA_HOLD-ENDDA = '99991231'.
WA_HOLD-OTYPE = 'S'.
WA_HOLD-PLVAR = '01'.
WA_HOLD-RSIGN = 'A'.
WA_HOLD-RELAT = '008'.
WA_HOLD-SCLAS = 'P'.
WA_HOLD-SOBID = GD_PERNR.
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
FCODE = 'INSE'
VTASK = 'A'
ORDER_FLG = 'X'
COMMIT_FLG = 'X'
AUTHY = 'X'
PPPAR_IMP =
OLD_TABNR = ' '
REPID = ' '
FORM = ' '
KEEP_LUPD =
WORKF_ACTV = 'X'
TABLES
INNNN = WA_HOLD
ILFCODE =
EXCEPTIONS
NO_AUTHORIZATION = 1
ERROR_DURING_INSERT = 2
REPID_FORM_INITIAL = 3
CORR_EXIT = 4
BEGDA_GREATER_ENDDA = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
This also not updating holder in the hrp1001 postion in the table.
May i know where to do change in the code so that holder can be maintained.
Thanks
Rav -
Hi all, BDC call transaction METHOD, trapping ERRORS
hi
i have developed BDC (recording via call transaction method) for VB01.
could u please tell me how to display records having errors after running recording or to give index of records having errors.
and is it possible to give transaction code for recording since my bdc is executable program.
plase answer both the questions.
thanxHere is the flow that Raja is explaining to you.
DATA: v_index LIKE sy-tabix.
LOOP AT itab.
v_index = sy-tabix.
*-- prepare the BDC data
CALL TRANSACTION 'VB01' USING bdcdata
MODE 'N'
MESSAGES INTO bdcmsgcoll.
READ TABLE bdcmsgcoll WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
*-- Error occured for the record with index <b>v_index</b>
ELSE.
*-- unless there is a success message with this number,
* it is not succesfull because 'No data for screen xxx'
* will not show up as an error message type, but will be
* a success message type
READ TABLE bdcmsgcoll WITH KEY msgnr = '312'.
IF sy-subrc = 0.
*-- success
ELSE.
*-- error with index <b>v_index</b>
ENDIF.
ENDIF.
ENDLOOP.
As you can see, now you have the index of the record where the error occured. Now this will become complicated if you are combining several records into one transaction call. In that case you need to find how you can know all the records that you just accumulated.
As an example, let us say you have an internal table with external number, customer, material, quantity and at every new external number, you want to create a sales order. Until you get a new external number, you will not do the call transaction because until then it will be items of the same sales order. So in this case, after the call transaction, you will have get all the records that belong to making this sales order by using the external number and then prepare your messages.
I hope this is clear.
Srinivas
Message was edited by: Srinivas Adavi -
Handling Warning pop up windows in BDC call transaction method
Hi All,
Iam using a BDC to automate the Costing Process i.e. Transaction CK40N using call transaction method. In a particular Screen after i perform the execute action, a warning pop up window appears. Only if I click on OK, the execution continues or else it will not proceed. How to handle this situation in case a warning pop up window appears based on the input which is given? In other words a Dynamic warning message. Thanks in advance....
Regards,
NirmalHello,
U can either use NO_DIALOG or SUPPRESS DIALOG to avaid this,.
Regards,
Vasanth -
Screen no change in BDC call transaction method
Hi experts
Greetings!
I have a BDC created in call transaction method for t-code FB01.
Data passed successfully to the first screen but when it navigates to the second screen I am not able to pass any data.
After debugging I found that the issue was because of the DYNPRO value.
It was 8500 when I created this recording but now the screen number shows 350.
Is is possible that screen nos change because of any support stack or OSS notes implementation.
In run time i tried to change the value to 350 and it works fine..
Thanks
JayHi,
LSMW Direct input method is better for your quiry. Becasuse i wrote BDC for FB01 but not working properly.
So i used LSMW, helped me a lot. Progmra name is RFBIBL00. Or else i will export and send you if you want. It can handle multiple line items upto 950.
Thanks,
Sriram -
How can we update mk01 with BDC call transaction method
can any one send the sample code for upload of MK01 using call transaction method.
its urgent..Use the following code.
*& Report ZMK01_VA01 *
REPORT Z_MK01 .
SOURCE INTERNAL TABLE
DATA: BEGIN OF T_SOURCE OCCURS 0,
LIFNR TYPE LIFNR,
EKORG TYPE EKORG,
KTOKK TYPE KTOKK,
NAME1 TYPE NAME1,
SORTL TYPE SORTL,
LAND1 TYPE LAND1,
WAERS TYPE WAERS,
END OF T_SOURCE.
*DATA: E_MESSAGE TYPE C.
ERROR MESSAGE TABLE
DATA: T_ERRORMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
TARGET TABLE LIKE BDCDATA
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
TO UPLOAD DATA FROM LEGACY SYSTEM
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'D:\MK01.TXT'
FILETYPE = 'DAT'
IMPORTING
FILELENGTH =
TABLES
data_tab = T_SOURCE
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 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.
TRANSFERING DATA FROM INTERNAL SOURCE TABLE TO TARGET TABLE
LOOP AT T_SOURCE.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0107'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
T_SOURCE-LIFNR.
perform bdc_field using 'RF02K-EKORG'
T_SOURCE-EKORG.
perform bdc_field using 'RF02K-KTOKK'
T_SOURCE-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
T_SOURCE-NAME1.
perform bdc_field using 'LFA1-SORTL'
T_SOURCE-SORTL.
perform bdc_field using 'LFA1-LAND1'
T_SOURCE-LAND1.
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' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
T_SOURCE-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'MK01' USING BDCDATA MODE 'A' MESSAGES INTO T_ERRORMSG.
ENDLOOP.
LOOP AT T_ERRORMSG.
WRITE:/ 'MESSAGE TYPE',T_ERRORMSG-MSGTYP,
'FIELDNAME WERE ERROR OCCURED', T_ERRORMSG-FLDNAME.
*CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = T_ERRORMSG-MSGID
LANG = SY-LANGU
NO = T_ERRORMSG-MSGNR
V1 = T_ERRORMSG-MSGV1
V2 = T_ERRORMSG-MSGV2
V3 = T_ERRORMSG-MSGV3
V4 = T_ERRORMSG-MSGV4
IMPORTING
MSG = E_MESSAGE
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:/ E_MESSAGE.
ENDLOOP.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
With Regards
K Srinivas -
In bdc call transaction method which one ll prefer synchronous or asynchron
hi could anybody tel me
call transaction method which one is preferred synchronous or asynchronous..?
what ll happen if we do other method..?
foreground or background which one ll prefer..?
what ll happen if we do otehr method..?
on which condition we have to use synchronous and asynchronous
on which condition we have to use foreground and background
thanx
kals.Hi,
if you haven't done yet please visit for general information:
http://help.sap.com/saphelp_nw70/helpdata/en/d2/f8f3393bef4604e10000000a11402f/frameset.htm
for further information:
http://help.sap.com/saphelp_nw70/helpdata/en/69/c2501a4ba111d189750000e8322d00/frameset.htm
This will hopefully answer your question.
Regards
Bernd -
Simple doubt in BDC Call Transaction Method
Hi Friends,
When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.
Thanks in Advance.I am not passing through the selection screen . It is like iteractive report. when i select the particular line in the list output then the screen fields should take the values from that selected line. First time when i select the line it is taking properly.
But next time when i select the line the content of the i_bdc_tbl is changing correctly but when it enter in to the transaction it is not taking the values from the i_bdc_tbl. Simply it is displaying the screen fields with the old values. It is not updating the screen fields with the values from the i_bdc_tbl. Why the screen fields are not replaced with the value of i_bdc_tbl? Why it is not getting refreshed with the new values?
Just i am posting the bdc portion of my code here. So you can help me out on this.
AT LINE-SELECTION.
SELECT SINGLE kozgf FROM t685 INTO v_kozgf
WHERE kschl = wa_report-kschl.
SELECT kolnr kotabnr FROM t682i INTO TABLE i_t682i
WHERE kozgf = v_kozgf.
SORT i_t682i BY kolnr.
READ TABLE i_t682i WITH KEY kotabnr = wa_report-tabna+1(3)
TRANSPORTING NO FIELDS.
CHECK sy-subrc = 0.
v_index = sy-tabix.
REFRESH i_bdc_tbl.
l_tabix = '01'.
PERFORM f_vk13.
CONCATENATE 'RV13' wa_report-tabna INTO v_bdc_val_field.
PERFORM bdc_dynpro USING v_bdc_val_field '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'F004-LOW'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ONLI'.
CREATE DATA v_rec TYPE (wa_report-tabna).
ASSIGN v_rec->* TO <wa_table>.
SELECT SINGLE * FROM (wa_report-tabna) INTO <wa_table>
WHERE kschl = wa_report-kschl AND matnr = wa_report-matnr AND knumh = wa_report-objectid.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = wa_report-tabna
TABLES
dfies_tab = lwa_tabna
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
READ TABLE lwa_tabna WITH KEY fieldname = 'KSCHL'.
p1 = sy-tabix + 1.
READ TABLE lwa_tabna WITH KEY fieldname = 'MATNR'.
p2 = sy-tabix.
LOOP AT lwa_tabna.
v_field = lwa_tabna-fieldname.
IF lwa_tabna-position BETWEEN p1 AND p2.
ASSIGN COMPONENT lwa_tabna-position OF STRUCTURE <wa_table> TO <fld>.
PERFORM f_vk13_s2 USING lwa_tabna-fieldname <fld>.
ENDIF.
ENDLOOP.
PERFORM bdc_field USING 'RV130-DATAM'
wa_report-fdate_value_new.
PERFORM bdc_field USING 'BDC_OKCODE'
'ONLI'.
PERFORM bdc_field USING 'BDC_CURSOR'
'F001'.
CALL TRANSACTION 'VK13' USING i_bdc_tbl
MODE 'A'.
FORM f_vk13.
DATA: l_tabix(2) TYPE c.
*Condition type
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RV13A-KSCHL'
wa_report-kschl.
*Key combination
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(01)'
l_tabix = v_index.
SHIFT l_tabix RIGHT.
OVERLAY l_tabix WITH '00'.
CONCATENATE 'RV130-SELKZ(' l_tabix ')' INTO v_bdc_field.
PERFORM bdc_field USING v_bdc_field
'X'.
ENDFORM. "f_vk13
FORM BDC_DYNPRO
This form accepts the program name and screen number
and places the values into the I_BDC_TBL internal table.
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdc_tbl.
wa_bdc_tbl-program = program.
wa_bdc_tbl-dynpro = dynpro.
wa_bdc_tbl-dynbegin = 'X'.
APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM. "BDC_DYNPRO
FORM F_BDC_FIELD
This form accepts the field name and the corresponding value
for that field and places them into the I_BDC_TBL internal table.
FORM bdc_field USING fnam fval.
CLEAR wa_bdc_tbl.
MOVE fnam TO wa_bdc_tbl-fnam.
MOVE fval TO wa_bdc_tbl-fval.
APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM. "BDC_FIELD
*& Form f_vk13_s2
text
--> p1 text
<-- p2 text
FORM f_vk13_s2 USING p_fieldname p_fld.
CONCATENATE wa_report-tabna '-' p_fieldname INTO v_bdc_val_field.
CHECK NOT p_fld IS INITIAL.
PERFORM bdc_field USING v_bdc_val_field p_fld.
ENDFORM. " f_vk13_s2
Thanks. -
Should 'call transaction' be called inside the loop or outside the loop in BDC?
Hi Sangeeta,
It depends on the scenario in which your going to call the transaction. Consider a situation in which I was required to write a BDC program for Task List dependency editor (IA06 transaction). Every Task List can have a number of operations and operation can have suboperations. I was required to call the transaction for only the Task List Number and not for individual operations and suboperations. In such a scenario , we populate the BDCDATA internal table inside a loop . The process of calling the transaction can be done in the loop itself (using some flags and ON CHANGE and IF statements) or after the Task List Number changes exit the loop(using the EXIT statement) and then do the call transaction. So its just the ease with which you can implement your logic, that you call the transaction inside the loop or outside the loop. The only thing to be remembered is that BDCDATA internal table should be populated before you call the transaction. -
Hi,
I am uplaoding CoA profile data using BDC call transaction method, but records could not be uplaoded because of the error " Screen 0000 is too large for internal batch input Area". I didnt understand what is the reason for this error.
Could you plesae help in this?Hi,
Keep the REFRESH KTAB after first Endloop.
Like
LOOP AT ITAB.
LOOP AT KTAB.
ENDLOOP.
REFRESH KTAB.
ENDLOOP.
Edited by: subas Bose on Mar 26, 2010 7:17 PM -
Dif betwen BDC call transaction and session method
Hi to all,
This is my problem. I want to know, what is the difference between BDC call Transaction method and Session method. where the situation we can use these methods.
I will be thankfull to all.Session Method :
Asynchronous Processing.
Transfers Data for Multiple Transactions
Synchronous Database Update
During Processing, No Transaction is started until the previous transction has been written to the database.
A Batch Input Processing log is generated for each session
Sessions can not be generated in Parallel.
The Batch Input Porgram must not open a Session until it has closed the preceding Session.
Call Transaction :
Synchronous Processing.
Transfers Data for a single transaction.
Synchronous and Asynchronous Database updating both Possible.
The Program Specifies which kind of updating is desired.
Seperate LUW for the transaction.
The System Performs a database commit immediately before and after the CALL TRANSACTION Using Statement.
No Batch Input Processing Log is generated.
These are the differences between session and call transaction method.
Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.
Maybe you are looking for
-
Hello, Though the article is old, I hope someone can help me. I need to do two things (on of which is partly explained here). 1.) Be able to open a fillable pdf located in a SharePoint document Library (located at the parent site level) in an InfoPa
-
when i do it using mxml, the list populates but when i try doing it using actionscript 3 it is not working. //DOESNT WORK... var catList:List = new List; catList.dataProvider = multiDArr; catList.labelField = 'label'; this.addChild(catList); //WORKS.
-
Mac App Store black background and broken layout??
Hello! I've been using my MacBook now for the last 4 weeks and I love it! But I got a problem which I cannot use my app store properly. This is now how it looks like: Is there a way to fix this problem? If there is, will it affect my DATA? Thanks and
-
PRODUCT NUMBER: XV699PA#ACJ SERIAL NUMBER: [edited] bought in Dec 2012 I have been facing many issues within 15days of purchase of this new laptop. I have been reporting issues through HP contact care center but no one seem to log the complaints corr
-
IPad 2 memory error when trying to buy movies or games.
My ipad 2 says I still have 4.9 GB free in iCloud and 194MB in storage, yet iTunes won't let me download anything. We're on vacation and took a few long videos, could that be affecting my usage? If so, unless I have access to a computer to upload the