04-09-2017 3:44 PM
Hi Experts,
I have created Business Partner using BAPI_BUPA_CREATE_FROM_DATA.Also assigned role to it using BAPI_BUPA_ROLE_ADD_2. Now I have to create Customer and Vendor. Please guide how to achieve this!
Any help is highly appreciated.
Regards,
Harsh.
04-10-2017 5:13 AM
Hi Harsha,
I have created BP using BAPI_BUPA_FS_CREATE_FROM_DATA2, in that I passed vendor/ customer roles in table parameter roles to link BP.
system automatically created vendor/customer based on roles(put break point VMD_EI_API=>MAINTAIN). After successfull creation of BP with vendor/customer roles, extend company code details/vendor details by using VMD_EI_API=>MAINTAIN_BAPI. For customer use CMD_EI_API=>MAINTAIN_BAPI.
Regards,
K.Pradeep Reddy.
04-10-2017 5:13 AM
Hi Harsha,
I have created BP using BAPI_BUPA_FS_CREATE_FROM_DATA2, in that I passed vendor/ customer roles in table parameter roles to link BP.
system automatically created vendor/customer based on roles(put break point VMD_EI_API=>MAINTAIN). After successfull creation of BP with vendor/customer roles, extend company code details/vendor details by using VMD_EI_API=>MAINTAIN_BAPI. For customer use CMD_EI_API=>MAINTAIN_BAPI.
Regards,
K.Pradeep Reddy.
04-15-2017 6:50 PM
Thank You Pradeep. Could you please elaborate on this part..break point VMD_EI_API=>MAINTAIN. OR, Could you provide a code snippet for the same.
Regards,
Harsh.
08-31-2017 5:00 AM
09-13-2017 7:28 AM
Hi Dear,
I am getting one error "Field: TASK, value: is not permitted" in the VMD_EI_API=>MAINTAIN_BAPI method.
I have tried with task 'I','U' and 'M'. Please suggest.
03-02-2021 1:46 PM
Hi ketan, I too tried with Task as 'I', 'M' and 'U', getting the error : Field : TASK , value: is not permitted
Any Suggestions, how to resolve this issue
06-28-2017 1:13 PM
I not found any direct BAPI to create data in LFB1 and LFM1 , currently Purchase and Company view, but there is a exit in BP creation that is called in BP transaction and 'BUPA_CREATE_FROM_DATA'. So, I did the following steps to create these two structure.
1) Create a enhancement based on CVI_CUSTOM_MAPPER method IF_EX_CVI_CUSTOM_MAPPER~MAP_VENDOR_TO_BP, this BADI is called at save moment of customer. The content is very simply. Call Z methods into exit:
TRY .
zcl_bc0001_bp_update=>get_purchansing( CHANGING cs_structure = c_vendor ).
zcl_bc0001_bp_update=>get_company( CHANGING cs_structure = c_vendor ).
CATCH cx_root.
ENDTRY.
2) Define the zcl_bc0001_bp_update class and methods get_company and get_purchansing
METHOD get_purchansing.
IF gs_purchasing_data IS NOT INITIAL.
cs_structure-purchasing_data = gs_purchasing_data.
ENDIF.
ENDMETHOD.
METHOD get_company.
IF gs_company_data IS NOT INITIAL.
cs_structure-company_data = gs_company_data.
ENDIF.
ENDMETHOD.
3) Define methods create_bupa_purchase_company( ) . This method set global structures gs_company_data and gs_purchasing_data
METHOD create_bupa_purchase_company.
DATA: t_purchasing TYPE vmds_ei_purchasing_t.
DATA: w_purchansing TYPE vmds_ei_purchasing.
DATA: t_company TYPE vmds_ei_company_t.
DATA: w_company TYPE vmds_ei_company.
"Purchase
w_purchansing-task = 'M'.
w_purchansing-data_key = 'AAAA'.
w_purchansing-data-waers = 'USD'.
w_purchansing-data-zterm = '0001'.
w_purchansing-datax-waers = 'X'.
w_purchansing-datax-zterm = 'X'.
w_purchansing-datax = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'.
APPEND w_purchansing TO t_purchasing.
gs_purchasing_data-purchasing = t_purchasing.
"Company
w_company-task = 'M'.
w_company-data_key = 'XXXX'.
w_company-data-akont = '2101309999'.
w_company-data-zwels = 'D'.
w_company-data-zterm = '0001'.
w_company-data-zuawa = '000'.
w_company-data-reprf = 'X'.
w_company-datax-reprf = 'X'.
w_company-datax-akont = 'X'.
w_company-datax-zwels = 'X'.
w_company-datax-zterm = 'X'.
w_company-datax-reprf = 'X'.
w_company-datax = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'.
APPEND w_company TO t_company.
gs_company_data-company = t_company.
ENDMETHOD.
4) Final step, call BAPI 'BUPA_CREATE_FROM_DATA', our method create_bupa_purchase_company( ) and so 'BAPI_TRANSACTION_COMMIT'. Our method set the golbal static gs_purchasing_data and gs_company_data defined as attribute in zcl_bc0001_bp_update,
GS_PURCHASING_DATA Static AttributePrivateTypeVMDS_EI_VMD_PURCHASING
GS_COMPANY_DATA Static AttributePrivateTypeVMDS_EI_VMD_COMPANY
and in bapi_transaction_commit our enhacement is called before save BP data. Basically, we will replace the value of c_vendor structure, which come empty, for our values in gt_ structures.
Regards.
Wagner Baldi.
09-13-2017 7:29 AM
Hi Dear,
I am getting one error "Field: TASK, value: is not permitted" in the VMD_EI_API=>MAINTAIN_BAPI method.
I have tried with task 'I','U' and 'M'. Please suggest.
09-13-2017 8:23 AM
Hi ...
It has been resolved !!
We need to update the task in Header also then it will work.
regards,
Bhupendra Singh
09-13-2017 8:23 AM
Hi ...
It has been resolved !!
We need to update the task in Header also then it will work.
regards,
Bhupendra Singh
03-28-2018 3:32 PM
Hi all,
Can anyone please provide me the code to convert Business partner to Customer using FM '
'BUPA_CREATE_FROM_DATA'. My requirement is to change the change general business partner to customer(MKK role) through coding.
Thanks
sub