10-03-2005 10:23 AM
Anybody how know why my program does not work?
REPORT Z_TEST_FUNKTIONSMODUL .
DATA wa_order TYPE VBAK. "orderheader
DATA it_order TYPE VPKVBAKTTYP. "create intern table from table type
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = wa_order
PI_PARVW =
PI_PRICE_CONDITION1 = 'PR00'
PI_PRICE_CONDITION2 =
PI_PRICE_CONDITION3 =
PI_TAX_CONDITION =
PI_UNIT_SPLIT = 50
PI_TEXT_ID = '0001'
PI_LANGUAGE = SY-LANGU
IMPORTING
PO_ORDER_HEADER =
RETURN =
TABLES
POT_ORDER_ITEM = it_order.
10-03-2005 10:27 AM
10-03-2005 10:31 AM
10-03-2005 10:32 AM
Actually I do not really understand what the function module do... Any idea?
10-03-2005 10:32 AM
wa_order should be of type /SAPNEA/MR3_ORDER_HEADER
it_order should be of type /SAPNEA/MR3_ORDER_ITEM
Regards
Raja
10-03-2005 10:39 AM
Hi Linn,
Modify your code to look something like this:
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
wa_order-SALESDOCUMENT = 'HERE_YOU_SHOULD_PUT_SALES_DOCUMENT_NUMBER'.
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = wa_order
* PI_PARVW =
* PI_PRICE_CONDITION1 = 'PR00'
* PI_PRICE_CONDITION2 =
* PI_PRICE_CONDITION3 =
* PI_TAX_CONDITION =
* PI_UNIT_SPLIT = 50
* PI_TEXT_ID = '0001'
* PI_LANGUAGE = SY-LANGU
* IMPORTING
* PO_ORDER_HEADER =
* RETURN =
TABLES
POT_ORDER_ITEM = it_order.
Note that you must pass some value to the function module to get some values back. So in above example you must pass some data to the workarea like sales document number.
Regards,
Ville
10-03-2005 10:52 AM
Is sales document number "vbeln" in table "vbak" or how do I find the document number?
10-03-2005 11:13 AM
Hi Linn,
Sales document number is VBELN in VBAK like you already assumed.
Regards,
Ville
10-03-2005 11:16 AM
Hi Linn,
Test this code:
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
PARAMETERS pa_order TYPE vbak-vbeln.
wa_order-SALESDOCUMENT = pa_order.
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = wa_order
* PI_PARVW =
* PI_PRICE_CONDITION1 = 'PR00'
* PI_PRICE_CONDITION2 =
* PI_PRICE_CONDITION3 =
* PI_TAX_CONDITION =
* PI_UNIT_SPLIT = 50
* PI_TEXT_ID = '0001'
* PI_LANGUAGE = SY-LANGU
* IMPORTING
* PO_ORDER_HEADER =
* RETURN =
TABLES
POT_ORDER_ITEM = it_order.
Regards,
Ville
10-04-2005 7:41 AM
Hi Linn,
If you found any of these answers useful please close the post and reward points.
Regards,
Ville
10-03-2005 10:33 AM
Linn,
Sounds like the function module will get the Order details if you pass the right values to the parameter wa_order.
However, in the code you have given, you are not passing in any values in wa_order so its not going to return any values.
Please fill the variable wa_order with the order no. etc and it should give you the details in the table it_order.
Regards,
Ravi
Note : please reward points if this helpful.
10-03-2005 10:44 AM
Thanks for helping me. Do you mean something like this?
PARAMETERS pa_order TYPE I. table fiels
DATA it_order TYPE VPKVBAKTTYP. "create intern table from table type
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = pa_order
PI_PARVW =
PI_PRICE_CONDITION1 = 'PR00'
PI_PRICE_CONDITION2 =
PI_PRICE_CONDITION3 =
PI_TAX_CONDITION =
PI_UNIT_SPLIT = 50
PI_TEXT_ID = '0001'
PI_LANGUAGE = SY-LANGU
IMPORTING
PO_ORDER_HEADER =
RETURN =
TABLES
POT_ORDER_ITEM = it_order.
10-03-2005 10:37 AM
If you have an order number with you, you can try something like this.
Select * from vbak into corresponding fields of wa_order where vbeln = (order number).
Now pass the wa_order to the function module.
Regards,
Ravi