cancel
Showing results for 
Search instead for 
Did you mean: 

Purchasing doc category(EKKO-BSTYP) in BAPI_CONTRACT_CREATE

Former Member

Hi Experts,

Where to fill purchasing doc category(EKKO-BSTYP) in BAPI_CONTRACT_CREATE?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Hello

Nowhere.

This field is filled automatically depending on importances of field BSART (Purchasing document type).

For example: if BSART = 'NB' then BSTYP automatically set 'B'.

Look at table T161 - you will see relationship between this fields.

pedro_candiago
Explorer
0 Kudos

Hi!

I have a problem with this BAPI too. I´m trying to create a contract without plant field filled (strutucture ITEM-PLANT).

When I execute a message (8B 664 - "Enter plant") is displayed.

Debuging the program I see that BAPI_CONTRACT_CREATE call the function J_1B_MATERIAL_READ_MAIN. In this function, at the first lines of code, there is verification:

if i_ekpo-werks is initial. "note 176273

if i_ekko-bstyp = 'A'. "RFQ "note 175242

exit. "note 175242

endif. "note 175242

if i_ekko-bstyp = 'K'. "Kontrakt "note 175242

exit. "note 175242

endif. "note 175242

endif.

The problem is in field EKKO-BSTYP that is not filled. When I try to create a contract in ME31K this field is filled.

Do you know how to solve this problem?

Thank you

pedro_candiago
Explorer
0 Kudos

just to be registered...

i did an enhancement point in function ME_REL_STRATEGIE_EKKO.

In my Z program, I export to memory id the structure i_cekko_new:

CLEAR i_cekko_new.

i_cekko_new-bukrs = gs_cabec-bukrs.

i_cekko_new-bstyp = cc_k.

i_cekko_new-bsart = gs_cabec-evart.

i_cekko_new-lifnr = gs_cabec-lifnr.

i_cekko_new-spras = 'P'.

i_cekko_new-ekorg = gs_cabec-ekorg.

i_cekko_new-ekgrp = gs_cabec-ekgrp.

i_cekko_new-waers = gs_cabec-waers.

i_cekko_new-bedat = sy-datum.

i_cekko_new-ktwrt = gs_cabec-ktwrt.

i_cekko_new-lifre = gs_cabec-lifnr.

i_cekko_new-usrc2 = gs_cabec-unsez.

i_cekko_new-gnetw = gs_cabec-ktwrt.

EXPORT i_cekko_new TO MEMORY ID 'xxx'.

In the enhancement point, I just verify if sy-tcode equals my Z transaction so I IMPORT i_cekko_new FROM MEMORY ID 'xxx'.

sorry my english...