2008 Aug 26 11:52 AM
2008 Aug 27 10:41 AM
Hi,
Do the required recording for the given transaction code. And edit the recorded program based on the call transaction.
For session method the output format cannot be changed.
For the program to be run in background give the mode as N rather than given A and E for other modes.
The sample code for the given requirement is given as.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_path
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = int_0007
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PERFORM open_group.
*Looping pernr values*
LOOP AT int_0007 INTO wa_0007.
CONCATENATE wa_0007-begda4(2) '/' wa_0007-begda6(2) '/' wa_0007-begda+0(4) INTO
w_date.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*INSERTING THE PERNR VALUE*
PERFORM bdc_field USING 'RP50G-PERNR'
wa_0007-pernr. "'00001011'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-CHOIC'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'0007'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-BEGDA'.
PERFORM bdc_field USING 'RP50G-BEGDA'
w_date.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=INS'.
PERFORM bdc_field USING 'RP50G-PERNR'
wa_0007-pernr. "'1011'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Planned Working Time - 0007'.
PERFORM bdc_dynpro USING 'MP000700' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
perform bdc_field using 'P0007-BEGDA'
'12/01/2007'.
perform bdc_field using 'P0007-ENDDA'
'12/31/9999'.
*INSERTING THE WORK SCHEDULE*
PERFORM bdc_field USING 'P0007-SCHKZ'
wa_0007-schkz. "'N12'.
perform bdc_field using 'P0007-ZTERF'
WA_0007-ZTERF. "'1'.
*INSERTING THE OVERTIME CLASS*
IF wa_0007-r1 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_ELGBLE'
'X'.
ELSEIF wa_0007-r2 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_NOTELG'
'X'.
ELSEIF wa_0007-r3 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_TMPELG'
'X'.
ENDIF.
*BDC output for transaction code*
PERFORM f_bdc_output USING 'pa30'.
ENDLOOP.
Take a look at the sample code and review the same.
Thanks,
Sakthi
2008 Aug 26 11:55 AM
2008 Aug 26 11:55 AM
2008 Aug 26 12:06 PM
Hi ,
Can I write in my report CALL TRANSACTION 'MM01' USING BDCDATA MODE A/E/N UPDATE A/S MESSAGE INTO MESSTAB.
2008 Aug 26 2:21 PM
2008 Aug 27 10:32 AM
Hi,
Can anybody prrovide me exact code so my BDC which is running in foregroung can run in background.
Ravi
2008 Aug 27 11:03 AM
Hi,
Can anybody prrovide me exact code so my BDC which is running in foregroung can run in background.
No.due to security issues.
2008 Aug 26 11:55 AM
2008 Aug 26 12:11 PM
Yes, you can run your BDC in background mode by using the 'N' option in MODE.
CALL TRANSACTION 'MM01' USING i_tab_bdcdata MODE 'N' MESSAGES INTO i_tab_messtab.
2008 Aug 27 10:41 AM
Hi,
Do the required recording for the given transaction code. And edit the recorded program based on the call transaction.
For session method the output format cannot be changed.
For the program to be run in background give the mode as N rather than given A and E for other modes.
The sample code for the given requirement is given as.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_path
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = int_0007
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PERFORM open_group.
*Looping pernr values*
LOOP AT int_0007 INTO wa_0007.
CONCATENATE wa_0007-begda4(2) '/' wa_0007-begda6(2) '/' wa_0007-begda+0(4) INTO
w_date.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*INSERTING THE PERNR VALUE*
PERFORM bdc_field USING 'RP50G-PERNR'
wa_0007-pernr. "'00001011'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-CHOIC'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'0007'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-BEGDA'.
PERFORM bdc_field USING 'RP50G-BEGDA'
w_date.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=INS'.
PERFORM bdc_field USING 'RP50G-PERNR'
wa_0007-pernr. "'1011'.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'Planned Working Time - 0007'.
PERFORM bdc_dynpro USING 'MP000700' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
perform bdc_field using 'P0007-BEGDA'
'12/01/2007'.
perform bdc_field using 'P0007-ENDDA'
'12/31/9999'.
*INSERTING THE WORK SCHEDULE*
PERFORM bdc_field USING 'P0007-SCHKZ'
wa_0007-schkz. "'N12'.
perform bdc_field using 'P0007-ZTERF'
WA_0007-ZTERF. "'1'.
*INSERTING THE OVERTIME CLASS*
IF wa_0007-r1 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_ELGBLE'
'X'.
ELSEIF wa_0007-r2 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_NOTELG'
'X'.
ELSEIF wa_0007-r3 = 'X'.
PERFORM bdc_field USING 'ZHQ0007-OVT_TMPELG'
'X'.
ENDIF.
*BDC output for transaction code*
PERFORM f_bdc_output USING 'pa30'.
ENDLOOP.
Take a look at the sample code and review the same.
Thanks,
Sakthi