10-04-2005 10:43 AM
My program does not work. Anybody who understands why?
REPORT Z_TEST_FUNKTIONSMODUL
*The function module get information about the order.
.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
wa_order-SALESDOCUMENT = '0005100000'.
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 = wa_order
RETURN = it_order
TABLES
POT_ORDER_ITEM = it_order.
Data: wa_result LIKE LINE OF it_order.
LOOP AT it_order INTO wa_result.
WRITE: 'wa_order-MATNR'.
ENDLOOP.
10-04-2005 10:52 AM
Linn,
Here's code which is working:
REPORT ZTEST1.
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
DATA: wa_result TYPE /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.
LOOP AT it_order INTO wa_result.
WRITE: wa_result-ITM_NUMBER.
ENDLOOP.
Oh, and please close your previous posts and reward points for helpful answers.
Regards,
Ville
10-04-2005 10:47 AM
LOOP AT it_order INTO wa_result.
must be
LOOP AT it_order INTO wa_order.
i think.
which error does your program give?
10-04-2005 10:50 AM
Runtime error. Call_function_conflict_leng. CX_SY_DYN_CALL_ILLEGAL_TYPE
10-04-2005 10:50 AM
Hi the problem is in ur write statement
WRITE: wa_order-MATNR.
No Quotes allowed.
DATA: wa_pi_order TYPE /SAPNEA/MR3_ORDER_HEADER,
wa_po_order TYPE /SAPNEA/MR3_ORDER_HEADER,
i_item TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM,
wa_item TYPE /SAPNEA/MR3_ORDER_ITEM.
wa_pi_order = 'give the value'.
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
pi_order_header = wa_pi_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 = wa_po_order
* RETURN =
tables
pot_order_item = i_item
.
LOOP AT i_item INTO wa_item.
WRITE:/ wa_item-MATERIAL.
ENDLOOP.
Try the above code it will work fine test with ur data, i dont have any testdata in my system.
Kindly reward points and close the thread, could u plz close the threads previously opened by u.
10-04-2005 10:55 AM
I do not really understand what you mean I should do. What is now allowed?
10-04-2005 10:57 AM
10-04-2005 11:06 AM
> How do I close? Mark "solved it by my own?"
Hi Linn,
First take a look on this page:
https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
If you solved the problem on your own and any of the answers to your post was not helpful you can mark your post by "Solved it by my own". But if you found some of the posts helpful you can give points according how helpful it was for you.
You can close the post by marking one of the answers (most helpfull one) by "Solved my problem" or if you did solve it on your own then close it by "Solved it by my own".
Regards,
Ville
10-04-2005 10:52 AM
Linn,
Here's code which is working:
REPORT ZTEST1.
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
DATA: wa_result TYPE /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.
LOOP AT it_order INTO wa_result.
WRITE: wa_result-ITM_NUMBER.
ENDLOOP.
Oh, and please close your previous posts and reward points for helpful answers.
Regards,
Ville