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: 

BAPI_INQUIRY_CREATEFROMDATA2: Updating pricing time in inquiry

Former Member
0 Kudos

I am using the function module BAPI_INQUIRY_CREATEFROMDATA2 to successfully create an inquiry document in our system. However, we rely on the pricing date and time to access our pricing conditions. I have not yet found a way to update the pricing time in the header of the inquiry through this BAPI. Without this specified, our pricing is incorrect since it is based on the time of day. The BAPISDHD1-PRICE_DATE field fills in the date, but I cannot find a field in this or any of the other structures passed to this func. mod. to update the time. Is there any way to accomplish this?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Jonathan,

I don't find price time in my system? Are you perhaps on an IS solution? IS Oil perhaps?

Anyway, the way you can send extra data to this BAPI using the EXTENSIONIN parameter.

First, find the dictionary table which holds the field you want to send (I would guess VBKD). Then, add the field you want to send (using an append structure in transaction SE11) to the structure bape_<table_name> (for example bape_vbkd).

Then, when you call the BAPI, add a row to the EXTENSIONIN parameter as follows:

1. For the STRUCTURE field, just fill in with the text BAPE_<table_name> (for example BAPE_VBKD).

2. For the VALUEPART1 field, you need to move the contents of the structure bape_<table_name>. So first, load up the structure with data (for example 0000000000000000101501 for inquiry 0000000000 and item 000000 and price time 10:15 and 1 second using structure bape_vbkd), and then transfer it to VALUEPART1.

The code within the BAPI will transfer the data from this extension to the appropriate ABAP table (note the field names in the actual table and the bape_<table_name> structure need to match).

Hope that helps.

Cheers,

Brad

8 REPLIES 8

Former Member
0 Kudos

Hello Jonathan!

There is a field PRICE_DATE in structure ORDERHEADERIN.

Is that what you're looking for?

Regards, Joerg

Former Member
0 Kudos

Hi Jonathan,

I don't find price time in my system? Are you perhaps on an IS solution? IS Oil perhaps?

Anyway, the way you can send extra data to this BAPI using the EXTENSIONIN parameter.

First, find the dictionary table which holds the field you want to send (I would guess VBKD). Then, add the field you want to send (using an append structure in transaction SE11) to the structure bape_<table_name> (for example bape_vbkd).

Then, when you call the BAPI, add a row to the EXTENSIONIN parameter as follows:

1. For the STRUCTURE field, just fill in with the text BAPE_<table_name> (for example BAPE_VBKD).

2. For the VALUEPART1 field, you need to move the contents of the structure bape_<table_name>. So first, load up the structure with data (for example 0000000000000000101501 for inquiry 0000000000 and item 000000 and price time 10:15 and 1 second using structure bape_vbkd), and then transfer it to VALUEPART1.

The code within the BAPI will transfer the data from this extension to the appropriate ABAP table (note the field names in the actual table and the bape_<table_name> structure need to match).

Hope that helps.

Cheers,

Brad

0 Kudos

Hi Brad,

I tried your suggestion, extending the table structure BAPE_VBKD with the OIC_TIME field (yes, we are using IS-Oil) and the issue now seems to be that I am creating the inquiry, so I don't know the inquiry number to pass to the structure. I also tried using all zeros for the inquiry number and item number and the VBKD-OIC_TIME field did not get updated. Is there a way to populate the time field at inquiry creation without knowing the inquiry number in advance of the function module call?

Regards,

Jon Ziegler

0 Kudos

Even though you dont need to fill in the inquiry number, you still need to assign numbers to your items and use the same numbers to group all other structures such as schedule lines and pricing. You can just give 1,2, 3 etc and the system will take care of later converting them to internal item numbering.

Srinivas

0 Kudos

Hi Jonathan,

What Srivinas has written is correct.

You should be able to leave the enquiry number empty, but you will need to assign an item number. This is so that SAP knows for which item you wish to assign the price time. This same number should be used for all item relevant information you pass to link the data for one item together (INQUIRY_ITEMS_IN, INQUIRY_SCHEDULES_IN, etc.)

On the contrary to what Srivanas said though, in my experience, the item numbers you pass through are the actual item numbers that get assigned in VBAP-POSNR (it seems to ignore the config setting for item number increment for the sales document type if the numbers are passed in the BAPI). So I normally pass items in increments of 10 (10,20,30 etc.).

Hope that helps.

Please remember to acknowledge those who have helped you by using the points system.

Cheers,

Brad

0 Kudos

Yes, all of the suggestions have been very helpful so far. The pricing time is actually at the header level of the inquiry document and our existing inquiry docuemnts are stored in VBKD with a POSNR of 000000 to indicate header level. The documentation of this function module, which my colleague graciously pointed out, indicates that the BAPE_VBAK and VBAKKOZ structures need to also be extended in order to pull in the EXTENSIONIN modifications for the VBKD table. I'm going to also try that today and see how it works.

0 Kudos

Finally got it working! To pass along the VBKD-OIC_TIME field to the BAPI I had to extend two structures, BAPE_VBAK and BAPE_VBKD, with two seperate append structures. Each contained only the OIC_TIME field. I then filled each of these structures via the EXTENSIONIN parameter using a blank for VBELN for each structure since the doc is being created, a POSNR of '000000' to indicate the header level in BAPE_VBKD, and then the appropriate time '101601' for example. The quote gets created and the time is now filled in too. Thanks to everyone for their help!

0 Kudos

Thank You Jonathan for giving the forum your final solution. Please close the post as well.

Srinivas