Call transaction (urgent)
Hi All ,
My requirement is to create asset. user wil enter required details on selection screen. that im populating into an internal table, which then i have to pass it to the bdc program using call transaction. i dont want the call transaction screen to come on the screen only my designed screen should come and then all the entered values should be given to the<b> transaction</b> <b>AS01</b>. and then asset no ahould be given as output.
Please help me with the same ..
Thanx
Amruta.
hi,
no need to use BDC..
U can direct use call transaction 'AS01' and skip first screen.
For this, U have to set parameter id of the values u getting in selection screen..
suppose i am callinf Transaction VF03 so i have written like,
SET PARAMETER ID 'VF' FIELD itab-vbeln.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
For VF03, i need to pass vbeln (Billing Doc) snd it is in itab-vbeln.
Parameter id for vbeln is VF, which u can find from <b>Technical Information</b> (Pressing F1)
Reward if useful
Similar Messages
-
CALL Transaction in background not working pls help URGENT
hi i have writtin a bdc program which uses CALL TRSANCTION everything is working in foreground.
if i schedule the program in background the call transaction does not work. any idea why?????????
pls help its urgenthi
good
have you checked in the debug mode, if you have checked in the debug mode check wheather it is giving any error before data is displaying in the screen, if any error is displaying as a message than check that error why it is coming there.
If no error is coming than check your flow of the bdc screen in the debug mode , there must be some prob, so that it is not working in the background.
thanks
mrutyun^ -
!urgent!!!!!calling transaction
<b>How to call any view of MM03 from ABAP program,without BDC and call transaction mm03 skip first screen.Please give me some suggestions regarding this. suppose i want to call mm03
mrp1 view from abap program. user sould not interact with any button, it directly display that view for the the corresponding material and plant. Thanks in advance</b>Hi,
U may try the following code if it is yet to resolve.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA:lw_output LIKE LINE OF t_output.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'MATNR'.
Read data table, using index of row user clicked on
READ TABLE t_output INTO lw_output INDEX
RS_SELFIELD-TABINDEX.
Set parameter ID for transaction screen field
if sy-subrc = 0.
SET PARAMETER ID 'MAT' FIELD lw_output-matnr .
CALL TRANSACTION 'MM43' AND SKIP first SCREEN.
CLEAR r_ucomm.
endif.
ENDIF.
ENDFORM.
If helpful pl reward.
Cheers. -
Call transaction ANd session method very urgent
Hi,
When there are 5000 records which method u prefer to use?What was the reason to choose perticular method?
Regards
saiUse the CALL TRANSACTION USING statement
Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
The most important features of CALL TRANSACTION USING are:
Synchronous processing
Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
You can update the database both synchronously and asynchronously
The program specifies the update type
Separate LUW (logical units of work) for the transaction
The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
No batch input processing log
Create a session on the batch input queue.
Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
The most important aspects of the session interface are:
Asynchronous processing
Transfers data for multiple transactions
Synchronous database update
During processing, no transaction is started until the previous transaction has been written to the database.
A batch input processing log is generated for each session
Sessions cannot be generated in parallel
The batch input program must not open a session until it has closed the preceding session. -
Call transaction and session method -urgent
Hi,
can anybody tell me the diffence between call transaction and session method .
what are the advantage of each method and when we go for it.
how to see log file in session method.
i will really appricitatehi,
check this code,
REPORT ZTEST_ABCD NO STANDARD PAGE HEADING LINE-SIZE 255.
*REPORT zabzon_bdc
NO STANDARD PAGE HEADING LINE-SIZE 255.
TYPES: BEGIN OF record,
xbanl LIKE raifp3-xbanl,
anln1 LIKE raifp2-anln1,
anln2 LIKE raifp2-anln2,
anbtr TYPE string,
bldat TYPE string,
budat TYPE string,
bzdat TYPE string,
sgtxt LIKE raifp2-sgtxt,
monat LIKE raifp2-monat,
blart LIKE raifp1-blart,
gkont LIKE raifp2-gkont,
bwasl LIKE raifp1-bwasl,
xblnr LIKE raifp1-xblnr,
END OF record.
TYPES :BEGIN OF x_messages,
index TYPE i,
msgtyp(1),
message(120),
END OF x_messages.
DATA: it_record TYPE STANDARD TABLE OF record,
wa_record TYPE record.
DATA : it_messages TYPE STANDARD TABLE OF x_messages,
wa_messages TYPE x_messages.
DATA : it_bdcmsg TYPE STANDARD TABLE OF bdcmsgcoll,
wa_bdcmsg TYPE bdcmsgcoll.
DATA : bdcdata TYPE STANDARD TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata.
DATA : it_excel TYPE STANDARD TABLE OF alsmex_tabline,
wa_excel TYPE alsmex_tabline.
DATA : fname TYPE string.
DATA :l_index LIKE sy-tabix.
data : str type string.
*Selection screen.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_file1 TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
*Selction-Screen F4 Help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'p_file1'
IMPORTING
file_name = p_file1.
*START-OF-SELECTION.
START-OF-SELECTION.
PERFORM process_f1data.
PERFORM execute_bdc.
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO bdcdata.
CLEAR wa_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval .
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO bdcdata.
CLEAR wa_bdcdata.
ENDFORM. "BDC_FIELD
*& Form process_f1data
text
--> p1 text
<-- p2 text
FORM process_f1data.
REFRESH it_excel.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file1
i_begin_col = 1
i_begin_row = 1
i_end_col = 99
i_end_row = 1000
TABLES
intern = it_excel.
LOOP AT it_excel INTO wa_excel.
CASE wa_excel-col .
WHEN '1' .
wa_record-xbanl = wa_excel-value.
WHEN '1' .
wa_record-anln1 = wa_excel-value.
WHEN '2'.
wa_record-anln2 = wa_excel-value.
WHEN '3'.
wa_record-anbtr = wa_excel-value.
WHEN '4'.
wa_record-bldat = wa_excel-value.
WHEN '5'.
wa_record-budat = wa_excel-value.
WHEN '6'.
wa_record-bzdat = wa_excel-value.
WHEN '7'.
wa_record-sgtxt = wa_excel-value.
WHEN '8'.
wa_record-monat = wa_excel-value.
WHEN '9'.
wa_record-blart = wa_excel-value.
WHEN '10'.
wa_record-gkont = wa_excel-value.
WHEN '11'.
wa_record-bwasl = wa_excel-value.
WHEN '12'.
wa_record-xblnr = wa_excel-value.
ENDCASE.
AT END OF row.
CONDENSE : wa_record-anln1,wa_record-anln2,
wa_record-anbtr,wa_record-bldat,wa_record-budat,
wa_record-bzdat,wa_record-sgtxt,wa_record-monat,
wa_record-blart,wa_record-gkont,wa_record-bwasl,
wa_record-xblnr.
APPEND wa_record TO it_record.
CLEAR wa_record.
ENDAT.
ENDLOOP.
ENDFORM. " process_f1data
*& Form execute_bdc
text
--> p1 text
<-- p2 text
FORM execute_bdc.
LOOP AT it_record INTO wa_record.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NEWA'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP3-XBANL'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'22.05.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-ANLN1'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
wa_record-anln1. "'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'22.05.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-ANLN2'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
wa_record-anln2. "'0'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'22.05.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-ANBTR'.
str = wa_record-anbtr.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
wa_record-anbtr. "'45000'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'22.05.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
'45,000.00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-BLDAT'.
PERFORM bdc_field USING 'RAIFP1-BLDAT'
wa_record-bldat. "'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'22.05.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
'45,000.00'.
PERFORM bdc_field USING 'RAIFP1-BLDAT'
'01.04.2008'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-BUDAT'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
wa_record-budat. "'01.04.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
'45,000.00'.
PERFORM bdc_field USING 'RAIFP1-BLDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'01.04.2008'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-BZDAT'.
PERFORM bdc_field USING 'RAIFP1-BZDAT'
wa_record-bzdat. "'01.04.2008'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
'45,000.00'.
PERFORM bdc_field USING 'RAIFP1-BLDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BZDAT'
'01.04.2008'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-SGTXT'.
PERFORM bdc_field USING 'RAIFP2-SGTXT'
wa_record-sgtxt. "'test01'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAB02'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-ANLN1'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-ANBTR'
'45,000.00'.
PERFORM bdc_field USING 'RAIFP1-BLDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BUDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP1-BZDAT'
'01.04.2008'.
PERFORM bdc_field USING 'RAIFP2-SGTXT'
'test01'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-MONAT'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
wa_record-monat. "'01'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-BLART'.
PERFORM bdc_field USING 'RAIFP1-BLART'
wa_record-blart. " 'AA'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-GKONT'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-GKONT'.
PERFORM bdc_field USING 'RAIFP2-GKONT'
wa_record-gkont. "'1600'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_field USING 'RAIFP2-GKONT'
'1600'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-BWASL'.
PERFORM bdc_field USING 'RAIFP1-BWASL'
wa_record-bwasl. "'100'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_field USING 'RAIFP2-GKONT'
'1600'.
PERFORM bdc_field USING 'RAIFP1-BWASL'
'100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP1-XBLNR'.
PERFORM bdc_field USING 'RAIFP1-XBLNR'
wa_record-xblnr. "'TEST01'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RAIFP2-ANLN1'.
PERFORM bdc_field USING 'RAIFP3-XBANL'
'X'.
PERFORM bdc_field USING 'RAIFP2-ANLN1'
'3100309'.
PERFORM bdc_field USING 'RAIFP2-ANLN2'
'0'.
PERFORM bdc_field USING 'RAIFP2-MONAT'
'1'.
PERFORM bdc_field USING 'RAIFP1-BLART'
'AA'.
PERFORM bdc_field USING 'RAIFP2-GKONT'
'1600'.
PERFORM bdc_field USING 'RAIFP1-BWASL'
'100'.
PERFORM bdc_field USING 'RAIFP1-XBLNR'
'TEST01'.
PERFORM bdc_dynpro USING 'SAPLAMDP' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SHWD'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'ABZON' USING bdcdata
MODE 'A'
MESSAGES INTO it_bdcmsg.
PERFORM collect_bdc_messages.
ENDLOOP.
ENDFORM. " execute_bdc
*& Form collect_bdc_messages
text
--> p1 text
<-- p2 text
FORM collect_bdc_messages.
DATA: l_msg(100).
LOOP AT it_bdcmsg INTO wa_bdcmsg.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_bdcmsg-msgid
lang = wa_bdcmsg-msgspra
no = wa_bdcmsg-msgnr
v1 = wa_bdcmsg-msgv1
v2 = wa_bdcmsg-msgv2
IMPORTING
msg = l_msg
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_msg.
CLEAR wa_bdcmsg.
wa_messages-index = l_index.
wa_messages-msgtyp = wa_bdcmsg-msgtyp.
wa_messages-message = l_msg.
APPEND wa_messages TO it_messages.
WRITE:/ wa_messages-message.
ENDLOOP.
l_index = l_index + 1.
REFRESH it_bdcmsg.
ENDFORM. " collect_bdc_messages
regards
siva -
Call Transaction 'PA40' ALWAYS returns with error code
Hi,
I'm having issues with updating personnel actions using CALL TRANSACTION 'PA40'. The call always ends with an error code.
I checked the message table and there are no error messages, only warnings and status messages. Warning and information messages are usually skipped in the BDC...I've coded an 'ENTER' to past the warning but this does not work either as the subsequent infotype screen fields are then not filled correctly.
The following values for addition OPTIONS are used:
data: opt like ctu_params.
opt-dismode = 'N'.
opt-updmode = 'A'. ('S' makes no difference)
opt-defsize = 'X'.
opt-nobinpt = 'X'. ( ' ' makes no difference)
I've tried using 'PA30' for the same actions but I get the same problem. I've used call transaction 'PA30' in many programs and I've never come across this problem.
Is there perhaps a config setting somewhere to fix this? I've tried hiring employees using HR_MAINTAIN_MASTERDATA with the employee existance check off but there's a couple of problems there as well - sample code for hiring an employee would be very helpful...
I need your help urgently and would appreciate your assitance immensely. (I'm working on 4.6C.)
Thank you.
LMThe easiest way to resolve this is to set
opt-dismode = 'E'.
this way it will run in background and jump out when it hits an error, and it's much easier to see what the real issue is.
I'm assuming you used SHDB first to get the recording? -
Type of error in the log file while using using call transaction mode u2018Eu2019
Hi Gurus,
Please Answer for this qusetion urgently
what type of error exactly you will be seeing in the log file while using call transaction mode u2018Eu2019?
Thanks/
Radha.Hi,
Can you be clear.
In call transaction , no error logs are created, you have to handle the errors explicitly using the structure BDCMSGCOLL.
Whenever you use E mode then if the transaction encounters any of the errors i.e. data type mismatching or invalid values etc, it will stop at that screen.
You can handle the errors in call transaction in the following method.
create a table using the structure BDCMSGCOLL.
then
loop at ......
CALL TRANSACTION 'XK01' USING I_BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO I_MESGTAB.
endloop.
SORT I_MESGTAB BY MSGID MSGV1 ASCENDING.
DELETE ADJACENT DUPLICATES FROM I_MESGTAB.
LOOP AT I_MESGTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_MESGTAB-MSGID
LANG = I_MESGTAB-MSGSPRA
NO = I_MESGTAB-MSGNR
V1 = I_MESGTAB-MSGV1
V2 = I_MESGTAB-MSGV2
V3 = I_MESGTAB-MSGV3
V4 = I_MESGTAB-MSGV4
IMPORTING
MSG = MESG1.
IF I_MESGTAB-MSGTYP = 'S' .
WA_SUCCMESG-MESG = MESG1.
APPEND WA_SUCCMESG TO I_SUCCMESG.
else IF I_MESGTAB-MSGTYP = 'E' .
WA_ERRMESG-MESG = MESG1.
APPEND WA_ERRMESG TO I_ERRMESG.
ENDIF.
ENDLOOP.
Hope this is clear.
Thanks and Regards. -
Hi guys please give me sample code for call transaction that handles error
hi guys, please give me sample code for call transaction that handles error,
please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.
please do help me as it is urgent.
thanks and regards.
prasadnn.Hi Prasad,
Check this code.
Source Code for BDC using Call Transaction
*Code used to create BDC
*& Report ZBDC_EXAMPLE *
*& Example BDC program, which updates net price of item 00010 of a *
*& particular Purchase order(EBELN). *
REPORT ZBDC_EXAMPLE NO STANDARD PAGE HEADING
LINE-SIZE 132.
Data declaration
TABLES: ekko, ekpo.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekko-ebeln,
waers TYPE ekko-waers,
netpr TYPE ekpo-netpr,
err_msg(73) TYPE c,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_error TYPE t_ekko,
it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_success TYPE t_ekko.
DATA: w_textout LIKE t100-text.
DATA: gd_update TYPE i,
gd_lines TYPE i.
*Used to store BDC data
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
*Used to stores error information from CALL TRANSACTION Function Module
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
*Screen declaration
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE text-001. "Purchase order Num
SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
TITLE text-002. "New NETPR value
PARAMETERS: p_newpr(14) TYPE c obligatory. "LIKE ekpo-netpr.
SELECTION-SCREEN END OF BLOCK block2.
*START-OF-SELECTION
START-OF-SELECTION.
Retrieve data from Purchase order table(EKKO)
SELECT ekkoebeln ekkowaers ekpo~netpr
INTO TABLE it_ekko
FROM ekko AS ekko INNER JOIN ekpo AS ekpo
ON ekpoebeln EQ ekkoebeln
WHERE ekko~ebeln IN so_ebeln AND
ekpo~ebelp EQ '10'.
*END-OF-SELECTION
END-OF-SELECTION.
Check data has been retrieved ready for processing
DESCRIBE TABLE it_ekko LINES gd_lines.
IF gd_lines LE 0.
Display message if no data has been retrieved
MESSAGE i003(zp) WITH 'No Records Found'(001).
LEAVE TO SCREEN 0.
ELSE.
Update Customer master data (instalment text)
LOOP AT it_ekko INTO wa_ekko.
PERFORM bdc_update.
ENDLOOP.
Display message confirming number of records updated
IF gd_update GT 1.
MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
ELSE.
MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
ENDIF.
Display Success Report
Check Success table
DESCRIBE TABLE it_success LINES gd_lines.
IF gd_lines GT 0.
Display result report column headings
PERFORM display_column_headings.
Display result report
PERFORM display_report.
ENDIF.
Display Error Report
Check errors table
DESCRIBE TABLE it_error LINES gd_lines.
If errors exist then display errors report
IF gd_lines GT 0.
Display errors report
PERFORM display_error_headings.
PERFORM display_error_report.
ENDIF.
ENDIF.
*& Form DISPLAY_COLUMN_HEADINGS
Display column headings
FORM display_column_headings.
WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
SKIP.
WRITE:2 'The following records updated successfully:'(013).
WRITE:/ sy-uline(42).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(004), sy-vline,
(11) 'Old Netpr'(005), sy-vline,
(11) 'New Netpr'(006), sy-vline.
WRITE:/ sy-uline(42).
ENDFORM. " DISPLAY_COLUMN_HEADINGS
*& Form BDC_UPDATE
Populate BDC table and call transaction ME22
FORM bdc_update.
PERFORM dynpro USING:
'X' 'SAPMM06E' '0105',
' ' 'BDC_CURSOR' 'RM06E-BSTNR',
' ' 'RM06E-BSTNR' wa_ekko-ebeln,
' ' 'BDC_OKCODE' '/00', "OK code
'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'EKPO-NETPR(01)',
' ' 'EKPO-NETPR(01)' p_newpr,
' ' 'BDC_OKCODE' '=BU'. "OK code
Call transaction to update customer instalment text
CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
MESSAGES INTO messtab.
Check if update was succesful
IF sy-subrc EQ 0.
ADD 1 TO gd_update.
APPEND wa_ekko TO it_success.
ELSE.
Retrieve error messages displayed during BDC update
LOOP AT messtab WHERE msgtyp = 'E'.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
Build error table ready for output
wa_error = wa_ekko.
wa_error-err_msg = w_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDIF.
Clear bdc date table
CLEAR: bdc_tab.
REFRESH: bdc_tab.
ENDFORM. " BDC_UPDATE
FORM DYNPRO *
stores values to bdc table *
--> DYNBEGIN *
--> NAME *
--> VALUE *
FORM dynpro USING dynbegin name value.
IF dynbegin = 'X'.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-program,
value TO bdc_tab-dynpro,
'X' TO bdc_tab-dynbegin.
APPEND bdc_tab.
ELSE.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-fnam,
value TO bdc_tab-fval.
APPEND bdc_tab.
ENDIF.
ENDFORM. " DYNPRO
*& Form DISPLAY_REPORT
Display Report
FORM display_report.
FORMAT COLOR COL_NORMAL.
Loop at data table
LOOP AT it_success INTO wa_success.
WRITE:/ sy-vline,
(10) wa_success-ebeln, sy-vline,
(11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
(11) p_newpr, sy-vline.
CLEAR: wa_success.
ENDLOOP.
WRITE:/ sy-uline(42).
REFRESH: it_success.
FORMAT COLOR COL_BACKGROUND.
ENDFORM. " DISPLAY_REPORT
*& Form DISPLAY_ERROR_REPORT
Display error report data
FORM display_error_report.
LOOP AT it_error INTO wa_error.
WRITE:/ sy-vline,
(10) wa_error-ebeln, sy-vline,
(11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
(73) wa_error-err_msg, sy-vline.
ENDLOOP.
WRITE:/ sy-uline(104).
REFRESH: it_error.
ENDFORM. " DISPLAY_ERROR_REPORT
*& Form DISPLAY_ERROR_HEADINGS
Display error report headings
FORM display_error_headings.
SKIP.
WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
SKIP.
WRITE:2 'The following records failed during update:'(008).
WRITE:/ sy-uline(104).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(009), sy-vline,
(11) 'Netpr'(010), sy-vline,
(73) 'Error Message'(012), sy-vline.
WRITE:/ sy-uline(104).
FORMAT COLOR COL_NORMAL.
ENDFORM. " DISPLAY_ERROR_HEADINGS
Hope this resolves your query.
Reward all the helpful answers.
Regards -
Alv grid - call transaction 'ME22N' and reflect the change made in alv grid
Hi,
<u>Scenario</u>
I have an alv list which has fields Purchase document no. (EBELN) and Item delivery date (EINDT). EBELN field is hot spot enabled. when i click on that transaction 'ME22' is called. I have done this using USER_COMMAND subroutine.the code is given.
FORM USER_COMMAND *
Call transaction ME22N on clicking Document number *
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
DATA: F_SUBRC LIKE SY-SUBRC,
s_arseg like G_T_PORD. "the internal table used is G_T_PORD
CASE F_UCOMM.
WHEN '&IC1'.
IF i_selfield-fieldname = 'EBELN'.
READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
endform.
<u>Requirement</u>
After calling the transaction, If the user changes the Item delivery date (EINDT) at the ME22 transaction screen, the new date needs to be reflected in the ALV grid.
Plz help it is very urgent.The first method (using selfield-refresh = 'X'.) didn't work as the internal table doesnt get modified when the user make changes in Item delivery date(EINDT) at ME22 transaction screen. The 2nd method is OO,which can't be used in my case.
I tried calling the subroutine for populating the itab (G_T_PORD) and the subroutine for displaying the alv grid immediately after calling ME22N transaction. Still it is not reflecting the new date in the output alv. The code is given below.
FORM USER_COMMAND *
Call transaction ME22N on clicking Document number *
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
DATA: F_SUBRC LIKE SY-SUBRC,
s_arseg like G_T_PORD.
CASE F_UCOMM.
WHEN '&IC1'.
IF i_selfield-fieldname = 'EBELN'.
READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
refresh G_T_PORD.
perform F1000_POPULATE_PO.
perform F2000_DISPLAY_PO .
endform. -
FB05 CALL TRANSACTION BACKGROUND MODE ERROR
Hi Experts,
I have a recording for FB05 transaction and I using call transaction to run it ..problem is its running fine in Foreground and not in background ...I am getting an error in screen..
NO BATCH INPUT DATA FOR SCREEN SAPMF05A 0710
Actually I know the reason that is that screen has Additional selections in which I have to select the radio-button for Document number as by default always None would be selected. How to achieve this ?? Its urgent please...
Full points will be rewarded for helpfull answer's..
RaghavHi,
Waht ever you want to do do it manually.
EX;
Say you are unalbe to record radion button click.
In your program read recording code carefully and get confirm where to add your code. Now on your tcode(FB05) click on F1 help and get the screen field name .Ex: T041T-AUGLT pass thsi to below perform
This is to put cursor on radio button
PERFORM bdc_field USING 'BDC_CURSOR'
'T041T-AUGLT'.
This to check
PERFORM bdc_field USING 'ITOB-INVNR'
'X'.
In above code you can write conditions ,like based on some conditons particular radio button has to check.
Pls. reward if useful.... -
Hi all,
I am uploading 10 records in to sap . By using call transaction method . But after insertion of 5 record server suddenly shutdown. Then what happens . What we have to do
and what about the updated 5 recs as well as remaining 5 recs.
And if it happens in case of BDC-SESSION then what is the status what we have to do..
PLEZ GIVe reply soon...its urgent
regards,
anilreddy...Hi,
If you are using call transaction , you will not get error messages for balance 5 records that not updated. you need to cross check with the transaction and rerun again.
Session method is concerned no session will be created. system shutdown happened before the close_group,
a® -
Probelm in BDC call transaction
Hi Experts,
I have a program in which I am calling transaction MI31. This program is having a seelction screen. Now I am facing a problem.
That is If I am using the statement
include BDCRECX1
perform bdc_transaction using 'MI31'.
This is working fine..I am getting the correct result.But it's showing selection screen of inlcude BDCRECX1.
But I do not want that screen to display. I always want to execute bdc in MODE N.
Also I tried with
CALL TRANSACTION 'MI31' USING BDCDATA
MODE 'N'.
But Using this I am not getting the result.
Is there any way to hide the selction screen of inlcude BDCRECX1 so that I can just pass mode N by default.
Please help as It's very urgent.
Helpful answers will be highly rewared.
Thanks,
Krishan
Edited by: Krishan Kumar on Jul 6, 2008 3:32 AMHi,
Please check the program in the link given below and follow the same procedure. This should solve your problem. NO-DISPLAY is the word to be used as given the program.
Reward points if useful.
Best Regards,
Sekhar -
Handling Information Pop-up box in BDC Call transaction
Hi All,
How to handle Information Pop-up box in BDC Call transaction method.
If we can't handle this ,then what is the alternate for this ???
Please I need it urgently ....
Thanks in advanceHi,
Don't worry about information popup box.
Go to SHDB transaction and record the transaction for which u want write BDC using bdc recording. That will handle all the screens accordingly.
Regards,
Sankar -
Regarding BDC and Call transaction Method
hi gurus,
can anyone tell the difference how many records Call transaction and Session
Method can upload in case of single transaction and what is the time taken by each.its urgent pls.
thanks and regards.Rajesh,
u can do as many as ,
coming to speed means it depends on server,
if ur using session then u can calculate time ,
with in one time h many records system will upload the records by seeing in sm35
(first see h many records systems uploads, see the number and put the time , after one min again see the records h many it is ,) u can calculate by this.
remember this speed will changes depends on server,
so if u have n number of records better to do upload in weekends.
2) if u r using call transaction method means , normally we use error file where ever record occurs that record is in error file, i think we cant analyze h many records it will be with in a time r .
we can also check by going respective tables , just put the time and do refreshing the table after one minute , n this way u can analyze .
Thanks -
How can we update mk01 with BDC call transaction method
can any one send the sample code for upload of MK01 using call transaction method.
its urgent..Use the following code.
*& Report ZMK01_VA01 *
REPORT Z_MK01 .
SOURCE INTERNAL TABLE
DATA: BEGIN OF T_SOURCE OCCURS 0,
LIFNR TYPE LIFNR,
EKORG TYPE EKORG,
KTOKK TYPE KTOKK,
NAME1 TYPE NAME1,
SORTL TYPE SORTL,
LAND1 TYPE LAND1,
WAERS TYPE WAERS,
END OF T_SOURCE.
*DATA: E_MESSAGE TYPE C.
ERROR MESSAGE TABLE
DATA: T_ERRORMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
TARGET TABLE LIKE BDCDATA
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
TO UPLOAD DATA FROM LEGACY SYSTEM
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'D:\MK01.TXT'
FILETYPE = 'DAT'
IMPORTING
FILELENGTH =
TABLES
data_tab = T_SOURCE
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.
TRANSFERING DATA FROM INTERNAL SOURCE TABLE TO TARGET TABLE
LOOP AT T_SOURCE.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0107'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
T_SOURCE-LIFNR.
perform bdc_field using 'RF02K-EKORG'
T_SOURCE-EKORG.
perform bdc_field using 'RF02K-KTOKK'
T_SOURCE-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
T_SOURCE-NAME1.
perform bdc_field using 'LFA1-SORTL'
T_SOURCE-SORTL.
perform bdc_field using 'LFA1-LAND1'
T_SOURCE-LAND1.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
T_SOURCE-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'MK01' USING BDCDATA MODE 'A' MESSAGES INTO T_ERRORMSG.
ENDLOOP.
LOOP AT T_ERRORMSG.
WRITE:/ 'MESSAGE TYPE',T_ERRORMSG-MSGTYP,
'FIELDNAME WERE ERROR OCCURED', T_ERRORMSG-FLDNAME.
*CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = T_ERRORMSG-MSGID
LANG = SY-LANGU
NO = T_ERRORMSG-MSGNR
V1 = T_ERRORMSG-MSGV1
V2 = T_ERRORMSG-MSGV2
V3 = T_ERRORMSG-MSGV3
V4 = T_ERRORMSG-MSGV4
IMPORTING
MSG = E_MESSAGE
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.
*WRITE:/ E_MESSAGE.
ENDLOOP.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
With Regards
K Srinivas
Maybe you are looking for
-
Plzzz help me for this report,its emergency.....
hey guys/guls...I have to develop a Repair Bill report,At the end(bottom) of this report I've to show the calculations n values like Paid amount,previous balance,Grand net & net balance, I'M doing this by enlarging(lengthening)the master record much
-
IPhone 5 home screen backgrounds how do you make them smaller
Home to make home & lock screen pics smaller
-
The synchronization of Home folder is working good. But my Mail and iCal data is not synched. Is there anyway to sync this data without using .Mac? Thanks
-
I have photos in my camera roll on iphone and they do not sync to iphoto or itunes. how do I do that. John
-
Hi, These days I have come to mac news about a new software for searching images, (ImageBrain). The question is, if you already know it and because the nature of this, because Apple has not included this type of research, which I find useful for peop