Call transaction tcode OPTIONS FROM opt ?
hi,
i use BDC for a enhanced t/code, so i think i should use no batch input mode to call the transaction,
could someone give a code example about this ?
thanks!
see the simple example code :
Report : ZMPPC018
Type : Data upload
Author : Seshu Maramreddy
Date : 07/05/2005
Transport : DV3K921247
Transaction: ??
Description: This ABAP/4 Program to Update Rate Routing Material PRT's
for SMI plants using CA22 Transaction.It accepts
tab-delimited spreadsheet input and Run the Call
Transaction Method.
report zmppc018 no standard page heading
line-size 120
line-count 55
message-id zz.
Constants
constants : c_x type c value 'X'," Dynbegin
c_tcode type tstc-tcode value 'CA22'," Transaction Code
c_r(1) type c value 'R'," Task List type
c_O(1) type c value 'O',
c_fh(2) type c value 'FH'.
Variables
data : v_lines_in_xcel like sy-tabix,
v_matnr(18) type c, " Material Number
v_PLNNR like mapl-plnnr," Group
V_DATE(8) type c," System date
v_date1(4) type c,
v_date2(2) type c,
v_date3(2) type c,
V_COUNT TYPE I." Count
Internal table for BDCDATA Structure
data : begin of itab_bdc_tab occurs 0.
include structure bdcdata.
data : end of itab_bdc_tab.
Internal table for File
data : begin of t_file occurs 0,
matnr(18) type c, " Material #
werks(4) type c, " Plant
plnal(2) type n, " Group Counter
vornr(4) type n, " Op #
equnr(18) type c, " PRT Material #
steuf(4) type c, " Control Key
mgvgw(6) type n, " Qty
mgeinh(3) type c, " Qty Unit
end of t_file.
Internal table for Error Log
data : begin of i_error occurs 0,
matnr like mara-matnr,
werks like marc-werks,
vornr like plpo-vornr,
plnnr like plpo-plnnr,
text(90) type c,
end of i_error.
Selection-screen
selection-screen : begin of block blk with frame.
selection-screen: skip 1.
parameters : p_file like rlgrap-filename obligatory,
P_mode type c obligatory Default 'N'.
selection-screen : skip 1.
selection-screen : end of block blk.
at selection-screen on value-request for p_file.
F4 value for Input file
perform filename_get.
main processing
start-of-selection.
To get the data from file to Internal table
perform getdata_fromfile.
loop at t_file.
fill in bdc-data for Routing maintenance screens
perform bdc_build_script.
insert the bdc script as a BDC transaction
perform bdc_submit_transaction.
endloop.
top-of-page.
call function 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
skip 1.
write:/2 'Material #',24 'Plant',32 'Group',44 'Op #',
53 'Status Message'.
skip 1.
*& Form filename_get
F4 Value for Input File parameter
FORM filename_get.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_PATH = 'C:\Temp\ '
MASK = ',.,..'
MODE = 'O'
TITLE = 'Select File '(007)
IMPORTING
FILENAME = p_file
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
ENDFORM. " filename_get
*& Form getdata_fromfile
text
FORM getdata_fromfile.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = p_file
FILETYPE = 'DAT'
TABLES
DATA_TAB = t_file
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
if sy-subrc eq 0.
sort t_file by matnr werks plnal vornr .
clear v_lines_in_xcel.
describe table t_file lines v_lines_in_xcel.
if v_lines_in_xcel is initial.
write: / 'No data in input file'.
stop.
endif.
else.
write:/ 'Error reading input file'.
stop.
endif.
ENDFORM. " getdata_fromfile
*& Form bdc_build_script
BDC Script
FORM bdc_build_script.
Get the material number from tables ZMSMI_FERR_RAW,
ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW
perform get_matnr.
Screen 1010.
perform bdc_screen using 'SAPLCPDI' '1010'.
perform bdc_field using 'BDC_OKCODE' '=VOUE'.
perform bdc_field using 'RC27M-MATNR' SPACE .
perform bdc_field using 'RC27M-WERKS' SPACE.
perform bdc_field using 'RC271-VBELN' SPACE.
perform bdc_field using 'RC271-POSNR' SPACE.
perform bdc_field using 'RC271-PSPNR' SPACE.
Clear v_plnnr.
Get the Group from MAPL Table
select single plnnr from mapl
into v_plnnr
where matnr = t_file-matnr
and werks = t_file-werks
and loekz = space
and plnty = c_r
and plnal = t_file-plnal.
perform bdc_field using 'RC271-PLNNR' v_plnnr.
Current date
MOVE SY-DATUM TO V_DATE.
perform get_date.
perform bdc_field using 'RC271-STTAG' V_DATE.
perform bdc_field using 'RC271-PLNAL' t_file-plnal.
Screen 5400
perform bdc_screen using 'SAPLCPDI' '5400'.
perform bdc_field using 'BDC_OKCODE' '=OSEA'.
Screen 1010
perform bdc_screen using 'SAPLCP02' '1010'.
perform bdc_field using 'BDC_OKCODE' '=ENT1'.
perform bdc_field using 'RC27H-VORNR' T_FILE-VORNR.
Screen 5400
perform bdc_screen using 'SAPLCPDI' '5400'.
perform bdc_field using 'BDC_OKCODE' '=FHUE'.
perform bdc_field using 'RC27X-FLG_SEL(01)' C_X.
Get the no of records from PLAS,PLPO and PLFH Tables
perform get_count.
Screen 0200
IF V_COUNT = 0.
perform bdc_screen using 'SAPLCFDI' '0200'.
perform bdc_field using 'BDC_OKCODE' '/EFIM'.
ELSEif v_count > 0.
Screen 0100
perform bdc_screen using 'SAPLCFDI' '0100'.
perform bdc_field using 'BDC_OKCODE' '/EFIM'.
ENDIF.
Screen 0230
perform bdc_screen using 'SAPLCFDI' '0200'.
perform bdc_field using 'BDC_OKCODE' '=BACK'.
perform bdc_field using 'PLFHD-MATNR' T_FILE-EQUNR.
perform bdc_field using 'PLFHD-STEUF' T_FILE-STEUF.
perform bdc_field using 'PLFHD-MGVGW' T_FILE-mgvgw.
perform bdc_field using 'PLFHD-MGEINH' T_FILE-MGEINH.
Screen 0100
perform bdc_screen using 'SAPLCFDI' '0100'.
perform bdc_field using 'BDC_OKCODE' '=BU'.
ENDFORM. " bdc_build_script
*& Form get_matnr
Get the material number from tables ZMSMI_FERR_RAW,
ZMSMI_SNAP_RAW and ZMSMI_SIMP_RAW
FORM get_matnr.
clear v_matnr.
case t_file-werks.
when '0101'.
select single cmatnr from zmsmi_simp_raw
into v_matnr where matnr = t_file-matnr.
if not v_matnr is initial.
clear t_file-matnr.
t_file-matnr = v_matnr.
endif.
when '0103'.
select single cmatnr from zmsmi_ferr_raw
into v_matnr where matnr = t_file-matnr.
if not v_matnr is initial.
clear t_file-matnr.
t_file-matnr = v_matnr.
endif.
when '0102' or '0110' or '0111' or '0112' or '0113'
or '0114' or '0115' or '0116' or '0117'.
select single cmatnr from zmsmi_snap_raw
into v_matnr where matnr = t_file-matnr.
if not v_matnr is initial.
clear t_file-matnr.
t_file-matnr = v_matnr.
endif.
endcase.
ENDFORM. " get_matnr
*& Form bdc_screen
BDC Script for Screen fields
-->P_PROG Program name
-->P_SCRN Screen Number
FORM bdc_screen USING p_prog
p_scrn.
clear itab_bdc_tab.
itab_bdc_tab-program = p_prog.
itab_bdc_tab-dynpro = p_scrn.
itab_bdc_tab-dynbegin = c_x.
append itab_bdc_tab.
ENDFORM. " bdc_screen
*& Form bdc_field
BDC Script for Screen fileds
-->P_NAM Field name
-->P_VAL Field value
FORM bdc_field USING p_nam
p_val.
clear itab_bdc_tab.
itab_bdc_tab-fnam = p_nam.
itab_bdc_tab-fval = p_val.
append itab_bdc_tab.
ENDFORM. " bdc_field
*& Form bdc_submit_transaction
BDC_INSERT Function Module
FORM bdc_submit_transaction.
call transaction c_tcode using itab_bdc_tab
mode p_mode update 'S'.
refresh itab_bdc_tab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = '-E'
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = i_error-text
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
i_error-matnr = t_file-matnr.
i_error-werks = t_file-werks.
i_error-plnnr = v_plnnr.
i_error-vornr = t_file-vornr.
append i_error.
clear i_error.
clear t_file.
ENDFORM. " bdc_submit_transaction
*& Form get_date
Converted date as per CA22 Transaction
FORM get_date.
clear : v_date,
v_date1,
v_date2,
v_date3.
v_date1 = sy-datum+0(4).
v_date2 = sy-datum+4(2).
v_date3 = sy-datum+6(2).
concatenate v_date2 v_date3 v_date1 into v_date.
ENDFORM. " get_date
*& Form get_count
text
FORM get_count.
clear v_count.
select count(*) into v_count
from plas as a inner join plpo as b on aplnty = bplnty
and aplnnr = bplnnr
and aplnkn = bplnkn
inner join plfh as c on cplnty = aplnty
and cplnnr = aplnnr
and cplnal = aplnal
and cplnfl = aplnfl
and cplnkn = bplnkn
where a~plnty = c_r
and a~plnnr = v_plnnr
and a~plnal = t_file-plnal
and c~objct = c_O
and a~loekz = space
and b~vornr = t_file-vornr
and c~objty = c_fh
and c~loekz = space.
ENDFORM. " get_count
end-of-selection.
Displaying Error Log
loop at i_error.
write:/2 i_error-matnr,24 i_error-werks,32 i_error-plnnr,
44 i_error-vornr,50 '-', 53 i_error-text.
endloop.
Similar Messages
-
Replace Call transaction TCode: /AFS/MD04 Either Report or Function Module
Hi,
Is there any standard Function Module or Report that can replace the call transaction T-Code /AFS/MD04?
Please help me out?
Regards,
Chanda.Hi,
There is a function module 'ABAP4_CALL_TRANSACTION' to replace the call transaction see and check it.
Thanks & Regards,
Raghunadh. K
Moderator Message:Please stop responding to old threads, you're just pushing them up the list.
Edited by: Suhas Saha on Jan 25, 2012 4:38 PM -
LOAD_PROGRAM_NOT_FOUND when calling transaction in ECC6 from CRM3.0
Hi
Very new to CRM so would appreciate any assistance here.
We have a CRM 3.0 system and have recently replaced the old 4.7 R3 system with ECC6 The ECC6 system has a different logical system name to the old 4.7 system. We have created a new RFC destination, a new logical system name, linked then in BD97 etc as per note 363097.
We then changed the logical system names in the action boxes to the new logical system.
When we call the transactions in the new system it shortdumps in the destination system with LOAD_PROGRAM_NOT_FOUND and the program it is trying to load is as follows.
/1ISU/ENMD4MAND300ZMK00000VA21. This program name is what it tries to call when we want to call VA21 in the R3 system. It is prefixing the transaction code with language, source logical system and action box configuration name. You can change the transaction code to VA23 and the program name it dumps on becomes /1ISU/ENMD4MAND300ZMK00000VA23.
Can anyone explain why it is doing this and what we can do to fix it?
Thanks
LeighHi Liegh,
Even i was facing similar problem of Load_Program_not_found. For this you can check the program name in your queus, which will give the name of the program which is not active, then check the same program in your debugging process above.
Try and let me know, cos my problem was fixed by this.
Best Regards,
Madhup -
Calling the TCode TP04 from the report
Hi folks,
In my ALV output, i have a field Trip No, which if i double click on it, it should go to the TCode TP04, by taking the data of the corresponding trip number. i am trying this by using the statement SET PARAMETER ID. But for the field Trip No, there is no parameter ID defined. So what is the alternative or best way to accomplish my task.
Thanks in advance,
Ram.Hi Ram ,
You could use BDC in error mode so that the tcode opens skipping the first screen, if there is not PARAMETER ID .
Let me know if it helped or not .
Yugandhar -
Hi,
i´m developing a program that uses the sentence
CALL TRANSACTION FBWE by means of a batch.
The problem is that when i run the batch in question the flow of the program (SAPMFBWE) encounters an enqueue function followed by a COMMIT WORK sentence an then my batch doesn´t work.
How can i overcome this unexpected COMMIT WORK.Best regards.Can you try the following , it should work.
CALL TRANSACTION FBWE OPTIONS FROM <b>opt</b> .
opt shoud be a structure of type CTU_PARAMS .
you need to set opt-RACOMMIT to 'X' .
Regards
Raja -
Passing select-options values using call transaction method
Hi Experts,
I have a scenario in which i have three fields BUKRS,WERKS and MATKL in an internal table i_tab and I have MATNR as a selection-option.
After this I have to use call transaction <tcode> for all the line items in the internal table and the MATNR select-option values I have to pass directly for each line of i_tab using call transaction method.
TYPES: BEGIN OF t_tab,
bukrs TYPE bukrs,
werks TYPE werks_d,
matkl TYPE matkl,
END OF t_tab.
DATA: w_tab TYPE t_tab,
i_tab TYPE STANDARD TABLE OF t_tab.
SELECT-OPTIONS: s_matnr FOR marc-matnr.
Now I am putting a loop at i_tab and have to use CALL TRANSACTION <TCODE> for each line with the SELECT-OPTIONS for MATNR.
Please tell me whether we can pass multiple ranges for MATNR using call transcation method.
for example there can be multiple single values/multiple ranges/excluded ranges for MATNR. so please suggest me how tho achieve this sceanrio using CALL transaction method of BDC.
Thanks a lot.
Regards,
KrishanHi Krishan,
For the Call transaction TCODE there is extension ....OPTIONS from OPT. Just Check it out. I think it is possible like this.
... OPTIONS FROM opt
*Effect*
This addition gives you control using the values of the components of the structure opt, which must be of the Dictionary type CTU_PARAMS. The components have the following meaning:
DISMODE
Processing mode (comparable with the MODE addition)
UPDMODE
Update mode (comparable with the UPDATE addition)
CATTMODE
CATT mode (controlling a CATT procedure)
The CATT mode can have the following values:
' ' No CATT procedure active
'N' CATT procedure without single screen control
'A' CATT procedure with single screen control
DEFSIZE
Use standard window size
RACOMMIT
COMMIT WORK does not end CATT procedure
NOBINPT
No batch input mode, that s SY-BINPT = SPACE.
NOBIEND
No batch input mode after BDC data has been read
The components DEFSIZE , RACOMMIT, NOBINPT, NOBIEND always take the following values:
'X' Yes
' ' No
If the OPTIONS addition is omitted, the following settings are valid for the control parameters:
DISMODE from the MODE addition
UPDMODE
from the UPDATE addition
CATTMODE
No CATT procedure active
DEFSIZE
Do not use standard window size
RACOMMIT
COMMIT WORK ends procedure successfully
NOBINPT
Batch input mode, that is SY-BINPT =X.
NOBIEND
Batch input mode also active after BDC data has been read
Regards,
Swapna. -
How to get a message from call transaction in RFC call
Hello :
I would like to ask one favor i make a 2 call transaction in a RFC funtion when i make the first CALL TRANSACTION using te next statement.
CALL TRANSACTION 'F-43'
USING bdcdata MESSAGES INTO messtab2 OPTIONS FROM l_fromopt.
I recive the number of the document in the field sy-msgv1 from the message table messtab2 , then i make the second CALL TRANSACTION and i am waiting to get the other number of the document from the table messtab3 using the next statatement.
CALL TRANSACTION 'FIBLFFP'
USING bdcdata MESSAGES INTO messtab3 OPTIONS FROM l_fromopt. but now the table messtab3 don't send the number of document , and i need to get the number of this document for making a REFERENCE.
thanks a lot for you helpFORM bdc_transaction USING tcode TYPE tcode.
DATA: l_mstring(480).
DATA: l_subrc TYPE sy-subrc,
lwa_t100 TYPE t100.
DATA : gv_ctumode TYPE ctu_params-dismode VALUE 'A'.
call transaction using
BREAK-POINT.
REFRESH gt_messtab.
CLEAR gwa_messtab.
gv_ctumode = gc_ctumode.
CALL TRANSACTION tcode USING gi_bdcdata "#EC CI_CALLTA
MODE gv_ctumode
UPDATE gc_cupdate
MESSAGES INTO gt_messtab.
l_subrc = sy-subrc.
IF sy-subrc <> 0.
WRITE: / 'CALL_TRANSACTION',
tcode,
'returncode:',
l_subrc,
'RECORD:',
sy-index.
LOOP AT gt_messtab INTO gwa_messtab.
CLEAR lwa_t100.
SELECT SINGLE * FROM t100 INTO lwa_t100 WHERE sprsl = gwa_messtab-msgspra
AND arbgb = gwa_messtab-msgid
AND msgnr = gwa_messtab-msgnr.
IF sy-subrc = 0.
l_mstring = lwa_t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH gwa_messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH gwa_messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH gwa_messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH gwa_messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH gwa_messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv4 INTO l_mstring.
ENDIF.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = gwa_messtab-msgid
lang = sy-langu
no = gwa_messtab-msgnr
v1 = gwa_messtab-msgv1
v2 = gwa_messtab-msgv2
v3 = gwa_messtab-msgv3
v4 = gwa_messtab-msgv4
IMPORTING
msg = l_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CONDENSE l_mstring.
IF NOT l_mstring IS INITIAL.
WRITE: / gwa_messtab-msgtyp, l_mstring(250).
MESSAGE l_mstring TYPE 'I'.
ENDIF.
ELSE.
WRITE: / gwa_messtab.
ENDIF.
ENDLOOP.
SKIP.
ENDIF. -
How to use call transaction stmt from webdynpro application
Hi Expers,
Can I use call transaction 'tcode' in my webdynpro application, I have tried in my application but i am getting short dump saying
Error analysis+
An exception occurred that is explained in detail below.The exception, which is assigned to class'CX_SY_SEND_DYNPRO_NO_RECEIVER', was not caught and therefore caused a runtime error. The reason for the exception is: During background processing, the system attempted to send a screen to a user. Current screen: "SAPLMGMM " 0060.
I haven't used any more statements in my application am sure from my application side everything perfect. but I have seen a screen shot
with SAP screen in webbrowser.
Please help me out if you are not clear abt my doubt please ask me for clear idea.
Thanks in advance
Phalani MHello,
Since you can't use the call transaction command in web dynpros components, I suggest you to create a report and fill a BDC table on this and use the call transaction in this report.
So, in your web dynpro component you can use a command SUBMIT to create a job in background.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
Regards. -
How To call a Tcode From a Program and returning back ?
Dear All,
I have a requirement, i have to show all the open orders as in the the tcode va05 and return back to the my program. so how to display the tcode and getting back to my program. please help?Hi,
Basic syntax to call the transaction is:
SET PARAMETER ID <id name> FIELD <filedname>.
CALL TRANSACTION <TCOde> AND SKIP FIRST SCREEN.
If your are using ALV then snippet is :
FORM user_command USING okcode LIKE sy-ucomm
lselfield TYPE slis_selfield.
CASE okcode.
WHEN '&IC1'. " SAP standard code for double-clicking
CASE lselfield-sel_tab_field."check if double click is only on
WHEN 'ITAB-AUFNR'."aufnr not on any other field
SET PARAMETER ID 'ANR' FIELD lselfield-value.
CALL TRANSACTION 'IW32' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
Endform.
Pooja -
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 -
Problem in passing selection screen values using CALL TRANSACTION.
Hi All
I am facing problem in transfering selection screen values to the called transaction. I am trying to pass the path of the transaction filer but to no avail. The variable for filepath is not empty.
Below is my code:
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
opt TYPE ctu_params.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'RFBASM00'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'RFPDO1-FEBUMSF'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'RFPDO1-FEBUMSF'.
wa_bdcdata-fval = gv_filepath.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = 'PASS'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
opt-dismode = 'E'.
opt-updmode = 'S'.
CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
Please help.
HarshHi Harsh,
I think you have entered wrong main program for tcode 'FF_5' and wrong screen field for the file name. Use the below code instead of yours.
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
opt TYPE ctu_params,
gv_filepath type char128 value 'C:\testfile.txt'.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'RFEBKA00'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'UMSFILE'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'UMSFILE'.
wa_bdcdata-fval = gv_filepath.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
*wa_bdcdata-fnam = 'BDC_OKCODE'.
*wa_bdcdata-fval = 'PASS'.
*APPEND wa_bdcdata TO lt_bdcdata.
*CLEAR wa_bdcdata.
opt-dismode = 'A'.
opt-updmode = 'S'.
CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
Thanks.
Regards,
Jey -
hi experts,
I want to call a transaction and to invoke a function code in the called transaction without any user interaction. Is it possible to use <b>call transaction "Tcode" </b>statement and pass a fuction code along with it. else suggest me how to over come this problem.
with regards,
James....
valuable answers will be rewarded..........this is one more addtion of the CALL TRANSACTION statement
... <b>USING bdc_tab [bdc_options]</b>
Effect
Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
Component Description
PROGRAM Name of the program of the called transaction
DYNPRO Number of the dynpro to be processed
DYNBEGIN Flag for the beginning of a new dynpro (possible values are "X" and " ")
FNAM Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor
FVAL Value to be passed to the dynpro field or to the control statement
Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
System Fields
sy-subrc Description
0 The batch input processing of the called transaction was successful.
< 1000 Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES.
1001 Error in batch input processing.
Note
Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
Example
Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
DATA: bdcdata_wa TYPE bdcdata,
bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPLSEOD'.
bdcdata_wa-dynpro = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
bdcdata_wa-fval = class_name.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CIDI'.
APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt. -
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 -
CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN .
Hi all,
i hope there is someone that can help me.
My problem is: in an ABAP custom report in a FORM user-command my code is
CASE ls_selfield-sel_tab_field.
WHEN 'ITAB-BELNR'.
IF NOT ls_selfield-value IS INITIAL.
SET PARAMETER ID 'RBN' FIELD ls_selfield-value.
CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN .
ENDCASE.
When i click on output field of my report, not skip first screen but only call MIR6!!!
How can i solve this problem?
Regards.Hi,
First of all Please don't use all Caps for Subject Line
Test Following Sample Code it will solve out your problem,
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_it_bdcdata LIKE LINE OF it_bdcdata,
belnr(10).
belnr = '100'. " Give Document Number here
DATA opt TYPE ctu_params.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-program = 'SAPMM08N'.
wa_it_bdcdata-dynpro = '100'.
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 = 'SO_BELNR-LOW'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'SO_BELNR-LOW'.
wa_it_bdcdata-fval = BELNR.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_OKCODE'.
wa_it_bdcdata-fval = '=CRET'.
APPEND wa_it_bdcdata TO it_bdcdata.
opt-dismode = 'E'.
CALL TRANSACTION 'MIR6' USING it_bdcdata OPTIONS FROM opt.
Please Reply if any Issue,
Best Regards,
Faisal -
Skip first screen when calling transaction via BDC
I need to use BDC to call transaction FD32 and suppress the first screen. Do I need to set BDC_OKCODE? However, when I set BDC_OKCODE to '/00', this error occured, "System error: Error in routine DYNPRO_ERSTES_BILD".
Here is my code:
CLEAR ls_bdcdata.
ls_bdcdata-program = 'SAPMF02C'.
ls_bdcdata-dynpro = '0100'.
ls_bdcdata-dynbegin = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-KUNNR'.
ls_bdcdata-fval = gs_data-kunnr.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-KKBER'.
ls_bdcdata-fval = p_kkber.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-D0105'.
ls_bdcdata-fval = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '/00'.
APPEND ls_bdcdata TO lt_bdcdata.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'FD32' USING lt_bdcdata OPTIONS FROM opt.
Any suggestions?Hi,
Try this..This is working fine for me..
CLEAR ls_bdcdata.
ls_bdcdata-program = 'SAPMF02C'.
ls_bdcdata-dynpro = '0100'.
ls_bdcdata-dynbegin = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'BDC_CURSOR'.
ls_bdcdata-fval = 'RF02L-D0110'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '/00'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-KUNNR'.
ls_bdcdata-fval = gs_data-kunnr.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-KKBER'.
ls_bdcdata-fval = p_kkber.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-D0105'.
ls_bdcdata-fval = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-D0110'.
ls_bdcdata-fval = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'RF02L-D0120'.
ls_bdcdata-fval = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.
CALL TRANSACTION 'FD32' USING lt_bdcdata MODE 'E'.
Thanks,
Naren
Maybe you are looking for
-
How can i stop firefox from trying to restore my previous sessions
Ever since I updated to firefox 20.0 I've been having a problem with firefox. Every time I start up firefox I get a message saying that this is so embarrassing for trying but failing to restore my previous session and it gives me the option to either
-
Itunes can't find my music folder
I can't install Itunes....it downloads fine from the exe file but when i try to open itunes it gives me the error msg that it can't find My Music folder. I went to the support page and it told me that if i couldn't find My Music folder to create one
-
I saved an Excel file yesterday afternoon, and when I opened it today, all the formatting was lost.
-
Perms to specific reports folder in sccm 2012
Have set up access to certain reports based on security settings in sccm so accounts in specific AD group can access certain sccm reports via ssrs reporting web site. Utilized the very useful information in the links below. I have a request for the
-
please send me the template for copa [email protected]