Call transaction fb60
Hello again,
I have an ALV report , I have to call transaction FB60 by double click.
This transaction has no parameter ID.
I tried with with Submit ' but got dump since the program is type M.
How can I call FB60?
Regards
Yifat
Record BDC for FB60 using SHDB TCODE..Code for BDC of FB60 for one record of ALV..
Cheers
Similar Messages
-
Baseline date mesg not appear when call transaction FB60 in custom tcode
Hi Experts,
One of the custom tcode which calls the standard tcode FB60.
If we give the last month date in payment date, it should shows the 'Due date is in the past' message and if we give next year as payment date i.e, more than 365 days, then show 'Baseline date foe pmnt is 700 days after the document date : check'.. These messages are coming when we call the standard tcode FB60 directly.
But if call it in the custom tcode, these messages are not appear.
Thanks,
Mani.Hi Experts,
One of the custom tcode which calls the standard tcode FB60.
If we give the last month date in payment date, it should shows the 'Due date is in the past' message and if we give next year as payment date i.e, more than 365 days, then show 'Baseline date foe pmnt is 700 days after the document date : check'.. These messages are coming when we call the standard tcode FB60 directly.
But if call it in the custom tcode, these messages are not appear.
Thanks,
Mani. -
Hi,
i am facing problem in call transaction for fb60.
since we have three company code 1000 2000 n 3000.
so when we select the company code for change and change it and when press ok then cursor come to vendor account.
i did the recording in shdb by the same method but after transfering the code and making some manual correction it stuck after pressing ok button for company code in uploading.
it ask for vendor account and makes the all other fields gray and code stop there.
what should i do since i rarely used bdc but here i m bounded to use that.
please suggest me the solution.
*EACH HELPFULL ANSWER WILL BE REWARDED
report ZFIB_FB60
no standard page heading line-size 255.
DATA: BEGIN OF T_FB60 OCCURS 0,
BUKRS TYPE BKPF-BUKRS,
ACCNT TYPE INVFO-ACCNT,
BLDAT(10) TYPE C,
XBLNR TYPE INVFO-XBLNR,
BUDAT(10) TYPE C,
WRBTR(13) TYPE C,
WAERS TYPE INVFO-WAERS,
WMWST(13) TYPE C,
MWSKZ TYPE INVFO-MWSKZ,
SECCO TYPE INVFO-SECCO,
SGTXT TYPE INVFO-SGTXT,
HKONT TYPE ACGL_ITEM-HKONT,
WRBTR1(13) TYPE C,
ZUONR TYPE ACGL_ITEM-ZUONR,
VALUT(10) TYPE C,
SGTXT1 TYPE ACGL_ITEM-SGTXT,
KOSTL TYPE ACGL_ITEM-KOSTL,
END OF T_FB60.
DATA: W_FNAME TYPE STRING.
include bdcrecx1.
SELECTION-SCREEN BEGIN OF BLOCK BLK_001 WITH FRAME TITLE TEXT-001.
PARAMETERS : PR_FNAME LIKE RLGRAP-FILENAME.
SELECTION-SCREEN END OF BLOCK BLK_001.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_FNAME.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = PR_FNAME.
START-OF-SELECTION.
W_FNAME = PR_FNAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_FNAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = T_FB60.
LOOP AT T_FB60.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'/ECCDE'.
perform bdc_dynpro using 'SAPLACHD' '1000'.
perform bdc_field using 'BDC_CURSOR'
'BKPF-BUKRS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'BKPF-BUKRS'
T_FB60-BUKRS.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF05A-BUSCS'
'R'.
perform bdc_field using 'BDC_CURSOR'
'INVFO-ACCNT'.
perform bdc_field using 'INVFO-BUDAT'
T_FB60-BUDAT.
perform bdc_field using 'INVFO-WAERS'
T_FB60-WAERS.
perform bdc_field using 'INVFO-ACCNT'
T_FB60-ACCNT.
perform bdc_field using 'INVFO-BLDAT'
T_FB60-BLDAT.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'DUMMY'.
perform bdc_field using 'RF05A-BUSCS'
'R'.
perform bdc_field using 'BDC_CURSOR'
'INVFO-MWSKZ'.
perform bdc_field using 'INVFO-ACCNT'
T_FB60-ACCNT.
perform bdc_field using 'INVFO-XBLNR'
T_FB60-XBLNR.
perform bdc_field using 'INVFO-WRBTR'
T_FB60-WRBTR.
perform bdc_field using 'INVFO-WAERS'
T_FB60-WAERS.
perform bdc_field using 'INVFO-WMWST'
T_FB60-WMWST.
perform bdc_field using 'INVFO-MWSKZ'
T_FB60-MWSKZ.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'RF05A-BUSCS'
'R'.
perform bdc_field using 'INVFO-ACCNT'
T_FB60-ACCNT.
perform bdc_field using 'INVFO-XBLNR'
T_FB60-XBLNR.
perform bdc_field using 'INVFO-WRBTR'
T_FB60-WRBTR.
perform bdc_field using 'INVFO-WMWST'
T_FB60-WMWST.
perform bdc_field using 'INVFO-MWSKZ'
T_FB60-MWSKZ.
perform bdc_field using 'INVFO-SECCO'
T_FB60-SECCO.
perform bdc_field using 'INVFO-SGTXT'
T_FB60-SGTXT.
perform bdc_field using 'BDC_CURSOR'
'ACGL_ITEM-KOSTL(01)'.
perform bdc_field using 'ACGL_ITEM-HKONT(01)'
T_FB60-HKONT.
perform bdc_field using 'ACGL_ITEM-WRBTR(01)'
T_FB60-WRBTR1.
perform bdc_field using 'ACGL_ITEM-TXJCD(01)'
perform bdc_field using 'ACGL_ITEM-ZUONR(01)'
T_FB60-ZUONR.
perform bdc_field using 'ACGL_ITEM-VALUT(01)'
T_FB60-VALUT.
perform bdc_field using 'ACGL_ITEM-SGTXT(01)'
T_FB60-SGTXT1.
perform bdc_field using 'ACGL_ITEM-KOSTL(01)'
T_FB60-KOSTL.
CLEAR T_FB60.
ENDLOOP.
CALL TRANSACTION 'FB60' USING BDCDATA
MODE 'A' "CTUMODE
UPDATE 'S' "CUPDATE
MESSAGES INTO MESSTAB.
Thanks and Regards
vijay dwivedihi vijay,
i might just be able to help you with this one..
i just finished doing BDc (i did one posting) in FB60,
so here is the solution..
1) record company code change step
2) header entry step
3) detail entry step
FOR CHECKING COMPANY CODE after each call..
just check the value stored in PARAMETER ID 'BUK'
GET PARAMETER ID 'BUK' FIELD CO_CD_CHECK.
now checking the CO_CD_CHECK we can make the logic to skip the company code change part,
just go to header entry and detail entry step..
and if compnay code is not what you want..
enter company code change then header entry detail entry..
revert back with any queries you have in your mind
i might give you the solution
regards
Rohan -
Number of parked invoice call transaction
Hi
I use this code in my programme and i want to catch th number of parked invoice generated.
invoice is succfully parked but wt_message is empty ( no line)
Can you halp me.
DATA opt type CTU_PARAMS.
opt-NOBINPT = 'X'.
opt-DISMODE = 'N'.
opt-UPDMODE = 'A'.
CALL TRANSACTION 'FB60' USING BDCDATA
OPTIONS FROM opt
MESSAGES INTO WT_MESSTAB.
best regardread the Internal table WT_MESSTAB with success message and show the message with number of success message as an message to the user..
Raghav -
Hi Problem in call transaction program of FB60
Hi Techies,
in my call transaction program for FB60 compnay code is defaulted in the initial screen.Every time i need to post different records with the different company codes.
when i record the company code change in FB60 through SHDB once i chnage the company code it is coming out of the recording.
pls let me know how can i continue FB60 transaction once i change the company code for further processing.
and let me know and logic to handle the compnay code when it is defaulted in FB60.
Thanks in advance
Krishna DHi,
Try this code and cross check with urs.
CASE SY-UCOMM.
WHEN '&BATCH'. "Batch Field
PERFORM F1000_BDC_MM03 USING LV_MATNR LV_WERKS.
endcase.
FORM F1000_BDC_MM03 USING P_LV_MATNR
P_LV_WERKS.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4110'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=GESV'.
CALL TRANSACTION C_TRANSACTION_CALL_MM03 USING I_BDCDATA MODE 'E'
MESSAGES INTO I_MESSTAB.
ENDFORM. " f1000_bdc_mm03
&----& Form bdc_dynpro
&---- Appending the BDC dynpros to internal table BDCDATA
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR W_BDCDATA.
W_BDCDATA-PROGRAM = PROGRAM.
W_BDCDATA-DYNPRO = DYNPRO.
W_BDCDATA-DYNBEGIN = 'X'.
APPEND W_BDCDATA TO I_BDCDATA.
ENDFORM.
DATA: I_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
Internal table to hold BDC messages
I_MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL.
&----& Form bdc_field
Appending the BDC FIELDS to internal table BDCDATA
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR W_BDCDATA.
W_BDCDATA-FNAM = FNAM.
W_BDCDATA-FVAL = FVAL.
APPEND W_BDCDATA TO I_BDCDATA.
ENDIF.
ENDFORM.
Tahnks & Regards,
Judith -
BADi called from transaction FB60
Hi all
I am looking for a BADi called from transaction FB60 in ECC 6.0. This is needed due to the fact we will develope a solution where we transfer the cost from an invoice booked to an intern order and transfer the cost and currency to CRM 7.0. Please if there is anybody who know a Badi that is triggered when the transaction FB60 is Saved, it will be very help full to us.
Best Regards
CamillaHi,
Re: Need user exit or BADI for FB60
Best regards, Christian -
IDOC/ BAPI for transaction FB60
Hi Experts,
Can anybody tell me IDOC/ BAPI for transaction FB60 for document type (KR = Original Invoice).
ThanksHi Venkata,
Please refer below code, this works similar to FB60.
REPORT z_bapi_test.
*REPORT acc_bapi_test_document .
SELECTION-SCREEN BEGIN OF BLOCK bl01 .
PARAMETERS:
check_l RADIOBUTTON GROUP rb1,
check_a DEFAULT 'X' RADIOBUTTON GROUP rb1,
post RADIOBUTTON GROUP rb1.
SELECTION-SCREEN ULINE.
PARAMETERS:
rev_c RADIOBUTTON GROUP rb1,
rev_p RADIOBUTTON GROUP rb1.
SELECTION-SCREEN ULINE.
PARAMETERS:
ref_key LIKE bapiache01-obj_key DEFAULT 'TEST000001BAPICALL',
dest LIKE bdi_logsys-logsys DEFAULT ' '.
SELECTION-SCREEN END OF BLOCK bl01 .
DATA:
gd_documentheader LIKE bapiache09,
gd_customercpd LIKE bapiacpa09,
gd_fica_hd LIKE bapiaccahd,
it_accountreceivable LIKE TABLE OF bapiacar09 WITH HEADER LINE,
it_accountgl LIKE TABLE OF bapiacgl09 WITH HEADER LINE,
it_accounttax LIKE TABLE OF bapiactx09 WITH HEADER LINE,
it_criteria LIKE TABLE OF bapiackec9 WITH HEADER LINE,
it_valuefield LIKE TABLE OF bapiackev9 WITH HEADER LINE,
it_currencyamount LIKE TABLE OF bapiaccr09 WITH HEADER LINE,
it_return LIKE TABLE OF bapiret2 WITH HEADER LINE,
it_receivers LIKE TABLE OF bdi_logsys WITH HEADER LINE,
it_fica_it LIKE TABLE OF bapiaccait WITH HEADER LINE,
it_accountpayable LIKE TABLE OF bapiacap09 WITH HEADER LINE,
it_paymentcard LIKE TABLE OF bapiacpc09 WITH HEADER LINE,
it_ext LIKE TABLE OF bapiacextc WITH HEADER LINE.
it_re LIKE TABLE OF bapiacre09 WITH HEADER LINE,
it_ext2 LIKE TABLE OF bapiparex WITH HEADER LINE.
PERFORM fill_internal_tables.
IF check_l = 'X'.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
DESTINATION dest
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
WRITE: / 'Result of check lines:'. "#EC NOTEXT
PERFORM show_messages.
ENDIF.
IF check_a = 'X'.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
DESTINATION dest
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
WRITE: / 'Result of check all:'. "#EC NOTEXT
PERFORM show_messages.
ENDIF.
IF post = 'X'.
DATA: l_type LIKE gd_documentheader-obj_type,
l_key LIKE gd_documentheader-obj_key,
l_sys LIKE gd_documentheader-obj_sys.
IF dest = space OR
dest = gd_documentheader-obj_sys.
post synchron
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
IMPORTING
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
WRITE: / 'Result of post:'. "#EC NOTEXT
PERFORM show_messages.
ELSE.
create Idoc
it_receivers-logsys = dest.
APPEND it_receivers.
CALL FUNCTION 'ALE_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
paymentcard = it_paymentcard
contractitem = it_fica_it
extension2 = it_ext2
realestate = it_re
receivers = it_receivers
COMMUNICATION_DOCUMENTS* APPLICATION_OBJECTS EXCEPTIONS
error_creating_idocs = 1
OTHERS = 2 .
IF sy-subrc = 0.
WRITE: / 'IDoc created'. "#EC NOTEXT
ELSE.
WRITE: sy-msgid.
ENDIF.
ENDIF.
ENDIF.
IF rev_p = 'X' OR rev_c = 'X'.
DATA: rev LIKE bapiacrev,
rev_key LIKE ref_key.
rev_key = ref_key.
rev_key(1) = 'R'.
rev-obj_type = gd_documentheader-obj_type.
rev-obj_key = rev_key.
rev-obj_sys = gd_documentheader-obj_sys.
rev-obj_key_r = ref_key.
IF rev_c IS INITIAL.
IF dest = space OR
dest = gd_documentheader-obj_sys.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'
EXPORTING
reversal = rev
bus_act = gd_documentheader-bus_act
TABLES
return = it_return.
ELSE.
it_receivers-logsys = dest.
APPEND it_receivers.
CALL FUNCTION 'ALE_ACC_DOCUMENT_REV_POST'
EXPORTING
reversal = rev
busact = gd_documentheader-bus_act
OBJ_TYPE = 'BUS6035'
SERIAL_ID = '0'
TABLES
receivers = it_receivers
COMMUNICATION_DOCUMENTS* APPLICATION_OBJECTS EXCEPTIONS
error_creating_idocs = 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.
ELSE.
WRITE: / 'IDoc created'. "#EC NOTEXT
ENDIF.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_CHECK'
EXPORTING
reversal = rev
bus_act = gd_documentheader-bus_act
TABLES
return = it_return.
ENDIF.
WRITE: / 'Result of Reversal Posting:'. "#EC NOTEXT
PERFORM show_messages.
ENDIF.
COMMIT WORK.
Kindly close if it helps you.
Regards
Abhii... -
Run in test mode call transaction
I have written a bdc program using call transaction method. I am giving the option in the
selection screen like run in test mode.so i want to display the error mess
without actually updating the tables,
if there is a way to do this
please tell me how to run in test mode.
thank you so much for all the replies.have written a bdc program using call transaction method. I am giving the option in the
selection screen like run in test mode.so i want to display the error mess
without actually updating the tables,
if there is a way to do this
please tell me how to run in test mode.
thank you so much for all the replies.
Hi
it is not possible, once u run call tranation the data is updated in table.
for ur requirement, put the option in test mode in selection screen, in this mode flat file data check with master data (flat file validations
) , if any errors it disaly errors in a report.
i provide some code, this is for fb60 check this code
FORM validate *
FORM validate.
delete t_record index 1.
loop at t_record.
delete t_record where accnt = ' '.
translate t_record-bukrs to upper case.
translate t_record-accnt to upper case.
translate t_record-waers to upper case.
translate t_record-xblnr to upper case.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = t_record-accnt
IMPORTING
OUTPUT = t_record-accnt.
move-corresponding t_record to n_record.
append n_record.
clear n_record.
endloop.
loop at t_record.
clear flag.
delete t_record where accnt = ' '.
vendor and company code checking.
translate t_record-accnt to upper case.
translate t_record-bukrs to upper case.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = t_record-accnt
IMPORTING
OUTPUT = t_record-accnt.
select single * from lfb1 where bukrs = t_record-bukrs
and lifnr = t_record-accnt.
if sy-subrc <> 0.
flag = 'X'.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
error_record-text1 = 'The Vendor not Under this company Code'.
endif.
With holding liability.
select single * from lfbw where bukrs = t_record-bukrs
and lifnr = t_record-accnt
and WT_SUBJCT = 'X'.
if sy-subrc <> 0.
flag = 'X'.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
error_record-text2 = 'The Vendor doesnt have Withholding Tax Liability'.
endif.
G/L account check with company code*
select single * from skb1 where bukrs = t_record-bukrs
and saknr = t_record-hkont.
if sy-subrc <> 0.
flag = 'X'.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
error_record-text3 = 'The G/L acc not under the given company code'.
endif.
*cost centre checking
this FM for leading zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = t_record-kostl
IMPORTING
OUTPUT = v_kostl.
select single kostl from csks into v_kostl where bukrs = t_record-bukrs
and kostl = v_kostl.
if sy-subrc <> 0.
flag = 'X'.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
error_record-text4 = 'The costcentre not under the given company code'.
endif.
it check the invioce alredy posted or not.
translate t_record-waers to upper case.
translate t_record-xblnr to upper case.
select single belnr into v_belnr1 from bsip where bukrs = t_record-bukrs
and lifnr = t_record-accnt
and waers = t_record-waers
and bldat = p_invdat
and xblnr = t_record-xblnr.
if sy-subrc = 0.
day = p_invdat+6(2).
month = p_invdat+4(2).
year = p_invdat+0(4).
concatenate day month year into date1 SEPARATED BY '.'.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
concatenate 'This document under number' v_belnr1 'already posted on '
date1 into fld2 separated by space.
error_record-text5 = fld2.
flag = 'X'.
endif.
*zero balance
on change of t_record-accnt or t_record-xblnr.
amount = 0.
totalamount = 0.
amount = t_record-wrbtr1.
loop at n_record where bukrs = t_record-bukrs
and accnt = t_record-accnt
and xblnr = t_record-xblnr
and wrbtr1 = t_record-wrbtr1
and waers = t_record-waers.
totalamount = totalamount + n_record-wrbtr2.
endloop.
endon.
if amount ne totalamount.
error_record-rowno = sy-tabix + 1.
move-corresponding t_record to error_record.
error_record-text6 = 'Posting only possible with zero balance'.
flag = 'X'.
endif.
if flag = 'X'.
error_record-flag = 'X'.
append error_record.
endif.
if flag <> 'X'.
move-corresponding t_record to f_record.
append f_record.
endif.
clear f_record.
clear error_record.
endloop.
endform.
*& Form Table Control
FORM head_item .
clear t_record.
LOOP AT t_record.
delete t_record where accnt = ' '.
translate t_record-bukrs to upper case.
translate t_record-accnt to upper case.
translate t_record-waers to upper case.
translate t_record-xblnr to upper case.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = t_record-accnt
IMPORTING
OUTPUT = t_record-accnt.
on change of t_record-accnt or t_record-xblnr or t_record-wrbtr1.
MOVE-CORRESPONDING t_record TO t_head.
APPEND t_head.
endon.
MOVE-CORRESPONDING t_record TO t_item.
APPEND t_item.
clear : t_item,t_head.
ENDLOOP.
ENDFORM.
form disperrortestrun.
loop at error_record.
format color 2 intensified on.
set left scroll-boundary column 70.
write : /'|',
(6) error_record-rowno, '|' no-gap,
(14) error_record-bukrs, '|' no-gap,
(12) error_record-accnt, '|' no-gap,
(16) error_record-xblnr, '|' no-gap,
(16) error_record-wrbtr1, '|' no-gap,
(8) error_record-waers, '|' no-gap,
(13) error_record-secco, '|' no-gap,
(20) error_record-sgtxt, '|' no-gap,
(14) error_record-hkont, '|' no-gap,
(15) error_record-wrbtr2, '|' no-gap,
(10) error_record-mwskz, '|' no-gap,
(20) error_record-gsber, '|' no-gap,
(12) error_record-kostl, '|' no-gap,
(5) error_record-flag, '|' no-gap,
(50) error_record-text1, '|' no-gap,
(53) error_record-text2, '|' no-gap,
(50) error_record-text3, '|' no-gap,
(50) error_record-text4, '|' no-gap,
(67) error_record-text5, '|' no-gap,
(45) error_record-text6, '|' .
endloop.
uline at /1(538).
format color off.
endform.
Report Header for Test Run *
form header.
set left scroll-boundary column 70.
format color 5 .
write: 'REPORT :', sy-repid,
38 'ERROR RECORDS DETAILS OF TEST RUN OF FB60(VENDOR INVIOCE POSTING)'
,123 'DATE :', sy-datum .
format color off.
skip 3.
format color 1 intensified on.
uline at 1(538).
write : /'|',
(6) 'Row No', '|' no-gap,
(14) 'Company Code', '|' no-gap,
(12) 'Vendor No', '|' no-gap,
(16) 'Reference', '|' no-gap,
(16) 'Invioce Amount', '|' no-gap,
(8) 'Currency', '|' no-gap,
(13) 'Section Code', '|' no-gap,
(20) 'text', '|' no-gap,
(14) 'G/L Account', '|' no-gap,
(15) 'Item Amount', '|' no-gap,
(10) 'Tax Code', '|' no-gap,
(20) 'Business Area', '|' no-gap,
(12) 'Cost Centre', '|' no-gap,
(5) 'Error record Status', '|' no-gap,
(50) 'Company Code/Vendor', '|' no-gap,
(53) 'Vendor/With holding tax Liability', '|' no-gap,
(50) 'Company Code/ G/L Account', '|' no-gap,
(50) 'Company Code / Cost Centre', '|' no-gap,
(67) 'Invioce Status', '|' no-gap,
(45) 'Invalid Balance',
'|'.
uline at /1(538).
format color off.
endform.
thanks
sitaram. -
Unable to Capture ALV output in an Internal Table, after CALL TRANSACTION
Dear all,
My requirement is to run multiple materials in T-code CK86_99 but as we know CK86_99 is only adequate to one material at a time.
So, I want to capture the Output of the T-code in my Internal table with respect to all the Material Numbers I use in the Select-Options of my Z Program.
Below is the Code I developed so far, but the Class
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lf_ref ).
is not capturing the Ouput...
Please have a look and enlighten me how it could be solved.
TABLES : mara.
DATA : BEGIN OF wa_mara,
matnr TYPE mara-matnr,
END OF wa_mara.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_it_bdcdata LIKE LINE OF it_bdcdata,
it_mara LIKE TABLE OF wa_mara.
* BELNR(10).
FIELD-SYMBOLS:<fs_tab> TYPE ANY TABLE,
<fs_line> TYPE any.
DATA:lf_ref TYPE REF TO data,
lf_ref1 TYPE REF TO data.
SELECT-OPTIONS so_matnr FOR mara-matnr.
PARAMETERS p_werks LIKE t001w-werks.
*BELNR = 'Z92'. " Give Document Number here
SELECT matnr FROM mara INTO TABLE it_mara WHERE matnr IN so_matnr.
DATA opt TYPE ctu_params.
LOOP AT it_mara INTO wa_mara.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-program = 'SAPMKKB0'.
wa_it_bdcdata-dynpro = '0300'.
wa_it_bdcdata-dynbegin = 'X'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'KKB0-MATNR'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'KKB0-MATNR'.
wa_it_bdcdata-fval = wa_mara-matnr.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'KKB0-WERKS'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'KKB0-WERKS'.
wa_it_bdcdata-fval = p_werks.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_OKCODE'.
wa_it_bdcdata-fval = 'OSNY'."'ONLI'."=CRET'.
APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-program = 'SAPLKKRSOO'.
* wa_it_bdcdata-dynpro = '0100'.
* wa_it_bdcdata-dynbegin = 'X'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-fnam = 'BDC_OKCODE'.
* wa_it_bdcdata-fval = 'BACK'."=CRET'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-program = 'SAPMKKB0'.
* wa_it_bdcdata-dynpro = '0300'.
* wa_it_bdcdata-dynbegin = 'X'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-fnam = 'BDC_OKCODE'.
* wa_it_bdcdata-fval = 'EXIT'."=CRET'.
* APPEND wa_it_bdcdata TO it_bdcdata.
opt-dismode = 'N'.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_true
data = abap_true ).
CALL TRANSACTION 'CK86_99' USING it_bdcdata OPTIONS FROM opt.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lf_ref ).
ASSIGN lf_ref->* TO <fs_tab>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
IF <fs_tab> IS ASSIGNED.
CREATE DATA lf_ref1 LIKE LINE OF <fs_tab>.
ASSIGN lf_ref1->* TO <fs_line>.
ENDIF.
*LOOP AT <FS_TAB> ASSIGNING <FS_LINE>.
*ENDLOOP.Hi Abhay,
If you go to Transaction code SE93, enter the tcode "CK86_99" and click display, you may see the default value for transaction is "KKBB" and the screen field for P_SCREEN = 0300, P_TCODE = ck86_99.
You may need to copy the transaction code "KKBB" and go to SE93 again, enter the tcode for "KKBB" then click display, now you may see the program name is "RKKB1000".
Hope this answer your question.
Thanks
Hock Lin -
Call transaction error handling
how to maintain the log i.e sucess/failures like below.
Line No. Success/ Failure Document No Error Details
1 S Doc 740000001
2 S Doc 740000002
3 F Co- code does not exist
4 F GL Account does not exist
I'm getting only one last document no: but i need all the documents to be displayed i.e either success/failures.
below is my code.
TYPES: BEGIN OF ty_filedata,
bukrs TYPE bukrs, "Company code
blart TYPE blart, "Document type
bldat TYPE char10, "Document Date
budat TYPE char10, "Posting date
xblnr TYPE xblnr, "Reference
bktxt TYPE bktxt, "Document Header text
waers TYPE waers, "Currency
newbs TYPE bschl, "Posting Key for the next line item
wrbtr TYPE char10, "Amount
zuonr LIKE bsik-zuonr, "Assignment
sgtxt TYPE sgtxt, "Text
newko TYPE hkont, "Account for the next line item
END OF ty_filedata.
TYPES: BEGIN OF ty_detail_log,
item_no TYPE i, " Item line no.
status(1) TYPE c, " Status - success/failure
doc_no TYPE bkpf-belnr," Document No.
message TYPE string, " Message
END OF ty_detail_log.
*& DATA declaration of internal tables
Internal Table declaration for excel data
DATA: it_itab TYPE STANDARD TABLE OF alsmex_tabline INITIAL SIZE 0,
Internal Table declaration for upload data
it_upload TYPE STANDARD TABLE OF ty_filedata INITIAL SIZE 0,
Internal Table Declaration for BDCDATA
it_bdcdata TYPE STANDARD TABLE OF bdcdata,
Internal Table Declaration for BDCMSGCOLL
it_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll,
Internal Table Declaration for FILENMAE
lf_fname TYPE rlgrap-filename.
t_err_log TYPE STANDARD TABLE OF ty_err
INITIAL SIZE 0, " table for validation error log
t_DETAIL_LOG TYPE STANDARD TABLE OF TY_DETAIL_LOG.
C_MSGNO TYPE BDC_MNR VALUE '312',
*& DATA declaration of work area
Work Area declaration for Excel Data
DATA: w_itab TYPE alsmex_tabline,
Work Area declaration for upload data
w_upload TYPE ty_filedata,
Work Area declaration for upload data
w_upload_n TYPE ty_filedata,
Work Area declaration for upload data
w_bdcdata TYPE bdcdata,
Work Area declaration for upload data
w_bdcmsgcoll TYPE bdcmsgcoll,
w_detail_log TYPE ty_detail_log.
*& SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
PARAMETERS:p_file TYPE rlgrap-filename. " MODIF ID G1.
SELECTION-SCREEN: END OF BLOCK bk1.
*& AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
dynpro_number = syst-dynnr
CHANGING
file_name = p_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.
*& START-OF-SELECTION
START-OF-SELECTION.
DATA: lw_itab TYPE alsmex_tabline.
lf_fname = p_file.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = lf_fname
i_begin_col = '1'
i_begin_row = '6'
i_end_col = '12'
i_end_row = '999'
TABLES
intern = it_itab[]
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
*MESSAGE S205(ZF_COMMON_MSGS_FIN1) DISPLAY LIKE C_E.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
IF it_itab IS NOT INITIAL.
SORT it_itab BY row col.
DELETE it_itab WHERE row LT 6.
LOOP AT it_itab INTO lw_itab.
w_itab = lw_itab.
AT NEW row.
CLEAR: w_upload.
ENDAT.
CASE w_itab-col.
WHEN '0001'.
w_upload-bukrs = w_itab-value.
WHEN '0002'.
w_upload-blart = w_itab-value.
WHEN '0003'.
w_upload-bldat = w_itab-value.
WHEN '0004'.
w_upload-budat = w_itab-value.
WHEN '0005'.
w_upload-xblnr = w_itab-value.
WHEN '0006'.
w_upload-bktxt = w_itab-value.
WHEN '0007'.
w_upload-waers = w_itab-value.
WHEN '0008'.
w_upload-newbs = w_itab-value.
WHEN '0009'.
w_upload-wrbtr = w_itab-value.
WHEN '0010'..
w_upload-zuonr = w_itab-value.
WHEN '0011'.
w_upload-sgtxt = w_itab-value.
WHEN '0012'.
w_upload-newko = w_itab-value.
ENDCASE.
AT END OF row.
APPEND w_upload TO it_upload.
CLEAR: w_upload.
ENDAT.
ENDLOOP.
*endif.
ENDIF.
DATA: lw_upload TYPE ty_filedata,
lv_lines TYPE sy-tabix,
lv_index TYPE sy-tabix.
DESCRIBE TABLE it_upload LINES lv_lines.
LOOP AT it_upload INTO lw_upload.
lv_index = sy-tabix.
w_upload = lw_upload.
IF NOT w_upload-bukrs IS INITIAL.
IF lv_index GT 1.
CALL TRANSACTION 'FB01' USING it_bdcdata
MODE 'N' UPDATE 'S' MESSAGES INTO it_bdcmsgcoll.
PERFORM fr_format_message_text.
REFRESH: it_bdcdata.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BKPF-XBLNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BKPF-BLDAT'
w_upload-bldat.
PERFORM bdc_field USING 'BKPF-BLART'
w_upload-blart.
PERFORM bdc_field USING 'BKPF-BUKRS'
w_upload-bukrs.
PERFORM bdc_field USING 'BKPF-BUDAT'
w_upload-budat.
PERFORM bdc_field USING 'BKPF-WAERS'
w_upload-waers.
PERFORM bdc_field USING 'BKPF-XBLNR'
w_upload-xblnr.
*perform bdc_field using 'FS006-DOCID'
PERFORM bdc_field USING 'RF05A-NEWBS'
w_upload-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
w_upload-newko.
ENDIF.
IF lv_index NE lv_lines.
lv_index = lv_index + 1.
READ TABLE it_upload INTO w_upload_n INDEX lv_index.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
w_upload-wrbtr.
PERFORM bdc_field USING 'RF05A-NEWBS'
w_upload_n-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
w_upload_n-newko.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'BSEG-WRBTR'
w_upload-wrbtr.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-ANLN1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
CALL TRANSACTION 'FB01' USING it_bdcdata
MODE 'N' UPDATE 'S' MESSAGES INTO it_bdcmsgcoll.
PERFORM fr_format_message_text .
REFRESH: it_bdcdata.
*& Form BDC_DYNPRO
FORM bdc_dynpro USING program dynpro.
CLEAR w_bdcdata.
w_bdcdata-program = program.
w_bdcdata-dynpro = dynpro.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO it_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF fval <> space.
CLEAR w_bdcdata.
w_bdcdata-fnam = fnam.
w_bdcdata-fval = fval.
APPEND w_bdcdata TO it_bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form fr_format_message_text
FORM fr_format_message_text.
DATA: lf_msg TYPE string.
WRITE:/ sy-uline(125).
FORMAT COLOR 1 INTENSIFIED ON.
WRITE : /1 sy-vline,
2 text-041 , "'record Number',
16 sy-vline,
17 text-042 , " 'success/failure',
35 sy-vline,
36 text-043, " 'document no',
55 sy-vline,
56 text-044, "'Error details',
125 sy-vline.
WRITE:/ sy-uline(125).
LOOP AT it_bdcmsgcoll INTO w_bdcmsgcoll.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = w_bdcmsgcoll-msgid
lang = sy-langu
no = w_bdcmsgcoll-msgnr
v1 = w_bdcmsgcoll-msgv1
v2 = w_bdcmsgcoll-msgv2
v3 = w_bdcmsgcoll-msgv3
v4 = w_bdcmsgcoll-msgv4
IMPORTING
msg = lf_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc EQ 0.
WRITE:/01 sy-vline,
02 sy-tabix,
16 sy-vline,
17 w_bdcmsgcoll-msgtyp,
35 sy-vline,
36 w_bdcmsgcoll-msgv1,
55 sy-vline,
56 lf_msg,
125 sy-vline.
WRITE:/ sy-uline(125).
ENDIF.
ENDLOOP.
ENDFORM. "fr_format_message_text
Thanks in advance.Hi Neelima,
Just put the following code within that LOOP...ENDLOOP statement.
LOOP AT it_upload INTO lw_upload.
CALL TRANSACTION 'FB01' USING it_bdcdata
MODE 'N' UPDATE 'S' MESSAGES INTO it_bdcmsgcoll.
PERFORM fr_format_message_text .
REFRESH: it_bdcdata.
ENDLOOP.
Regards,
R.Nagarajan.
We can - -
BDC Call Transaction - Doc.No not getting generated in Message Internal tab
Dear All,
I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
Kindly look into the matter and revert back for any further info.
Regards
NareshHi,
Please try using the following kind of code in 'CALL TRANSACTION'
opt-dismode = 'E'. " Exclusive mode
opt-defsize = 'X'.
opt-updmode = 'S'.
opt-nobinpt = ' '.
CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
MESSAGES INTO t_bdcmsgcoll .
Hope this will work.
Thanks,
Leo -
VALUES not getting passed in t.code 'FMY3' VIA call transaction 'FMY3'
hi guru's,
i have created a ALV report for funds precommitment,when i click the document number,the respective document is not opening
i have coded like this
IF selfield-value IS NOT INITIAL.
READ TABLE final INDEX selfield-tabindex.
SET PARAMETER ID: 'KBL' FIELD final-belnr,
'KBP' FIELD final-blpos.
CALL TRANSACTION 'FMY3' AND SKIP FIRST SCREEN.
ENDIF.
the transaction is called,but with empty value in the field and the document is not opening....please help me with this regard...
thanks in advance,
regards,
Balaji.SHello Venkat.O,
i have a similar problem with the overwrite of the memory ID, when calling transaction FMY3. In the code block you mentioned, the system gets the right value from the memory ID, that i've set before calling the transaction. But i found that after that the system runs in the include LFMFRO01, the code
MODULE init_suppress OUTPUT.
IF status2 = st2_app. "/Genehmigen/Ablehnen
Lesen aus Memory: wird in WF-Methode 'APPROVE' gefüllt
IMPORT wfdata TO g_f_wfdata FROM MEMORY ID con_memid_wf.
IF NOT g_f_wfdata-belnr IS INITIAL.
IF g_f_wfdata-blpos = space.
g_f_wfdata-blpos = con_initial_blpos.
ENDIF.
kbld-belnr = g_f_wfdata-belnr.
and here the system gets the memory of the last document created and overwrites the selecion-screen field KBLD-BELNR with that value. And the value i had stored in the parameter ID 'MRV', and that the system gets it right in the code you show, is overwritten..
This seems like a bug from SAP, don't you think?
This way the system will always show the last doc. when calling transaction, after setting a parameter ID.. -
BDC Call Transaction : FS00(Create G/L Account)
Hi,
BDC of FS00 is running properly in Forground (A) Mode, with success messages and G/L account being created in SKB1 table.
But when I run it in Background (N) Mode, it is not creating the G/L account. Although I am getting the success messages in the end of the execution but in the table, there is no G/L account.
FORM fill_bdcdata .
loop at i_output.
clear i_bdcdata.
refresh i_bdcdata.
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-BUKRS'.
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-SAKNR'
i_output-SAKNR. "gl ac number
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-BUKRS'
i_output-BUKRS. "company code
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'. "ac grp
*perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
i_output-cc.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
i_output-xplacct. "pl account
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
i_output-xbilk. "balance sheet
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB02'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
i_output-ktoks. "ac grp
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
i_output-xplacct. "pl account
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-TXT50_ML'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
i_output-txt20_ml. "short text
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
i_output-txt50_ml. "long text
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-MITKZ'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XSALH'
i_output-xsalh. "Only Balance in Local Currency
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
i_output-mwskz. "Tax Category
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XMWNO'
i_output-xmwno. "Posting without tax
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
i_output-mitkz. "Reccon A/C
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
i_output-xopvw. "Open Item Management
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'
i_output-xkres. "Line Item Display
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
i_output-zuawa. "Sort Key
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
i_output-fstag. "Field Stauts
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XINTB'
i_output-xintb. "post automatically
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-XGKON'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XGKON'
i_output-xgkon. "relevent to cash A/c
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
i_output-fstag. "Field Stauts
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XINTB'
i_output-xintb. "post automatically
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XGKON'
i_output-xgkon. "relevent to cash A/c
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'/EEXIT'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-XGKON'.
perform bdc_dynpro using 'SAPLSPO1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform f_elog.
endloop.
FORM f_elog .
data len type i.
clear i_msgtab.
call transaction 'FS00'
using i_bdcdata
mode g_v_mode "N
messages into i_msgtab
update g_v_update . "S
write: i_output-saknr.
I am not getting where I am going wrong in the code.
Regards,
Priyanka.Hi,
Make the mode 'E' and see excatly, where the warning or errors or coming.
If you are having an currency or UOM ,related fields, see that the values should not be empty. If they are enpty. Put an if condition there and Quit filling such fields.
First keep in mode 'e' and debug. 100% you will see the warnings or errors, then tell me what is the error.
<b>call transaction 'FS00'
using i_bdcdata
mode g_v_mode "E
messages into i_msgtab</b>
Thansk'
Manju. -
Improve performance of bdc call transaction
Hi all,
I am performing a batch update of tax codes in a BDC call transaction program. This particular code takes about 3 minutes to process 2,600 entries. I have tried almost everything but is there a way to improve / make it run faster?
I have a feeling it has something to do with the form "do_transaction", but I really don't know anymore.
Thank you in advance.
Attached is the code:
*& Report ZFI_CHANGEWTAX
*& Description: Change Doctors Withholding Tax Code (EI)
*& Using BDC Call Transaction Method
*& Created by : mpena
*& Created on : 07/15/2009
*& Modification History
*& Seq Changed on
*& Changed by
*& 001 07/15/2009
*& mpena Initial Development
*& 002 07/20/2009
*& mpena Logic modification
*& Testing
*& 003 07/20/2009
*& mpena Call function parameter modification
*& 004 07/22/2009
*& mpena Report generation
*& Performance improvements
REPORT zfi_changewtax
NO STANDARD PAGE HEADING
MESSAGE-ID zfk02msg.
TYPES: BEGIN OF t_tax,
lifnr LIKE lfa1-lifnr, "account number
wt_withcd LIKE lfbw-wt_withcd, "current tax code
wt_withcd_new LIKE lfbw-wt_withcd, "new tax code (left blank at default)
END OF t_tax.
DATA: wa_tax TYPE t_tax,
i_tax TYPE STANDARD TABLE OF t_tax,
it_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,
lin TYPE i.
-------Selection Screen Design -
SELECTION-SCREEN:
SKIP 1,
BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
PARAMETERS: p_ktokk LIKE lfa1-ktokk DEFAULT 'DOCT' OBLIGATORY,
p_bukrs LIKE lfbw-bukrs DEFAULT 'SL' OBLIGATORY,
p_wtax LIKE lfbw-wt_withcd OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
INITIALIZATION.
aaa = 'Change Tax Code to specified value'.
TOP-OF-PAGE.
WRITE:
/ 'Update of taxes successful on:', sy-datum, sy-uzeit,
/ 'Generated by:', sy-uname,
/ 'Company Code:', p_bukrs, 'Vendor Group:', p_ktokk.
SKIP 1.
ULINE.
WRITE:
/ 'Account Number', 20 'Old Withholding Tax Code', 50 'New Withholding Tax Code'.
ULINE.
START-OF-SELECTION.
SELECT lfa1~lifnr
lfbw~wt_withcd
INTO TABLE i_tax
FROM lfa1 INNER JOIN lfbw
ON lfa1lifnr = lfbwlifnr
WHERE lfbw~bukrs EQ p_bukrs
AND lfbw~witht EQ 'EI'.
IF sy-subrc EQ 0.
DESCRIBE TABLE i_tax LINES lin.
ENDIF.
Update i_tax with new value of wt_witchd, then display for comparison.
After write: if old and new tax are the same, tax update was not successful for that specific account
or inputted tax type is the same as the old one.
LOOP AT i_tax INTO wa_tax.
wa_tax-wt_withcd_new = p_wtax.
MODIFY i_tax FROM wa_tax.
WRITE:
/ wa_tax-lifnr,
20 wa_tax-wt_withcd,
50 wa_tax-wt_withcd_new.
CLEAR wa_tax.
ENDLOOP.
PERFORM do_transaction USING p_bukrs p_wtax.
*& Form do_transaction
Extracted from ZFKO2 recording accessible in shdb.
FORM do_transaction USING v_bukrs v_wtax.
MESSAGE i000 WITH lin.
LOOP AT i_tax INTO wa_tax.
REFRESH it_bdcdata.
PERFORM bdc_dynpro USING 'SAPMF02K' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-D0610'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
wa_tax-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
v_bukrs.
PERFORM bdc_field USING 'RF02K-D0610'
'X'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0610'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBW-WT_WITHCD(01)'.
PERFORM bdc_field USING 'LFB1-QLAND'
'PH'.
PERFORM bdc_field USING 'LFBW-WT_WITHCD(01)'
v_wtax.
PERFORM bdc_dynpro USING 'SAPMF02K' '0610'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-QLAND'.
PERFORM bdc_field USING 'LFB1-QLAND'
'PH'.
CALL TRANSACTION 'FK02' USING it_bdcdata
MODE 'N'
UPDATE 'A'.
ENDLOOP.
MESSAGE i001.
ENDFORM. "do_transaction
form for bdc dynpro
FORM bdc_dynpro USING program
dynpro.
it_bdcdata-program = program.
it_bdcdata-dynpro = dynpro.
it_bdcdata-dynbegin = 'X'.
APPEND it_bdcdata.
CLEAR it_bdcdata.
ENDFORM. "bdc_dynpro
form for bdc field
FORM bdc_field USING fnam
fval.
it_bdcdata-fnam = fnam.
it_bdcdata-fval = fval.
APPEND it_bdcdata.
CLEAR it_bdcdata.
ENDFORM. "bdc_fieldYou might want to try using a BAPI instead of a call transaction. I believe "BAPI_VENDOR_SAVECHARVALREPLICA" will work for you. Calling a BAPI is just like calling a function module. After you call the bapi remember to commit it with the function module "BAPI_TRANSACTION_COMMIT".
-
Doubt in uploading using call transaction method
hi all
i am uploading f-29 in call transaction method .. i have a problem in currency field, the currency field is not picking up it shows a error that input field is longer than screen field .. i have declared currency field as type BSEG-WRBTR(same as screen field ...how to go about
thanks
lokeshHi,
When you use the database value directly in your BDC, you will have this issue. It is always advisable to use character fields when doing BDC. so change it to charecter field and try it..
Regards
Sudheer
Maybe you are looking for
-
Iasdeploy not working in ias6.5
I Just installed ias6.5 on Windows NT with Sp6. Installation went on fine, but i could not run sample fortune application. Fortune application itself is not registered in the server and if i try to manually register the application by iasdeploy deplo
-
Photoshop CS5 crashes when opening file/creating new file
I can load up CS5 and its fine. I then go to open or create a file and it just crashes. Can someone help me please I really need photoshop for my photography Cheers Lunty
-
Would love a bumper case that can stay on the phone
It appears there is an overwhelming number of people who would love a bumper case that can stay on the phone when docking it in a speaker dock, a clock dock etc etc. Is there such a beast and if so who makes it and who sells it?
-
HI ALL MY problem is that how can we print sale order and delivery no on a/r invoice . we can print base docnum but we want both no so and delivery . Let we create a sales order no is 19 and through it we create deliver note no 25 and through del
-
I have a nokia c3-00 set, suddenly it's keypad stops working. just if i hold, call dorp button, then it show the screen. i have very important contacts in it. I want that contacts. kindly advise me, is it a software problem or hardware? what am i su