Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Vendor within BADi method

0 Kudos

I have a requirement to have the ability to create a vendor within a BADi method. This BADi will import the necessary fields needed to create a vendor (fields to populate tables LFA1, LFB1 RF02K)

I have researched ways to create a vendor from BDC to FM to using a BAPI, but unsure of what to use within a BADi method.

Any ideas? I need to create records in LFA1, LFB1, RF02K

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

Where and when is this BAdI called, you must first decide if you can use a commit without breaking the transaction consistency, use the current transaction commit (without mess of common data) or trigger an execution in another LUW (e.g. thru a CALL <frc enabled FM> IN BACKGROUND executed after main transaction commit)

Only then will you choose between BDC, BAPI or method such as VMD_EI_API=>MAINTAIN_BAPI.

NB: RF02K is a structure (non persistent data) and not a database table...

0 Kudos

We are passing expense report data from a SAP system to FI. This BADi will be called each time a report is created to see

if an employee has a Vendor created against their employee id and if they dont, create a vendor master record. Is there a BAPi or FM available that calls transaction FK02? From my understanding, you cant use BDC within a badi method because you cant execute a PERFORM.

0 Kudos

Or could I just create a FM containing a BDC to call transaction FK01 and then within my badi method pass my fields to the FM?

0 Kudos
  • Just build a wrapper using an allowed tech.
  • To create/update a vendor from employee master data, you could look at report RPRAPA00 (transaction PRAA)

Abinathsiva
Active Contributor
0 Kudos

Hi Tim.

Can you mention which BADi you are going to use and how values for vendor master captured.