Call transaction in report
Hi guys,
I have 1 report having all details of sales order like sales order no, item ,material etc....
I want that if i click on any row or suppose second row then that sales order should open in va03.
Modertor Message: Extremely basic question. Please search.
Edited by: kishan P on Oct 3, 2011 11:39 AM
Hi Sriram ,
I am displaying an ALV report. It is an interactive ALV. When user clicks a particular row, I am picking up the values and calling KSB1 transaction. The values picked up are used to fill the first screen of the transaction KSB1 but my requirement is (if you go the transaction KSB1 you will find the tab 'Further selection Crieteria.' Please click this tab and go the 'Documents and objects' then go to 'Partner obeject' after clicking this the screen will be displayed. Here I need to pass some input here too. Hiow to achieve this ? )
Is is clear now ?
Similar Messages
-
Need to call transaction from report
Hi,
I have to create BAPIs to call from webDynpro to realize the functionality of the transactions MI01/MI04 and MI07. I´m working in the SAP cable Solution environment.
Do You know any BAPIs to use instead of calling the transactions? Maybe there are standard ones, which contain cable solution modifications...
Otherwise I thought about building frame BAPIs and calling the transactions inside of it. Do You think it´s possible to realize that by batch-input?
I need some other opinions and ideas to this problem.
Thank You for Your help!
Reward points guaranteedHey Ravi,
ok, I'll try that!
I'm not that deep into the module of material management. Do You have a tipp, how I can find out, if these functions are also working with the cable materials?
When I'm running the function bapi_matphysinv_create_mult, a document has been created. But I'm not sure, if it's using the cable specials...
Thank You -
Program for call transaction method
can any body help me , how to write a call transaction method . how to create error logs for call transaction method
hi
REPORT ZCALL.
TYPES : BEGIN OF itab,
lifnr TYPE rf02k-lifnr,
ktokk TYPE rf02k-ktokk,
END OF itab.
DATA : i_tab TYPE TABLE OF itab INITIAL SIZE 0,
wa_tab TYPE itab.
DATA : i_bdc TYPE TABLE OF bdcdata INITIAL SIZE 0,
wa_bdc TYPE bdcdata.
DATA : i_message LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
wa_message TYPE bdcmsgcoll.
DATA : fname TYPE string VALUE 'd:\manish.txt'.
DATA: p_text(100) TYPE c.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = fname
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = i_tab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT i_tab INTO wa_tab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'RF02K-LIFNR' wa_tab-lifnr.
PERFORM bdc_field USING 'RF02K-KTOKK' wa_tab-ktokk.
PERFORM bdc_field USING 'BDC_OKCODE' '= AUSW'.
CALL TRANSACTION 'XK01' USING i_bdc MODE 'N'. " UPDATE 'S' MESSAGES
"INTO i_message.
REFRESH i_bdc.
ENDLOOP.
IF sy-subrc NE 0.
READ TABLE i_message WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
LOOP AT i_message INTO wa_message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = i_message-msgid
lang = 'EN'
no = i_message-msgnr
v1 = i_message-msgv1
v2 = i_message-msgv2
v3 = i_message-msgv3
v4 = i_message-msgv4
IMPORTING
msg = p_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
WRITE:/ p_text.
ENDLOOP.
ENDIF.
ENDIF.
*& Form bdc_dynpro
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdc.
wa_bdc-program = program.
wa_bdc-dynpro = dynpro.
wa_bdc-dynbegin = 'X'.
APPEND wa_bdc TO i_bdc.
ENDFORM. "bdc_dynpro
*& Form bdc_field
text
-->FNAM text
-->FVAL text
reward if u find useful
regards
Nagesh.Paruchuri -
Call transaction (MF60) with variant
hi
in user will save some variant of the TCODE : MF60, and will put they in job what use SM36 to set job schedule.but the resule message can't be know in BG work.
i want to write a report to run the Transaction (MF60) and to save message with abap application log.
first:
how to find the Transaction contain variant?
second:
if i use abap code: CALL transaction in report,how to set variant to transaction.
three:
i know the command:SUBMIT will call from VARIANT:
but MF60's report is RMPU_SEL_SCREEN,but this report have two transaction: MF60,MF63.
how to set Transaction to this RMPU_SEL_SCREEN.
four:
i know the SM36 will set variant to TCODE,how to open job in ABAP.
thank you very much!in my company,users will create themselves varaints about MF60.
and they put variants in job schedule (use SM36 ) in bg work at night.
so when these job is over,the last message don't show for they.
they doubt about it and they will spent lot time to get what oneself document for last genearate.
i want to write a report and put this report in job schedule to run MF60.
and get last message for call transaction in abap appliacation log.
next day users just use TCODE SLG1 to view last night run MF60 result.
so first i must get all MF60 of variant what will be run and get message
when this transancations is over.save message in database!
thank you very much for your help! -
Bdc(call transaction and session method)
hi experts,
i want to write for bdc program in which i have used call transaction and session method.please help me.
thank you
with regards,
santoshHi,
See the Sample BDc Code for Vendor Master Upload:
Look at the Include BDCRECX1 for Seesion and Call Transaction types:
REPORT zmm_vendor_master_upload
NO STANDARD PAGE HEADING
LINE-SIZE 255.
ABAP Name : ZMM_VENDOR_MASTER_UPLOAD
Description : This Program is used to Upload the Vendor Master.
Modification Log:
Date Programmer Correction Description
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_vendor OCCURS 0,
bukrs(004), " Company Code
ekorg(004), " Purchase Orgn
ktokk(004), " Account Group
Address Screen
anred(015), " Title
name1(035), " Name1
sortl(010), " Sort Field
name2(035), " Name2
name3(035), " Contact Person1
name4(035), " Contact Person 2
stras(035), " Street
pfach(010), " PO Box
ort01(035), " City
pstlz(010), " Postal Code
land1(003), " Country
spras(002), " Language
telf1(016), " Telephone No
telfx(031), " Fax Number
lfurl(132), " URL-Mail Id
Material Group Characteristics
klart(003), " Class Type '010'
class(018), " Class 'Vendor'
mname_01(030), " Characteristic
mname_02(030), " Characteristic
mname_03(030), " Characteristic
mwert_01(030), " Charct.Value
mwert_02(030), " Charct.Value
mwert_03(030), " Charct.Value
Control Data
emnfr(010), " Manufact.Part No
Bank Details
banks_01(003), " Country of Bank1
banks_02(003), " Country of Bank2
bankl_01(015), " Bank Key of 1
bankl_02(015), " Bank Key of 2
bankn_01(018), " Account No Bank1
bankn_02(018), " Account No Bank2
Accounting Info
akont(010), " Reconcillation Account
zuawa(003), " Sort Key
fdgrv(010), " Cash Management Group
Payment Transactions
zterm(004), " Payment terms
reprf(001), " Check Double Inv.
zwels(010), " Payment Method
hbkid(005), " House Bank
xpore(001), " Individ.Payment
Correspondence
mahns(001), " Dunning Level
xausz(001), " Account Statement
Withholding Tax Details
qland(003), " Withholding Tax Country
witht_01(002), " WH tax Type
wt_withcd(002), " WH Tax Code
wt_subjct(001), " Indicator:WH Tax
Purchasing Data
waers(005), " Currency
zterm1(004), " Payment Terms
END OF i_vendor.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
Paramters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_vendor
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Upload the Data from Internal Table
LOOP AT i_vendor.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-BUKRS'
i_vendor-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
i_vendor-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
i_vendor-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-SPRAS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KLAS'.
PERFORM bdc_field USING 'LFA1-ANRED'
i_vendor-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
i_vendor-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
i_vendor-sortl.
PERFORM bdc_field USING 'LFA1-NAME2'
i_vendor-name2.
PERFORM bdc_field USING 'LFA1-NAME3'
i_vendor-name3.
PERFORM bdc_field USING 'LFA1-NAME4'
i_vendor-name4.
PERFORM bdc_field USING 'LFA1-STRAS'
i_vendor-stras.
PERFORM bdc_field USING 'LFA1-PFACH'
i_vendor-pfach.
PERFORM bdc_field USING 'LFA1-ORT01'
i_vendor-ort01.
PERFORM bdc_field USING 'LFA1-PSTLZ'
i_vendor-pstlz.
PERFORM bdc_field USING 'LFA1-LAND1'
i_vendor-land1.
PERFORM bdc_field USING 'LFA1-SPRAS'
i_vendor-spras.
PERFORM bdc_field USING 'LFA1-TELF1'
i_vendor-telf1.
PERFORM bdc_field USING 'LFA1-TELFX'
i_vendor-telfx.
PERFORM bdc_field USING 'LFA1-LFURL'
i_vendor-lfurl.
PERFORM bdc_dynpro USING 'SAPLCLCA' '0602'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMCLF-KLART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'RMCLF-KLART'
'010'. "i_vendor-klart.
PERFORM bdc_dynpro USING 'SAPLCLFM' '0500'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMCLF-CLASS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM bdc_field USING 'RMCLF-CLASS(01)'
'Vendor'."i_vendor-class.
PERFORM bdc_dynpro USING 'SAPLCTMS' '0109'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RCTMS-MWERT(03)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
PERFORM bdc_field USING 'RCTMS-MNAME(01)'
'MATERIALGROUP'." i_vendor-mname_01.
PERFORM bdc_field USING 'RCTMS-MNAME(02)'
'MATERIALGROUP'." i_vendor-mname_02.
PERFORM bdc_field USING 'RCTMS-MNAME(03)'
'MATERIALGROUP'." i_vendor-mname_03.
PERFORM bdc_field USING 'RCTMS-MWERT(01)'
i_vendor-mwert_01.
PERFORM bdc_field USING 'RCTMS-MWERT(02)'
i_vendor-mwert_02.
PERFORM bdc_field USING 'RCTMS-MWERT(03)'
i_vendor-mwert_03.
PERFORM bdc_dynpro USING 'SAPLCLFM' '0500'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMCLF-CLASS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENDE'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-ANRED'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-EMNFR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFA1-EMNFR'
i_vendor-emnfr.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFBK-BANKS(01)'
i_vendor-banks_01.
PERFORM bdc_field USING 'LFBK-BANKS(02)'
i_vendor-banks_02.
PERFORM bdc_field USING 'LFBK-BANKL(01)'
i_vendor-bankl_01.
PERFORM bdc_field USING 'LFBK-BANKL(02)'
i_vendor-bankl_02.
PERFORM bdc_field USING 'LFBK-BANKN(01)'
i_vendor-bankn_01.
PERFORM bdc_field USING 'LFBK-BANKN(02)'
i_vendor-bankn_02.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFB1-AKONT'
i_vendor-akont.
PERFORM bdc_field USING 'LFB1-ZUAWA'
i_vendor-zuawa.
PERFORM bdc_field USING 'LFB1-FDGRV'
i_vendor-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-XPORE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFB1-ZTERM'
i_vendor-zterm.
PERFORM bdc_field USING 'LFB1-REPRF'
c_x. "i_vendor-reprf.
PERFORM bdc_field USING 'LFB1-ZWELS'
i_vendor-zwels.
PERFORM bdc_field USING 'LFB1-HBKID'
i_vendor-hbkid.
PERFORM bdc_field USING 'LFB1-XPORE'
c_x. "i_vendor-xpore.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFB5-MAHNS'
i_vendor-mahns.
PERFORM bdc_field USING 'LFB1-XAUSZ'
i_vendor-xausz.
PERFORM bdc_dynpro USING 'SAPMF02K' '0610'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBW-WT_SUBJCT(01)'.
PERFORM bdc_field USING 'LFB1-QLAND'
i_vendor-qland.
PERFORM bdc_field USING 'LFBW-WITHT(01)'
i_vendor-witht_01.
PERFORM bdc_field USING 'LFBW-WT_WITHCD(01)'
i_vendor-wt_withcd.
PERFORM bdc_field USING 'LFBW-WT_SUBJCT(01)'
c_x.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFM1-WAERS'
i_vendor-waers.
PERFORM bdc_field USING 'LFM1-ZTERM'
i_vendor-zterm1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
Call the Transaction
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
Close the BDc Session
PERFORM close_group.
Regards,
Anji -
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. -
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 -
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? -
How to resolve the error in bdc call transaction in ALV report
Dear Experts, i am executing the alv report program and in alv report program one bdc is there..
after executing output is showing in alv format but one button is there (update master)..when i am clicking update button the bdc is run but is not updated in the material master..after executing my bdc is not updated in mm02.
how to resove it?
CALL TRANSACTION 'MM02' USING BDCDATA MODE MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.Hi Kaustav,
Looking at the code you attached, it appears to me that your BDC (Form USER_COMMAND) is not executed at all as you haven't passed the 'USER_COMMAND' in FM REUSE_ALV_GRID_DISPLAY for ALV display.
You must pass the importing parameter I_CALLBACK_USER_COMMAND of this FM as 'USER_COMMAND', only then this form will be executed and your BDC will run.
Thereafter, in case your BDC update fails, you can put a break-point in the form (at CALL TRANSACTION statement) and analyze the message table MESSTAB.
Hope it helps.
Regards,
Sapeksh -
Call transaction in ALV report
Dear Experts,
I want to call transaction HUMO from my ALV report on double click on Handling unit no.
I want to pass the Handling unit through my report and skip the first screen.
I try it using Call Transaction but the filed Handling unit doesn't have a parameter ID.
I also try it using Submit but the program is a function pool.
Can anyone please help me out in solving the issue.
Thanks in advance
Best regards
Ankur G.Hai,
This can be achieved by creating custom parameter id.
1.Go to the table maintenance generator of the table TPARA and go to the Maintain button through the transaction SM30.
Enter the table view name TPARA.
2.Click on the maintain button. The following information will appear. Click on the Tick button or the ENTER button to go to the next screen.
3.Enter the Set/Get parameter id as the parameter ID you want to create. Here, I will be creating the parameter Id as ZNAME_DATA1. Click on ENTER button.
4.It will ask for the text of the parameter Id. Enter the text of the parameter ID and click on the Save button.
5.Now go to the SE11 transaction for creating a data element and enter the parameter id at the Further Characteristics tab at the parameter Id section.
6.Activate the data element and use it with the program. It will act the same good as a standard one. -
CALL TRANSACTION IN INTERACVTIVE REPORT AND DIRECTLY DISPLYAING DATA
I have created a interactive report in ist list i displayed data of sales order no in the 2nd list i have to call transaction va03 and it should display the data for the sales order no which i have selected from the ist list but i am enable to write code for this can any can send the code.
Hey ravi can u be clear.I cant understand your requirement.There wont be any coding for visual composing.The coding has to be done in ABAP and the transactiond code has to be called on to the portal.
-
Call transaction in background in report
I have a report in which I call a transaction, but the requirement is that I have to call it in background.
Can you please suggest how I can achieve this.
<removed_by_moderator>
Edited by: Julius Bussche on Aug 26, 2008 3:20 PMHi charles,
Use the mode 'N'
Example:-
DATA:
fs_opt TYPE ctu_params.
fs_opt-dismode = 'N'.
CALL TRANSACTION 'PA30' USING t_bdcdata OPTIONS FROM fs_opt.
Luck,
Bhumika -
Call transaction from the ABAP report
Hi Gurus,
Please help me with suggestion. I would like to access from SAP report with double click transaction FB03. I can access it, but in old transaction view ... How can I get the new transaction view?
Here is the code,
BR
Saso
IF fieldname CS 'BELNR'.
PERFORM bdc_screen USING 'SAPMF05L' '100'.
PERFORM bdc_field USING 'RF05L-BELNR' fieldvalue.
PERFORM bdc_field USING 'RF05L-BUKRS' '0008'.
PERFORM bdc_field USING 'RF05L-GJAHR' int-gjahr.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
CALL TRANSACTION 'FB03' USING bdc_data MODE 'E'.
REFRESH bdc_data.
ENDIFTry this Example:
REPORT ZABHI_TABSTRIP NO STANDARD PAGE HEADING
LINE-SIZE 80 LINE-COUNT 60.
TABLES : sscrfields.
DATA activetab(6) TYPE c .
DATA mat_des TYPE makt-maktx.
DATA pl_des TYPE t001w-name1 .
DATA mat_gro TYPE mara-mbrsh .
DATA mat_typ TYPE mara-mtart .
SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-010 FOR FIELD matnr.
PARAMETERS matnr TYPE mara-matnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN END OF SCREEN 001.
SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-020 FOR FIELD matnr.
PARAMETERS werks TYPE t001w-werks.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN END OF SCREEN 002.
SELECTION-SCREEN BEGIN OF SCREEN 003 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block3 WITH FRAME TITLE text-004 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-030 FOR FIELD matnr.
PARAMETERS mbrsh TYPE mara-mbrsh.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block3.
SELECTION-SCREEN END OF SCREEN 003.
SELECTION-SCREEN BEGIN OF SCREEN 004 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block4 WITH FRAME TITLE text-005 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-005 FOR FIELD matnr.
PARAMETERS mtart TYPE mara-mtart.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block4.
SELECTION-SCREEN END OF SCREEN 004.
SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 5 LINES NO INTERVALS.
SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1
DEFAULT SCREEN 002.
SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2 .
SELECTION-SCREEN TAB (15) tabs3 USER-COMMAND ucomm3.
SELECTION-SCREEN TAB (15) tabs4 USER-COMMAND ucomm4.
* DEFAULT SCREEN 002 .
SELECTION-SCREEN END OF BLOCK tabb1.
INITIALIZATION.
tabs1 = text-002.
tabs2 = text-003.
tabs3 = text-004.
tabs4 = text-005.
activetab = 'TABS1'.
AT SELECTION-SCREEN .
CASE sscrfields-ucomm.
WHEN 'UCOMM1'.
tabb1-prog = sy-repid.
tabb1-dynnr = 001.
tabb1-activetab = 'TABS1'.
activetab = 'TABS1' .
WHEN 'UCOMM2'.
tabb1-prog = sy-repid.
tabb1-dynnr = 002.
tabb1-activetab = 'TABS2'.
activetab = 'TABS2'.
WHEN 'UCOMM3'.
tabb1-prog = sy-repid.
tabb1-dynnr = 003.
tabb1-activetab = 'TABS3'.
activetab = 'TABS3'.
WHEN 'UCOMM4'.
tabb1-prog = sy-repid.
tabb1-dynnr = 004.
tabb1-activetab = 'TABS4'.
activetab = 'TABS4'.
ENDCASE.
START-OF-SELECTION.
CASE activetab.
WHEN 'TABS1'.
SELECT SINGLE maktx FROM makt INTO pl_des WHERE matnr = matnr.
WRITE: 'Material ' , matnr , mat_des .
WHEN 'TABS2'.
SELECT SINGLE name1 FROM t001w INTO pl_des WHERE werks = werks.
WRITE: 'Plant ' , werks ,pl_des.
WHEN 'TABS3'.
SELECT SINGLE mbrsh FROM mara INTO mat_gro WHERE mbrsh = mbrsh.
WRITE: 'Material Group ' , mbrsh ,mat_gro.
WHEN 'TABS4'.
SELECT SINGLE mtart FROM mara INTO mat_typ WHERE mtart = mtart.
WRITE: 'Material Type ' , mtart , mat_typ.
ENDCASE.
And let me know. -
Two call transaction in Sigle Report
Hello Everybody ,
Is it possible to write BDC in baclground for two call transaction for different Tcode in a sigle ABAP Report .
Regards,
SandeepHi,
Yes it is possible. Populate the values on BDCDATA table and do the call transaction. Only thing to remeber is the document flow. It should not be dependent. I.e data created by the BDC on first transaction should not be required to post second transaction. In such cases you may face difficulty for the second call transaction.
thanks,
Vivekanand
Maybe you are looking for
-
when i upload a word doc into RH, all the chapters are out of sequence. how does that happend and how do i fix that? thanks
-
Is it possible to run my swing app in another jre
Hi All, I have a swing app jar deployed in the server having jre. It may be possible that the client may have a lower version of jre. In that case would it be possible to download the jre itself from the server (local server not Sun server) and then
-
Planned delivery time is not considering in SNP-PR date
Hi All, I gave PDT 10days in product master.when i ran the heuristics system giving me PR on the same date.How to fix this issue? Regards venkadesh
-
Stamina Mode ignores my whitelist
Hi, I have some problems with the stamina mode. I have created a whitelist with gmail and whtasapp. After 10min or so I get no more notifications. After I turn on the display I receive all my messages?? I have set Wifi to stay connected in standby an
-
i created a website with Muse and tried to upload it to Hostgator; they say the coding is not supported and I need to find out where the muse files need to be. Can anyone guide me?