method IF_FP_OFFLINE~GET_INSTANCE.
CREATE OBJECT ro_instance TYPE ZCL_INBOUND_HANLDER_BUPA.
endmethod.
method if_fp_offline~handle_pdf.
constants lc_object type balobj_d value 'FORM_TEST'.
constants lc_subobj type balsubobj value 'OTHERS'.
data ls_log_header type bal_s_log.
data ls_msg type bal_s_msg.
data : lv_fm_name type rs38l_fnam,
t_return type standard table of bapiret2,
t_per_info type standard table of smum_xmltb.
data lv_url type string.
data lv_preprinted type fpboolean.
data lv_effchangedate type sydate.
data lv_employeeid type string.
data lv_department type string.
data lv_name type string.
data ls_newaddress type fptest_smpladd.
data ls_oldaddress type fptest_smpladd.
data ls_groupstates type fptest_states.
data :
lv_name1 type name1,
lv_street type ad_street,
lv_housenumber type ad_hsnm1,
lv_country type land1,
lv_postalcode type ad_pstcd1,
lv_telcountry type ad_comctry,
lv_telephone type ad_tlnmbr.
* Check parameters.
if iv_form_name is initial or iv_pdf is initial or iv_xml is initial.
raise exception type cx_fp_offline
exporting
textid = cx_fp_offline=>cx_fp_offline.
endif.
* Create application log.
ls_log_header-object = lc_object.
ls_log_header-subobject = lc_subobj.
ls_log_header-aldate_del = sy-datum + 90.
call function 'BAL_LOG_CREATE'
exporting
i_s_log = ls_log_header.
move 'S' to ls_msg-msgty.
move 'AD' to ls_msg-msgid.
move '010' to ls_msg-msgno.
* Write header log entry.
ls_msg-msgv1 = cl_abap_classdescr=>get_class_name( me ).
replace '\CLASS=' in ls_msg-msgv1 with ''.
ls_msg-detlevel = '1'.
call function 'BAL_LOG_MSG_ADD'
exporting
i_s_msg = ls_msg
exceptions
others = 0.
* Parse the XML data and write the field values into the log,
* using the generated function module to ease this task.
try.
call function 'FP_FUNCTION_MODULE_NAME'
exporting
i_name = iv_form_name
importing
ev_funcname_inbound = lv_fm_name.
catch cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal.
message id 'FPAPIGENERIC' type 'E' number '000' with iv_form_name.
endtry.
if iv_form_lang is not initial.
call function 'SCP_MIXED_LANGUAGES_1_INIT'.
call function 'SCP_MIXED_LANGUAGES_1_SWITCH'
exporting
need_lang = iv_form_lang
exceptions
others = 0.
endif.
call function lv_fm_name
exporting
iv_xml_data = iv_xml
importing
name1 = lv_name1
street = lv_street
house_no = lv_housenumber
country = lv_country
postl_cod1 = lv_postalcode
telcountry = lv_telcountry
telephone = lv_telephone
exceptions
usage_error = 1
system_error = 2
internal_error = 3
others = 4.
if sy-subrc is not initial.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
call function 'SMUM_XML_PARSE'
exporting
xml_input = iv_xml
tables
xml_table = t_per_info
return = t_return.
data : lfs_per_info type smum_xmltb.
loop at t_per_info into lfs_per_info.
case lfs_per_info-cname.
when 'NAME1'.
lv_name1 = lfs_per_info-cvalue.
when 'STREET'.
lv_street = lfs_per_info-cvalue.
when 'HOUSE_NO'.
lv_housenumber = lfs_per_info-cvalue.
when 'COUNTRY'.
lv_country = lfs_per_info-cvalue.
when 'POSTL_COD1'.
lv_postalcode = lfs_per_info-cvalue.
when 'TELCOUNTRY'.
lv_telcountry = lfs_per_info-cvalue.
when 'TELEPHONE'.
lv_telephone = lfs_per_info-cvalue.
when others.
endcase.
endloop.
if iv_form_lang is not initial.
call function 'SCP_MIXED_LANGUAGES_1_NORMAL'.
call function 'SCP_MIXED_LANGUAGES_1_FINISH'.
endif.
* Make the log entries.
define add_message.
move &1 to ls_msg-msgv1.
move ':' to ls_msg-msgv2.
move &2 to ls_msg-msgv3.
move '2' to ls_msg-detlevel.
call function 'BAL_LOG_MSG_ADD'
exporting
i_s_msg = ls_msg
exceptions
others = 0.
end-of-definition.
** Declarations
add_message 'NAME1' lv_name1.
add_message 'STREET' lv_street.
add_message 'HOUSE_NO' lv_housenumber.
add_message 'COUNTRY' lv_country.
add_message 'POSTL_COD1' lv_postalcode.
add_message 'TELCOUNTRY' lv_telcountry.
add_message 'TELEPHONE' lv_telephone.
**---------------------------------------------------------------------
*--------------.
types: begin of ty_bpdata,
* sel(1) type c,
businesspartner type bapibus1006_head-bpartner,
bpvendor type lfa1-lifnr,
lifnr type lfa1-lifnr,
reference(25) type c,
msg_type type bapiret2-type,
message type bapiret2-message,
traffic(4) type c.
types: end of ty_bpdata.
data: lt_vend1 type standard table of mere_outtab_mkvz,
ls_vend1 like line of lt_vend1,
lt_vend_main type standard table of zmere_outtab_mkvz,
ls_vend_main like line of lt_vend_main,
lt_vend type standard table of zmere_outtab_mkvz,
ls_vend like line of lt_vend,
* lt_lfa1 TYPE STANDARD TABLE OF lfa1,
* lt_lfb1 TYPE STANDARD TABLE OF lfb1,
* lt_lfm1 TYPE STANDARD TABLE OF lfm1,
* lt_wyt3 TYPE STANDARD TABLE OF wyt3,
* ls_lfa1 LIKE LINE OF lt_lfa1,
lt_lfa1 type standard table of lfa1,
ls_lfa1 like line of lt_lfa1,
lt_lfb1 type standard table of lfb1,
ls_lfb1 like line of lt_lfb1,
lt_lfm1 type standard table of lfm1,
ls_lfm1 like line of lt_lfm1,
lt_wyt3 type standard table of wyt3,
ls_wyt3 like line of lt_wyt3,
lt_adrc type standard table of adrc,
ls_adrc like line of lt_adrc,
lt_bpdata_temp type standard table of ty_bpdata,
ls_bpdata_temp like line of lt_bpdata_temp,
lt_bpdata type standard table of ty_bpdata,
ls_bpdata like line of lt_bpdata,
ls_bapiret2 type bapiret2.
data: partner type bapibus1006_head-bpartner,
partnercategory type bapibus1006_head-partn_cat,
partnertype type bapibus1006_head-partn_typ,
partnergroup type bapibus1006_head-partn_grp,
partnerextno type bapibus1006_head-extern_no,
centraldata type bapibus1006_central,
centraldataperson type bapibus1006_central_person,
centraldataorganization type bapibus1006_central_organ,
adressdata type bapibus1006_address,
businesspartner type bapibus1006_head-bpartner,
lt_telefondata type standard table of bapiadtel,
ls_telefondata type bapiadtel,
lt_faxdata type standard table of bapiadfax,
ls_faxdata type bapiadfax,
lt_e_maildata type standard table of bapiadsmtp,
ls_e_maildata type bapiadsmtp,
lt_return type standard table of bapiret2,
ls_return type bapiret2,
lv_msg type c length 1,
lv_return type bapiret2,
lv_return2 type standard table of bapiret2,
lv_message type string,
lv_file type string,
lv_string type string,
lv_minbw type string,
lv_azekorg type string.
data: ls_vend_master_data type vmds_ei_main,
lt_vendors type vmds_ei_extern_t,
ls_vendors type vmds_ei_extern,
ls_vend_header type vmds_ei_header,
ls_vend_central_data type vmds_ei_central_data,
ls_vend_company_data type vmds_ei_vmd_company,
ls_purchasing_data type vmds_ei_vmd_purchasing,
ls_vend_central type vmds_ei_vmd_central,
ls_vend_address type cvis_ei_address1,
ls_vend_bankdetail type cvis_ei_bankdetail,
lt_vend_bankdetails type cvis_ei_bankdetail_t,
ls_vend_bankdetails type cvis_ei_cvi_bankdetail,
lt_vend_company type vmds_ei_company_t,
ls_vend_company type vmds_ei_company,
lt_vend_purchasing type vmds_ei_purchasing_t,
ls_vend_purchasing type vmds_ei_purchasing,
lt_vend_functions type vmds_ei_functions_t,
ls_vend_functions type vmds_ei_functions.
data: es_vend_master_data_correct type vmds_ei_main,
es_vend_message_correct type cvis_message,
es_vend_master_data_defective type vmds_ei_main,
es_vend_message_defective type cvis_message.
*-- Fill the BP data
refresh: lt_telefondata.
partnercategory = '2'.
partnergroup = 'Y001'.
centraldata-title_key = '0003'.
centraldataorganization-name1 = lv_name1.
adressdata-standardaddress = abap_true.
adressdata-langu = 'EN'.
adressdata-city = 'Test'.
adressdata-postl_cod1 = lv_postalcode.
adressdata-street = lv_street.
adressdata-house_no = lv_housenumber.
adressdata-country = lv_country.
ls_telefondata-country = lv_telcountry.
ls_telefondata-std_no = 'X'.
ls_telefondata-telephone = lv_telephone.
append ls_telefondata to lt_telefondata.
*-- Create BUPA
clear: businesspartner, lv_return.
call function 'BAPI_BUPA_CREATE_FROM_DATA'
exporting
partnercategory = partnercategory
partnergroup = partnergroup
centraldata = centraldata
centraldataorganization = centraldataorganization
addressdata = adressdata
importing
businesspartner = businesspartner
tables
telefondata = lt_telefondata
return = lv_return2
.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = lv_return.
if businesspartner is not initial.
ls_bpdata_temp-businesspartner = businesspartner.
endif.
add_message 'BUPANUM' businesspartner .
* Save the log.
call function 'BAL_DB_SAVE'
exporting
i_save_all = abap_true
exceptions
others = 0.
call function 'POPUP_TO_INFORM'
exporting
titel = 'Busines Partner Creation'
txt1 = | Busines Partner { businesspartner } Created |
txt2 = ' '
txt3 = ' '
txt4 = ' '.
lv_objtype TYPE sibftypeid,
lv_event TYPE sibfevent,
lv_objkey TYPE sibfinstid.
lv_objtype = 'ZCL_BUPA'.
lv_event = 'BUPA_CREATED.
• Set up the LPOR instance id
ls_zcl_key- businesspartner = businesspartner .
MOVE ls_zcl_key TO lv_objkey.
• Raise the event
TRY.
CALL METHOD cl_swf_evt_event=>raise
EXPORTING
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
im_objkey = lv_objkey
• IM_EVENT_CONTAINER =
.
CATCH cx_swf_evt_invalid_objtype .
CATCH cx_swf_evt_invalid_event .
ENDTRY.
COMMIT WORK.
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |