Material configuration with BAPI_SALESORDER_CREATEFROMDAT2
Hi there,
I am trying to create a new sales order with material configuration using BAPI_SALESORDER_CREATEFROMDAT2. It's not working though. I have seen some comments that it is not possible to create configuration directly with this BAPI - is this really true? - and that the config should be created after sales order creation using function CE_C_PROCESSING.
I have played around a bit, but without succes. Could somebody help me out?
Kins regards,
Roy
Hi, you can use this BAPI to create a sales order with configurable material.
Fisrt you can try with some hardcode config items.
You need the corresponding 'Characteristic values' in your system
eg:
*Header data
wa_header-doc_type = 'ZREK'.
wa_header-sales_org = '1020'.
wa_header-distr_chan = 'AS'.
wa_header-division = 'AS'. "not mandantory
wa_header-purch_no_c = 'mypohehe'.
*Partner data
it_partners-partn_role = 'AG'.
it_partners-partn_numb = '0000000104'.
APPEND it_partners.
it_partners-partn_role = 'WE'.
it_partners-partn_numb = '0000000105'.
APPEND it_partners.
*1st
*items
it_items-material = 'BC263R'.
it_items-po_itm_no = '000010'.
it_items-target_qty = '1.000'.
it_items-target_qu = 'ST'.
APPEND it_items.
it_schedules_in-itm_number = '000010'.
it_schedules_in-req_qty = '1.000'.
APPEND it_schedules_in.
*it_items_inx
not needed for creation
*reference
it_cfgs_ref-posex = '000010'.
it_cfgs_ref-config_id = '000001'.
it_cfgs_ref-root_id = '00000001'.
APPEND it_cfgs_ref.
*it_cfgs_inst
it_cfgs_inst-config_id = '000001'.
it_cfgs_inst-inst_id = '00000001'.
it_cfgs_inst-obj_type = 'MARA'.
it_cfgs_inst-class_type = '300'.
it_cfgs_inst-obj_key = 'Z-BC263R'.
APPEND it_cfgs_inst.
configuration values
it_cfgs_value-config_id = '000001'.
it_cfgs_value-inst_id = '00000001'.
it_cfgs_value-charc = 'ATS_GRUNDLAGE'.
it_cfgs_value-value = p_conf. "01 - 07
APPEND it_cfgs_value.
it_cfgs_value-config_id = '000001'.
it_cfgs_value-inst_id = '00000001'.
it_cfgs_value-charc = 'ATS_BESCHRIFTUNG'.
it_cfgs_value-value = 'N'.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
order_header_in = wa_header
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
int_number_assignment =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
salesdocument = v_salesdocument
TABLES
return = it_return
order_items_in = it_items
order_items_inx = it_items_inx
order_partners = it_partners
order_schedules_in = it_schedules_in
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN =
order_cfgs_ref = it_cfgs_ref
order_cfgs_inst = it_cfgs_inst
ORDER_CFGS_PART_OF = it_cfgs_part_of
order_cfgs_value = it_cfgs_value
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
*it_return
READ TABLE it_return WITH KEY type = 'E'.
Rgds,
JP
Similar Messages
-
Material substitution with BAPI_SALESORDER_CREATEFROMDAT2
Hi, I'm creating sales orders with BAPI_SALESORDER_CREATEFROMDAT2 in background, I have some materials that have substitutes, but when I use the bapi, the material is does not change. When I create the sales order manually in the VA01, the material is replaced.
thanks.It should behave exactly the same. Usually when you run something online, there are certain fields that get defaulted and you will not notice. But when you call the BAPI, you have to pass those default values as well so that you will see the same result. You will have try it out in a couple of different ways and also debug the code where it decides whether or not substitution allowed and you can trace it back to the value that is missing.
-
Variiant configuration with material varaint
Hi
I had creted material with material type FERT, i want to use this as configurable , i made "Material is Configurable and Material variant" in Basic data 2 view.I am using strategy 10 (MTS)
I made all the settings class, characters,configuration profile etc. Its working fine in Cu50 screen.
when i am creating Production order using co01.the cdonfiguration is not poping when i tried from header screen its just in display mode.
MY requirement is depend upon configuration characterstics BOM components/qty has to come in Production order.
How to configure this.where i have missed the settings?
Regards,
srihari.MDear Srihari,
If you want to create configurable material with material type FERT, you must maintain :
1. Basic data 1 : General item category 0002 configuration
2. Basic data 2 : Tick material is configurable
3. Maintain classification with class 300
4. confuration profile in cu41
5. MRP 3 : Strategy 25, not 10 (it is make to stock strategy not configurable)
6. Maintain super bom and super routing, you can use object dependency in item bom and operation to characteristic in class.
also consult with your SD team, you need to maintain delivering plant and item category group in sales distribution view, also variant pricing in class 300 that you create for configurable material.
Important note : You can not configure using variant configuration with CO01 create pro manually because in variant configuration concept the all characteristic chosen in sales order step, try run MRP, check planned order with configuration then you can create PRO by converting this planned order.
If you use material variant :
1. maintain material like other finished good, do not check configurable tick.
2. In MRP 3, link this material variant to its material configurable and define the fix characteristic with for variant.
3. You can create link for bom with CS40.
then you can create manually with CO01 for this material variant
Hopefully it clears you
Regards,
ArmanLie -
BAPI for ME21N with Material Configuration
Hi friends,
I need to create a Z Program which will create the purchase order and during creation of purchase order it will also make the configuration of material in Material Data. I know the BAPI name BAPI_PO_CREATE1, but it will not do the configuration in Material Data.
I have tryed the BDC but it is working for only one line item only.
Please suggest any suitable way for the solution.
Thanks in advance.
KrishanCan you explain what exactly you mean by Material Configuration?
BAPI_PO_CREATE1 is the right bapi for ME21N.
YOu cannot do a BDC on this tansaction as it is a SAP Enjoy transaction.
Regards,
ravi -
Material determination with Product selection
Hi SAP Gurus
We are using material determination with product selection. The process is that customer will send in one product in a sales order. At the time of doing ATP we have to look for about three or four possible alternatives and confirm that alternative which has the highest stock level depending on the ATP situation. We have configured material determination with SAP standard substitution reason0006 to take care of this. The problem with this is that this creates two line items in sales order as the item substituted is shown as a sub-item of the material entered. We do not want to have two line items in a sales order for this. Is there a way we can do material determination with product selection (Based on ATP) and have the item substituted replace the item entered in a sales order? In other words we do not want to see two line items in a sales order. The substitute item should simply replace the original item and the material entered could be stored in field VBAP-MATWA. I have gone through all the standard SAP documentation which clearly states that in order to material determination based on ATP we have to use outcome A or B both of which create a sub-item.
I was wondering if there is any workaround or if there is any user exit in which we can replace the original item with the substituted item?? Any help or any direction will be highly appreciated.
Another question is if we were to use APO for doing global/Rule based ATP is it possible to get rid of the double line items. We have also tried to use rule based ATP in APO and use product/location substitution in our sandbox system to see if we can get back only one line item. But even in that case we do get a sub item. Any help on this issue will be greatly appreciated. You can also send me an e-mail at [email protected]
Thanks
SDSAPCON>
SAPCON SD wrote:
> Hi SAP Gurus
>
> We are using material determination with product selection. The process is that customer will send in one product in a sales order. At the time of doing ATP we have to look for about three or four possible alternatives and confirm that alternative which has the highest stock level depending on the ATP situation. We have configured material determination with SAP standard substitution reason0006 to take care of this. The problem with this is that this creates two line items in sales order as the item substituted is shown as a sub-item of the material entered. We do not want to have two line items in a sales order for this. Is there a way we can do material determination with product selection (Based on ATP) and have the item substituted replace the item entered in a sales order? In other words we do not want to see two line items in a sales order. The substitute item should simply replace the original item and the material entered could be stored in field VBAP-MATWA. I have gone through all the standard SAP documentation which clearly states that in order to material determination based on ATP we have to use outcome A or B both of which create a sub-item.
>
> I was wondering if there is any workaround or if there is any user exit in which we can replace the original item with the substituted item?? Any help or any direction will be highly appreciated.
>
> Another question is if we were to use APO for doing global/Rule based ATP is it possible to get rid of the double line items. We have also tried to use rule based ATP in APO and use product/location substitution in our sandbox system to see if we can get back only one line item. But even in that case we do get a sub item. Any help on this issue will be greatly appreciated. You can also send me an e-mail at [email protected].
>
> Thanks
>
> SDSAPCON
In the substitution reasons ...mark the OUTCOME as blank for this particular 0006. I am not sure for ATP
rgds
Sai
Edited by: Sai on Mar 27, 2008 10:00 PM -
IDOC and ALE Configuration with cross application with SD
Hi Sap Gurus,
Please send me some document on IDOC and ALE Configuration with cross application with SD.
Please send me the material on my mail id [email protected]
Regards
shekharDear Shekhar,
concerning EDI concept in SD: the EDI concept is intended to realize the sales and distribution process completely automatically with the help of electronical documents. These documents are sent from one customer to another, are processed mostly on the background and give a possibility to realize the sales process extremely efficiently.
If MM-customer would like to purchase the goods then he creates the IDOC of type ORDERS and send it to SD-customer. On the SD-side the IDOC is processed via the function module IDOC_INPUT_ORDERS and creates the sales order. As confirmation the SD-side can send to MM-side the Order-Response IDOC (function IDOC_OUTPUT_ORDERS). The MM-customer can every thime send a change to the existiong order, then on SD side the ORDCHG IDOC will be processed. It can change the order like in VA02. The creation of the invoice can be made via IDOC of message type INVOIC (function IDOC_OUTPUT_INVOIC).
So, the process can be realized completely automatically between SD and MM partners with the help of IDOCs: ORDERS, ORDCHG, ORDRSP, INVOIC.
That's all concerning the SD-EDI.
Additional processes in SD, where EDI are used:
1) application of delivery schedules to the scheduling agreement: IDOC of type DELINS
2) creation of a delivery order to the scheduling agreement: IDOC of type DELORD
3) creation of external agent service delivery to scheduling agreement: IDOC of type EDLNOT
4) creation of credit advice / credit memo in the frames of self-billing: IDOCs of type GSVERF, SBWAP and for external invoice creation SBINV.
It is all processes which are realized in the SD module via EDI.
I hope this info helps.
Kind regards,
Akmal Vakhidov
Development Support SAP, Walldorf/Germany -
ISync Palm Conduit cannot be configured with the HotSync Manager UPDATE
First, I apologize for the SPAM-like posting of the material below in the existing threads regarding this issue. It is—unfortunately—the most effective way to garner the attention of earlier posters and gather this information.
Apple continues to investigate the issue, and needs this information to isolate and identify the problem. It is characterized by the apparently successful installation of the bundled iSync Palm Conduit using the Enable Palm OS Syncing… option in iSync 2.4 with either Mac OS X 10.4.9 or 10.4.10, but with the result that this conduit—normally visible in and configurable with the HotSync Manager—cannot be seen and therefore not configured.
In order to help Apple software engineers isolate and identify this issue—if you are affected by this specific issue—can you please provide the precise build number for the operating system on the machine that exhibit this problem?
To do so, select About This Mac from the Apple menu, and—beneath the Mac OS X label—press the Version 10.4.9 or Version 10.4.10 label. That value will change to something like 8P1xxx. Please respond to this message with that build number, the version of Mac OS X 10.4.x you have installed, and the last three digits of your machine serial number.
Thank you in advance for providing this information.First, I apologize for the SPAM-like posting of the material below in the existing threads regarding this issue. It is—unfortunately—the most effective way to garner the attention of earlier posters and gather this information.
Apple continues to investigate the issue, and needs this information to isolate and identify the problem. It is characterized by the apparently successful installation of the bundled iSync Palm Conduit using the Enable Palm OS Syncing… option in iSync 2.4 with either Mac OS X 10.4.9 or 10.4.10, but with the result that this conduit—normally visible in and configurable with the HotSync Manager—cannot be seen and therefore not configured.
In order to help Apple software engineers isolate and identify this issue—if you are affected by this specific issue—can you please provide the precise build number for the operating system on the machine that exhibit this problem?
To do so, select About This Mac from the Apple menu, and—beneath the Mac OS X label—press the Version 10.4.9 or Version 10.4.10 label. That value will change to something like 8P1xxx. Please respond to this message with that build number, the version of Mac OS X 10.4.x you have installed, and the last three digits of your machine serial number.
Thank you in advance for providing this information. -
Regarding sales order creation with "BAPI_SALESORDER_CREATEFROMDAT2"
Hi Experts,
I am facing an issue when creating a sales order with FM "BAPI_SALESORDER_CREATEFROMDAT2" it is showing the error
V1 -761 as " unpermitted combination of BUS 2032 with Sales document category L" .
In VA01 ,if i provide the fallowing details
Sales org 1000
dist 10
div 10
item no 10 material-52 plant 1000 shipping point -0001 target qty-1,uOM-EA,weight unit-KG
billing date 11022011
pricing date-11022011
currency - GBP
shipping party -1
sold to party -1
buyer - 1
bill-to-party -1
it is creating the sales order.
what could be the problem with this BAPI..
Please help.
Regards
VishnuHi Vishnu,
First try with minimum data for header and item .Check the documentation of that bapi.
DATA:
Order partners
li_order_partners TYPE STANDARD TABLE OF bapiparnr,l_order_partners LIKE bapiparnr,l_order_header_in LIKE bapisdhd1,
li_order_items_in TYPE STANDARD TABLE OF bapisditm,l_order_items_in LIKE bapisditm,li_order_items_inx TYPE STANDARD TABLE OF bapisditmx,l_order_items_inx LIKE bapisditmx,return TYPE STANDARD TABLE OF bapiret2,l_return TYPE bapiret2,
l_vbeln LIKE bapivbeln-vbeln,
CLEAR l_order_partners.
l_order_partners-partn_role = 'AG'. "Remember German codes !
l_order_partners-partn_numb = '0000001032'.
APPEND l_order_partners TO li_order_partners.
Sales document type
l_order_header_in-doc_type = 'TA'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
Sales organization
l_order_header_in-sales_org = '1000'.
l_order_header_in-distr_chan = '10'.
l_order_header_in-division = '00'.
l_order_items_in-itm_number = '10'.
l_order_items_in-material = 'abcmaterial'.
l_order_items_in-comp_quant = '1'.
APPEND l_order_items_in TO li_order_items_in.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header_in
IMPORTING
salesdocument = l_vbeln
TABLES
return = li_return
order_items_in = li_order_items_in
order_partners = li_order_part
WRITE: / l_vbeln.
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
For the above document type , sales organisation,distribution channel,division,customer,material check with you functional consultants and take the exact combination of data. That combination is very important.Please ask t if you need more help in this.
Regards,
Madhu.
Edited by: madhurao123 on Mar 3, 2011 5:11 AM -
Create sales order with BAPI_SALESORDER_CREATEFROMDAT2 example
Hi, does anyone have a working example of how to create a sales order using BAPI_SALESORDER_CREATEFROMDAT2?
Thankshi Robert,
Check this code...try to map.
one order with total sum of effort
clear: l_order_header,
l_salesdocument,
l_order_partners,
l_order_items,
l_order_schdl.
refresh: it_order_items,
it_order_partners,
it_order_schdl,
it_return.
???????? get from material ...
Order header
l_order_header-doc_type = 'ZQBV'.
l_order_header-distr_chan = '10'.
l_order_header-division = '00'.
if g_qals-werk eq '1100'.
l_order_header-sales_org = '1000'.
else.
if g_qals-werk eq '3100'.
l_order_header-sales_org = '3000'.
else.
message i001(00) with text-005.
endif.
endif.
l_order_header-purch_no_c = g_qals-prueflos. " <= lot
Partner data
l_order_partners-partn_role = 'AG'.
l_order_partners-partn_numb = g_qals-kunnr.
append l_order_partners to it_order_partners.
Order items => only one
l_order_items-itm_number = 10.
l_order_items-material = g_qals-matnr.
l_order_items-target_qty = 1.
append l_order_items to it_order_items.
Schedules for quantity
l_order_schdl-itm_number = 10.
l_order_schdl-req_qty = 1. " <= only 1 !
append l_order_schdl to it_order_schdl.
Conditions for value
l_order_conditions-itm_number = 10.
l_order_conditions-cond_type = 'PR00'.
l_order_conditions-cond_value = g_effort_sum.
l_order_conditions-currency = g_effort_unit.
append l_order_conditions to it_order_conditions.
BAPI to create sales order
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = l_order_header
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = l_salesdocument
TABLES
RETURN = it_return
ORDER_ITEMS_IN = it_order_items
ORDER_ITEMS_INX =
ORDER_PARTNERS = it_order_partners
ORDER_SCHEDULES_IN = it_order_schdl
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN = it_order_conditions
ORDER_CONDITIONS_INX =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
if not l_salesdocument is initial.
order successfully created
message i001(00) with text-001 l_salesdocument.
endif.
endif.
for more info check the below link also
Problem with BAPI_SALESORDER_CREATEFROMDAT2
Regards,
Naveen -
Hi All I need to Create a Frame contract with incomplete material configuration through report , In the manual we have lock symbol which when unlocked enables to to save a contract with incomplete configuration.
But through BDC , I am unable to save as there is no screen available like we do in manual way for BDC session.
So I need a help to create a Frame contract with incomplete configuration.Hi Experts,
I need help to solve the need, may be if have any sample code to create a Contract material configuration or classification will be much benifited. -
Display material configuration options
Hi all,
I want to find a function module to get all material configuration options for a material.
I found 'BAPI_CFGINST_CHARCS_READ' but unfortunately it does not take into account allready existing characteristics.
For instance :
- I have a charac "A" and a charac "B".
- "B" only appears if "A" has the value X.
What I'm looking for is a FM that gives me "A" if the actual config is initial, and that gives me "A" and "B" if "A" is valuated with X.
Do you know if it exists ?
Regards,
SylvainHi Ram,
'CACL_CLASS_READ_VALIDATION' is used "to display the restricted value set that was defined when your class was allocated to a superior class."
I don't think it could help me such i do not not have a call allocated to a superior one, and I'm not searching for restricted value set but for restricted characteristics according to actual value.
Regards,
Sylvain -
Creation of Material Documents With Mvt Type
On Performing Post Goods Issue (PGI) in one Plant in case of Plant to Plant Dispatches, there should be Inbound delivery created for already created Purchase Order (PO). In addition after creation of inbound delivery, there should be material document created with 103 movement. This Material document is triggered when the inbound delivery is saved. Once Warehouse processes are finished, then Post Goods Receipt (PGR) happens, so 101 Movement Type happens for Purchase Order. PGR document should trigger one more material document with 104 movements; this document is reversal for material document with 103 movement type.
can any one suggest to enhance SAP for this?
Moderator message : Requirements dumping is not allowed, show the work you have already done. Thread locked.
Edited by: Vinod Kumar on Oct 21, 2011 5:18 PMHi Nitin,
Before creating the Service type of product, you have to define the Base category for Service type product. Generally the category for service will be created under the R3 hierarchy R3PRODSTYPE. You can create this category using the TCode:
COMM_HIERARCHY. Here you have to select the product type as Service and have to assign the set types to the category.
You can create a service product using the transaction : COMMPR01 -> Click on Service ICON -> Select the Category for Service Type. Then fill in the details for Service Product description, Service ID(Based on number range settings for products), Language.
Also fill other details like Base Unit of measure, Pricing condition for different sales areas for the service product.
Since you are using CRM7.0, you can do all these activities using a POWER USER role.
For more information about Set types and hierarchies please refer the following help link:
http://help.sap.com/saphelp_crm70/helpdata/EN/46/57672501a208e7e10000000a114a6b/frameset.htm
Hope this helps!
Regards,
Chethan -
i changed my sim on my iPhone n reconfigured iMessage, it configured with my number but when i sign in with my apple id it says username/password is wrong while in all other things like FaceTime, App Store it worked with the same id and password..
can anyone help me to solve this issuei just opened my ipad, started my apple account/I.D. and realized I put the wrong e mail. I was having trouble correcting my I.D on the Ipad so I went to my laptop and make the proper changes/slash e mail address I wanted for my apple ID. I got back to my ipad and try to download an app I can't because I have to sign in my apple account and I can't because it still has the irrelivant I.D/email address..
So, i did what you said.. went to setting>app store> tapped on my e mail.. it asked me to sign in (with my invalid emails address showing). I signed in with the password I had created. It said "incorrect".. I went to reset password. I reset password, tried to sign in and it says again "unvalid password".. this is getting irritating. I have been asking and no one knows what to do. -
I have a problem with Mail on my Macbook Pro. It is configurated with a gmail account, and now I can't access the mail. Is it possible to reboot the account or..? Please help:)
The question mark means the computer cannot find a bootable volumes so can;t do anything, That, combined with annoying sounds, strongly suggests a failed hard drive.
You can ask a "genius" at an Apple Rtail Store to test it but I'm pretty sure the drive is kaput. I'm hoping you had your data backed up. -
Report For list of material Master with PO text
Hi all,
I need a report whether it is available in Standard SAP or a customized, for List of Material Master with their PO text.
If any one can help, please reply to this theard.
Regards,
Kapil KulkarniTo get the material number combined with the PO text you will need the help of an ABAP programmer. The programmer can create a report for you using the function module READ_TEXT in the function group STXD. The tables to use are:
STXH - STXD SAPscript text file header
STXL - STXD SAPscript text file lines
The selection screen should have at least the following:
OBJECT - STXH-TDOBJECT
NAME - STXH-TDNAME
LANGUAGE - STXH-TDSPRAS
TEXTID - STXH-TDID
You find the information for these fields by going to the PO text entry screen and displaying the header information under Goto -> Header. For materials, the object is MATERIAL, the name is "material number", the language is "EN", and the text ID is BEST. You can use this program to get long text in lots of places like information records, purchase order texts, etc.
Hope this helps.
Maybe you are looking for
-
Upload data from excel:can we upload from .csv only?
Hi Experts, Can we upload data from .CSV file only? Is this a limitation in ABAP? What if i have an excel sheet with multiple worksheets and I want to pick data from one of the worksheet. Is this scenario possible? Thanks and Regards, Rohit
-
Cannot resolve " home directory is full" issue with mail
I've read all of the posts and tried to resolve it by doing what was instructed. I copied my mail folder, moved the envelope index file to my destop and when I start mail, it imports everything, lets me click "done" and then hangs. I had a mac accoun
-
IMessage file transfer problem/Red notification missing
Hi, We have 4 imacs in our office some with latest Mavericks (iMessage) some with Mountain Lion (iChat). All of a sudden, one of the computer can not receive file transfers, we have an instant error when trying to send a file there saying "Unexpected
-
Oracle 9i features ... doc ?
hi where can find any documentation which has new features of oracle9i over 8i? thanks in adv.
-
dear All i am trying to execute a stored procedure in this class *public void get_data () throws SQLException {* PreparedStatement st; String sql = "begin pkg.TEST(X,Y); END;"; *try{* st = getDBTransaction().createPreparedStatement(sql, 0); st.setObj