2014 Feb 18 11:43 AM
Hi Gurus,
I am trying to fetch the details of a production order using FM K_ORDER_READ passing the production order number only in my program.
CALL FUNCTION 'K_ORDER_READ'
EXPORTING
aufnr = i_aufnr
IMPORTING
i_aufkv = l_aufkv
erloese = l_erloese
EXCEPTIONS
not_found = 01.
The aufkv structure returned (l_aufkv) does not have the sales order number (KDAUF) and the item number (KDPOS) filled when the program is executed, but if I directly execute the FM from SE37 with the same input the result is different, the sales order number mapped is correctly fetched.
Really at loss for a possible explanation for the above behavior. Please help!!
Regards,
Jeet
2014 Feb 19 7:16 AM
Hello Jeet,
Try to pass the value NO_BUFFER = 'X' in the exporting parameter of the function module and check whether it works.
CALL FUNCTION 'K_ORDER_READ'
EXPORTING
aufnr = i_aufnr
NO_BUFFER = 'X'
IMPORTING
i_aufkv = l_aufkv
erloese = l_erloese
EXCEPTIONS
not_found = 01.
Regards,
Thanga
2014 Feb 19 5:47 AM
I hope my question is clear enough. Does anyone have any idea on how to solve this problem???
2014 Feb 19 7:02 AM
Jeet...just check if the input i_aufnr you are passing to FM through program has leading zeroes or not.
Raghav
2014 Feb 21 9:23 AM
Hi Raghavendra,
I have used conversion exits before passing the order number to this FM, so leading zeroes is out of question.
Regards,
Jeet
2014 Feb 19 7:16 AM
Hello Jeet,
Try to pass the value NO_BUFFER = 'X' in the exporting parameter of the function module and check whether it works.
CALL FUNCTION 'K_ORDER_READ'
EXPORTING
aufnr = i_aufnr
NO_BUFFER = 'X'
IMPORTING
i_aufkv = l_aufkv
erloese = l_erloese
EXCEPTIONS
not_found = 01.
Regards,
Thanga
2014 Feb 19 7:18 AM
Use conversion routines before passing the order number to the FM
2014 Feb 21 9:39 AM
Hello Jeet,
That's great. Conversion routine worked. Please close the thread if the issue is solved.
Regards,
Thanga
2014 Feb 21 9:45 AM
Hi Thanga,
Sorry to disappoint you but the issue is not solved, I meant that leading zeroes is not causing the issue. Anyways with some deep debugging I found that the issue is due to buffer (attribute of this fm) containing some values from the previous steps in the program, so your solution to pass No buffer parameter might actually work. But the problem is this fm is called inside another fm WTYSC01_COLLECT_DIP_ITEMS. So I can not change the call to fm k_order_read. I have opened a new thread to continue this discussion with topic WTYSC01_COLLECT_DIP_ITEMS gives DYNAMIC_ITEM_ERROR . Neverthless your answer was really helpful. Thanks!!
regards,
Jeet
2014 Feb 21 9:50 AM