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: 

Add vendor in PO BADI ME_PROCESS_PO_CUST~PROCESS_HEADER

matias_z
Participant
0 Kudos

Hi all,

I need to add the vendor (EKKO-LIFNR) in method PROCESS_HEADER from BADI ME_PROCESS_PO_CUST.

I added it using this code:

      wa_header-lifnr = v_vendor.

      CALL METHOD im_header->set_data

        EXPORTING

          im_data = wa_header.

The vendor is added at the top of ME21N, but I get the following error:

"No master record exists for vendor XXXX"

If I enter that vendor manually in the header and then click ENTER, that error does not appear!

Am I missing something? What else should I enter in the badi code to avoid that error?

Thanks in advance!!

Matias

1 ACCEPTED SOLUTION

Juwin
Active Contributor
0 Kudos

Check preceeding zeros. If you are entering on screen manually, you may enter 10000, but if you are populating the vendor number through code, you need to prefix 0s with it to make it 10 characters. So, through code, you should enter 0000010000.

Thanks,

Juwin

1 REPLY 1

Juwin
Active Contributor
0 Kudos

Check preceeding zeros. If you are entering on screen manually, you may enter 10000, but if you are populating the vendor number through code, you need to prefix 0s with it to make it 10 characters. So, through code, you should enter 0000010000.

Thanks,

Juwin