‎2009 Feb 08 3:47 AM
Hi,
I am want to know is it possible to have Call Transaction having back ground processing? I had tried it but it is not working.
plzz provide me guiedlines to solve this problem by giving example of it.
‎2009 Feb 08 4:24 AM
hi,
Your issue can be resolved in this way.
You have various modes for call transaction to execute.
Mode 'A' --- All screen mode where you get to navigate every screen through out the transaction.
Mode 'E' --- The transaction stops only when a error message is encountered, when resolved at that screen, process continuous to other screens.
Mode 'N' --- This is no screen mode, this is similar to back ground processing of the BDC program, you get no screens to see, after all the navigation is done you get to know the status of execution, whether processed completely or not.
In this case better capture all your messages into a internal table of type ddic structure BDCMSGCOLL by using addition statement messages into t_message--- where t_message type table of BDCMSGCOLL.
use format_message FM to format the content of t_message and display all the messages in the basic list to know the status of transaction whether completely processed or stopped due to any error.
Thanks
Sharath
‎2009 Feb 08 4:27 AM
Hi,
EX:
DATA:t_opt type CTU_PARAMS.
T_opt-DISMODE = 'E/N'. -
>EERROR ONLY DISPLAY / NNo display mode
T_opt-defsize = 'X'.
t_opt-updmode = 'S'.
Call Transaction 'XX' using BDCTABLE Options T_opt.
Using N mode Processing will be done in back ground,
Using E SCREEN will be displayed when Error Occurs.
you can also schedule the program in backgroung job using Tcode:SM36
This will resolve the issue.
Regards,
Gurpreet
‎2009 Feb 09 4:47 AM
Hi,
Do F1 on call transaction, and look at the additions...
you get a clear picture.
Regards,
Manoj Kumar P
‎2009 Feb 09 4:56 AM
Hi,
Call transaction 'TCODE' using bdcsteps mode 'N'.
This will do processing in the background.
‎2009 Feb 09 5:16 AM
hi,
I am displaying the code and i this i am able to use error handling and mode in back gorund processing.
plzz provide me guidelines how to do this:-
report ZBDC_MB1B
no standard page heading line-size 255.
include bdcrecx1.
data: begin of record OCCURS 0,
WERKS_001(004), "Plant
MATNR_002(018), "ItemId
ERFMG_003(013), "Quantity in Unit of Entry
ERFME_004(003), "Unit of Entry
LGORT_005(004), "Storage Location
CHARG_006(010), "BatchId
KDAUF_007(010), "Sales Order Number
KDPOS_008(006), "Item Number in Sales Order
end of record.
PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
initialization.
CTUMODE = 'A'.
CUPDATE = 'A'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',. '
MODE = 'O'
IMPORTING
FILENAME = P_FILNAM
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
.
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.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILNAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD
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
NO_AUTHORITY = 10
OTHERS = 11
.
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 RECORD.
*********************************************************
BEGIN OF SCREEN 1
*********************************************************
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'BDC_CURSOR'
'RM07M-SOBKZ'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM07M-BWARTWA'
'411'.
perform bdc_field using 'RM07M-SOBKZ'
'E'.
perform bdc_field using 'RM07M-WERKS'
RECORD-WERKS_001. "Plant
perform bdc_field using 'XFULL'
'X'.
perform bdc_field using 'RM07M-WVERS2'
'X'.
*********************************************************
BEGIN OF SCREEN 2
*********************************************************
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-CHARG(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSEG-MATNR(01)'
RECORD-MATNR_002. "ITEMID
perform bdc_field using 'MSEG-ERFMG(01)'
RECORD-ERFMG_003. "QTY.
perform bdc_field using 'MSEG-ERFME(01)'
RECORD-ERFME_004. "UOM
perform bdc_field using 'MSEG-LGORT(01)'
RECORD-LGORT_005. "ST.LOC
perform bdc_field using 'MSEG-CHARG(01)'
RECORD-CHARG_006. "BATCHID
perform bdc_field using 'MSEGK-MAT_KDAUF'
RECORD-KDAUF_007. "S.O.
perform bdc_field using 'MSEGK-MAT_KDPOS'
RECORD-KDPOS_008. "S.O.LINE ITEM
perform bdc_field using 'DKACB-FMORE'
'X'.
*********************************************************
BEGIN OF SCREEN 3
*********************************************************
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'DKACB-FMORE'
'X'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-ERFMG(01)'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'DKACB-FMORE'
'X'.
*********************************************************
BEGIN OF SCREEN 4
*********************************************************
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_transaction using 'MB1B'.
ENDLOOP.
‎2009 Feb 09 5:20 AM
Hi,
I think in the initialization event you have written ctumode = 'A'.
if you change it to 'N' then it will work fine...
initialization.
CTUMODE = 'N'.
CUPDATE = 'A'.
‎2009 Feb 09 5:50 AM
Hi,
I have modified your code.
Try this one,
DATA:bdctab TYPE TABLE OF bdcdata,
wa_bdctab LIKE LINE OF bdctab. "Declared a wok area ans int tab
"Removed the include
DATA: BEGIN OF record OCCURS 0,
werks_001(004), "Plant
matnr_002(018), "ItemId
erfmg_003(013), "Quantity in Unit of Entry
erfme_004(003), "Unit of Entry
lgort_005(004), "Storage Location
charg_006(010), "BatchId
kdauf_007(010), "Sales Order Number
kdpos_008(006), "Item Number in Sales Order
END OF record.
PARAMETERS : p_filnam LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filnam.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',. '
mode = 'O'
IMPORTING
filename = p_filnam
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc NE 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_filnam
filetype = 'DAT'
TABLES
data_tab = record
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
no_authority = 10
OTHERS = 11.
IF sy-subrc NE 0.
*
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT record.
*********************************************************
*BEGIN OF SCREEN 1
*********************************************************
PERFORM bdc_dynpro USING 'SAPMM07M' '0400'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM07M-SOBKZ'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM07M-BWARTWA'
'411'.
PERFORM bdc_field USING 'RM07M-SOBKZ'
'E'.
PERFORM bdc_field USING 'RM07M-WERKS'
record-werks_001. "Plant
PERFORM bdc_field USING 'XFULL'
'X'.
PERFORM bdc_field USING 'RM07M-WVERS2'
'X'.
*********************************************************
*BEGIN OF SCREEN 2
*********************************************************
PERFORM bdc_dynpro USING 'SAPMM07M' '0421'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSEG-CHARG(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MSEG-MATNR(01)'
record-matnr_002. "ITEMID
PERFORM bdc_field USING 'MSEG-ERFMG(01)'
record-erfmg_003. "QTY.
PERFORM bdc_field USING 'MSEG-ERFME(01)'
record-erfme_004. "UOM
PERFORM bdc_field USING 'MSEG-LGORT(01)'
record-lgort_005. "ST.LOC
PERFORM bdc_field USING 'MSEG-CHARG(01)'
record-charg_006. "BATCHID
PERFORM bdc_field USING 'MSEGK-MAT_KDAUF'
record-kdauf_007. "S.O.
PERFORM bdc_field USING 'MSEGK-MAT_KDPOS'
record-kdpos_008. "S.O.LINE ITEM
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
*********************************************************
*BEGIN OF SCREEN 3
*********************************************************
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_dynpro USING 'SAPMM07M' '0421'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSEG-ERFMG(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
*********************************************************
*BEGIN OF SCREEN 4
*********************************************************
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
CALL TRANSACTION 'MB1B' USING bdctab MODE 'N' UPDATE 'S'. "Modified here
ENDLOOP.
"Added forms
*---------------------------------------------------------------------*
* FORM bdc_dynpro *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> P_PROGRAM *
* --> P_DYNPRO *
*---------------------------------------------------------------------*
FORM bdc_dynpro USING p_program
p_dynpro.
wa_bdctab-program = p_program.
wa_bdctab-dynpro = p_dynpro.
wa_bdctab-dynbegin = 'X'.
APPEND wa_bdctab TO bdctab.
CLEAR wa_bdctab.
ENDFORM. " bdc_dynpro
*---------------------------------------------------------------------*
* FORM bdc_field *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> P_FNAM *
* --> P_FVAL *
*---------------------------------------------------------------------*
FORM bdc_field USING p_fnam
p_fval.
wa_bdctab-fnam = p_fnam.
wa_bdctab-fval = p_fval.
APPEND wa_bdctab TO bdctab.
CLEAR wa_bdctab.
ENDFORM. " bdc_fieldHope this helps you.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Feb 9, 2009 6:51 AM
‎2009 Feb 09 5:16 AM
Hi,
Just call the transaction like this..
call transaction 'ME51' into t_bdcdata mode 'N'.
Goto se11 and type bdcdata...u will get an idea..why i used internal table t_bdcdata
Regards
Kiran
‎2009 Feb 09 6:46 AM
Hi,
Call transaction TCODE using bdcsteps mode 'N'.
mode 'A'.
Thanks,
Neelima.