‎2006 May 08 6:01 AM
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
‎2006 May 08 6:11 AM
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
‎2006 May 08 6:17 AM
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
‎2006 May 08 6:21 AM
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
‎2006 May 08 6:26 AM
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
‎2007 Feb 15 9:20 AM
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