Calling transaction
Hi Experts,
While selecting one tab in application toolbar I am calling one transaction. I wanted to autopopulate 2 fields of previous screen to next screen (i.e. called transaction).
I have written code like
WHEN 'ZABC'.
SET parameter id 'XYZ' field itab-f1.
SET parameter id 'MNO field itab-f2.
CALL TRANSACTION 'ZABC'.
After executing the above code the control will move to ABC transaction & populate the F1 field in ABC transaction but it doesn't populate the F2 field.
Anybody will pls tell me how to do it??
Hi Neha,
Use Get Parameter Id in the second screen for both the fileds.
And check the Syntax for your Set Parameter Id statement.
Hope it will work.
Regards.
Amit
Similar Messages
-
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? -
Changes to sales order item not reflected if Call Transaction is used
I m updating another Sales Order item quantity and reason for rejection programmatically from another sales order.
The code is working fine and the quantity does get changed as well as the reason for rejection flag get set (if required). But if I go to the change log from the menu in VA02 for the order item which has been changed. It does not record the changes.
I have tried using both BDC call transaction method as well as BAPI_SALESORDER_CHANGE in neither case the change log for the order which has been changed reflects the programmatically made changes?
What m I doing wrong. Here is the code.
IF v_update_order_flg = 'X'.
REFRESH t_bdcdata.
CLEAR s_bdcdata.
REFRESH t_messtab.
PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
PERFORM bdc_field USING 'VBAK-VBELN' <wa_r_rtb_posnrs>-zrtbvbeln.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
For Going to specific Item Number
LOOP AT t_schedule_lines.
PERFORM bdc_field USING 'BDC_OKCODE' '=POPO'.
READ TABLE t_item_in WITH KEY itm_number = t_schedule_lines-itm_number.
PERFORM bdc_dynpro USING 'SAPMV45A' '0251'.
PERFORM bdc_field USING 'RV45A-POSNR' t_schedule_lines-itm_number.
PERFORM bdc_field USING 'BDC_OKCODE' '=POSI'.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
v_ro_qty = t_schedule_lines-req_qty.
CONDENSE v_ro_qty.
PERFORM bdc_field USING 'RV45A-KWMENG(01)' v_ro_qty.
PERFORM bdc_field USING 'VBAP-ABGRU(01)' t_item_in-reason_rej.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
v_call_transaction_flg = 'X'.
EXPORT v_call_transaction_flg TO MEMORY ID 'call_transaction'.
CALL TRANSACTION 'VA02'
USING t_bdcdata
UPDATE 'S'
MODE 'N'
MESSAGES INTO t_messtab.
v_call_transaction_flg = space.
FREE MEMORY ID 'call_transaction'.Hi Srikrisna,
This is a typical problem with BDC for updating QUANTITY and CURRENCY fields.
You need to create a character variable of the same length as your quantity field. Move your quantity value to the newly created Character variable.
Now use this new char variable in the BDC.
This correction should solve your problem.
NOTE: BDC RECOGNIZES CHARACTER FIELDS ONLY.
Regards,
Prakash Pandey -
SAP MII 14.0 - Calling Transactions using SOAP Runner fails
Hello All,
We are calling transactions in SAP MII 14.0 from external apps using SOAP Runner and we are passing the login info in the payload. But we are getting the following error.
We are passing the following in the payload.
<xmii:LoginName>Username</xmii:LoginName>
<xmii:LoginPassword>Password</xmii:LoginPassword>
We are getting 401 unauthorized as the user name and password is not propagated to the MII.
It works if we supply the info explicitly when we invoke the URL.
Thanks,
KiranHello Rajesh,
I don't think that will be allowed. We usually pass the credentials in the payload and it has always worked for us in MII 12.1. But in MII 14.0 it does not seem to be working.
Thanks,
Kiran -
Want to call transactions from ALV list output
Hi Guru's,
I have a report which displays Open PR's, open PO's n their details with respect to material. wat i want to do is call transactions from this out put i.e i want a interactive output. if i click on particular PR i want the system to call that PR screen. how can i do this?? Plz help.REFER THIS
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
TABLES
T_OUTTAB =
IF SY-SUBRC <> 0.
ENDIF.
AND THEN
rs_lineinfo type slis_lineinfo.
FORM user_command5 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
data : lv_date type char4.
CLEAR : LV_DATE .
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'BELNR'.
read table it_e into wa_e index rs_selfield-tabindex.
if sy-subrc = 0.
lv_date = wa_e-budat(4).
endif.
SET PARAMETER ID 'BLN' FIELD rs_selfield-value.
SET PARAMETER ID 'BUK' FIELD s_bukrs-low.
SET PARAMETER ID 'GJR' FIELD lv_date.
call TRANsaction 'FB03' AND SKIP FIRST SCREEN.
endif.
ENDCASE.
ENDFORM. "user_comm
Maybe you are looking for
-
the following error is encountered although I have created the user escappuser in the default realm. Any help ? Unable to deploy EJB: D:\bea8\USER_P~1\domains\EVALGU~1\.\applications\.wlnotdel ete\wlap24823\inv_ejb.jar from inv_ejb.jar: weblogic.ejb2
-
Options for receiving goods in WM
Hi all. It is the first time that I am customizing WM for a certain warehouse in a plant. Customer requirement is mostly to manage storage bins (not complicated for the moment) but they prefer to have manual control, so they decide the bin where the
-
ASCII code to print barcode on Lexmark printer
Hi there Can anyone help me on how to arrive at ASCII code to produce EAN 128B barcode on Lexmark T634n laser printer? TJ
-
I have been trying to send a few numbers files to my gmail account. When I go to attach the file, all the numbers files that I'm trying to send seems "emptied".. i.e, they look whiter than the other files. This also means that I could not select them
-
Using AS to reference xml?
Can I use an ActionScript variable to reference in xml element? For example, I have an xml document that lists trees and their characteristics. In it's simplest form the xml looks generally like this: <trees> <tree id="1"> <commonName>Birch, Paper</c