Call Transaction VT02
Hello Guys,
Need some help in SAP 3.1, I am trying to perform a call transaction VT02 (change shipment) to empty the shipping units and later delete the same. I did code according the recordings but it seems to fail in sync mode due to pop_up_confirm message during deletion..can you please let me know how I can resolve the issue ?
Code -->
REFRESH BDCDATA.
PERFORM BDC_DYNPRO USING 'SAPMV56A' '0011'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'TKAL'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'VTTK-TKNUM'.
PERFORM BDC_FIELD USING 'VTTK-TKNUM' ITAB-TKNUM.
perform bdc_dynpro using 'SAPMV56A' '0020'.
perform bdc_field using 'BDC_OKCODE' 'VSEB'.
perform bdc_field using 'BDC_CURSOR' 'VTTK-TDLNR'.
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'UVLG'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51VE-SELKZ(01)'.
PERFORM BDC_FIELD USING 'V51VE-SELKZ(01)' 'X'.
*logic to mark all the units+packs
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2500'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'VSEE'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51V4-SELKZ(01)'.
DO x times
PERFORM BDC_FIELD USING 'V51V4-SELKZ(06)' 'X'.
PERFORM BDC_FIELD USING 'V51V4-SELKZ(07)' 'X'.
Enddo.
*logic to mark all the units+packs
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2500'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'VELO'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51V4-SELKZ(01)'.
DO x times
PERFORM BDC_FIELD USING 'V51V4-SELKZ(05)' 'X'.
Enddo.
PERFORM BDC_DYNPRO USING 'SAPLSP01' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'YES'.
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2500'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'ENT1'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51V4-TMENG(02)'.
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2500'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'BACK'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51V4-TMENG(02)'.
PERFORM BDC_DYNPRO USING 'SAPLV51A' '2001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'SICH'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'V51VE-EXIDV(01)'.
CALL TRANSACTION 'VT02' USING BDCDATA
MODE 'A'
UPDATE'S'.
--Any hints !!
hi
good
yes both of them retrun,
CALL TRANSACTION->
On the face of it, you would think that the Call Transaction has succeeded if "Sy-Subrc = 0" after the call. In an ALE environment this is only half the story, because when the import parameter Input_Method takes on the value "A" or "E", the inbound function module must call the transaction using mode = "A" or "E" ("show all screens" or "show the screens starting with the one where the error occurred"). In this case, the user sees the screens and can cancel the transaction using OK-code "/n", which also leads to "Sy-Subrc = 0" after the call! Hence the only reliable way to tell whether the Call Transaction succeeded or not is to check the message ID (Sy-Msgid) and number (Sy-Msgno). Beware that some transactions have more than one "success" message.
thanks
mrutyun^
Similar Messages
-
BAPI replacement for the transaction VT02
Hi All,
We are doing upgrade from 4.6C to ECC 6.0 version where we need to replace existing BDC with BAPI or a function module.
In a program we are using BDC for the transaction VT02 to update the fields End date (VTTK-DATEN) and End time (VTTK-UATEN) for the given shipments. Please suggest a BAPI or Function module to replace the existing BDC for VT02 transaction.
The BAPI 'BAPI_SHIPMENT_CHANGE' is not released officially in ECC 6.0 version. Can we use it in ECC 6.0 version? If yes, please let me know how to call this BAPI with only these three fields(Shipment number-TKNUM, Shipment end date-DATEN and Shipment end time-UATEN).
Thanks in advance.
Regards,
Siva.hi,
try this...
SD_SHIPMENT_HEADERS_CHANGE_DIA
Prabhudas -
BATCH-INPUT On transaction VT02 does not work.
Greetings, colleagues!!!
I have written BATCH-INPUT on transaction VT02. I try to remove delivery from transportation. But for me does not work BATCH-INPUT because function of "Positioning" does not work in BATCH-INPUT. Prompt please. How I can remove delivery from transportation in my program using functionality of transaction VT02?
Thanks for the help.
Sergey Kozymaev.I used this in a program a while ago, worked like a charm.
s_header-shipment_num = <shipment #>.
i_item-delivery = <delivery #>.
APPEND i_item.
i_itemaction-delivery = 'D'.
i_itemaction-itenerary = 'D'.
APPEND i_itemaction.
CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
EXPORTING
headerdata = s_header
headerdataaction = s_headeraction
TABLES
itemdata = i_item
itemdataaction = i_itemaction
return = i_return. -
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 -
i am calling a transaction from alv i want to select the check boxes on th called transaction and go to the next screen how do i do that
Hello Chandan
You have to handle the DOUBLE_CLICK event either in your callback form routine (FM-based ALV) or event handler method for event USER_COMMAND (ABAP-OO based ALV).
If you call the transaction directly you will not have the authority check for this transaction. If you need this, you can use function module <b>ABAP4_CALL_TRANSACTION</b> instead.
If you want to open the transaction in a new window you can use the static method <b>CL_RECA_GUI_SERVICES=>CALL_TRANSACTION</b> (no authority check!).
Regards
Uwe -
Drill down to all screens of XK03 in ALV report from CALL TRANSACTION
HI!
I have created a vendor master report which calls the XK03 transaction when the vendor is clicked on on the ALV output. It takes me to the XK03 address screen and when I try clicking to go to the next screen it says the last screen is reached , 'Do you wnat to cancell processing'. I want to enable the program to goto the next screens as well like the controll screen and the accounting screen ect in my drill down on call transaction.
following si my code section which does it.
CASE rs_selfield-fieldname.
WHEN 'LIFNR'.
* Set parameter ID for transaction screen field
CHECK NOT wa_vend-lifnr IS INITIAL.
SET PARAMETER ID 'LIF' FIELD wa_vend-lifnr.
SET PARAMETER ID 'BUK' FIELD wa_vend-bukrs.
SET PARAMETER ID 'EKO' FIELD wa_vend-ekorg.
SET PARAMETER ID 'KDY' FIELD kdy_val.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN. "EC needed
ENDCASE.
ENDCASE.
Thanks and regards,
AaravHi,
Your code seems to be right.
Try writing the code as the below format.
CASE SY-UCOMM.
* CHECK FUNCTION CODE
WHEN '&IC1'.
* CHECK FIELD CLICKED ON WITHIN ALVGRID REPORT
IF SELFIELD-FIELDNAME = 'LIFNR'.
* READ DATA TABLE, USING INDEX ROW USER CLICKED ON
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.
* SET PARAMETER ID FOR TRANSACTION SCREEN FIELD
SET PARAMETER ID 'BES' FIELD WA_FINAL-LIFNR.
* EXECUTE TRANSACTION 'XK03',AND SKIP INITIAL DATA ENTRY SCREEN.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
Thanks
Arbind -
Code for Hot spot in ALV report to call transaction
Hi,
I hv never use hot spot to link as a call transaction can u give the link or code how to make hot spot on a particular fields i am working on a ALV report in that report in the belnr coloumn when user click on belnr i want to call FB03 transaction ref. to that belnr number and fisacl year.
regards,
zafarHi,
In the fieldcatalog you will have to write the hotspot as shown below,
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'"----> this is important
i_callback_pf_status_set = 'PFSTATUS'
it_fieldcat = it_fieldcat
is_layout = it_layout
it_event_exit = it_eventexit
i_screen_start_column = 10
i_screen_start_line = 20
i_screen_end_column = 70
i_screen_end_line = 45
i_grid_title = 'Customer-Order Details'
TABLES
t_outtab = it_data.
then you will have to catch the user command as follows,
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: alv_vbeln TYPE vbeln,
mess_text(30) TYPE c,
txt_vbeln(10) TYPE c.
*User clicks a Order No. in ALV it passed to the following transaction.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_data INDEX rs_selfield-tabindex INTO wa_data.
alv_vbeln = wa_data-vbeln..
IF sy-subrc = 0.
CLEAR: mess_text, txt_vbeln.
SUBMIT zprogram
WITH pr_vbeln = alv_vbeln AND RETURN.
put your call transaction logic here
ENDIF.
ENDCASE.
ENDFORM. "user_command
Hope it helps you,
Regards,
Abhijit G. Borkar -
Call Transaction CRMD_ORDER
Hi experts,
I made a report displayed in ALV and one of the column was the transaction no.
Now, my user wants it to display the specific line in CRMD_ORDER once it is being double click in the grid filtered by lead. My problem is that the transaction no. under lead unable to display.
Here is my code below.
leadno or transaction no.
*& Form user_command
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
READ TABLE it_data INTO wa_data INDEX rs_selfield-tabindex.
IF SY-SUBRC EQ 0.
CASE r_ucomm.
WHEN '&IC1'.
SET PARAMETER ID 'CRM_OBJECT_ID' FIELD wa_data-leadno.
CALL TRANSACTION 'CRMD_BUS2000120' AND SKIP FIRST SCREEN.
ENDCASE.
ENDIF.
ENDFORM. "user_commandhi,
check this.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_data INTO wa_data INDEX rs_selfield-tabindex.
SET PARAMETER ID 'CRM_OBJECT_ID' FIELD wa_data-leadno.
CALL TRANSACTION 'CRMD_BUS2000120' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. "user_command -
Passing selection screen values to the next report using CALL TRANSACTION
Hi experts,
I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.
I want to display in the next report the selections that the user previously selected.
First report:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.
CALL TRANSACTION 'ZKKBC_PKO_2'.
Anyone can help me?
Thanks,
LawrenceHi experts,
What i did is this:
Using SET PARAMETER
in the first report
SET PARAMETER ID 'WRK' FIELD COMP.
SET PARAMETER ID 'VPE' FIELD PERIOD.
SET PARAMETER ID 'GJR' FIELD YEAR.
CALL TRANSACTION 'ZKKBC_PKO_2'.
Second Report
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: WRK LIKE AFRU-WERKS.
PARAMETERS: VPE LIKE COEP-PERIO.
PARAMETERS: GJR LIKE COEP-GJAHR.
SELECTION-SCREEN END OF BLOCK blk1.
Using SUBMIT
First Report
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.
SUBMIT ZCO_PRDCOST_ACTUAL_2 VIA SELECTION-SCREEN USING SELECTION-SETS OF PROGRAM 'ZCO_PRDCOST_ACTUAL_1' AND RETURN.
Second Report:
GET PARAMETER ID 'WRK' FIELD comp.
GET PARAMETER ID 'VPE' FIELD COEP-PERIO.
GET PARAMETER ID 'GJR' FIELD YEAR.
Either this 2 ways i still cannot get the first report selection values on the 2nd report. Can someone help me see if my codes is correcT?
Maybe you are looking for
-
I keep getting this error in Dreamweaver when I am trying to upload my website? Can you tell me what I am doing wrong? here is the error message: /html - error occurred - Unable to create remote folder /html. Access denied. The file may not exist
-
Hi everyone, Are there any libraries out there for image processing on J2ME devices? The device I am working on is JStamp, so it has not UI. Therefore no AWT. All image processing libraries seem to be based on AWT. When I try to upload Java classes u
-
List of Unfixed planned orders
Hi - Is there a report in R/3 which lists all the existing unfixed planned orders in the system? Appreciate your help. Thanks Varun
-
Do your Home Work BEFORE you "upgrade" to snow leopard
Here is my experience with this upgrade... I provide in hopes to prevent others from spending hours and hours with this upgrade... 1. First, I have 3 video cards in my MacPro. One is an ATI HD3780. Once I upgraded to Snow Leopard, my mac would not bo
-
Hello, It has been a while since I worked with Flash, but once a year I have to edit a Flash file (with sponsors of a local event). Last summer I made the latest version of the file in Flash CS5. I've installed CS6 (the complete design&web premium pa