Application Development and Automation 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: 
Read only

Using BAPI_PO_CREATE1 to STO

former_member311223
Participant
0 Likes
6,365

Dear experts,

I am using the BAPI_PO_CREATE1 to create STO and my program is working properly. I that excel we are passing the Vendor deatils in the Import parameter POHEADER in the below mentioned format and simultaneously updating the POHEADERX.

            PO_HEADER-COMP_CODE  = tab-COMP_CODE.

           PO_HEADER-PURCH_ORG  = tab-PURCH_ORG.

           PO_HEADER-PUR_GROUP  = tab-PUR_GROUP.

          PO_HEADER-VENDOR     = tab-VENDOR.
          PO_HEADER-SUPPL_PLNT = tab-SUPPL_PLNT.
          PO_HEADER-CREAT_DATE = tab-doc_DATE.

-----------------------------------------------------------------------------------------------
          POHEADERX-DOC_TYPE  = 'X'.
         POHEADERX-VENDOR    = 'X'.
         POHEADERX-PURCH_ORG = 'X'.
         POHEADERX-PUR_GROUP = 'X'.

Now my FC doesnot wants the Vendor details to pe specified in the excel. In doing so if i remove the Vendor field or make the Vendor field to blank I am getting error. "PO header data still faulty".

please suggest...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,822

Hi Gopa,

There could be two reasons.

1) Vendor field is mandatory for the purchase document type you have choosen.

2) If you have cleared the vendor field value from data field, please remove/clear the flag value being passed in structure field POHEADERX-VENDOR  as well.

Hope this helps
Regards,

Dear experts,

I am using the BAPI_PO_CREATE1 to create STO and my program is working properly. I that excel we are passing the Vendor deatils in the Import parameter POHEADER in the below mentioned format and simultaneously updating the POHEADERX.

            PO_HEADER-COMP_CODE  = tab-COMP_CODE.

           PO_HEADER-PURCH_ORG  = tab-PURCH_ORG.

           PO_HEADER-PUR_GROUP  = tab-PUR_GROUP.

          PO_HEADER-VENDOR     = tab-VENDOR.
          PO_HEADER-SUPPL_PLNT = tab-SUPPL_PLNT.
          PO_HEADER-CREAT_DATE = tab-doc_DATE.

-----------------------------------------------------------------------------------------------
          POHEADERX-DOC_TYPE  = 'X'.
         POHEADERX-VENDOR    = 'X'.
         POHEADERX-PURCH_ORG = 'X'.
         POHEADERX-PUR_GROUP = 'X'.

Now my FC doesnot wants the Vendor details to pe specified in the excel. In doing so if i remove the Vendor field or make the Vendor field to blank I am getting error. "PO header data still faulty".

please suggest...

8 REPLIES 8
Read only

Former Member
0 Likes
4,823

Hi Gopa,

There could be two reasons.

1) Vendor field is mandatory for the purchase document type you have choosen.

2) If you have cleared the vendor field value from data field, please remove/clear the flag value being passed in structure field POHEADERX-VENDOR  as well.

Hope this helps
Regards,

Read only

0 Likes
4,822
Read only

0 Likes
4,822

Dear prasanna,

Thanx for you reply..

I have already followed the second point which you have mentioned... first point I am checking...

I am getting the error below:-

1    E    BAPI    001    No instance of object type PurchaseOrder has been created. External reference:      PurchaseOrder  

POHEADER    1  

2    E    MEPO    002    PO header data still faulty   POHEADER    1  
3    E    06    098    Please enter supplying plant  

POHEADER    1  

______________________________

Read only

0 Likes
4,822

hi Gopa,

Please pass the POHEADERX-SUPPL_PLNT as value 'X'. I believe this resolves your error.


Regards

Read only

0 Likes
4,822

Dear Prasanna,

Thanx a ton....

My issue us solved....I did not pass the POHEADERX-SUPPL_PLNT as value 'X' in the POHEADERX parameter.

Read only

former_member222709
Contributor
0 Likes
4,822

Hi Gopa,

The very basic reason for creating a Stock Transfer Order is to officiate the order in the name of the selected vendor (or internal stock transfer).

Did you try: po_header-doc_type = 'UB'

If your FC wants the name to be reomved, ask your FC to manually create a Test STO without the vendor. If possible, the same can be converted using BAPI.

Reagrds,

Pranav.

Read only

Former Member
0 Likes
4,822

Hi Gopa,

While creating STO Supply Plant is mandatory not vendor.

Please try to create 1 sto manual there you can check that Vendor is mandatory .

If you are able to create STO manual without giving vendor , then via  BAPI  also we can create STO without giving Vendor.

Let us know .

So that we can process future .

Regards,

Yukti

Read only

Former Member
0 Likes
4,822

Hi Gopi ,

We have created STO without Vendor for one of our Project.

Do let us know.

Regards,

Yukti