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

Function BAPI_PO_CREATE1

Former Member
0 Likes
1,871

Hi,

I´m using the Function BAPI_PO_CREATE1 to create stock transport orders.

It is working fine except of one thing: The delivery date I´m providing the function, is not going to be set inside of the created purchase order and of course not in the delivery created afterwards.

I could only find one field inside of the function interface, where to put in the delivery date:

In the tables tab --> poschedule-delivery_date

This is, in the strange way, not a date format, it is a CHAR field with length 10.

I tried all kinds of date formats, like:

31.08.2007

20070831

and so on....

there is another field called DEL_DATCAT_EXT (Category of delivery date).

This can have the following of the field PRGBZ of table TPRG.

I don´t know, what else I can do, but I REALLY HAVE to set the delivery date!!!

Can somebody help me out of trouble, please.....

Arne

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,644

Hi!

You have to give these fields:

PO_ITEM = '0010' "PO item number

SCHED_LINE = 1 "constant 1, but mandantory field

DELIVERY_DATE = '20071231'

SCHED_LINE is a mandantory field, it is for the EKET-ETENR field.

With these 3 fields, your PO have to be correct. Maybe the format is not perfect for the date, you have to try out some...

Regards

Tamá

11 REPLIES 11
Read only

Former Member
0 Likes
1,645

Hi!

You have to give these fields:

PO_ITEM = '0010' "PO item number

SCHED_LINE = 1 "constant 1, but mandantory field

DELIVERY_DATE = '20071231'

SCHED_LINE is a mandantory field, it is for the EKET-ETENR field.

With these 3 fields, your PO have to be correct. Maybe the format is not perfect for the date, you have to try out some...

Regards

Tamá

Read only

0 Likes
1,644

Hi Tamás,

thank you for the fast answer. But I can´t get a delivery date, it´s always the todays date....

This is my content in the schedule item table:

PO_ITEM: 00010 SCHED_LINE: 0001 Delivery_date: 20070831 Qunatity: 2.000

PO_ITEM: 00020 SCHED_LINE: 0001 Delivery_date: 20070831 Qunatity: 1.000

PO_ITEM: 00030 SCHED_LINE: 0001 Delivery_date: 20070831 Qunatity: 3.000

PO_ITEM: 00040 SCHED_LINE: 0001 Delivery_date: 20070831 Qunatity: 2.000

What am I doing wrong? And what about the DEL_DATCAT_EXT field?

Thank you very much!

Read only

0 Likes
1,644

Hi!

It has to work. For testing purposes, you might try out a few formats:

SCHED_LINE = 1.

or

SCHED_LINE = '0001'.

Delivery_date = '2007.08.31'.

or

Delivery_date = '20070831'.

There are a few combinations, it was working for me, but I don't remember at the perfect formats (and I can't reach that system, where it is...).

Have you checked the BAPI's return table? There might be useful hint for the problem.

Regards

Tamá

Read only

0 Likes
1,644

I´ll throw a party, when it´s going to work!

Can anybody give me several date formats, I could try out? And what about the

DEL_DATCAT_EXT field? I´m now trying with only one item line:

po_item: 0010 Sched_Line: 0001 Delivery_date: 20070831 Quantity: 1

X-table:

po_item: 0010 Sched_line: 0001 po_itemx: X sched_linex: X Delivery_date: X Quantity: X

sorry, I forgot.... the Return table is always empty and the return code always 0....

Thank you!

Message was edited by:

Arne Hein

Read only

0 Likes
1,644

Have you tried it with 31.08.2007 instread of 20070831 ?

Read only

0 Likes
1,644

Yes, that I have done at first...

I don´t know, why it´s not taking the date...

Read only

0 Likes
1,644

check out by giving the date in the american formt of mm.dd.yyyy

Read only

0 Likes
1,644

Hi Sushi,

this is also not working. But I can see, that the function BAPI_PO_CREATE1 ist deleting my lines in the scheduleX Table.

Why is it so difficult to set the delivery date. I have now tried almost all possibilities of the schedule tables, and nothing is working...

Does anybody have a working example for this function with schedule lines and delivery date?

Thank you!

Read only

Former Member
0 Likes
1,644

Hi,

I've just had a quick look at the documentation for that function module and it shows the following as an example for the POSCHEDULE table:-

Parameter: POSCHEDULE
PO_ITEM              =                    00001
SCHED_LINE           =                    0001
DELIVERY_DATE        =                    02.12.2002
QUANTITY             =                    6.000
PO_ITEM              =                    00001
SCHED_LINE           =                    0002
DELIVERY_DATE        =                    03.12.2002
QUANTITY             =                    5.000
PO_ITEM              =                    00001
SCHED_LINE           =                    0003
DELIVERY_DATE        =                    04.12.2002
QUANTITY             =                    4.000

So it looks like the date should be in the full 10 character format as you thought. One question though, did you also populate table POSCHEDULEX with the fields you were updating?

I'd suggest reading the documentation from SE37 or from transaction BAPI for this module to see how the ...X tables work if this is the problem.

Gareth.

Read only

0 Likes
1,644

Hey,

thank you for the reply....

I have set the X table, that every field with content, has an X as value. Except the fields for po_item and sched_line. There are set like the po_item in the items table and to 0001 like the schedule table.

Ahhhh, that´s so annoying! why can´t they easily use a normal DATS field as for all other dates, too???

Read only

Former Member
0 Likes
1,644

Hi,

The structure <b>bapimeposchedule</b> will have the <b>delivery_date</b>. Pass the date to this field.

This is just for verification...see the fields that you have used in poschedule and poschedulex

Parameter: POSCHEDULE

PO_ITEM = 00001

SCHED_LINE = 0001

DELIVERY_DATE = 02.12.2002

QUANTITY = 6.000

Parameter: POSCHEDULEX

PO_ITEM = 00001

SCHED_LINE = 0001

PO_ITEMX = X

SCHED_LINEX = X

DELIVERY_DATE = X

QUANTITY = X

Regards

Sudheer