ZBP Vendor Creation
ZBP Vendor Creation
*include bdcrecx1.
start-of-selection.
v_file = pa_file.
v_file1 = pa_file.
perform upload_file using v_file.
*BREAK-POINT.
* perform open_group.
loop at it_data into wa_data.
endif.
* perform close_group.
call transaction 'BP' using bdcdata mode v_mode update 'S' messages into
gt_messages.
clear bdcdata[].
if not gt_messages[] is initial.
delete gt_messages where msgtyp = 'I' or msgtyp = 'W' . " Warning and Info
message type removed
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
condense bdcdata-fval.
append bdcdata.
endform. "bdc_field
form bdc_transaction using tcode.
data: l_mstring(480).
data: l_subrc like sy-subrc.
* data: lx_auth_check type ref to cx_root.
data: l_auth_check_text type string.
refresh messtab.
try.
call transaction tcode with authority-check using bdcdata
mode ctumode
update cupdate
messages into messtab.
catch cx_sy_authorization_error into lx_auth_check.
* Authorization missing for user when executing transaction
l_auth_check_text = lx_auth_check->get_text( ).
sy-subrc = 99.
endtry.
l_subrc = sy-subrc.
endform.
*&---------------------------------------------------------------------*
*& Form UPLOAD_FILE
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
* -->P_V_FILE text
*&---------------------------------------------------------------------*
form upload_file using p_v_file.
endform.