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

BAPI

Former Member
0 Likes
534

Hi All,

I have the following code. i am working in APO-ABAP.

Refresh it_receipts1.

wa_receipts-order_number = '12345'.

wa_receipts-product = '000000000001000253'.

wa_receipts-location = 'ZZZZ'.

wa_receipts-loctype = 1001 .

wa_receipts-proc_type = '0'.

wa_receipts-delivery_date = c_delivery_date .

wa_receipts-atpcat = 'AG'.

wa_receipts-quantity = 4000.

APPEND wa_receipts TO it_receipts1.

refresh it_receipts_x.

wa_receipts_x-order_number = '12345'.

wa_receipts_x-product = 'X'.

wa_receipts_x-location = 'X'.

wa_receipts_x-loctype ='X'.

wa_receipts_x-delivery_date = 'X'.

wa_receipts_x-atpcat = 'X'.

wa_receipts_x-proc_type = 'X'.

wa_receipts_x-quantity = 'X'.

APPEND wa_receipts_x TO it_receipts_x.

CALL FUNCTION 'BAPI_POSRVAPS_SAVEMULTI3'

EXPORTING

logical_system = 'AD2CLNT200'

order_type = ' '

commit_control = 'E'

plng_version = '000'

planning_mode_usage = '0'

TABLES

receipts = it_receipts1[]

receipts_x = it_receipts_x[]

return = it_return1.

When i use it in a method use_command for a push button in ALV the BAPI creates a purchase requisition But the number is 12345.But when i use se37 with the same inputs its creates a preq with system generated no.

Does, This is Bcoz i am using in a method its not creating a correct One.

Regards

Ahasan

5 REPLIES 5
Read only

Former Member
0 Likes
469

Hi,

Why are you passing the order number to the BAPI which creates a order and should generate a order number. The difference between the ALV and SE37 might be that in SE37 you are not passing the order numbers, so its generating a new one.

In ALV also, do NOT hard code the order number and then it should generate a new one.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
469

Hi,

To create a new order the value '12345'. is needed.

The same coding in the method if pasted in start-of-selection it creates an order with system generated no .But in method it creates a order with the no 12345.

Regards

ahasan

Read only

0 Likes
469

Hi,

I can assure you that it has nothing to do with the place of calling. I am still surprised how can it create a new order with a system generated one, if you are passing the order number, may be because the order already exists it picks up a new one and creates it.

What if you don't pass the order number in the method? Does it throw a error?

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
469

Hi,

The bapi gives the message Invalid value transferred in parameter/field ORDER_NUMBER.To create a new order with the Bapi the value '12345'. is necessary.Else it does not create.

Regards

Ahasan

Read only

Former Member
0 Likes
469

i want to create a purchase requisition i.e. ORDER_TYPE = '1' nad PROC_TYPE = '1'. Please tel which parameters should be considered for doing the same using BAPI_POSRVAPS_SAVEMULTI3.

Also specify the ATP Category.

Thanks & Regards