cancel
Showing results for 
Search instead for 
Did you mean: 

[Help] - How to create BP many times.

former_member187400
Active Contributor
0 Kudos

Dear all,

Pls help..

i created Business Partners(BP) many times (use FM: COM_BPUS_BUPA_CREATE)

This is the code:

LOOP AT lt_mstcust INTO ls_mstcust.

  • i FILL data cust that want to be created.

CALL FUNCTION 'COM_BPUS_BUPA_CREATE'

EXPORTING

IV_PARTNERCATEGORY = partner_cat

IV_BUSINESSPARTNERGROUP = lv_bpgroup

IS_CENTRALDATA = ls_central

IS_CENTRALDATAORGANIZATION = ls_organ

IS_ADDRESSDATA = ls_address

IV_ACCEPT_ERROR = 'X'

IV_BUSINESSPARTNERROLE = lv_bprole

IMPORTING

EV_BUSINESSPARTNER = lv_bpnumber

TABLES

IT_TELEFONDATA = lt_telephone

IT_FAXDATA = lt_fax

ET_RETURN = lt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = ''

IMPORTING

RETURN = lt_return.

ENDLOOP.

-


end of code.

The strange problems:

Not all BP that i created saved in table BUT000, although all BP number was generated after running that FM.

So i can say after i run the LOOP, i got all bp number. BUT, some of bp numbers were not found in table BUT000. It means when i run TCODE: BP and i entered BP number that were not found in BUT000, error message (bp is not found) would be raised.

Do u have any solutions for it?

Or are there others creating BP FM that can be run in LOOP (can create BP in many times)?

Please help y..

Ur help is very important for me.

Regards.

Daniel N.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

You can try out one of the following.

1. Call the function module "COM_BPUS_INPUTDATA_CHECK" before the function module "COM_BPUS_BUPA_CREATE"

2. Instead of calling the function module "COM_BPUS_BUPA_CREATE" Try calling "BAPI_BUPA_CREATE_FROM_DATA" and then commit and then call "COM_BPUS_BUPA_ROLE_ADD"

3. Try removing the flag IV_ACCEPT_ERROR = 'X' from the function module call.

4. In the BAPI_TRANSACTION_COMMIT pass a value 'X' to the parameter WAIT.

Let me know if this helps!

Jash.

former_member187400
Active Contributor
0 Kudos

Thx.. Jashwanth Doshi for ur help. But, i've tried like u said and it still didn't work.

The result was same like b4, not all bp number that was generated, saved in table BUT000.

But anyway thx so much.. perhaps if u have another idea, u could share to me again.

I'll wait it :p.

Regards

Daniel N.

Former Member
0 Kudos

Hi Daniel,

I think you should try using the function module "BUPA_CREATE_FROM_DATA" or "BAPI_BUPA_CREATE_FROM_DATA" instead of the one you are using.

These funtion modules are far more stable and reliable.

Let me know if this helps you!

Jash.

Answers (0)