cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI / LSMW

Former Member
0 Kudos

Hi Gurus,

I use LSMW for sales order creation and the feild which I have taken are only doc type, sales area, customer no and material no. Rest all data like plant,price etc etc gets determined from the master data maintained and is automatically populated in the order.

My question is that if we use BAPI than does the data gets determined in the sales order or what ever we enter in BAPI will only get populated in the order. Since LSMW is just like running transaction so data gets populated from the masters maintained also, but if we use BAPI so will the data get determined.\

Komal

Accepted Solutions (1)

Accepted Solutions (1)

madhu_vadlamani
Active Contributor
0 Kudos

Hi Komal,

Since LSMW is just like running transaction so data gets populated from the masters maintained also, but if we use BAPI so will the data get determined

Yes some fields will be populates when you go with bapi .Like plant,shipping point and all.

Regards,

Madhu.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If your material is holding the details of the Delivery Plant "( in Sales Org 1 view of material master ) ,then the plant will be picked up from this. if not if there is no condition set to the field of plant on the Sales order , then the same will remain blank.

-avs

Former Member
0 Kudos

Hi Komal,

CreateFromDat1 is from version 4.0 -> 4.6C and obsolete.

CreateFromData is from version 4.5A and obsolete.

CreateFromDat2 is from version 46A to above.

In the customer master data you can set the delivery site (plant)

or set that in material master data. This depends on your configuration.

I have always set the plant in the bapi so I do not know if it is possible to leave

empty.

If you have access to SAP, you can test this.

Goto to SE37, enter the FM name BAPI_SALESORDER_CREATEFROMDAT2

and from menu Function Module -> Test -> Single Test

Here you can test what fields you need to set. Also if you want to do commit also,

use the "Test Sequence" instead of "Single test". And set both functions:

BAPI_SALESORDER_CREATEFROMDAT2

BAPI_TRANSACTION_COMMIT

P.S. I read your question again and since the plant is not mandatory, you can leave it empty if you configure the plant settings elsewhere and it should get the plant from configuration. I bet you are using the same FM in the LSMW code too.

Br, mika

Edited by: M.Karvonen on Oct 9, 2011 12:01 PM

Former Member
0 Kudos

Hi,

Mandatory fields in BAPI_SALESORDER_CREATEFROMDAT2:

ORDER_HEADER_IN :

DOC_TYPE (Sales document type)

SALES_ORG (Sales organization)

DISTR_CHAN (Distribution channel)

DIVISION (Division)

ORDER_PARTNERS..:

PARTN_ROLE (Partner role, SP sold-to party)

PARTN_NUMB (Customer number)

If no ship-to party is entered, use the following: Ship-to party = sold-to party.

ORDER_ITEMS_IN..:

MATERIAL (Material number)

(number of goods?)

Also I'm not sure if you need to do bapi database commit since documentation says this is not included.

So if the bapi call is ok, you might need to call BAPI_TRANSACTION_COMMIT also.

German key words:

The following key words must be entered in German, independantly of the logon language: DOC_TYPE Sales document type, for example: TA for standard order, PARTN_ROLE Partner role, for example: WE for ship-to party or AG = Sold-to-Party.

The note 93091 contains general information on the BAPIs in SD

Former Member
0 Kudos

Hi,

In the above mentioned feilds, plant is not mandatory, so my question is that, will the plant get determined automatcially like it does in entering trasnsaction manually( provided if the determination is maintained)

Also, please tell me about the difference in

BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document

BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order

BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order

Thanks a lot for your early response.

Komal