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: 

Could block vendor by FM or BAPI?

Former Member
0 Kudos

Hi experts,

Are there any function module or BAPI to block vendor posting like tcode: FK05?

Thanks and regards,

Hung.

1 ACCEPTED SOLUTION

Former Member

Hi Hung,

I found function module " VENDOR_UPDATE" helpful in you case.

Check import parameter I_LFB1 in this FM, there is a field called SPERR. If you put "X" in this field vendor gets blocked for a company code.

Regards,

Ramesh.

9 REPLIES 9

Former Member
0 Kudos

Hi Hung,

I suppose this could be done through BADI's.

You could find the BAdi for your transaction using the followins steps.

1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.

2. In 'Display' mode, go to 'Methods' tab.

3. Double click the method 'Get Instance' to display it source code.

4. Set a breakpoint on 'CALL METHOD cl_exithandler => get_class_name_by_interface'.

5. Then run your transaction.

6. The screen will stop at this method.

7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.

Former Member

Hi Hung,

I found function module " VENDOR_UPDATE" helpful in you case.

Check import parameter I_LFB1 in this FM, there is a field called SPERR. If you put "X" in this field vendor gets blocked for a company code.

Regards,

Ramesh.

0 Kudos

it's ok now,

Thanks so much.

0 Kudos

Hi Ramesh

I have tried your solutions using VENDOR_UPDATE to block a vendor but I get the error below

" System error in table LFA1, account vendor_number

updating"

can you assit.

Regards

Pepele

Former Member
0 Kudos

Hi.

Refer this BAdi.

Business Add-in

ENDOR_ADDRSCR_CHG Change Address Screen in the Master Data Maintenance

ENDOR_ADD_DATA Additional Vendor Data

ENDOR_ADD_DATA_BI Additional Data for Vendors (Batch Input and ALE)

ENDOR_ADD_DATA_CS Additional Data for Vendors (Subscreen 4000)

ENDOR_FIELDSTATUS Change Field Status for Vendors

Regards.

Jay

0 Kudos

...and 'VENDOR_UPDATE' + commit still works for BP in S/4 HANA so you can update for example SPERM.
Vendor has LFA1-SPERM (Centrally imposed purchasing block) and Business Partner equivalent is "Purchasing block" (GS_LFA1-SPERM / All Purchasing Organization Block).
There is also second LFM1-SPERM (Purchasing block at purchasing organization level) in transaction BP called "Purchasing block POrg level" (GS_LFM1-SPERM / Selected Purchasing Organization BLock).

There are many old tables, FMs, BAPIs which still work fine in S4 (thanks to CVI). So similarly, you can change the BP client/customer with old SD_CUSTOMER_MAINTAIN_ALL (e.g. KNVV-ZTERM).

0 Kudos

Basically VENDOR_UPDATE is an update task FM, no check performed, only SQL statement, IMHO that was a wrong answer. For S/4HANA look at class CL_MD_BP_MAINTAIN.

 

0 Kudos

Yes, VENDOR_UPDATE is old. It needed also FMs for change documents and of course there are much better methods (especially related to BP) but it 100% works on S/4 (if you don't have time to replace it with something newer). Thanks.

0 Kudos

Technically there are no difference betwenn using update task FM and direct Abap SQL statemlents...